chatwork 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.env.example +4 -0
  3. data/.gitignore +1 -0
  4. data/.gitmodules +3 -0
  5. data/.rubocop.yml +10 -0
  6. data/.travis.yml +26 -0
  7. data/.yardopts +2 -0
  8. data/CHANGELOG.md +33 -1
  9. data/Gemfile +13 -1
  10. data/README.md +15 -2
  11. data/Rakefile +2 -2
  12. data/bin/console +10 -0
  13. data/chatwork.gemspec +20 -9
  14. data/lib/chatwork.rb +32 -36
  15. data/lib/chatwork/base_client.rb +8 -11
  16. data/lib/chatwork/chatwork_error.rb +6 -16
  17. data/lib/chatwork/client.rb +2 -2
  18. data/lib/chatwork/contacts.rb +24 -8
  19. data/lib/chatwork/entity_methods.rb +36 -0
  20. data/lib/chatwork/file.rb +63 -0
  21. data/lib/chatwork/incoming_request.rb +71 -0
  22. data/lib/chatwork/me.rb +33 -8
  23. data/lib/chatwork/member.rb +55 -4
  24. data/lib/chatwork/message.rb +147 -6
  25. data/lib/chatwork/my_status.rb +25 -0
  26. data/lib/chatwork/my_task.rb +36 -8
  27. data/lib/chatwork/oauth_client.rb +3 -3
  28. data/lib/chatwork/room.rb +119 -6
  29. data/lib/chatwork/task.rb +96 -4
  30. data/lib/chatwork/token.rb +2 -2
  31. data/lib/chatwork/version.rb +1 -1
  32. data/spec/lib/chatwork/chatwork_error_spec.rb +10 -8
  33. data/spec/lib/chatwork/client_spec.rb +14 -14
  34. data/spec/lib/chatwork/contacts_spec.rb +11 -0
  35. data/spec/lib/chatwork/entity_methods_spec.rb +21 -0
  36. data/spec/lib/chatwork/file_spec.rb +37 -0
  37. data/spec/lib/chatwork/incoming_request_spec.rb +35 -0
  38. data/spec/lib/chatwork/me_spec.rb +39 -0
  39. data/spec/lib/chatwork/member_spec.rb +40 -9
  40. data/spec/lib/chatwork/message_spec.rb +102 -0
  41. data/spec/lib/chatwork/my_status_spec.rb +13 -0
  42. data/spec/lib/chatwork/my_task_spec.rb +19 -0
  43. data/spec/lib/chatwork/oauth_client_spec.rb +7 -7
  44. data/spec/lib/chatwork/room_spec.rb +102 -0
  45. data/spec/lib/chatwork/task_spec.rb +77 -0
  46. data/spec/lib/chatwork/token_spec.rb +26 -7
  47. data/spec/lib/chatwork_spec.rb +26 -19
  48. data/spec/lib/support/utils/raml_parser_spec.rb +96 -0
  49. data/spec/spec_helper.rb +32 -6
  50. data/spec/support/contexts/api_context.rb +43 -0
  51. data/spec/support/examples/a_chatwork_api.rb +12 -0
  52. data/spec/support/matchers/match_example.rb +16 -0
  53. data/spec/support/utils/raml_parser.rb +86 -0
  54. metadata +214 -10
  55. data/lib/chatwork/entity.rb +0 -29
  56. data/lib/chatwork/operations.rb +0 -48
  57. data/spec/shared_oauth_stubs.rb +0 -49
  58. data/spec/shared_stubs.rb +0 -39
@@ -1,17 +1,36 @@
1
- require_relative '../../shared_oauth_stubs.rb'
2
-
3
1
  describe ChatWork::Token do
4
- include_context 'shared oauth stubs'
5
-
6
- describe '.refresh_access_token' do
2
+ describe ".refresh_access_token" do
7
3
  subject { ChatWork::Token.refresh_access_token(refresh_token, scope) }
8
4
 
9
- let(:scope) { [] }
5
+ before do
6
+ allow(ChatWork).to receive(:client_id) { client_id }
7
+ allow(ChatWork).to receive(:client_secret) { client_secret }
8
+
9
+ stub_request(:post, "https://oauth.chatwork.com/token").
10
+ with(body: { "grant_type" => "refresh_token", "refresh_token" => refresh_token },
11
+ headers: { "Authorization" => "Basic #{signature}", "Content-Type" => "application/x-www-form-urlencoded" }).
12
+ to_return(status: 200, body: token.to_json, headers: { "Content-Type" => "application/json" })
13
+ end
14
+
15
+ let(:client_id) { "client_id" }
16
+ let(:client_secret) { "client_secret" }
17
+ let(:refresh_token) { "refresh_token" }
18
+ let(:signature) { "Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=" }
19
+ let(:scope) { [] }
20
+ let(:token) do
21
+ {
22
+ access_token: "new_access_token",
23
+ token_type: "Bearer",
24
+ expires_in: "1800",
25
+ refresh_token: refresh_token,
26
+ scope: "users.all:read rooms.all:read_write contacts.all:read_write",
27
+ }
28
+ end
10
29
 
11
30
  its(["access_token"]) { should eq "new_access_token" }
12
31
  its(["token_type"]) { should eq "Bearer" }
13
32
  its(["expires_in"]) { should eq "1800" }
14
- its(["refresh_token"]) { should eq "refresh_token" }
33
+ its(["refresh_token"]) { should eq refresh_token }
15
34
  its(["scope"]) { should eq "users.all:read rooms.all:read_write contacts.all:read_write" }
16
35
  end
17
36
  end
@@ -1,5 +1,5 @@
1
1
  describe ChatWork do
2
- describe '#client' do
2
+ describe "#client" do
3
3
  subject { super().client }
4
4
 
5
5
  before do
@@ -9,48 +9,55 @@ describe ChatWork do
9
9
  it { should be_a(ChatWork::Client) }
10
10
  end
11
11
 
12
- describe '#api_base' do
12
+ describe "#api_base" do
13
13
  subject { super().api_base }
14
- it { should eq('https://api.chatwork.com/') }
14
+
15
+ it { should eq("https://api.chatwork.com/") }
15
16
  end
16
- describe '#api_base=' do
17
- before { ChatWork.api_base = 'https://test.example.com/' }
17
+ describe "#api_base=" do
18
+ before { ChatWork.api_base = "https://test.example.com/" }
18
19
 
19
- describe '#api_base' do
20
+ describe "#api_base" do
20
21
  subject { super().api_base }
21
- it { should eq('https://test.example.com/') }
22
+
23
+ it { should eq("https://test.example.com/") }
22
24
  end
23
25
 
24
- describe '#api_base' do
26
+ describe "#api_base" do
25
27
  subject { super().api_base }
26
- it { should eq('https://test.example.com/') }
28
+
29
+ it { should eq("https://test.example.com/") }
27
30
  end
28
31
  end
29
32
 
30
- describe '#api_key' do
31
- context 'when does not set env' do
33
+ describe "#api_key" do
34
+ context "when does not set env" do
32
35
  subject { super().api_key }
36
+
33
37
  it { should be_nil }
34
38
  end
35
39
 
36
- context 'when sets env' do
37
- let(:test_token) { 'chatwork_test_token' }
38
- before { ENV['CHATWORK_API_TOKEN'] = test_token }
40
+ context "when sets env" do
39
41
  subject { super().api_key }
42
+
43
+ let(:test_token) { "chatwork_test_token" }
44
+ before { ENV["CHATWORK_API_TOKEN"] = test_token }
40
45
  it { is_expected.to eq test_token }
41
46
  end
42
47
  end
43
48
 
44
- describe '#access_token' do
45
- context 'when does not set env' do
49
+ describe "#access_token" do
50
+ context "when does not set env" do
46
51
  subject { super().access_token }
52
+
47
53
  it { should be_nil }
48
54
  end
49
55
 
50
- context 'when sets env' do
51
- let(:test_token) { 'chatwork_test_token' }
52
- before { ENV['CHATWORK_ACCESS_TOKEN'] = test_token }
56
+ context "when sets env" do
53
57
  subject { super().access_token }
58
+
59
+ let(:test_token) { "chatwork_test_token" }
60
+ before { ENV["CHATWORK_ACCESS_TOKEN"] = test_token }
54
61
  it { is_expected.to eq test_token }
55
62
  end
56
63
  end
@@ -0,0 +1,96 @@
1
+ RSpec.describe RamlParser do
2
+ describe ".find_resource" do
3
+ subject { RamlParser.find_resource(verb, path) }
4
+
5
+ let(:verb) { :get }
6
+ let(:path) { "/rooms/{room_id}/members" }
7
+
8
+ its(["description"]) { should eq "チャットのメンバー一覧を取得\n" }
9
+ its(["is"]) { should eq ["room_member_list_response", "unauthorized_response"] }
10
+ end
11
+
12
+ describe ".find_response_example" do
13
+ subject { RamlParser.find_response_example(verb, path, status) }
14
+
15
+ context "contains in responses" do
16
+ let(:verb) { :put }
17
+ let(:path) { "/rooms/{room_id}/members" }
18
+ let(:status) { 200 }
19
+
20
+ let(:expected) do
21
+ {
22
+ "admin" => [123, 542, 1001],
23
+ "member" => [10, 103],
24
+ "readonly" => [6, 11],
25
+ }
26
+ end
27
+
28
+ it { should eq expected }
29
+ end
30
+
31
+ context "contains in is" do
32
+ let(:verb) { :get }
33
+ let(:path) { "/rooms/{room_id}/messages" }
34
+ let(:status) { 200 }
35
+
36
+ let(:expected) do
37
+ [
38
+ {
39
+ "message_id" => "5",
40
+ "account" => {
41
+ "account_id" => 123,
42
+ "name" => "Bob",
43
+ "avatar_image_url" => "https://example.com/ico_avatar.png",
44
+ },
45
+ "body" => "Hello Chatwork!",
46
+ "send_time" => 1_384_242_850,
47
+ "update_time" => 0,
48
+ },
49
+ ]
50
+ end
51
+
52
+ it { should eq expected }
53
+ end
54
+ end
55
+
56
+ describe ".find_trait" do
57
+ subject { RamlParser.find_trait(trait_name) }
58
+
59
+ let(:trait_name) { "room_icon" }
60
+
61
+ it "can get trait" do
62
+ expect(subject["queryParameters"]).not_to eq nil
63
+ expect(subject["queryParameters"]["icon_preset"]).not_to eq nil
64
+ expect(subject["queryParameters"]["icon_preset"]["displayName"]).to eq "アイコン種類"
65
+ end
66
+ end
67
+
68
+ describe ".find_query_parameter_example" do
69
+ subject { RamlParser.find_query_parameter_example(verb, path) }
70
+
71
+ let(:verb) { :put }
72
+ let(:path) { "/rooms/{room_id}" }
73
+
74
+ its(:count) { should eq 3 }
75
+ its(["name"]) { should eq "Website renewal project" }
76
+ its(["description"]) { should eq "group chat description" }
77
+ its(["icon_preset"]) { should eq "meeting" }
78
+ end
79
+
80
+ describe ".raml" do
81
+ subject { RamlParser.raml }
82
+
83
+ before do
84
+ RamlParser.instance_variable_set(:@raml, nil)
85
+ end
86
+
87
+ after do
88
+ RamlParser.instance_variable_set(:@raml, nil)
89
+ end
90
+
91
+ it "3 digit number can be read as a string" do
92
+ comma_separated_integer_list = subject["traits"][0]["room_members"]["queryParameters"]["members_admin_ids"]["example"]
93
+ expect(comma_separated_integer_list).to eq "123,542,1001"
94
+ end
95
+ end
96
+ end
@@ -1,9 +1,35 @@
1
- # encoding: utf-8
2
- #
3
- $: << File.expand_path(File.join(*%w{.. .. lib}), __FILE__)
1
+ if ENV["CI"]
2
+ require "coveralls"
3
+ Coveralls.wear!
4
+ end
4
5
 
5
- require 'chatwork'
6
+ $LOAD_PATH << File.expand_path(File.join("..", "..", "lib"), __FILE__)
6
7
 
7
- require 'rspec/its'
8
- require_relative './shared_stubs'
8
+ require "chatwork"
9
9
 
