rakuten_web_service-rails 0.1.0 → 0.2.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: 4ca5e7b3398b6253cf2fe53b2dbc7f42c0ccc064
4
- data.tar.gz: 24bc774c3997812b06d7e84d337675f90de0a503
3
+ metadata.gz: b82d6677ed7938a813f0aa7e569cac83e750fcd7
4
+ data.tar.gz: 6b4e87aa2cb56c430e21d10a85b6e1b153960ada
5
5
  SHA512:
6
- metadata.gz: a5e8884b1b0e2544eeecc9c7329b2f5f20009d80839065d9f2c29c5a6ed936e7b2dc4670dababa550f057da9a7b40342320c9ead12d6f5e07da015b24933736a
7
- data.tar.gz: d2455630fcf0834f9bbf39c5b3750e3adb3034adbeb8150d3ee810ae50515926e41babb385b06e4086f93cfff3adf0c60666d412bdcbaebdfae3f0ce9a318212
6
+ metadata.gz: 0c7ca3313617451f4e6095b1ee91f42897fc08e7303459c3576db58d3873e094ad5cdd4b6e8fdd4f0b1cb7d8d16c0577c433d8c88487130e86cd99de719647ea
7
+ data.tar.gz: 765e87988864b621ca2b44c8714a39ffc1ff1a5bae4de4fcea2cdf0683daf3860b00c24208204dfdf797bb88402916bb18209e8903e1d39ef948fd134c420115
@@ -0,0 +1,12 @@
1
+ # v0.2.0 (November 3, 2016)
2
+
3
+ ## Enhancements
4
+
5
+ * The configuration file can be written in ERB file. [#2](https://github.com/satoryu/rakuten_web_service-rails/pull/2)
6
+
7
+
8
+ # v0.1.0 (November 2, 2016)
9
+
10
+ ## Enhancements
11
+
12
+ * Provides an initializer to a Rails app to load configurations from YAML file.
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # RakutenWebService::Rails
2
+ [![Gem Version](https://badge.fury.io/rb/rakuten_web_service-rails.svg)](https://badge.fury.io/rb/rakuten_web_service-rails)
2
3
 
3
4
  The gem provides an initializer to load the configuration for accessing Rakuten Web Service from YAML file in your Rails app's `config` directory.
4
5
 
@@ -32,7 +33,7 @@ Put your configuration to access Rakuten Web Service, application ID and affilia
32
33
  affiliate_id: 'your affiliate id' # Optional
33
34
 
34
35
  production:
35
- application_id: 'your application id for PROD' # Required
36
+ application_id: <%= ENV['RAS_APPLICATION_ID'] %> # This configuration file is dealt as ERB
36
37
  ```
37
38
 
38
39
  That's it!
@@ -45,7 +46,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
45
46
 
46
47
  ## Contributing
47
48
 
48
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rakuten_web_service-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/satoryu/rakuten_web_service-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
50
 
50
51
 
51
52
  ## License
@@ -6,7 +6,12 @@ module RakutenWebService
6
6
  class Railtie < ::Rails::Railtie
7
7
  initializer "rakuten_web_service.load_configuration" do
8
8
  config_path = ::Rails.root.join('config', 'rakuten_web_service.yml')
9
- config = YAML.load_file(config_path)[::Rails.env]
9
+
10
+ self.load_configuration(config_path, ::Rails.env)
11
+ end
12
+
13
+ def load_configuration(config_path, environment)
14
+ config = YAML.load(ERB.new(File.read(config_path)).result(binding))[environment]
10
15
  RakutenWebService.configure do |c|
11
16
  c.application_id = config['application_id']
12
17
  c.affiliate_id = config['affiliate_id']
@@ -1,5 +1,5 @@
1
1
  module RakutenWebService
2
2
  module Rails
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["satoryu.1981@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Integrate 'rakuten_web_service' with your Rails app.}
13
- spec.description = %q{This gem provides a generator and helpers to help you integrate 'rakuten_web_service' with your Rails applications.}
13
+ spec.description = %q{This gem provides an initializer to load configurations of 'rakuten_web_service' with your Rails applications.}
14
14
  spec.homepage = "https://github.com/satoryu/rakuten_web_service-rails"
15
15
  spec.license = "MIT"
16
16
 
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.1.0
4
+ version: 0.2.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-02 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,7 +86,7 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '3.0'
89
- description: This gem provides a generator and helpers to help you integrate 'rakuten_web_service'
89
+ description: This gem provides an initializer to load configurations of 'rakuten_web_service'
90
90
  with your Rails applications.
91
91
  email:
92
92
  - satoryu.1981@gmail.com
@@ -97,6 +97,7 @@ files:
97
97
  - ".gitignore"
98
98
  - ".rspec"
99
99
  - ".travis.yml"
100
+ - CHANGELOG.md
100
101
  - CODE_OF_CONDUCT.md
101
102
  - Gemfile
102
103
  - LICENSE.txt