openstax_exchange 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- exchange-ruby
2
- =============
1
+ # exchange-ruby
3
2
 
4
3
  [![Gem Version](https://badge.fury.io/rb/openstax_exchange.svg)](http://badge.fury.io/rb/openstax_exchange)
5
4
  [![Build Status](https://travis-ci.org/openstax/exchange-ruby.svg?branch=master)](https://travis-ci.org/openstax/exchange-ruby)
@@ -7,8 +6,7 @@ exchange-ruby
7
6
 
8
7
  A ruby client for interfacing with the OpenStax Exchange API.
9
8
 
10
- Usage
11
- -----
9
+ ## Usage
12
10
 
13
11
  Include the gem in your project:
14
12
  ```rb
@@ -21,16 +19,19 @@ Include the following in your script:
21
19
  require 'openstax_exchange'
22
20
  ```
23
21
 
24
- Configure the client's knowledge of the Exchange server:
22
+ ### Client Configuration
25
23
 
24
+ *NOTE:* After changing the client configuration, use:
26
25
  ```rb
27
- OpenStax::Exchange.configure do |config|
28
- config.client_platform_id = '123'
29
- config.client_platform_secret = 'abc' ## do not check real secrets into version control!
30
- config.client_server_url = 'http://www.example.com:3000/base/path'
31
- config.client_api_version = 'v1'
32
- end
26
+ OpenStax::Exchange.reset!
33
27
  ```
28
+ to ensure that the changes take effect.
29
+
30
+ #### Choosing the Client
31
+
32
+ Two clients are supported:
33
+ * a real client which connects to an actual Exchange server
34
+ * a fake client which implements a fake of the Exchange server
34
35
 
35
36
  By default the real Exchange client will be used. However, the choice can be made explicitly by using the following:
36
37
 
@@ -39,7 +40,22 @@ OpenStax::Exchange.use_real_client
39
40
  OpenStax::Exchange.use_fake_client
40
41
  ```
41
42
 
42
- If using the fake client, configure the faked server settings:
43
+ #### Configuring the Client
44
+
45
+ Regardless of which client is used, you must configure the client's knowledge of the Exchange server:
46
+
47
+ ```rb
48
+ OpenStax::Exchange.configure do |config|
49
+ config.client_platform_id = '123'
50
+ config.client_platform_secret = 'abc' ## do not check real secrets into version control!
51
+ config.client_server_url = 'http://www.example.com:3000/base/path'
52
+ config.client_api_version = 'v1'
53
+ end
54
+ ```
55
+
56
+ #### Configuring the Fake Client
57
+
58
+ The fake client automatically uses the `OpenStax::Exchange.configure` client-side settings, but you must also configure the faked client's server settings:
43
59
 
44
60
  ```rb
45
61
  OpenStax::Exchange::FakeClient.configure do |config|
@@ -49,22 +65,16 @@ OpenStax::Exchange::FakeClient.configure do |config|
49
65
  end
50
66
  ```
51
67
 
52
- After changing the client configuration, use:
53
- ```rb
54
- OpenStax::Exchange.reset!
55
- ```
56
- to ensure that the changes take effect.
68
+ ### Supported API Methods
57
69
 
58
70
  The following Exchange API methods are currently supported:
59
71
  ```rb
60
72
  identifier = OpenStax::Exchange.create_identifier
61
- ```
62
- ```rb
73
+
63
74
  response = OpenStax::Exchange.record_multiple_choice_answer(identifier, resource_uri, trial, answer)
64
75
  ```
65
76
 
66
- Running the Specs
67
- -----------------
77
+ ## Running the Specs
68
78
 
69
79
  Create a local clone of the repo, and run the following commands:
70
80
  ```rb
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Exchange
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_exchange
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-13 00:00:00.000000000 Z
12
+ date: 2015-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 149071873678705480
186
+ hash: 4392210853823961273
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  segments:
194
194
  - 0
195
- hash: 149071873678705480
195
+ hash: 4392210853823961273
196
196
  requirements: []
197
197
  rubyforge_project:
198
198
  rubygems_version: 1.8.23.2