10
+ require "rspec-parameterized"
11
+ require "rspec/its"
12
+ require "webmock/rspec"
13
+ require "pry"
14
+ require "active_support/all"
15
+
16
+ begin
17
+ require "backport_dig"
18
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
19
+ end
20
+
21
+ Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }
22
+
23
+ def spec_dir
24
+ Pathname(__dir__)
25
+ end
26
+
27
+ def schema_file
28
+ spec_dir.join("../api/RAML/api-ja.raml")
29
+ end
30
+
31
+ RSpec.configure do |config|
32
+ config.before(:suite) do
33
+ raise "Not found '#{schema_file}'. Please run `git submodule update --init` at first" unless schema_file.exist?
34
+ end
35
+ end
@@ -0,0 +1,43 @@
1
+ RSpec.shared_context :api_context, type: :api do
2
+ let(:api_key) { "api_key" }
3
+
4
+ let(:response_headers) do
5
+ {
6
+ "Content-Type" => "application/json",
7
+ "X-RateLimit-Limit" => ratelimit_limit,
8
+ "X-RateLimit-Remaining" => ratelimit_remaining,
9
+ "X-RateLimit-Reset" => ratelimit_reset,
10
+ }
11
+ end
12
+
13
+ let(:ratelimit_limit) { 100 }
14
+ let(:ratelimit_remaining) { 44 }
15
+ let(:ratelimit_reset) { 1_390_941_626 }
16
+
17
+ before do
18
+ allow(ChatWork).to receive(:api_key) { api_key }
19
+ end
20
+
21
+ def stub_chatwork_request(expected_verb, expected_path, resource_path = nil, status = 200)
22
+ resource_path ||= expected_path
23
+ example = RamlParser.find_response_example(expected_verb, resource_path, status)
24
+ raise "Not found '#{expected_verb.to_s.upcase} #{resource_path} #{status}' in '#{schema_file}'" unless example
25
+
26
+ request_options = { headers: { "X-Chatworktoken" => api_key } }
27
+
28
+ query_example = RamlParser.find_query_parameter_example(expected_verb, resource_path)
29
+ unless query_example.empty?
30
+ case expected_verb
31
+ when :get, :delete
32
+ query_string = "?" + query_example.to_query
33
+ when :post, :put
34
+ request_options[:headers]["Content-Type"] = "application/x-www-form-urlencoded"
35
+ request_options[:body] = query_example
36
+ end
37
+ end
38
+
39
+ stub_request(expected_verb, "https://api.chatwork.com/v2#{expected_path}#{query_string}").
40
+ with(request_options).
41
+ to_return(status: status, body: example.to_json, headers: response_headers)
42
+ end
43
+ end
@@ -0,0 +1,12 @@
1
+ RSpec.shared_examples :a_chatwork_api do |verb, resource, status = 200|
2
+ it { should match_example(verb, resource, status) }
3
+
4
+ it "works with block" do
5
+ subject do |body, headers|
6
+ aggregate_failures do
7
+ expect(body).to match_example(verb, resource, status)
8
+ expect(headers).to eq response_headers
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ RSpec::Matchers.define :match_example do |verb, resource, status = 200|
2
+ match do |actual|
3
+ expected_example = RamlParser.find_response_example(verb, resource, status)
4
+ raise "Not found '#{verb.to_s.upcase} #{resource} #{status}' in '#{schema_file}'" unless expected_example
5
+
6
+ # NOTE: when empty response, FaradayMiddleware::ParseJson convert to nil
7
+ return true if status == 204 && actual.nil? && expected_example.empty?
8
+
9
+ actual == expected_example
10
+ end
11
+
12
+ description do
13
+ expected_example = RamlParser.find_response_example(verb, resource, status)
14
+ "match '#{expected_example}'"
15
+ end
16
+ end
@@ -0,0 +1,86 @@
1
+ module RamlParser
2
+ def self.find_resource(verb, path)
3
+ elements = path.split("/").reject(&:empty?).map { |str| "/#{str}" }
4
+ elements << verb.to_s.upcase
5
+ find_node(elements)
6
+ end
7
+
8
+ def self.find_response_example(verb, path, status = 200)
9
+ resource = find_resource(verb, path)
10
+ return nil unless resource
11
+
12
+ response_json = resource.dig("responses", status, "body", "application/json", "example")
13
+ return parse_response(response_json) if response_json
14
+
15
+ return nil unless resource["is"]
16
+
17
+ resource["is"].each do |trait_name|
18
+ trait = find_trait(trait_name)
19
+ next unless trait
20
+
21
+ response_json = trait.dig("responses", status, "body", "application/json", "example")
22
+ return parse_response(response_json) if response_json
23
+ end
24
+
25
+ nil
26
+ end
27
+
28
+ def self.find_trait(trait_name)
29
+ traits = find_node("traits")
30
+ traits.each do |trait|
31
+ return trait.first.last if trait.first.first == trait_name
32
+ end
33
+ nil
34
+ end
35
+
36
+ def self.find_query_parameter_example(verb, path)
37
+ resource = find_resource(verb, path)
38
+ return {} unless resource
39
+
40
+ parameter_example = {}
41
+
42
+ if resource["queryParameters"]
43
+ resource["queryParameters"].each do |name, value|
44
+ parameter_example[name] = value["example"]
45
+ end
46
+ end
47
+
48
+ if resource["is"]
49
+ resource["is"].each do |trait_name|
50
+ trait = find_trait(trait_name)
51
+ next unless trait
52
+ next unless trait["queryParameters"]
53
+
54
+ trait["queryParameters"].each do |name, value|
55
+ parameter_example[name] = value["example"]
56
+ end
57
+ end
58
+ end
59
+
60
+ parameter_example
61
+ end
62
+
63
+ def self.find_node(elements)
64
+ elements = Array(elements)
65
+ raml.dig(*elements)
66
+ end
67
+ private_class_method :find_node
68
+
69
+ def self.raml
70
+ return @raml if @raml
71
+
72
+ yaml_data = schema_file.read
73
+
74
+ # e.g. example: 123,542,1001 -> example: '123,542,1001'
75
+ yaml_data.gsub!(/example: ([0-9,]+)/) { "example: '#{Regexp.last_match(1)}'" }
76
+
77
+ @raml = YAML.safe_load(yaml_data)
78
+ end
79
+
80
+ def self.parse_response(response_json)
81
+ JSON.parse(response_json)
82
+ rescue JSON::ParserError
83
+ response_json
84
+ end
85
+ private_class_method :parse_response
86
+ end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - asonas
8
+ - sue445
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
12
+ date: 2018-01-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: faraday
@@ -24,6 +25,48 @@ dependencies:
24
25
  - - "~>"
