backlog_jp 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2e797e9b65c70348d8e4429b9d085da3a0ec294
4
- data.tar.gz: 6693a706708d14cd04e5995a0623faae675a6b30
3
+ metadata.gz: f98ff9d25fcd2eb7c2c6f36d692b8dc2b1e07eaa
4
+ data.tar.gz: 8bf91042e78e4ecf0f22496bc89819c4004811b3
5
5
  SHA512:
6
- metadata.gz: d43d70d23715a20cee7a7e81d91a92ceadf9eda230baa4dcd282ee140fa607950019b8533c58467207b690f032c7dadf1c2a0e122b3501f2c92bb2a2665200fc
7
- data.tar.gz: 57d2209fc096e7fd9a3b15fc622d3ea5c42ee6b4a3a9de193ef9ca4da8c81aa3ca2ea978b8db42799444ed1823904df94ad249890e55b6dfaf278065359070f8
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
- gem 'backlog_jp'
15
+ ```ruby
16
+ gem 'backlog_jp'
17
+ ```
16
18
 
17
19
  And then execute:
18
20
 
19
- $ bundle
21
+ ```bash
22
+ $ bundle
23
+ ```
20
24
 
21
25
  Or install it yourself as:
22
26
 
23
- $ gem install backlog_jp
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
- require "backlog_jp"
35
+ ```ruby
36
+ require "backlog_jp"
30
37
 
31
- # Create client with your space name and api key.
32
- client = BacklogJp::Client.new space: "my-space", api_key: "xxxxxxxxxx"
38
+ # Create client with your space name and api key.
39
+ client = BacklogJp::Client.new space: "my-space", api_key: "xxxxxxxxxx"
33
40
 
34
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space
35
- client.get "space"
41
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space
42
+ client.get "space"
36
43
 
37
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project
38
- client.get "projects/MYPJ"
44
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project
45
+ client.get "projects/MYPJ"
39
46
 
40
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issues
41
- client.get "issues", "projectId[]": 12345678
47
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issues
48
+ client.get "issues", "projectId[]": 12345678
42
49
 
43
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comments
44
- client.get "issues/MYPJ-123/comments"
50
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comments
51
+ client.get "issues/MYPJ-123/comments"
45
52
 
46
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/post-comments
47
- client.post "issues/MYPJ-123/comments", content: "hello"
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
- # http://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue
50
- client.patch "issues/MYPJ-123", statusId: 4
56
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue
57
+ client.patch "issues/MYPJ-123", statusId: 4
51
58
 
52
- # etc...
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
 
@@ -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
- unless config.key?(:space) && config.key?(:api_key)
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
 
@@ -1,3 +1,3 @@
1
1
  module BacklogJp
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
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-15 00:00:00.000000000 Z
11
+ date: 2015-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler