ruby2fmpxml is an example Sinatra app which creates FileMaker XML documents in FMPXMLRESULT grammar using Ruby.
The app takes a URL encoded string and returns a Rot13 version of the string in FMPXMLRESULT grammar.
Clone the app from Github
git clone [email protected]:cantab/ruby2fmpxml.git
Go into the project directory
cd ruby2fmpxml
Install gems and dependencies
bundle install
Start the Puma server
foreman start
The app should now be live at http://localhost:5000. Enter the string to be converted and click the 'Submit' button.
Call http://www.example.com/rot13 with a URL encoded string
curl http://ruby2fmpxml.herokuapp.com/rot13/Vg%27f%20n%20fyrqtr
Pass the string in URL encoded form as a POST parameter 'my_string' to the endpoint http://www.example.com/rot13
curl -d "my_string=Vg%27f%20n%20fyrqtr" http://ruby2fmpxml.herokuapp.com/rot13
The following XML shows the result of calling the app on the string "Fur'f n zna"
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="03-21-2013" NAME="FileMaker" VERSION="ProAdvanced 12.0v4"/>
<DATABASE DATEFORMAT="D/m/yyyy" LAYOUT="" NAME="Database.fmp12" RECORDS="1" TIMEFORMAT="h:mm:ss a"/>
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Input" TYPE="TEXT"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Output" TYPE="TEXT"/>
</METADATA>
<RESULTSET FOUND="1">
<ROW MODID="0" RECORDID="0">
<COL>
<DATA>Fur'f n zna</DATA>
</COL>
<COL>
<DATA>She's a man</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
Explore the app live at http://ruby2fmpxml.herokuapp.com
Please feel free to contribute. Fork, make your changes, and do a pull request. Make sure to add documentation to this readme file.
Copyright (c) 2013 Chong-Yee Khoo
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.