chatwork 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chatwork.gemspec +1 -1
- data/lib/chatwork.rb +1 -0
- data/lib/chatwork/chatwork_error.rb +3 -1
- data/lib/chatwork/client.rb +2 -0
- data/lib/chatwork/task.rb +13 -0
- data/lib/chatwork/version.rb +1 -1
- data/spec/lib/chatwork_spec.rb +25 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0002230b882c6ce42c5ab7e35754175d54a2f5fc
|
4
|
+
data.tar.gz: 4e9e4fbf1d37fd2c5afce26b74edcf57dcab0307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 650015698c78315f6e9271e5293f48aa003dcbf55737060ae14b5078ebd1181dc49d4a388f0b34fc1efbc0f739ae4dedfd718cc586b12a633476d30dfb831463
|
7
|
+
data.tar.gz: 3284b33fbd4553484dcf0d19f675e3f02e0248af7f54be4148fc3675cbcbfb0c770bf5f8dd9093ebde5866de6420502a14955a085bfa3f90fef309c79bf5ca82
|
data/chatwork.gemspec
CHANGED
data/lib/chatwork.rb
CHANGED
@@ -3,13 +3,15 @@ module ChatWork
|
|
3
3
|
class ChatWorkError < StandardError
|
4
4
|
|
5
5
|
def self.from_response(status, body)
|
6
|
+
# HTTP status 204 don't have body.
|
7
|
+
return APIError.new(status, "") if status == 204
|
8
|
+
|
6
9
|
hash =
|
7
10
|
begin
|
8
11
|
JSON.load(body)
|
9
12
|
rescue JSON::ParserError => e
|
10
13
|
return ChatWork::APIConnectionError.new("Response JSON is broken. #{e.message}: #{body}", e)
|
11
14
|
end
|
12
|
-
|
13
15
|
unless hash['errors']
|
14
16
|
return APIConnectionError.new("Invalid response #{body}")
|
15
17
|
end
|
data/lib/chatwork/client.rb
CHANGED
data/lib/chatwork/version.rb
CHANGED
data/spec/lib/chatwork_spec.rb
CHANGED
@@ -2,12 +2,31 @@ require 'spec_helper'
|
|
2
2
|
require 'chatwork'
|
3
3
|
|
4
4
|
describe ChatWork do
|
5
|
-
|
6
|
-
|
5
|
+
describe '#client' do
|
6
|
+
subject { super().client }
|
7
|
+
it { should be_a(ChatWork::Client) }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#api_base' do
|
11
|
+
subject { super().api_base }
|
12
|
+
it { should eq('https://api.chatwork.com/') }
|
13
|
+
end
|
7
14
|
describe '#api_base=' do
|
8
|
-
before {
|
9
|
-
|
10
|
-
|
15
|
+
before { ChatWork.api_base = 'https://test.example.com/' }
|
16
|
+
|
17
|
+
describe '#api_base' do
|
18
|
+
subject { super().api_base }
|
19
|
+
it { should eq('https://test.example.com/') }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#api_base' do
|
23
|
+
subject { super().api_base }
|
24
|
+
it { should eq('https://test.example.com/') }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#api_key' do
|
29
|
+
subject { super().api_key }
|
30
|
+
it { should be_nil }
|
11
31
|
end
|
12
|
-
its(:api_key) { should be_nil }
|
13
32
|
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- asonas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.1.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.1.0
|
69
69
|
description: ChatWork is cloud-based business chat tool
|
70
70
|
email:
|
71
71
|
- hzw1258@gmail.com
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/chatwork/message.rb
|
88
88
|
- lib/chatwork/operations.rb
|
89
89
|
- lib/chatwork/room.rb
|
90
|
+
- lib/chatwork/task.rb
|
90
91
|
- lib/chatwork/version.rb
|
91
92
|
- spec/lib/chatwork_spec.rb
|
92
93
|
- spec/spec_helper.rb
|
@@ -117,4 +118,3 @@ summary: Ruby bindings of Chatwork API
|
|
117
118
|
test_files:
|
118
119
|
- spec/lib/chatwork_spec.rb
|
119
120
|
- spec/spec_helper.rb
|
120
|
-
has_rdoc:
|