chatwork 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ff8952348e48984572331eb1eb9b3d0eb041c78
4
- data.tar.gz: 601db99a6ba2b1cdeb2862719e28e5aedef69ddd
3
+ metadata.gz: 3a3b2adaced84713cd86ba540f1eeaea0315f0cc
4
+ data.tar.gz: d373bf611bc2eabeb8cefeacc67a705927df7760
5
5
  SHA512:
6
- metadata.gz: 3af7f7081830a9b5beff2e0d4528961ff60f4d6b352f511b8b3760360b0dc3a89dfd34639844b479d405bb570074f1484ae9fad154fefcacd5b4f6b6789c1caa
7
- data.tar.gz: ca9243c495e2c0f8a638be90c2c38395f71e531c3cd2e1ada4de4b1052bc3748b8cb1b9a9ce6ed2be91a679dd1041de3a7cd8dc4a90ccc7847a2451ed016b1b3
6
+ metadata.gz: c7f21f7b1416be38b7e6e622d2a06ee5aa01c4f4cc36240ea99c692b5407397a040d847ed6a6862c39a6ff85e08623a82540ecdda0eadcb0933810cb6cb65a4d
7
+ data.tar.gz: 55d38783c3d7278a643f6f71b34f2f7da4ff1be301a8d28115ff54ccefb56f3f285e82ae89ef2fc01f584e3c2350175f65f85f369adbc907d22f0da657c176e8
data/lib/chatwork.rb CHANGED
@@ -21,7 +21,7 @@ module ChatWork
21
21
 
22
22
  class << self
23
23
  def client
24
- @client ||= Client.new(@api_key, @api_base, @api_version)
24
+ @client ||= Client.new(api_key, api_base, api_version)
25
25
  end
26
26
 
27
27
  def api_base=(new_value)
@@ -39,7 +39,11 @@ module ChatWork
39
39
  end
40
40
 
41
41
  def api_key
42
- @api_key
42
+ @api_key || ENV['CHATWORK_API_TOKEN']
43
+ end
44
+
45
+ def api_version
46
+ @api_version
43
47
  end
44
48
  end
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module ChatWork
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -26,7 +26,16 @@ describe ChatWork do
26
26
  end
27
27
 
28
28
  describe '#api_key' do
29
- subject { super().api_key }
30
- it { should be_nil }
29
+ context 'when does not set env' do
30
+ subject { super().api_key }
31
+ it { should be_nil }
32
+ end
33
+
34
+ context 'when sets env' do
35
+ let(:test_token) { 'chatwork_test_token' }
36
+ before { ENV['CHATWORK_API_TOKEN'] = test_token }
37
+ subject { super().api_key }
38
+ it { is_expected.to eq test_token }
39
+ end
31
40
  end
32
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatwork
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
  - asonas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-21 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -114,11 +114,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.4.5.1
117
+ rubygems_version: 2.5.2
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Ruby bindings of Chatwork API
121
121
  test_files:
122
122
  - spec/lib/chatwork_spec.rb
123
123
  - spec/spec_helper.rb
124
- has_rdoc: