rakuten_web_service 1.2.0 → 1.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: 99b714dfe2d0bd4009d95f2ca806dbf446c8ed5d
4
- data.tar.gz: a1597c3749f7eb7f0d6cff37261583939661c233
3
+ metadata.gz: f79961bad825f4fb30452d991970455ea06c3dfe
4
+ data.tar.gz: 3fe13d653a47429b7a4423f49cfa92a8bc48e41e
5
5
  SHA512:
6
- metadata.gz: e8eaeb445ef960ad736b11c545af488fdde4e700306b4221de66f3b88eebb88b7a1a7059c364a9d8044900ee514049b8be51b0db0093f6f75ef50e5f5645f17a
7
- data.tar.gz: 055e6f2dacdd6baee0868ea136897742bcdb4aaee6e0c64953509c201c66960b6d87d0a45b8d2f41033709f421c61c64c80d4db59da5ea4066cdb50478f68381
6
+ metadata.gz: 417d44418dccbcbb5ba5c7cce48168b9204b2d4fa56790119bcc9864abed6e9dfedd8c7738dca523dbc4e733825063f6fe1116da728b281ca0c64bd98748f738
7
+ data.tar.gz: 64ac7fb9c11bc7754eae3127ea522234289a3f664e4fa274e3297b0883927dacdcb95c0a7db4c45f6910c1324f3bc28ad18e49ddb0af655e646783ad486fa72f
data/.codeclimate.yml ADDED
@@ -0,0 +1,16 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ duplication:
5
+ enabled: true
6
+ config:
7
+ languages:
8
+ - ruby
9
+
10
+ ratings:
11
+ paths:
12
+ - lib/**/*.rb
13
+
14
+ exclude_paths:
15
+ - spec/**/*
16
+ - examples/*.rb
data/.travis.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  language: ruby
2
-
3
2
  rvm:
4
3
  - 2.1.10
5
4
  - 2.2.5
@@ -11,6 +10,10 @@ cache: bundler
11
10
  before_install:
12
11
  - gem install bundler
13
12
 
13
+ script:
14
+ - bundle exec rake
15
+ - bundle exec codeclimate-test-reporter
16
+
14
17
  matrix:
15
18
  allow_failures:
16
19
  - rvm: ruby-head
@@ -19,3 +22,9 @@ addons:
19
22
  code_climate:
20
23
  repo_token:
21
24
  secure: Z23O936LoCDGJ/OyYsLzxTUI+CMWyrfeN1PtQdCNMdF4vxwaCsAHr3ulTdudGhKMrVZGENSEK6fq0Xal3o3oPaH9aGM9sUQ/ibRM+J94Lx6Owu4okTsIHoEy4vFeW+A/62aiwxPcoi7PFrvC8FOfaZg+b+vvYAQcitVe6qwBHiE=
25
+
26
+ notifications:
27
+ email: false
28
+ hipchat:
29
+ rooms:
30
+ secure: RYuIFjh/T6Hlj9nJ0RjmlTlES+9ZWcDNe1o2KRqMdH8cK1epIEgcEzMsFP6wKPRMQqOVw6Tu5gBMltDgu26sAW8HkTnMlzYtF6AVeOgsC6VVO9XzdaoVWWQX5J/Xn21vNV1vcncuOuMByz6dmzWngZv3T0u1mcvPje00EDNo27M=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # v1.3.0 (2016/11/08)
2
+
3
+ ## Enhancements
4
+
5
+ * Loads Application ID and Affiliate ID from environment varaibles `RWS_APPLICATION_ID` and `RWS_AFFILIATE_ID` respectively. [#47](https://github.com/rakuten-ws/rws-ruby-sdk/pull/47)
6
+
7
+ ## Improvements
8
+
9
+ * Upgraded `codeclimate-test-reporter`. [#48](https://github.com/rakuten-ws/rws-ruby-sdk/pull/48)
10
+
1
11
  # v1.2.0 (2016/10/25)
2
12
 
3
13
  ## Ehancements
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem "codeclimate-test-reporter", require: nil
7
+ gem "codeclimate-test-reporter", '~> 1.0.0'
8
8
  gem "coveralls", require: nil
9
9
  end
data/README.md CHANGED
@@ -59,6 +59,8 @@ If you have not got it, register your application [here](https://webservice.raku
59
59
 
60
60
  At first, you have to specify your application's key. And you can tell the client your afiiliate id with `RakutenWebService.configuration`.
61
61
 
62
+ #### In Your Code
63
+
62
64
  ```ruby
63
65
  RakutenWebService.configuration do |c|
64
66
  # (Required) Appliction ID for your application.
@@ -81,6 +83,11 @@ At first, you have to specify your application's key. And you can tell the clien
81
83
 
82
84
  Please note that you need to replace `'YOUR_APPLICATION_ID'` and `'YOUR_AFFILIATE_ID'` with actual ones you have.
83
85
 
86
+ #### Environment Variables
87
+
88
+ You can configure `application_id` and `affiliate_id` by defining environment variables `RWS_APPLICATION_ID` and `RWS_AFFILIATION_ID`.
89
+
90
+
84
91
  ### Search Ichiba Items
85
92
 
86
93
  ```ruby
@@ -1,10 +1,10 @@
1
- require 'logger'
2
-
3
1
  module RakutenWebService
4
2
  class Configuration
5
3
  attr_accessor :application_id, :affiliate_id, :max_retries, :debug
6
4
 
7
5
  def initialize
6
+ @application_id = ENV['RWS_APPLICATION_ID']
7
+ @affiliate_id = ENV['RWS_AFFILIATE_ID']
8
8
  @max_retries = 5
9
9
  end
10
10
 
@@ -1,3 +1,3 @@
1
1
  module RakutenWebService
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.3.0".freeze
3
3
  end
@@ -2,6 +2,27 @@ require 'spec_helper'
2
2
  require 'rakuten_web_service/configuration'
3
3
 
4
4
  describe RakutenWebService::Configuration do
5
+ describe '#initialize' do
6
+ context "environment variable RWS_APPLICATION_ID and RWS_AFFILIATE_ID are defined" do
7
+ before do
8
+ ENV['RWS_APPLICATION_ID'] = 'env_application_id'
9
+ ENV['RWS_AFFILIATE_ID'] = 'env_affiliate_id'
10
+ end
11
+
12
+ after do
13
+ ENV.delete 'RWS_APPLICATION_ID'
14
+ ENV.delete 'RWS_AFFILIATE_ID'
15
+ end
16
+
17
+ subject { RakutenWebService::Configuration.new }
18
+
19
+ specify "the application id is set by the environment variable" do
20
+ expect(subject.application_id).to eq 'env_application_id'
21
+ expect(subject.affiliate_id).to eq 'env_affiliate_id'
22
+ end
23
+ end
24
+ end
25
+
5
26
  describe '.configure' do
6
27
  context 'given block has one arity' do
7
28
  before do
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,4 @@
1
1
  if ENV['CI']
2
- require 'codeclimate-test-reporter'
3
- CodeClimate::TestReporter.start
4
-
5
2
  require 'coveralls'
6
3
  Coveralls.wear!
7
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakuten_web_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Sato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,6 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".codeclimate.yml"
90
91
  - ".coveralls.yml"
91
92
  - ".gitignore"
92
93
  - ".travis.yml"