rakuten_web_service-rails 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b82d6677ed7938a813f0aa7e569cac83e750fcd7
4
- data.tar.gz: 6b4e87aa2cb56c430e21d10a85b6e1b153960ada
3
+ metadata.gz: da6271dda87a323427138e6b9e862e70c818c32b
4
+ data.tar.gz: 1153a3745fdb5a2d6489e9942ae57ecca5b9d41f
5
5
  SHA512:
6
- metadata.gz: 0c7ca3313617451f4e6095b1ee91f42897fc08e7303459c3576db58d3873e094ad5cdd4b6e8fdd4f0b1cb7d8d16c0577c433d8c88487130e86cd99de719647ea
7
- data.tar.gz: 765e87988864b621ca2b44c8714a39ffc1ff1a5bae4de4fcea2cdf0683daf3860b00c24208204dfdf797bb88402916bb18209e8903e1d39ef948fd134c420115
6
+ metadata.gz: d09b562dd444dbd9e523c8c706435e85407a0a0a82861089ccc84f8d783c27fb0d02d290d26ef26145d47abc39dd4532f576479003927d251e2db763bd690deb
7
+ data.tar.gz: 0fa9473fdab91dfe90b79f5154c2e06c835445268f237470844e7cf4ecf56d48230ab8a30fc88dbd26e7addca494e80dce129afda4156f6c3e0196a708698000
data/.gitignore CHANGED
@@ -8,3 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /gemfiles/*.lock
11
+ *.sqlite3
12
+ spec/tmp/
13
+ *.log
data/.travis.yml CHANGED
@@ -8,6 +8,11 @@ gemfile:
8
8
  - gemfiles/Gemfile.rail4
9
9
  - gemfiles/Gemfile.rail5
10
10
  before_install: gem install bundler -v 1.12.5
11
+
12
+ script:
13
+ - bundle exec rspec
14
+ - bundle exec rspec --tag integration
15
+
11
16
  matrix:
12
17
  exclude:
13
18
  - rvm: 2.1.9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.3.0 (January 4, 2017)
2
+
3
+ ## Enhancement
4
+
5
+ * The generator `rakuten_web_service:config` has been rolled out! [#5](https://github.com/satoryu/rakuten_web_service-rails/pull/5)
6
+
1
7
  # v0.2.0 (November 3, 2016)
2
8
 
3
9
  ## Enhancements
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rakuten_web_service-rails.gemspec
4
4
  gemspec
5
+
6
+ gem 'sqlite3'
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # RakutenWebService::Rails
2
2
  [![Gem Version](https://badge.fury.io/rb/rakuten_web_service-rails.svg)](https://badge.fury.io/rb/rakuten_web_service-rails)
3
+ [![Build Status](https://travis-ci.org/satoryu/rakuten_web_service-rails.svg?branch=master)](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
- Put your configuration to access Rakuten Web Service, application ID and affiliate ID, in YAML to `/path/to/your_rails_app/config/rakuten_web_service.yml` like:
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: 'your application id' # Required
29
- affiliate_id: 'your affiliate id' # Optional
35
+ application_id: DEV_APPLICATION_ID
36
+ affiliate_id: DEV_AFFILIATE_ID
30
37
 
31
38
  test:
32
- application_id: 'your application id' # Required
33
- affiliate_id: 'your affiliate id' # Optional
39
+ application_id: TEST_APPLICATION_ID
40
+ affiliate_id: TEST_AFFILIATE_ID
34
41
 
35
42
  production:
36
- application_id: <%= ENV['RAS_APPLICATION_ID'] %> # This configuration file is dealt as ERB
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
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '../'
5
5
 
6
6
  gem 'rails', '~> 4.2.5'
7
+ gem 'sqlite3'
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec path: '../'
5
5
 
6
6
  gem 'rails', '~> 5.0.0'
7
+ gem 'sqlite3'
@@ -0,0 +1,7 @@
1
+ class RakutenWebService::ConfigGenerator < Rails::Generators::Base
2
+ source_root File.expand_path("../templates", __FILE__)
3
+
4
+ def copy_config_file
5
+ copy_file "rakuten_web_service.yml", "config/rakuten_web_service.yml"
6
+ end
7
+ end
@@ -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
- RakutenWebService.configure do |c|
16
- c.application_id = config['application_id']
17
- c.affiliate_id = config['affiliate_id']
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
@@ -1,5 +1,5 @@
1
1
  module RakutenWebService
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.0'
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.2.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: 2016-11-03 00:00:00.000000000 Z
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.2.0
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.2.0
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.1
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.