chatwork 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 +4 -4
- data/lib/chatwork.rb +6 -2
- data/lib/chatwork/version.rb +1 -1
- data/spec/lib/chatwork_spec.rb +11 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a3b2adaced84713cd86ba540f1eeaea0315f0cc
|
4
|
+
data.tar.gz: d373bf611bc2eabeb8cefeacc67a705927df7760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
data/lib/chatwork/version.rb
CHANGED
data/spec/lib/chatwork_spec.rb
CHANGED
@@ -26,7 +26,16 @@ describe ChatWork do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '#api_key' do
|
29
|
-
|
30
|
-
|
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.
|
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:
|
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.
|
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:
|