25
26
  - !ruby/object:Gem::Version
26
27
  version: '0.9'
28
+ - !ruby/object:Gem::Dependency
29
+ name: faraday_middleware
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: hashie
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: activesupport
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
27
70
  - !ruby/object:Gem::Dependency
28
71
  name: bundler
29
72
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +81,62 @@ dependencies:
38
81
  - - "~>"
39
82
  - !ruby/object:Gem::Version
40
83
  version: '1.3'
84
+ - !ruby/object:Gem::Dependency
85
+ name: coveralls
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: dotenv
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: onkcop
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '='
117
+ - !ruby/object:Gem::Version
118
+ version: 0.52.1.0
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.52.1.0
126
+ - !ruby/object:Gem::Dependency
127
+ name: pry-byebug
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
41
140
  - !ruby/object:Gem::Dependency
42
141
  name: rake
43
142
  requirement: !ruby/object:Gem::Requirement
@@ -80,46 +179,138 @@ dependencies:
80
179
  - - ">="
81
180
  - !ruby/object:Gem::Version
82
181
  version: '0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: rspec-parameterized
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ - !ruby/object:Gem::Dependency
197
+ name: rubocop
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - '='
201
+ - !ruby/object:Gem::Version
202
+ version: 0.52.1
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - '='
208
+ - !ruby/object:Gem::Version
209
+ version: 0.52.1
210
+ - !ruby/object:Gem::Dependency
211
+ name: rubocop-rspec
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - '='
215
+ - !ruby/object:Gem::Version
216
+ version: 1.21.0
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - '='
222
+ - !ruby/object:Gem::Version
223
+ version: 1.21.0
224
+ - !ruby/object:Gem::Dependency
225
+ name: webmock
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: yard
240
+ requirement: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ type: :development
246
+ prerelease: false
247
+ version_requirements: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: '0'
83
252
  description: ChatWork is cloud-based business chat tool
84
253
  email:
85
254
  - hzw1258@gmail.com
255
+ - sue445@sue445.net
86
256
  executables: []
87
257
  extensions: []
88
258
  extra_rdoc_files: []
89
259
  files:
260
+ - ".env.example"
90
261
  - ".gitignore"
262
+ - ".gitmodules"
91
263
  - ".rspec"
264
+ - ".rubocop.yml"
265
+ - ".travis.yml"
266
+ - ".yardopts"
92
267
  - CHANGELOG.md
93
268
  - Gemfile
94
269
  - LICENSE.txt
95
270
  - README.md
96
271
  - Rakefile
272
+ - bin/console
97
273
  - chatwork.gemspec
98
274
  - lib/chatwork.rb
99
275
  - lib/chatwork/base_client.rb
100
276
  - lib/chatwork/chatwork_error.rb
101
277
  - lib/chatwork/client.rb
102
278
  - lib/chatwork/contacts.rb
103
- - lib/chatwork/entity.rb
279
+ - lib/chatwork/entity_methods.rb
280
+ - lib/chatwork/file.rb
281
+ - lib/chatwork/incoming_request.rb
104
282
  - lib/chatwork/me.rb
105
283
  - lib/chatwork/member.rb
106
284
  - lib/chatwork/message.rb
285
+ - lib/chatwork/my_status.rb
107
286
  - lib/chatwork/my_task.rb
108
287
  - lib/chatwork/oauth_client.rb
109
- - lib/chatwork/operations.rb
110
288
  - lib/chatwork/room.rb
111
289
  - lib/chatwork/task.rb
112
290
  - lib/chatwork/token.rb
113
291
  - lib/chatwork/version.rb
114
292
  - spec/lib/chatwork/chatwork_error_spec.rb
115
293
  - spec/lib/chatwork/client_spec.rb
294
+ - spec/lib/chatwork/contacts_spec.rb
295
+ - spec/lib/chatwork/entity_methods_spec.rb
296
+ - spec/lib/chatwork/file_spec.rb
297
+ - spec/lib/chatwork/incoming_request_spec.rb
298
+ - spec/lib/chatwork/me_spec.rb
116
299
  - spec/lib/chatwork/member_spec.rb
300
+ - spec/lib/chatwork/message_spec.rb
301
+ - spec/lib/chatwork/my_status_spec.rb
302
+ - spec/lib/chatwork/my_task_spec.rb
117
303
  - spec/lib/chatwork/oauth_client_spec.rb
304
+ - spec/lib/chatwork/room_spec.rb
305
+ - spec/lib/chatwork/task_spec.rb
118
306
  - spec/lib/chatwork/token_spec.rb
119
307
  - spec/lib/chatwork_spec.rb
120
- - spec/shared_oauth_stubs.rb
121
- - spec/shared_stubs.rb
308
+ - spec/lib/support/utils/raml_parser_spec.rb
122
309
  - spec/spec_helper.rb
310
+ - spec/support/contexts/api_context.rb
311
+ - spec/support/examples/a_chatwork_api.rb
312
+ - spec/support/matchers/match_example.rb
313
+ - spec/support/utils/raml_parser.rb
123
314
  homepage: https://github.com/asonas/chatwork-ruby
124
315
  licenses:
125
316
  - MIT
@@ -140,17 +331,30 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
331
  version: '0'
141
332
  requirements: []
142
333
  rubyforge_project:
143
- rubygems_version: 2.6.11
334
+ rubygems_version: 2.7.4
144
335
  signing_key:
145
336
  specification_version: 4
146
- summary: Ruby bindings of Chatwork API
337
+ summary: Ruby bindings of ChatWork API
147
338
  test_files:
148
339
  - spec/lib/chatwork/chatwork_error_spec.rb
149
340
  - spec/lib/chatwork/client_spec.rb
341
+ - spec/lib/chatwork/contacts_spec.rb
342
+ - spec/lib/chatwork/entity_methods_spec.rb
343
+ - spec/lib/chatwork/file_spec.rb
344
+ - spec/lib/chatwork/incoming_request_spec.rb
345
+ - spec/lib/chatwork/me_spec.rb
150
346
  - spec/lib/chatwork/member_spec.rb
347
+ - spec/lib/chatwork/message_spec.rb
348
+ - spec/lib/chatwork/my_status_spec.rb
349
+ - spec/lib/chatwork/my_task_spec.rb
151
350
  - spec/lib/chatwork/oauth_client_spec.rb
351
+ - spec/lib/chatwork/room_spec.rb
352
+ - spec/lib/chatwork/task_spec.rb
152
353
  - spec/lib/chatwork/token_spec.rb
153
354
  - spec/lib/chatwork_spec.rb
154
- - spec/shared_oauth_stubs.rb
155
- - spec/shared_stubs.rb
355
+ - spec/lib/support/utils/raml_parser_spec.rb
156
356
  - spec/spec_helper.rb
357
+ - spec/support/contexts/api_context.rb
358
+ - spec/support/examples/a_chatwork_api.rb
359
+ - spec/support/matchers/match_example.rb
360
+ - spec/support/utils/raml_parser.rb