activeresource-chatwork 1.0.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 +7 -0
- data/.editorconfig +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +158 -0
- data/Rakefile +6 -0
- data/activeresource-chatwork.gemspec +29 -0
- data/bin/console +14 -0
- data/bin/setup +6 -0
- data/circle.yml +18 -0
- data/lib/chatwork.rb +14 -0
- data/lib/chatwork/base.rb +47 -0
- data/lib/chatwork/contact.rb +9 -0
- data/lib/chatwork/file.rb +12 -0
- data/lib/chatwork/member.rb +12 -0
- data/lib/chatwork/message.rb +12 -0
- data/lib/chatwork/my.rb +16 -0
- data/lib/chatwork/nest_of_room.rb +8 -0
- data/lib/chatwork/room.rb +67 -0
- data/lib/chatwork/task.rb +15 -0
- data/lib/chatwork/version.rb +3 -0
- metadata +181 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4a946e0834391b63e300f5047b21366d3ea7bcd6
|
4
|
+
data.tar.gz: cf72d30e77cfa7df2a5716e505e10735e705edd5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7ede91450a5b9688e6780d0595efaede1841001e97a77bc01b5b658a50bda35c889b74e66d7a5d058ea85c35f9c31cfe7b8c9aa43cb24d39068d3b66565b5f2b
|
7
|
+
data.tar.gz: 819d537a5723055e9d72830a29a208e1b55769eca00d93d2be4aee203994b42f8bf61a409af7080514d42b63b507adabcc2c5195ef0e94179c8a07ac3771c06f
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 Shingo Inoue
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Shingo Inoue
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
# activeresource-chatwork
|
2
|
+
[](https://circleci.com/gh/Leko/activeresource-chatwork/tree/master)
|
3
|
+
[](https://codecov.io/gh/Leko/activeresource-chatwork)
|
4
|
+
|
5
|
+
ActiveResource classes for Chatwork API
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'activeresource-chatwork'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install activeresource-chatwork
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
### Setup
|
26
|
+
```ruby
|
27
|
+
ENV['CHATWORK_TOKEN'] = 'YOUR_CHATWORK_API_TOKEN'
|
28
|
+
```
|
29
|
+
|
30
|
+
### Contacts
|
31
|
+
```ruby
|
32
|
+
# GET /v1/contacts
|
33
|
+
contacts = Chatwork::Contact.all
|
34
|
+
```
|
35
|
+
|
36
|
+
### My
|
37
|
+
```ruby
|
38
|
+
# GET /v1/my/status
|
39
|
+
status = Chatwork::My.status
|
40
|
+
|
41
|
+
# GET /v1/my/tasks?status=open
|
42
|
+
tasks = Chatwork::My.tasks status: Chatwork::Task::STATUS_OPEN
|
43
|
+
```
|
44
|
+
|
45
|
+
### Rooms
|
46
|
+
```ruby
|
47
|
+
# GET /v1/rooms
|
48
|
+
rooms = Chatwork::Room.all
|
49
|
+
|
50
|
+
# GET /v1/rooms/xxx
|
51
|
+
room = Chatwork::Room.find xxx
|
52
|
+
|
53
|
+
# POST /v1/rooms
|
54
|
+
params = {
|
55
|
+
name: 'xxx',
|
56
|
+
members_admin_ids: [yyy],
|
57
|
+
icon_preset: Chatwork::Room::ICON_GROUP
|
58
|
+
# show all icon constants -> Chatwork::Room.constants.grep(/ICON_/)
|
59
|
+
}
|
60
|
+
room = Chatwork::Room.create params
|
61
|
+
|
62
|
+
# PUT /v1/rooms/xxx
|
63
|
+
room.name = 'xxx'
|
64
|
+
room.save
|
65
|
+
|
66
|
+
# DELETE /v1/rooms/xxx
|
67
|
+
# show all action constants -> Chatwork::Room.constants.grep(/ACTION_/)
|
68
|
+
Chatwork::Room.delete(room.id, action_type: Chatwork::Room::ACTION_DELETE)
|
69
|
+
```
|
70
|
+
|
71
|
+
### Messages
|
72
|
+
```ruby
|
73
|
+
# GET /v1/rooms/xxx/messages
|
74
|
+
params = {params: {force: 1, room_id: xxx}}
|
75
|
+
messages = Chatwork::Message.all params
|
76
|
+
# or
|
77
|
+
room = Chatwork::Room.find xxx
|
78
|
+
messages = room.messages
|
79
|
+
|
80
|
+
# GET /v1/rooms/xxx/messages/yyy
|
81
|
+
params = {params: {room_id: xxx}}
|
82
|
+
message = Chatwork::Message.find yyy, params
|
83
|
+
# or
|
84
|
+
room = Chatwork::Room.find xxx
|
85
|
+
message = room.message yyy
|
86
|
+
|
87
|
+
# POST /v1/rooms/xxx/messages
|
88
|
+
message = Chatwork::Message.new body: 'yyy'
|
89
|
+
message.prefix_options[:room_id] = xxx
|
90
|
+
message.save
|
91
|
+
```
|
92
|
+
|
93
|
+
### Members
|
94
|
+
```ruby
|
95
|
+
# GET /v1/rooms/xxx/members
|
96
|
+
params = {params: {room_id: xxx}}
|
97
|
+
members = Chatwork::Member.all params
|
98
|
+
# or
|
99
|
+
room = Chatwork::Room.find xxx
|
100
|
+
members = room.members
|
101
|
+
|
102
|
+
# PUT /v1/rooms/xxx/members
|
103
|
+
room = Chatwork::Room.find xxx
|
104
|
+
room.update_members members_admin_ids: [yyy, zzz].join(',')
|
105
|
+
```
|
106
|
+
|
107
|
+
### Tasks
|
108
|
+
```ruby
|
109
|
+
# GET /v1/rooms/xxx/tasks
|
110
|
+
tasks = Chatwork::Contact.all
|
111
|
+
# or
|
112
|
+
room = Chatwork::Room.find xxx
|
113
|
+
tasks = room.tasks
|
114
|
+
|
115
|
+
# GET /v1/rooms/xxx/tasks/yyy
|
116
|
+
params = { params: { room_id: xxx } }
|
117
|
+
tasks = Chatwork::Task.all params
|
118
|
+
# or
|
119
|
+
room = Chatwork::Room.find xxx
|
120
|
+
task = room.task(yyy)
|
121
|
+
|
122
|
+
# POST /v1/rooms/xxx/tasks
|
123
|
+
task = Chatwork::Task.new(body: 'some task', to_ids: [yyy, zzz])
|
124
|
+
task.prefix_options[:room_id] = xxx
|
125
|
+
task.save
|
126
|
+
```
|
127
|
+
|
128
|
+
### Files
|
129
|
+
```ruby
|
130
|
+
# GET /v1/rooms/xxx/files
|
131
|
+
params = { params: { room_id: xxx } }
|
132
|
+
files = Chatwork::File.all params
|
133
|
+
# or
|
134
|
+
room = Chatwork::Room.find xxx
|
135
|
+
files = room.files
|
136
|
+
|
137
|
+
# GET /v1/rooms/xxx/files/yyy
|
138
|
+
file = Chatwork::Contact.all
|
139
|
+
# or
|
140
|
+
room = Chatwork::Room.find xxx
|
141
|
+
file = room.file(yyy)
|
142
|
+
```
|
143
|
+
|
144
|
+
|
145
|
+
## Development
|
146
|
+
|
147
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
148
|
+
|
149
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
150
|
+
|
151
|
+
## Contributing
|
152
|
+
|
153
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Leko/activeresource-chatwork.
|
154
|
+
|
155
|
+
|
156
|
+
## License
|
157
|
+
|
158
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'chatwork/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'activeresource-chatwork'
|
8
|
+
spec.version = Chatwork::VERSION
|
9
|
+
spec.authors = ['Leko']
|
10
|
+
spec.email = ['leko.noor@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'ActiveResource classes for Chatwork API'
|
13
|
+
spec.homepage = 'https://github.com/Leko/activeresource-chatwork'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'activeresource'
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
25
|
+
spec.add_development_dependency 'rubocop'
|
26
|
+
spec.add_development_dependency 'simplecov'
|
27
|
+
spec.add_development_dependency 'codecov'
|
28
|
+
spec.add_development_dependency 'dotenv'
|
29
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'chatwork'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/circle.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
dependencies:
|
2
|
+
override:
|
3
|
+
- ./bin/setup
|
4
|
+
|
5
|
+
test:
|
6
|
+
override:
|
7
|
+
- bundle exec rubocop
|
8
|
+
- bundle exec rake spec
|
9
|
+
|
10
|
+
deployment:
|
11
|
+
rubygems:
|
12
|
+
branch: master
|
13
|
+
commands:
|
14
|
+
- curl -u Leko:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
15
|
+
- git config user.name Leko
|
16
|
+
- git config user.email $RUBYGEMS_EMAIL
|
17
|
+
- bundle exec rake build
|
18
|
+
- bundle exec rake release
|
data/lib/chatwork.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'chatwork/version'
|
2
|
+
|
3
|
+
# Define autoloads
|
4
|
+
module Chatwork
|
5
|
+
autoload :Base, 'chatwork/base'
|
6
|
+
autoload :Contact, 'chatwork/contact'
|
7
|
+
autoload :My, 'chatwork/my'
|
8
|
+
autoload :Room, 'chatwork/room'
|
9
|
+
autoload :Message, 'chatwork/message'
|
10
|
+
autoload :Member, 'chatwork/member'
|
11
|
+
autoload :Task, 'chatwork/task'
|
12
|
+
autoload :File, 'chatwork/file'
|
13
|
+
autoload :NestOfRoom, 'chatwork/nest_of_room'
|
14
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'json'
|
3
|
+
require 'active_resource'
|
4
|
+
require 'active_resource/formats/json_format'
|
5
|
+
|
6
|
+
module Chatwork
|
7
|
+
#
|
8
|
+
# Chatwork API用のフォーマッター
|
9
|
+
#
|
10
|
+
# 送信は`x-www-form-urlencoded`に対しデコードは`application/json`という特殊な要件
|
11
|
+
# を吸収するために実装した。Chatwork以外で使用するケースはないと判断しここに置いている
|
12
|
+
class FormToJsonParser
|
13
|
+
include ActiveResource::Formats::JsonFormat
|
14
|
+
|
15
|
+
def mime_type
|
16
|
+
'application/x-www-form-urlencoded'
|
17
|
+
end
|
18
|
+
|
19
|
+
def decode(json)
|
20
|
+
ActiveSupport::JSON.decode(json)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# ChatworkのAPI通信をする際の基底クラス
|
26
|
+
#
|
27
|
+
# APIキーの設定やフォーマッタの設定など、共通で必要な設定をここで行う
|
28
|
+
# Chatwork APIを扱う際にはこのクラスを継承すること
|
29
|
+
class Base < ActiveResource::Base
|
30
|
+
headers['X-ChatWorkToken'] = ENV['CHATWORK_TOKEN']
|
31
|
+
|
32
|
+
self.site = 'https://api.chatwork.com/v1'
|
33
|
+
self.format = FormToJsonParser.new
|
34
|
+
self.include_format_in_path = false
|
35
|
+
|
36
|
+
def to_json(options = {})
|
37
|
+
json = if include_root_in_json
|
38
|
+
super({ root: self.class.element_name }.merge(options))
|
39
|
+
else
|
40
|
+
super(options)
|
41
|
+
end
|
42
|
+
hash = JSON.parse(json)
|
43
|
+
|
44
|
+
URI.encode_www_form(hash)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
module Chatwork
|
3
|
+
# /rooms/xxx/files
|
4
|
+
# see http://developer.chatwork.com/ja/endpoint_rooms.html
|
5
|
+
class File < Base
|
6
|
+
include Chatwork::NestOfRoom
|
7
|
+
|
8
|
+
self.prefix = '/v1/rooms/:room_id/'
|
9
|
+
self.collection_name = 'files'
|
10
|
+
self.primary_key = 'file_id'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
module Chatwork
|
3
|
+
# /rooms/xxx/members
|
4
|
+
# see http://developer.chatwork.com/ja/endpoint_rooms.html
|
5
|
+
class Member < Base
|
6
|
+
include Chatwork::NestOfRoom
|
7
|
+
|
8
|
+
self.prefix = '/v1/rooms/:room_id/'
|
9
|
+
self.collection_name = 'members'
|
10
|
+
self.primary_key = 'account_id'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
module Chatwork
|
3
|
+
# /rooms/xxx/messages
|
4
|
+
# see http://developer.chatwork.com/ja/endpoint_rooms.html
|
5
|
+
class Message < Base
|
6
|
+
include Chatwork::NestOfRoom
|
7
|
+
|
8
|
+
self.prefix = '/v1/rooms/:room_id/'
|
9
|
+
self.collection_name = 'messages'
|
10
|
+
self.primary_key = 'message_id'
|
11
|
+
end
|
12
|
+
end
|
data/lib/chatwork/my.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
module Chatwork
|
3
|
+
# /my
|
4
|
+
# see http://developer.chatwork.com/ja/endpoint_my.html
|
5
|
+
class My < Base
|
6
|
+
self.collection_name = 'my'
|
7
|
+
|
8
|
+
def self.status
|
9
|
+
get(:status)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.tasks(params = {})
|
13
|
+
get(:tasks, params).map { |t| Chatwork::Task.new(t, true) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Chatwork
|
2
|
+
# /rooms
|
3
|
+
# see http://developer.chatwork.com/ja/endpoint_rooms.html
|
4
|
+
class Room < Base
|
5
|
+
ACTION_LEAVE = 'leave'.freeze
|
6
|
+
ACTION_DELETE = 'delete'.freeze
|
7
|
+
|
8
|
+
ICON_GROUP = 'group'.freeze
|
9
|
+
ICON_CHECK = 'check'.freeze
|
10
|
+
ICON_DOCUMENT = 'document'.freeze
|
11
|
+
ICON_MEETING = 'meeting'.freeze
|
12
|
+
ICON_EVENT = 'event'.freeze
|
13
|
+
ICON_PROJECT = 'project'.freeze
|
14
|
+
ICON_BUSINESS = 'business'.freeze
|
15
|
+
ICON_STUDY = 'study'.freeze
|
16
|
+
ICON_SECURITY = 'security'.freeze
|
17
|
+
ICON_STAR = 'star'.freeze
|
18
|
+
ICON_IDEA = 'idea'.freeze
|
19
|
+
ICON_HEART = 'heart'.freeze
|
20
|
+
ICON_MAGCUP = 'magcup'.freeze
|
21
|
+
ICON_BEER = 'beer'.freeze
|
22
|
+
ICON_MUSIC = 'music'.freeze
|
23
|
+
ICON_SPORTS = 'sports'.freeze
|
24
|
+
ICON_TRAVEL = 'travel'.freeze
|
25
|
+
|
26
|
+
self.collection_name = 'rooms'
|
27
|
+
self.primary_key = 'room_id'
|
28
|
+
|
29
|
+
def messages(params = {})
|
30
|
+
Message.all(params: subroute_params(params))
|
31
|
+
end
|
32
|
+
|
33
|
+
def message(pk)
|
34
|
+
Message.find(pk, params: subroute_params)
|
35
|
+
end
|
36
|
+
|
37
|
+
def members(params = {})
|
38
|
+
Member.all(params: subroute_params(params))
|
39
|
+
end
|
40
|
+
|
41
|
+
def update_members(params = {})
|
42
|
+
put(:members, params)
|
43
|
+
end
|
44
|
+
|
45
|
+
def files(params = {})
|
46
|
+
File.all(params: subroute_params(params))
|
47
|
+
end
|
48
|
+
|
49
|
+
def file(pk)
|
50
|
+
File.find(pk, params: subroute_params)
|
51
|
+
end
|
52
|
+
|
53
|
+
def tasks(params = {})
|
54
|
+
Task.all(params: subroute_params(params))
|
55
|
+
end
|
56
|
+
|
57
|
+
def task(pk)
|
58
|
+
Task.find(pk, params: subroute_params)
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def subroute_params(additional = {})
|
64
|
+
{ room_id: room_id }.merge(additional)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
module Chatwork
|
3
|
+
# /rooms/xxx/tasks
|
4
|
+
# see http://developer.chatwork.com/ja/endpoint_rooms.html
|
5
|
+
class Task < Base
|
6
|
+
include Chatwork::NestOfRoom
|
7
|
+
|
8
|
+
STATUS_OPEN = 'open'.freeze
|
9
|
+
STATUS_DONE = 'done'.freeze
|
10
|
+
|
11
|
+
self.prefix = '/v1/rooms/:room_id/'
|
12
|
+
self.collection_name = 'tasks'
|
13
|
+
self.primary_key = 'task_id'
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activeresource-chatwork
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Leko
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activeresource
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: codecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: dotenv
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email:
|
127
|
+
- leko.noor@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".editorconfig"
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".rubocop.yml"
|
136
|
+
- ".travis.yml"
|
137
|
+
- Gemfile
|
138
|
+
- LICENSE
|
139
|
+
- LICENSE.txt
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- activeresource-chatwork.gemspec
|
143
|
+
- bin/console
|
144
|
+
- bin/setup
|
145
|
+
- circle.yml
|
146
|
+
- lib/chatwork.rb
|
147
|
+
- lib/chatwork/base.rb
|
148
|
+
- lib/chatwork/contact.rb
|
149
|
+
- lib/chatwork/file.rb
|
150
|
+
- lib/chatwork/member.rb
|
151
|
+
- lib/chatwork/message.rb
|
152
|
+
- lib/chatwork/my.rb
|
153
|
+
- lib/chatwork/nest_of_room.rb
|
154
|
+
- lib/chatwork/room.rb
|
155
|
+
- lib/chatwork/task.rb
|
156
|
+
- lib/chatwork/version.rb
|
157
|
+
homepage: https://github.com/Leko/activeresource-chatwork
|
158
|
+
licenses:
|
159
|
+
- MIT
|
160
|
+
metadata: {}
|
161
|
+
post_install_message:
|
162
|
+
rdoc_options: []
|
163
|
+
require_paths:
|
164
|
+
- lib
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
requirements: []
|
176
|
+
rubyforge_project:
|
177
|
+
rubygems_version: 2.4.5.1
|
178
|
+
signing_key:
|
179
|
+
specification_version: 4
|
180
|
+
summary: ActiveResource classes for Chatwork API
|
181
|
+
test_files: []
|