G5 Integrations Updatable

Gem Version Circle CI

G5 Integrations Updatable provides a solution for automatic updates of integration settings from https://github.com/g5search/g5-integrations-dashboard

Requirements

G5 Integrations Updatable makes use of PostgrSQL's json field type, and so only supports implementing apps that also use PostgreSQL.

Installation

  1. Add this line to your application's Gemfile:
   gem 'g5_integrations_updatable'
  1. And then execute:
   bundle
  1. Run the generator.
   rails g g5_integrations_updatable:install

This mounts the engine at /g5_integrations_updatable.

  1. And copy the engine's migrations to your application:
    rake g5_integrations_updatable:install:migrations
  1. Add your app to g5-integrations-dashboard's.
  cd ../g5-integrations-dashboard
  rails c
  IntegrationUpdatable.create(url: 'http://<your-app-host>/g5_integrations_updatable/feeds')

Now, if you make any changes in g5-integrations-dashboard, they will be migrated over to .

  1. Prime your database with all of G5-Integrations Dashboard's data
    rake g5_integrations_updatable:load_all

Note, all of the G5_AUTH env variables need to be set for this to work.

Or,

  cd ../g5-integrations-dashboard
  rake g5_integrations_sync:integration_upatables

Usage

G5 Integrations Updatable exposes a POST route at /g5_integrations_updatable/feeds#create that accepts a feed_url parameter (the URL for the client's detail page within the G5 Hub). When the route is hit, it will update/create all location_settings under the client_setting.

G5 Integrations Updatable also exposes GET '/g5_integrations_updatable/feeds', which returns a JSON representation of all the settings.

Spec Helpers

The engine provides a helper files that can be included in your project to bring in some testing support.

require 'g5_integrations_updatable/rspec'

Authors

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write your code and specs
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

If you find bugs, have feature requests or questions, please file an issue.

Specs

The database.yml for the dummy app must be created and modified to match your PostgreSQL configuration. If you are using the G5 Orion Vagrant image, the sample file should just work. You can copy it into place with:

$ cp spec/dummy/config/database.sample.yml spec/dummy/config/database.yml

Run specs via rspec with:

$ rspec spec

License

Copyright (c) 2014 G5

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.