backlog_jp 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9677d8922a4959d4d0dd47f5fa51be789922ca2f
4
- data.tar.gz: a9ab169d6b6ebf872b3e42c232b96a06db344113
3
+ metadata.gz: d2e797e9b65c70348d8e4429b9d085da3a0ec294
4
+ data.tar.gz: 6693a706708d14cd04e5995a0623faae675a6b30
5
5
  SHA512:
6
- metadata.gz: 211de2a5f77b5a87233e6cc7641b26482695a8f0252b5075c9a669c9d1fbafcea7849a5bcbf6fcf6ef92c4abffd1ae16d5c5166cc8fc924f4433ab91d546776c
7
- data.tar.gz: ce1826b406f995d84825df3dda881dbaff5ad430c9b2505fbe6d32cf534380287041767142ba2d24de8f22adc2e3bf7fbccc6c69aecb9fcbfde3dd1fa67fc13d
6
+ metadata.gz: d43d70d23715a20cee7a7e81d91a92ceadf9eda230baa4dcd282ee140fa607950019b8533c58467207b690f032c7dadf1c2a0e122b3501f2c92bb2a2665200fc
7
+ data.tar.gz: 57d2209fc096e7fd9a3b15fc622d3ea5c42ee6b4a3a9de193ef9ca4da8c81aa3ca2ea978b8db42799444ed1823904df94ad249890e55b6dfaf278065359070f8
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **!!!WORK IN PROGRESS!!!**
4
4
 
5
- A Rubyish interface for Backlog.
5
+ A Ruby client for [Backlog.jp API V2](http://developer.nulab-inc.com/ja/docs/backlog/api/2/).
6
6
 
7
7
  ## Requirements
8
8
 
@@ -28,27 +28,28 @@ TODO: Write more usage instructions here
28
28
 
29
29
  require "backlog_jp"
30
30
 
31
- # Configure space/user infomation with a block.
32
- BacklogJp.configure do |config|
33
- config.space = ENV["BACKLOG_SPACE"]
34
- config.username = ENV["BACKLOG_USERNAME"]
35
- config.password = ENV["BACKLOG_PASSWORD"]
36
- end
31
+ # Create client with your space name and api key.
32
+ client = BacklogJp::Client.new space: "my-space", api_key: "xxxxxxxxxx"
37
33
 
38
- all_projects = BacklogJp::Project.all # Array of all projects.
34
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-space
35
+ client.get "space"
39
36
 
40
- project = all_projects.first # A Project object.
41
- project.issue_types # Array of project's issue types.
37
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project
38
+ client.get "projects/MYPJ"
42
39
 
43
- project.name #=> "some project" # Get project's name.
44
- project.name = "greatest project" # Set new project name.
45
- project.save # Save changed attribute
40
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issues
41
+ client.get "issues", "projectId[]": 12345678
46
42
 
47
- client = Backlog.client # Client object.
48
- client.get_projects # Call `getProjects` API directly.
43
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/get-comments
44
+ client.get "issues/MYPJ-123/comments"
45
+
46
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/post-comments
47
+ client.post "issues/MYPJ-123/comments", content: "hello"
48
+
49
+ # http://developer.nulab-inc.com/ja/docs/backlog/api/2/update-issue
50
+ client.patch "issues/MYPJ-123", statusId: 4
49
51
 
50
52
  # etc...
51
- # work in progress
52
53
 
53
54
  ## Contributing
54
55
 
@@ -19,7 +19,7 @@ class BacklogJp::Client
19
19
  api_path, params = *args
20
20
  params ||= {}
21
21
 
22
- response = connection.send(method, "/api/v2/#{api_path}?apiKey=#{@api_key}", build_params(params))
22
+ response = connection.send(method, "#{api_path}?apiKey=#{@api_key}", build_params(params))
23
23
 
24
24
  unless response.status.to_s.start_with? "2"
25
25
  fail APIException, JSON.parse(response.body, symbolize_names: true)
@@ -32,11 +32,7 @@ class BacklogJp::Client
32
32
  private
33
33
 
34
34
  def connection
35
- @connection ||= Faraday.new host
36
- end
37
-
38
- def host
39
- @host ||= "https://#{@space}.backlog.jp"
35
+ @connection ||= Faraday.new "https://#{@space}.backlog.jp/api/v2/"
40
36
  end
41
37
 
42
38
  def camelize string
@@ -1,3 +1,3 @@
1
1
  module BacklogJp
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
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.7
4
+ version: 0.0.8
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-14 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler