backlog4r 0.0.2 → 0.0.3

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: 7788df74dc5638fb1b2084c5a9f7fc55035b4622
4
- data.tar.gz: 5183f28b9a4348baedb2535abdbfba1dc2f5ff1b
3
+ metadata.gz: b96eedc12b088d142e5691b61e5a31cc0474d9cb
4
+ data.tar.gz: 13693c229e6db8a8c1e33f6a50a28731ece70b50
5
5
  SHA512:
6
- metadata.gz: 22cdcd043ba05708daefaeea29e0eba44f52fd43cffb3403229fcbb7accdf3cc36feb9448c855be61bed0b57c4d9d4c2681aad869c48c0c0c008b446344d1d9e
7
- data.tar.gz: f9f1e11c9c084a7397cad309aa618a3d781b51797cbedf266e973296b5beafa0c3ea56a02301b54f0982bc20629090ceec27da5701a52173ec26a14ee8158a80
6
+ metadata.gz: f1c08c52baa7b46f6afc282bc2ce6d467e59a9195d75b718ebd9e622c50f1c0d225ca87949775cbc2eb315903cb585827cbb5a07627b488e2b79ee166d038ac8
7
+ data.tar.gz: 74ba4ca0051a56beb193cb05df3050108cb4afcaec8bd8dc5484896548c5746e16d529dddc7a23071bc06f1151104707c96cd2dceeae960ec2677923da7fbc84
@@ -0,0 +1,8 @@
1
+ module Backlog4r
2
+ class Admin < Client
3
+ def initialize(space_name, user_id, password)
4
+ super(space_name, user_id, password, 'backlog.admin')
5
+ end
6
+ end
7
+ end
8
+
@@ -0,0 +1,32 @@
1
+ require "backlog4r/version"
2
+ require "uri"
3
+ require "xmlrpc/client"
4
+ require "active_support/core_ext"
5
+
6
+ module Backlog4r
7
+ class Client < XMLRPC::Client::Proxy
8
+ def initialize(space_name, user_id, password, prefix)
9
+ space_uri = URI.parse("https://#{space_name}.backlog.jp/XML-RPC")
10
+ proxy_host = proxy_port = nil
11
+ use_ssl = true
12
+ timeout = 5
13
+
14
+ server = XMLRPC::Client.new(space_uri.host,
15
+ space_uri.path,
16
+ space_uri.port,
17
+ proxy_host,
18
+ proxy_port,
19
+ user_id,
20
+ password,
21
+ use_ssl,
22
+ timeout,
23
+ )
24
+ super(server, prefix)
25
+ end
26
+
27
+ def method_missing(action, *args)
28
+ action = action.to_s.camelize(:lower).to_sym
29
+ super
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,8 @@
1
+ module Backlog4r
2
+ class User < Client
3
+ def initialize(space_name, user_id, password)
4
+ super(space_name, user_id, password, 'backlog')
5
+ end
6
+ end
7
+ end
8
+
@@ -1,3 +1,3 @@
1
1
  module Backlog4r
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/backlog4r.rb CHANGED
@@ -1,44 +1,3 @@
1
- require "backlog4r/version"
2
- require "uri"
3
- require "xmlrpc/client"
4
- require "active_support/core_ext"
5
-
6
- module Backlog4r
7
- class Backlog < XMLRPC::Client::Proxy
8
- def initialize(space_name, user_id, password, prefix)
9
- space_uri = URI.parse("https://#{space_name}.backlog.jp/XML-RPC")
10
- proxy_host = proxy_port = nil
11
- use_ssl = true
12
- timeout = 5
13
-
14
- server = XMLRPC::Client.new(space_uri.host,
15
- space_uri.path,
16
- space_uri.port,
17
- proxy_host,
18
- proxy_port,
19
- user_id,
20
- password,
21
- use_ssl,
22
- timeout,
23
- )
24
- super(server, prefix)
25
- end
26
-
27
- def method_missing(action, *args)
28
- action = action.to_s.camelize(:lower).to_sym
29
- super
30
- end
31
- end
32
-
33
- class BacklogUser < Backlog
34
- def initialize(space_name, user_id, password)
35
- super(space_name, user_id, password, 'backlog')
36
- end
37
- end
38
-
39
- class BacklogAdmin < Backlog
40
- def initialize(space_name, user_id, password)
41
- super(space_name, user_id, password, 'backlog.admin')
42
- end
43
- end
44
- end
1
+ require 'backlog4r/client'
2
+ require 'backlog4r/user'
3
+ require 'backlog4r/admin'
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+ require "backlog4r"
3
+
4
+ describe Backlog4r::Admin do
5
+ context "when initialized valid conditions" do
6
+ subject { Backlog4r::Admin.new("space", "user", "pass") }
7
+
8
+ it { should be_an_instance_of Backlog4r::Admin }
9
+ end
10
+ end
11
+
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+ require "backlog4r"
3
+
4
+ describe Backlog4r::Client do
5
+ context "when initialized valid conditions" do
6
+ subject { Backlog4r::Client.new("space", "user", "pass", "prefix") }
7
+
8
+ it { should be_an_instance_of Backlog4r::Client }
9
+ end
10
+ end
11
+
data/spec/user_spec.rb ADDED
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+ require "backlog4r"
3
+
4
+ describe Backlog4r::User do
5
+ context "when initialized valid conditions" do
6
+ subject { Backlog4r::User.new("space", "user", "pass") }
7
+
8
+ it { should be_an_instance_of Backlog4r::User }
9
+ end
10
+ end
11
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backlog4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keisuke Futonaka
@@ -108,11 +108,14 @@ files:
108
108
  - Rakefile
