backlog_jp 0.0.8 → 0.0.9
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 +4 -4
- data/README.md +47 -19
- data/lib/backlog_jp/client.rb +5 -2
- data/lib/backlog_jp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98ff9d25fcd2eb7c2c6f36d692b8dc2b1e07eaa
|
4
|
+
data.tar.gz: 8bf91042e78e4ecf0f22496bc89819c4004811b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a498853874dc9aa78149d964ef993d22fea38c766c2481a04aa82a82d71d1635f3a74133790d90f41b7613cf2d23649db0e737653209bcc621c200238bc7c6cc
|
7
|
+
data.tar.gz: bff7000ef7fd3c5a3604fbaf9c4f94200485680e9ab892882661639099441e858ba76921cf837e8ad45242a29e067cf7315f09993f730a1c2714a280dbce26a8
|
data/README.md
CHANGED
@@ -12,44 +12,72 @@ A Ruby client for [Backlog.jp API V2](http://developer.nulab-inc.com/ja/docs/bac
|
|
12
12
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
|
-
|
15
|
+
```ruby
|
16
|
+
gem 'backlog_jp'
|
17
|
+
```
|
16
18
|
|
17
19
|
And then execute:
|
18
20
|
|
19
|
-
|
21
|
+
```bash
|
22
|
+
$ bundle
|
23
|
+
```
|
20
24
|
|
21
25
|
Or install it yourself as:
|
22
26
|
|
23
|
-
|
27
|
+
```bash
|
28
|
+
$ gem install backlog_jp
|
29
|
+
```
|
24
30
|
|
25
31
|
## Usage
|
26
32
|
|
27
33
|
TODO: Write more usage instructions here
|
28
34
|
|
29
|
-
|
35
|
+
```ruby
|
36
|
+
require "backlog_jp"
|
30
37
|
|
31
|
-
|
32
|
-
|
38
|
+
# Create client with your space name and api key.
|
39
|
+
client = BacklogJp::Client.new space: "my-space", api_key: "xxxxxxxxxx"
|
33
40
|
|
34
|
-
|
35
|
-
|
41
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space
|
42
|
+
client.get "space"
|
36
43
|
|
37
|
-
|
38
|
-
|
44
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project
|
45
|
+
client.get "projects/MYPJ"
|
39
46
|
|
40
|
-
|
41
|
-
|
47
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issues
|
48
|
+
client.get "issues", "projectId[]": 12345678
|
42
49
|
|
43
|
-
|
44
|
-
|
50
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comments
|
51
|
+
client.get "issues/MYPJ-123/comments"
|
45
52
|
|
46
|
-
|
47
|
-
|
53
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/post-comments
|
54
|
+
client.post "issues/MYPJ-123/comments", content: "hello"
|
48
55
|
|
49
|
-
|
50
|
-
|
56
|
+
# http://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue
|
57
|
+
client.patch "issues/MYPJ-123", statusId: 4
|
51
58
|
|
52
|
-
|
59
|
+
# etc...
|
60
|
+
```
|
61
|
+
|
62
|
+
## Changelog
|
63
|
+
|
64
|
+
### 0.0.9
|
65
|
+
|
66
|
+
Now able to accept Backlog space name and API key via ENV.
|
67
|
+
|
68
|
+
Export your space and key...
|
69
|
+
|
70
|
+
```bash
|
71
|
+
$ export BACKLOG_SPACE=my-space
|
72
|
+
$ export BACKLOG_API_KEY=xxxxxxxx
|
73
|
+
$ ruby yourapp.rb
|
74
|
+
```
|
75
|
+
|
76
|
+
In `yourapp.rb`...
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
client = BacklogJp::Client.new
|
80
|
+
```
|
53
81
|
|
54
82
|
## Contributing
|
55
83
|
|
data/lib/backlog_jp/client.rb
CHANGED
@@ -5,8 +5,11 @@ class BacklogJp::Client
|
|
5
5
|
AuthenticationException = Class.new Exception
|
6
6
|
APIException = Class.new Exception
|
7
7
|
|
8
|
-
def initialize config
|
9
|
-
|
8
|
+
def initialize config = {}
|
9
|
+
config[:space] ||= ENV["BACKLOG_SPACE"]
|
10
|
+
config[:api_key] ||= ENV["BACKLOG_API_KEY"]
|
11
|
+
|
12
|
+
unless config[:space] && config[:api_key]
|
10
13
|
fail AuthenticationException, "`:space` and `:api_key` are required for authentication."
|
11
14
|
end
|
12
15
|
|
data/lib/backlog_jp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backlog_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- y13i
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|