openstax_exchange 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +44 -0
  4. data/Rakefile +22 -0
  5. data/lib/openstax/exchange/version.rb +5 -0
  6. data/lib/openstax_exchange.rb +112 -0
  7. data/spec/dummy/README.md +1 -0
  8. data/spec/dummy/Rakefile +7 -0
  9. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  10. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  11. data/spec/dummy/app/controllers/api/dummy_controller.rb +11 -0
  12. data/spec/dummy/app/controllers/api/events_controller.rb +7 -0
  13. data/spec/dummy/app/controllers/application_controller.rb +7 -0
  14. data/spec/dummy/app/controllers/oauth_controller.rb +8 -0
  15. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  16. data/spec/dummy/config/application.rb +55 -0
  17. data/spec/dummy/config/boot.rb +10 -0
  18. data/spec/dummy/config/database.yml +25 -0
  19. data/spec/dummy/config/environment.rb +5 -0
  20. data/spec/dummy/config/environments/development.rb +29 -0
  21. data/spec/dummy/config/environments/production.rb +69 -0
  22. data/spec/dummy/config/environments/test.rb +35 -0
  23. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  24. data/spec/dummy/config/initializers/inflections.rb +15 -0
  25. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  26. data/spec/dummy/config/initializers/openstax_exchange.rb +10 -0
  27. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  28. data/spec/dummy/config/initializers/session_store.rb +8 -0
  29. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  30. data/spec/dummy/config/locales/en.yml +5 -0
  31. data/spec/dummy/config/routes.rb +11 -0
  32. data/spec/dummy/config.ru +4 -0
  33. data/spec/dummy/db/development.sqlite3 +0 -0
  34. data/spec/dummy/db/schema.rb +16 -0
  35. data/spec/dummy/db/test.sqlite3 +0 -0
  36. data/spec/dummy/log/development.log +929 -0
  37. data/spec/dummy/log/test.log +46753 -0
  38. data/spec/dummy/public/404.html +26 -0
  39. data/spec/dummy/public/422.html +26 -0
  40. data/spec/dummy/public/500.html +25 -0
  41. data/spec/dummy/public/favicon.ico +0 -0
  42. data/spec/dummy/script/rails +6 -0
  43. data/spec/lib/openstax_exchange_spec.rb +23 -0
  44. data/spec/spec_helper.rb +39 -0
  45. metadata +224 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module OpenStax
4
+ describe Exchange do
5
+
6
+ it 'makes api calls' do
7
+ expect(::Api::DummyController.last_action).to be_nil
8
+ expect(Api::DummyController.last_params).to be_nil
9
+ Exchange.api_call(:post, 'dummy', :params => {:test => true})
10
+ expect(Api::DummyController.last_action).to eq :dummy
11
+ expect(Api::DummyController.last_params).to include 'test' => 'true'
12
+ end
13
+
14
+ it 'makes api calls to events (index)' do
15
+ Api::EventsController.last_action = nil
16
+ Api::EventsController.last_params = nil
17
+ Exchange.search_events('sth')
18
+ expect(Api::EventsController.last_action).to eq :index
19
+ expect(Api::EventsController.last_params).to include :q => 'sth'
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,39 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+
3
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
4
+ require 'rspec/rails'
5
+
6
+ # Requires supporting ruby files with custom matchers and macros, etc,
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # in spec/support/ and its subdirectories.
10
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
11
+
12
+ RSpec.configure do |config|
13
+ # ## Mock Framework
14
+ #
15
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
16
+ #
17
+ # config.mock_with :mocha
18
+ # config.mock_with :flexmock
19
+ # config.mock_with :rr
20
+
21
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
22
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
23
+
24
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
25
+ # examples within a transaction, remove the following line or assign false
26
+ # instead of true.
27
+ config.use_transactional_fixtures = true
28
+
29
+ # If true, the base class of anonymous controllers will be inferred
30
+ # automatically. This will be the default behavior in future versions of
31
+ # rspec-rails.
32
+ config.infer_base_class_for_anonymous_controllers = false
33
+
34
+ # Run specs in random order to surface order dependencies. If you find an
35
+ # order dependency and want to debug it, you can fix the order by providing
36
+ # the seed, which is printed after each run.
37
+ # --seed 1234
38
+ config.order = "random"
39
+ end
metadata ADDED
@@ -0,0 +1,224 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: openstax_exchange
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - JP Slavinsky
8
+ - Dante Soares
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-07-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: oauth2
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.5.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.5.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '3.1'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '3.1'
42
+ - !ruby/object:Gem::Dependency
43
+ name: sqlite3
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: capybara
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: quiet_assets
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: thin
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ! '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ description: Ruby common code and bindings and for the 'Exchange' API
113
+ email:
114
+ - jps@kindlinglabs.com
115
+ - dms3@rice.edu
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - MIT-LICENSE
121
+ - README.md
122
+ - Rakefile
123
+ - lib/openstax/exchange/version.rb
124
+ - lib/openstax_exchange.rb
125
+ - spec/dummy/README.md
126
+ - spec/dummy/Rakefile
127
+ - spec/dummy/app/assets/javascripts/application.js
128
+ - spec/dummy/app/assets/stylesheets/application.css
129
+ - spec/dummy/app/controllers/api/dummy_controller.rb
130
+ - spec/dummy/app/controllers/api/events_controller.rb
131
+ - spec/dummy/app/controllers/application_controller.rb
132
+ - spec/dummy/app/controllers/oauth_controller.rb
133
+ - spec/dummy/app/helpers/application_helper.rb
134
+ - spec/dummy/config.ru
135
+ - spec/dummy/config/application.rb
136
+ - spec/dummy/config/boot.rb
137
+ - spec/dummy/config/database.yml
138
+ - spec/dummy/config/environment.rb
139
+ - spec/dummy/config/environments/development.rb
140
+ - spec/dummy/config/environments/production.rb
141
+ - spec/dummy/config/environments/test.rb
142
+ - spec/dummy/config/initializers/backtrace_silencers.rb
143
+ - spec/dummy/config/initializers/inflections.rb
144
+ - spec/dummy/config/initializers/mime_types.rb
145
+ - spec/dummy/config/initializers/openstax_exchange.rb
146
+ - spec/dummy/config/initializers/secret_token.rb
147
+ - spec/dummy/config/initializers/session_store.rb
148
+ - spec/dummy/config/initializers/wrap_parameters.rb
149
+ - spec/dummy/config/locales/en.yml
150
+ - spec/dummy/config/routes.rb
151
+ - spec/dummy/db/development.sqlite3
152
+ - spec/dummy/db/schema.rb
153
+ - spec/dummy/db/test.sqlite3
154
+ - spec/dummy/log/development.log
155
+ - spec/dummy/log/test.log
156
+ - spec/dummy/public/404.html
157
+ - spec/dummy/public/422.html
158
+ - spec/dummy/public/500.html
159
+ - spec/dummy/public/favicon.ico
160
+ - spec/dummy/script/rails
161
+ - spec/lib/openstax_exchange_spec.rb
162
+ - spec/spec_helper.rb
163
+ homepage: http://github.com/openstax/exchange-ruby
164
+ licenses: []
165
+ metadata: {}
166
+ post_install_message:
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ! '>='
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubyforge_project:
182
+ rubygems_version: 2.2.2
183
+ signing_key:
184
+ specification_version: 4
185
+ summary: Ruby common code and bindings and for the 'Exchange' API
186
+ test_files:
187
+ - spec/dummy/app/assets/javascripts/application.js
188
+ - spec/dummy/app/assets/stylesheets/application.css
189
+ - spec/dummy/app/controllers/api/dummy_controller.rb
190
+ - spec/dummy/app/controllers/api/events_controller.rb
191
+ - spec/dummy/app/controllers/application_controller.rb
192
+ - spec/dummy/app/controllers/oauth_controller.rb
193
+ - spec/dummy/app/helpers/application_helper.rb
194
+ - spec/dummy/config/application.rb
195
+ - spec/dummy/config/boot.rb
196
+ - spec/dummy/config/database.yml
197
+ - spec/dummy/config/environment.rb
198
+ - spec/dummy/config/environments/development.rb
199
+ - spec/dummy/config/environments/production.rb
200
+ - spec/dummy/config/environments/test.rb
201
+ - spec/dummy/config/initializers/backtrace_silencers.rb
202
+ - spec/dummy/config/initializers/inflections.rb
203
+ - spec/dummy/config/initializers/mime_types.rb
204
+ - spec/dummy/config/initializers/openstax_exchange.rb
205
+ - spec/dummy/config/initializers/secret_token.rb
206
+ - spec/dummy/config/initializers/session_store.rb
207
+ - spec/dummy/config/initializers/wrap_parameters.rb
208
+ - spec/dummy/config/locales/en.yml
209
+ - spec/dummy/config/routes.rb
210
+ - spec/dummy/config.ru
211
+ - spec/dummy/db/development.sqlite3
212
+ - spec/dummy/db/schema.rb
213
+ - spec/dummy/db/test.sqlite3
214
+ - spec/dummy/log/development.log
215
+ - spec/dummy/log/test.log
216
+ - spec/dummy/public/404.html
217
+ - spec/dummy/public/422.html
218
+ - spec/dummy/public/500.html
219
+ - spec/dummy/public/favicon.ico
220
+ - spec/dummy/Rakefile
221
+ - spec/dummy/README.md
222
+ - spec/dummy/script/rails
223
+ - spec/lib/openstax_exchange_spec.rb
224
+ - spec/spec_helper.rb