109
109
  - backlog4r.gemspec
110
110
  - lib/backlog4r.rb
111
+ - lib/backlog4r/admin.rb
112
+ - lib/backlog4r/client.rb
113
+ - lib/backlog4r/user.rb
111
114
  - lib/backlog4r/version.rb
112
- - spec/backlog_admin_spec.rb
113
- - spec/backlog_spec.rb
114
- - spec/backlog_user_spec.rb
115
+ - spec/admin_spec.rb
116
+ - spec/client_spec.rb
115
117
  - spec/spec_helper.rb
118
+ - spec/user_spec.rb
116
119
  homepage: ''
117
120
  licenses:
118
121
  - MIT
@@ -138,7 +141,7 @@ signing_key:
138
141
  specification_version: 4
139
142
  summary: WebAPI interface for backlog.jp
140
143
  test_files:
141
- - spec/backlog_admin_spec.rb
142
- - spec/backlog_spec.rb
143
- - spec/backlog_user_spec.rb
144
+ - spec/admin_spec.rb
145
+ - spec/client_spec.rb
144
146
  - spec/spec_helper.rb
147
+ - spec/user_spec.rb
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
- require "backlog4r"
3
-
4
- describe Backlog4r::BacklogAdmin do
5
- context "when initialized valid conditions" do
6
- subject { Backlog4r::BacklogAdmin.new("space", "user", "pass") }
7
-
8
- it { should be_an_instance_of Backlog4r::BacklogAdmin }
9
- end
10
- end
11
-
data/spec/backlog_spec.rb DELETED
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
- require "backlog4r"
3
-
4
- describe Backlog4r::Backlog do
5
- context "when initialized valid conditions" do
6
- subject { Backlog4r::Backlog.new("space", "user", "pass", "prefix") }
7
-
8
- it { should be_an_instance_of Backlog4r::Backlog }
9
- end
10
- end
11
-
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
- require "backlog4r"
3
-
4
- describe Backlog4r::BacklogUser do
5
- context "when initialized valid conditions" do
6
- subject { Backlog4r::BacklogUser.new("space", "user", "pass") }
7
-
8
- it { should be_an_instance_of Backlog4r::BacklogUser }
9
- end
10
- end
11
-