rakuten_web_service-rails 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -0
- data/README.md +16 -6
- data/gemfiles/Gemfile.rail4 +1 -0
- data/gemfiles/Gemfile.rail5 +1 -0
- data/lib/generators/rakuten_web_service/config_generator.rb +7 -0
- data/lib/generators/rakuten_web_service/templates/rakuten_web_service.yml +11 -0
- data/lib/rakuten_web_service/rails.rb +8 -3
- data/lib/rakuten_web_service/rails/version.rb +1 -1
- data/rakuten_web_service-rails.gemspec +2 -1
- metadata +21 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6271dda87a323427138e6b9e862e70c818c32b
|
4
|
+
data.tar.gz: 1153a3745fdb5a2d6489e9942ae57ecca5b9d41f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09b562dd444dbd9e523c8c706435e85407a0a0a82861089ccc84f8d783c27fb0d02d290d26ef26145d47abc39dd4532f576479003927d251e2db763bd690deb
|
7
|
+
data.tar.gz: 0fa9473fdab91dfe90b79f5154c2e06c835445268f237470844e7cf4ecf56d48230ab8a30fc88dbd26e7addca494e80dce129afda4156f6c3e0196a708698000
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# RakutenWebService::Rails
|
2
2
|
[](https://badge.fury.io/rb/rakuten_web_service-rails)
|
3
|
+
[](https://travis-ci.org/satoryu/rakuten_web_service-rails)
|
3
4
|
|
4
5
|
The gem provides an initializer to load the configuration for accessing Rakuten Web Service from YAML file in your Rails app's `config` directory.
|
5
6
|
|
@@ -21,21 +22,30 @@ Or install it yourself as:
|
|
21
22
|
|
22
23
|
## Usage
|
23
24
|
|
24
|
-
|
25
|
+
This gem provides a generator to put configuration to access Rakuten Web Service.
|
26
|
+
|
27
|
+
```sh
|
28
|
+
$ rails generator rakuten_web_service:conig
|
29
|
+
```
|
30
|
+
|
31
|
+
Ater that, you will find `rakuten_web_service.yml` under the `config` directory.
|
25
32
|
|
26
33
|
```yaml
|
27
34
|
development:
|
28
|
-
application_id:
|
29
|
-
affiliate_id:
|
35
|
+
application_id: DEV_APPLICATION_ID
|
36
|
+
affiliate_id: DEV_AFFILIATE_ID
|
30
37
|
|
31
38
|
test:
|
32
|
-
application_id:
|
33
|
-
affiliate_id:
|
39
|
+
application_id: TEST_APPLICATION_ID
|
40
|
+
affiliate_id: TEST_AFFILIATE_ID
|
34
41
|
|
35
42
|
production:
|
36
|
-
application_id: <%= ENV['
|
43
|
+
application_id: <%= ENV['RWS_APPLICATION_ID'] %>
|
44
|
+
affiliate_id: <%= ENV['RWS_AFFILIATE_ID'] %>
|
37
45
|
```
|
38
46
|
|
47
|
+
Replace `APPLICATION_ID` and `AFFILIATE_ID` with appropriate ones.
|
48
|
+
|
39
49
|
That's it!
|
40
50
|
|
41
51
|
## Development
|
data/gemfiles/Gemfile.rail4
CHANGED
data/gemfiles/Gemfile.rail5
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
development:
|
2
|
+
application_id: DEV_APPLICATION_ID
|
3
|
+
affiliate_id: DEV_AFFILIATE_ID
|
4
|
+
|
5
|
+
test:
|
6
|
+
application_id: TEST_APPLICATION_ID
|
7
|
+
affiliate_id: TEST_AFFILIATE_ID
|
8
|
+
|
9
|
+
production:
|
10
|
+
application_id: <%= ENV['RWS_APPLICATION_ID'] %>
|
11
|
+
affiliate_id: <%= ENV['RWS_AFFILIATE_ID'] %>
|
@@ -11,11 +11,16 @@ module RakutenWebService
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def load_configuration(config_path, environment)
|
14
|
+
return unless File.exists? config_path
|
15
|
+
|
14
16
|
config = YAML.load(ERB.new(File.read(config_path)).result(binding))[environment]
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
if config
|
18
|
+
RakutenWebService.configure do |c|
|
19
|
+
c.application_id = config['application_id']
|
20
|
+
c.affiliate_id = config['affiliate_id']
|
21
|
+
end
|
18
22
|
end
|
23
|
+
raise RuntimeError, "Required configuration for RakutenWebService has not been set" unless RakutenWebService.configuration.has_required_options?
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -27,9 +27,10 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
spec.add_dependency 'rails', '> 4.2', '< 5.1.0'
|
30
|
-
spec.add_dependency 'rakuten_web_service', '~> 1.
|
30
|
+
spec.add_dependency 'rakuten_web_service', '~> 1.4.0'
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.12"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
+
spec.add_development_dependency "ammeter", "~> 1.1.4"
|
35
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rakuten_web_service-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 1.
|
39
|
+
version: 1.4.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: 1.4.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '3.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: ammeter
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 1.1.4
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.1.4
|
89
103
|
description: This gem provides an initializer to load configurations of 'rakuten_web_service'
|
90
104
|
with your Rails applications.
|
91
105
|
email:
|
@@ -107,6 +121,8 @@ files:
|
|
107
121
|
- bin/setup
|
108
122
|
- gemfiles/Gemfile.rail4
|
109
123
|
- gemfiles/Gemfile.rail5
|
124
|
+
- lib/generators/rakuten_web_service/config_generator.rb
|
125
|
+
- lib/generators/rakuten_web_service/templates/rakuten_web_service.yml
|
110
126
|
- lib/rakuten_web_service/rails.rb
|
111
127
|
- lib/rakuten_web_service/rails/version.rb
|
112
128
|
- rakuten_web_service-rails.gemspec
|
@@ -131,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
147
|
version: '0'
|
132
148
|
requirements: []
|
133
149
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.5.
|
150
|
+
rubygems_version: 2.5.2
|
135
151
|
signing_key:
|
136
152
|
specification_version: 4
|
137
153
|
summary: Integrate 'rakuten_web_service' with your Rails app.
|