robinhood-ruby 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.coveralls.yml +1 -0
  4. data/.github/robinhood-ruby.png +0 -0
  5. data/.gitignore +9 -0
  6. data/.rspec +2 -0
  7. data/.travis.yml +15 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +11 -0
  10. data/Guardfile +5 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +520 -0
  13. data/Rakefile +8 -0
  14. data/bin/console +14 -0
  15. data/bin/setup +8 -0
  16. data/example/.DS_Store +0 -0
  17. data/example/robinhood-sample/.DS_Store +0 -0
  18. data/example/robinhood-sample/.env.example +2 -0
  19. data/example/robinhood-sample/.gitignore +19 -0
  20. data/example/robinhood-sample/Gemfile +16 -0
  21. data/example/robinhood-sample/Gemfile.lock +164 -0
  22. data/example/robinhood-sample/README.MD +7 -0
  23. data/example/robinhood-sample/Rakefile +6 -0
  24. data/example/robinhood-sample/app/assets/images/.keep +0 -0
  25. data/example/robinhood-sample/app/assets/javascripts/application.js +16 -0
  26. data/example/robinhood-sample/app/assets/stylesheets/application.css +15 -0
  27. data/example/robinhood-sample/app/controllers/application_controller.rb +5 -0
  28. data/example/robinhood-sample/app/controllers/concerns/.keep +0 -0
  29. data/example/robinhood-sample/app/helpers/application_helper.rb +2 -0
  30. data/example/robinhood-sample/app/mailers/.keep +0 -0
  31. data/example/robinhood-sample/app/models/.keep +0 -0
  32. data/example/robinhood-sample/app/models/concerns/.keep +0 -0
  33. data/example/robinhood-sample/app/views/layouts/application.html.erb +14 -0
  34. data/example/robinhood-sample/bin/bundle +3 -0
  35. data/example/robinhood-sample/bin/rails +9 -0
  36. data/example/robinhood-sample/bin/rake +9 -0
  37. data/example/robinhood-sample/bin/setup +29 -0
  38. data/example/robinhood-sample/bin/spring +16 -0
  39. data/example/robinhood-sample/config.ru +4 -0
  40. data/example/robinhood-sample/config/.DS_Store +0 -0
  41. data/example/robinhood-sample/config/application.rb +26 -0
  42. data/example/robinhood-sample/config/boot.rb +3 -0
  43. data/example/robinhood-sample/config/database.yml +25 -0
  44. data/example/robinhood-sample/config/environment.rb +5 -0
  45. data/example/robinhood-sample/config/environments/development.rb +41 -0
  46. data/example/robinhood-sample/config/environments/production.rb +79 -0
  47. data/example/robinhood-sample/config/environments/test.rb +42 -0
  48. data/example/robinhood-sample/config/initializers/.DS_Store +0 -0
  49. data/example/robinhood-sample/config/initializers/assets.rb +11 -0
  50. data/example/robinhood-sample/config/initializers/backtrace_silencers.rb +7 -0
  51. data/example/robinhood-sample/config/initializers/cookies_serializer.rb +3 -0
  52. data/example/robinhood-sample/config/initializers/filter_parameter_logging.rb +4 -0
  53. data/example/robinhood-sample/config/initializers/inflections.rb +16 -0
  54. data/example/robinhood-sample/config/initializers/mime_types.rb +4 -0
  55. data/example/robinhood-sample/config/initializers/robinhood.rb +1 -0
  56. data/example/robinhood-sample/config/initializers/session_store.rb +3 -0
  57. data/example/robinhood-sample/config/initializers/wrap_parameters.rb +14 -0
  58. data/example/robinhood-sample/config/locales/en.yml +23 -0
  59. data/example/robinhood-sample/config/routes.rb +56 -0
  60. data/example/robinhood-sample/config/secrets.yml +22 -0
  61. data/example/robinhood-sample/db/seeds.rb +7 -0
  62. data/example/robinhood-sample/lib/.DS_Store +0 -0
  63. data/example/robinhood-sample/lib/assets/.keep +0 -0
  64. data/example/robinhood-sample/lib/tasks/.keep +0 -0
  65. data/example/robinhood-sample/log/.keep +0 -0
  66. data/example/robinhood-sample/public/404.html +67 -0
  67. data/example/robinhood-sample/public/422.html +67 -0
  68. data/example/robinhood-sample/public/500.html +66 -0
  69. data/example/robinhood-sample/public/favicon.ico +0 -0
  70. data/example/robinhood-sample/public/robots.txt +5 -0
  71. data/example/robinhood-sample/test/controllers/.keep +0 -0
  72. data/example/robinhood-sample/test/fixtures/.keep +0 -0
  73. data/example/robinhood-sample/test/helpers/.keep +0 -0
  74. data/example/robinhood-sample/test/integration/.keep +0 -0
  75. data/example/robinhood-sample/test/mailers/.keep +0 -0
  76. data/example/robinhood-sample/test/models/.keep +0 -0
  77. data/example/robinhood-sample/test/test_helper.rb +10 -0
  78. data/example/robinhood-sample/vendor/assets/javascripts/.keep +0 -0
  79. data/example/robinhood-sample/vendor/assets/stylesheets/.keep +0 -0
  80. data/lib/.DS_Store +0 -0
  81. data/lib/robinhood-ruby.rb +37 -0
  82. data/lib/robinhood-ruby/.DS_Store +0 -0
  83. data/lib/robinhood-ruby/rest/.DS_Store +0 -0
  84. data/lib/robinhood-ruby/rest/api.rb +184 -0
  85. data/lib/robinhood-ruby/rest/client.rb +120 -0
  86. data/lib/robinhood-ruby/util.rb +4 -0
  87. data/lib/robinhood-ruby/util/.DS_Store +0 -0
  88. data/lib/robinhood-ruby/util/configuration.rb +7 -0
  89. data/lib/robinhood-ruby/util/request.rb +51 -0
  90. data/lib/robinhood-ruby/version.rb +3 -0
  91. data/robinhood-ruby-0.3.2.gem +0 -0
  92. data/robinhood-ruby.gemspec +52 -0
  93. metadata +346 -0
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |task|
5
+ task.rspec_opts = ['--color', '--format', 'nested']
6
+ end
7
+
8
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "robinhood"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/example/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ robinhood_username: your_username_here
2
+ robinhood_password: your_password_here
@@ -0,0 +1,19 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
18
+
19
+ .env
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '4.2.7.1'
4
+ gem 'sqlite3'
5
+ gem 'sass-rails', '~> 5.0'
6
+ gem 'uglifier', '>= 1.3.0'
7
+ gem 'coffee-rails', '~> 4.1.0'
8
+ gem 'jquery-rails'
9
+ gem 'turbolinks'
10
+ gem "dotenv-rails", require: "dotenv/rails-now"
11
+ gem "robinhood-ruby", path: "../.."
12
+
13
+ group :development, :test do
14
+ gem 'pry'
15
+ gem 'byebug'
16
+ end
@@ -0,0 +1,164 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ robinhood-ruby (0.3.1)
5
+ builder (>= 2.1.2)
6
+ jwt (~> 1.0)
7
+ multi_json (>= 1.3.0)
8
+ rack
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actionmailer (4.2.7.1)
14
+ actionpack (= 4.2.7.1)
15
+ actionview (= 4.2.7.1)
16
+ activejob (= 4.2.7.1)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 1.0, >= 1.0.5)
19
+ actionpack (4.2.7.1)
20
+ actionview (= 4.2.7.1)
21
+ activesupport (= 4.2.7.1)
22
+ rack (~> 1.6)
23
+ rack-test (~> 0.6.2)
24
+ rails-dom-testing (~> 1.0, >= 1.0.5)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (4.2.7.1)
27
+ activesupport (= 4.2.7.1)
28
+ builder (~> 3.1)
29
+ erubis (~> 2.7.0)
30
+ rails-dom-testing (~> 1.0, >= 1.0.5)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
32
+ activejob (4.2.7.1)
33
+ activesupport (= 4.2.7.1)
34
+ globalid (>= 0.3.0)
35
+ activemodel (4.2.7.1)
36
+ activesupport (= 4.2.7.1)
37
+ builder (~> 3.1)
38
+ activerecord (4.2.7.1)
39
+ activemodel (= 4.2.7.1)
40
+ activesupport (= 4.2.7.1)
41
+ arel (~> 6.0)
42
+ activesupport (4.2.7.1)
43
+ i18n (~> 0.7)
44
+ json (~> 1.7, >= 1.7.7)
45
+ minitest (~> 5.1)
46
+ thread_safe (~> 0.3, >= 0.3.4)
47
+ tzinfo (~> 1.1)
48
+ arel (6.0.3)
49
+ builder (3.2.2)
50
+ byebug (9.0.6)
51
+ coderay (1.1.1)
52
+ coffee-rails (4.1.1)
53
+ coffee-script (>= 2.2.0)
54
+ railties (>= 4.0.0, < 5.1.x)
55
+ coffee-script (2.4.1)
56
+ coffee-script-source
57
+ execjs
58
+ coffee-script-source (1.11.1)
59
+ concurrent-ruby (1.0.2)
60
+ dotenv (2.1.1)
61
+ dotenv-rails (2.1.1)
62
+ dotenv (= 2.1.1)
63
+ railties (>= 4.0, < 5.1)
64
+ erubis (2.7.0)
65
+ execjs (2.7.0)
66
+ globalid (0.3.7)
67
+ activesupport (>= 4.1.0)
68
+ i18n (0.7.0)
69
+ jquery-rails (4.2.1)
70
+ rails-dom-testing (>= 1, < 3)
71
+ railties (>= 4.2.0)
72
+ thor (>= 0.14, < 2.0)
73
+ json (1.8.3)
74
+ jwt (1.5.6)
75
+ loofah (2.0.3)
76
+ nokogiri (>= 1.5.9)
77
+ mail (2.6.4)
78
+ mime-types (>= 1.16, < 4)
79
+ method_source (0.8.2)
80
+ mime-types (3.1)
81
+ mime-types-data (~> 3.2015)
82
+ mime-types-data (3.2016.0521)
83
+ mini_portile2 (2.1.0)
84
+ minitest (5.10.1)
85
+ multi_json (1.12.1)
86
+ nokogiri (1.6.8.1)
87
+ mini_portile2 (~> 2.1.0)
88
+ pry (0.10.4)
89
+ coderay (~> 1.1.0)
90
+ method_source (~> 0.8.1)
91
+ slop (~> 3.4)
92
+ rack (1.6.5)
93
+ rack-test (0.6.3)
94
+ rack (>= 1.0)
95
+ rails (4.2.7.1)
96
+ actionmailer (= 4.2.7.1)
97
+ actionpack (= 4.2.7.1)
98
+ actionview (= 4.2.7.1)
99
+ activejob (= 4.2.7.1)
100
+ activemodel (= 4.2.7.1)
101
+ activerecord (= 4.2.7.1)
102
+ activesupport (= 4.2.7.1)
103
+ bundler (>= 1.3.0, < 2.0)
104
+ railties (= 4.2.7.1)
105
+ sprockets-rails
106
+ rails-deprecated_sanitizer (1.0.3)
107
+ activesupport (>= 4.2.0.alpha)
108
+ rails-dom-testing (1.0.7)
109
+ activesupport (>= 4.2.0.beta, < 5.0)
110
+ nokogiri (~> 1.6.0)
111
+ rails-deprecated_sanitizer (>= 1.0.1)
112
+ rails-html-sanitizer (1.0.3)
113
+ loofah (~> 2.0)
114
+ railties (4.2.7.1)
115
+ actionpack (= 4.2.7.1)
116
+ activesupport (= 4.2.7.1)
117
+ rake (>= 0.8.7)
118
+ thor (>= 0.18.1, < 2.0)
119
+ rake (12.0.0)
120
+ sass (3.4.22)
121
+ sass-rails (5.0.6)
122
+ railties (>= 4.0.0, < 6)
123
+ sass (~> 3.1)
124
+ sprockets (>= 2.8, < 4.0)
125
+ sprockets-rails (>= 2.0, < 4.0)
126
+ tilt (>= 1.1, < 3)
127
+ slop (3.6.0)
128
+ sprockets (3.7.0)
129
+ concurrent-ruby (~> 1.0)
130
+ rack (> 1, < 3)
131
+ sprockets-rails (3.2.0)
132
+ actionpack (>= 4.0)
133
+ activesupport (>= 4.0)
134
+ sprockets (>= 3.0.0)
135
+ sqlite3 (1.3.12)
136
+ thor (0.19.4)
137
+ thread_safe (0.3.5)
138
+ tilt (2.0.5)
139
+ turbolinks (5.0.1)
140
+ turbolinks-source (~> 5)
141
+ turbolinks-source (5.0.0)
142
+ tzinfo (1.2.2)
143
+ thread_safe (~> 0.1)
144
+ uglifier (3.0.4)
145
+ execjs (>= 0.3.0, < 3)
146
+
147
+ PLATFORMS
148
+ ruby
149
+
150
+ DEPENDENCIES
151
+ byebug
152
+ coffee-rails (~> 4.1.0)
153
+ dotenv-rails
154
+ jquery-rails
155
+ pry
156
+ rails (= 4.2.7.1)
157
+ robinhood-ruby!
158
+ sass-rails (~> 5.0)
159
+ sqlite3
160
+ turbolinks
161
+ uglifier (>= 1.3.0)
162
+
163
+ BUNDLED WITH
164
+ 1.13.6
@@ -0,0 +1,7 @@
1
+ # README
2
+
3
+ Update the .env.example file with your information and rename the file .env.
4
+
5
+ # Example
6
+
7
+ Note the `config/initializers/robinhood.rb` inititializer.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RobinhoodSample</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
13
+ gem 'spring', spring.version
14
+ require 'spring/binstub'
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module RobinhoodSample
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ # Do not swallow errors in after_commit/after_rollback callbacks.
24
+ config.active_record.raise_in_transactional_callbacks = true
25
+ end
26
+ end