This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'oauth2' | |
| require 'awesome_print' | |
| # Command line to call the script: | |
| # ruby oauth_token.rb <API_key> <API_secret> https://<domain.io> | |
| # domain.io is travelexchange.io for production | |
| # and travelexchange-staging.herokuapp.com for staging. | |
| client = OAuth2::Client.new(ARGV[0], ARGV[1], site: ARGV[2]) | |
| ap client.client_credentials.get_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| entity_class = "#{ARGV[0]}Entity".constantize | |
| model_class = "#{ARGV[0]}".constantize | |
| output_path = | |
| Rails.root.join('spec', 'fixtures', 'entities', "#{ARGV[0].underscore}.yml") | |
| File.open(output_path, 'w') do |file| | |
| file.write( | |
| entity_class | |
| .represent(model_class.new) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'openssl' | |
| key = [ARGV[0]].pack("H*") | |
| puts OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha1"), key, ARGV[1]).upcase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| rake db:schema:load RAILS_ENV=test; rspec --fail-fast spec/factories spec/requests/api/internal/v1/events_spec.rb spec/requests/organiser/events_spec.rb | |