bugherd-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile.lock +1 -0
- data/VERSION +1 -1
- data/bugherd-api.gemspec +84 -84
- data/lib/bugherd.rb +9 -3
- data/spec/project_spec.rb +3 -2
- data/spec/task_spec.rb +3 -2
- data/spec/user_spec.rb +2 -1
- metadata +31 -30
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.8.7@bugherd-api --create
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/bugherd-api.gemspec
CHANGED
@@ -1,84 +1,84 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{bugherd-api}
|
8
|
-
s.version = "0.0.
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Rafael George"]
|
12
|
-
s.date = %q{2011-08-
|
13
|
-
s.description = %q{BugherdAPI wrapper}
|
14
|
-
s.email = %q{george.rafael@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
"
|
23
|
-
"Gemfile
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"lib/bugherd.rb",
|
31
|
-
"lib/bugherd
|
32
|
-
"lib/bugherd
|
33
|
-
"lib/bugherd/
|
34
|
-
"lib/bugherd/
|
35
|
-
"lib/bugherd/
|
36
|
-
"
|
37
|
-
"spec
|
38
|
-
"spec/
|
39
|
-
"spec/fixtures
|
40
|
-
"spec/fixtures/projects
|
41
|
-
"spec/fixtures/projects
|
42
|
-
"spec/fixtures/
|
43
|
-
"spec/fixtures/tasks
|
44
|
-
"spec/fixtures/
|
45
|
-
"spec/
|
46
|
-
"spec/
|
47
|
-
"spec/
|
48
|
-
"spec/
|
49
|
-
|
50
|
-
|
51
|
-
s.
|
52
|
-
s.
|
53
|
-
s.
|
54
|
-
s.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
s.specification_version = 3
|
59
|
-
|
60
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
62
|
-
s.add_runtime_dependency(%q<activeresource>, [">= 0"])
|
63
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
64
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
65
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
66
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
67
|
-
else
|
68
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
69
|
-
s.add_dependency(%q<activeresource>, [">= 0"])
|
70
|
-
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
71
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
72
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
74
|
-
end
|
75
|
-
else
|
76
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
77
|
-
s.add_dependency(%q<activeresource>, [">= 0"])
|
78
|
-
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
79
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
80
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
81
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{bugherd-api}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Rafael George"]
|
12
|
+
s.date = %q{2011-08-24}
|
13
|
+
s.description = %q{BugherdAPI wrapper}
|
14
|
+
s.email = %q{george.rafael@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
".rvmrc",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"bugherd-api.gemspec",
|
30
|
+
"lib/bugherd-api.rb",
|
31
|
+
"lib/bugherd.rb",
|
32
|
+
"lib/bugherd/.project.rb.swp",
|
33
|
+
"lib/bugherd/base.rb",
|
34
|
+
"lib/bugherd/project.rb",
|
35
|
+
"lib/bugherd/task.rb",
|
36
|
+
"lib/bugherd/user.rb",
|
37
|
+
"spec/.project_spec.rb.swp",
|
38
|
+
"spec/bugherd-api_spec.rb",
|
39
|
+
"spec/fixtures/.projects.xml.swp",
|
40
|
+
"spec/fixtures/projects.xml",
|
41
|
+
"spec/fixtures/projects/.1458.xml.swp",
|
42
|
+
"spec/fixtures/projects/1458.xml",
|
43
|
+
"spec/fixtures/tasks.xml",
|
44
|
+
"spec/fixtures/tasks/4950.xml",
|
45
|
+
"spec/fixtures/users.xml",
|
46
|
+
"spec/project_spec.rb",
|
47
|
+
"spec/spec_helper.rb",
|
48
|
+
"spec/task_spec.rb",
|
49
|
+
"spec/user_spec.rb"
|
50
|
+
]
|
51
|
+
s.homepage = %q{http://github.com/cored/bugherd-api}
|
52
|
+
s.licenses = ["MIT"]
|
53
|
+
s.require_paths = ["lib"]
|
54
|
+
s.rubygems_version = %q{1.6.1}
|
55
|
+
s.summary = %q{BugherdAPI wrapper}
|
56
|
+
|
57
|
+
if s.respond_to? :specification_version then
|
58
|
+
s.specification_version = 3
|
59
|
+
|
60
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
62
|
+
s.add_runtime_dependency(%q<activeresource>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
64
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
65
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
66
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
67
|
+
else
|
68
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
69
|
+
s.add_dependency(%q<activeresource>, [">= 0"])
|
70
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
71
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
72
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
74
|
+
end
|
75
|
+
else
|
76
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
77
|
+
s.add_dependency(%q<activeresource>, [">= 0"])
|
78
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
79
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
80
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
81
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
data/lib/bugherd.rb
CHANGED
@@ -3,25 +3,31 @@ $: << File.dirname(__FILE__) unless $:.include?(File.dirname(__FILE__))
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'active_support'
|
5
5
|
require 'active_resource'
|
6
|
+
require 'bugherd/base'
|
6
7
|
|
7
8
|
module BugherdAPI
|
8
9
|
extend ActiveSupport::Autoload
|
9
10
|
|
10
|
-
autoload :Base, 'bugherd/base'
|
11
11
|
autoload :User, 'bugherd/user'
|
12
12
|
autoload :Project, 'bugherd/project'
|
13
13
|
autoload :Task, 'bugherd/task'
|
14
14
|
class Error < StandardError; end
|
15
15
|
|
16
16
|
class << self
|
17
|
+
attr_accessor :email, :password
|
17
18
|
def authenticate(email, password)
|
18
|
-
|
19
|
-
|
19
|
+
self.email = email
|
20
|
+
self.password = password
|
21
|
+
|
22
|
+
self::Base.user = email
|
23
|
+
self::Base.password = password
|
24
|
+
|
20
25
|
end
|
21
26
|
|
22
27
|
def resources
|
23
28
|
@resources ||= []
|
24
29
|
end
|
30
|
+
|
25
31
|
end
|
26
32
|
|
27
33
|
end
|
data/spec/project_spec.rb
CHANGED
@@ -3,9 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe "BugherdAPI::Project" do
|
4
4
|
before(:each) do
|
5
5
|
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
headers = {'Authorization' => 'Basic dXNlckBlbWFpbC5jb206MTIzNDU2', 'Accept' => 'application/xml'}
|
6
7
|
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
-
mock.get '/api_v1/projects.xml',
|
8
|
-
mock.get '/api_v1/projects/1458.xml',
|
8
|
+
mock.get '/api_v1/projects.xml', headers, fixture_for('projects', 'xml'), 200
|
9
|
+
mock.get '/api_v1/projects/1458.xml', headers, fixture_for('projects/1458','xml'), 200
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
data/spec/task_spec.rb
CHANGED
@@ -3,9 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe "BugherdAPI::Task" do
|
4
4
|
before(:each) do
|
5
5
|
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
headers = {'Authorization' => 'Basic dXNlckBlbWFpbC5jb206MTIzNDU2', 'Accept' => 'application/xml'}
|
6
7
|
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
-
mock.get '/api_v1/projects/1458/tasks.xml',
|
8
|
-
mock.get '/api_v1/projects/1458/tasks/4950.xml',
|
8
|
+
mock.get '/api_v1/projects/1458/tasks.xml', headers, fixture_for('tasks', 'xml'), 200
|
9
|
+
mock.get '/api_v1/projects/1458/tasks/4950.xml', headers, fixture_for('tasks/4950', 'xml'), 200
|
9
10
|
end
|
10
11
|
@project_id = 1458
|
11
12
|
end
|
data/spec/user_spec.rb
CHANGED
@@ -3,8 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe "BugherdAPI::User" do
|
4
4
|
before(:each) do
|
5
5
|
BugherdAPI.authenticate('user@email.com', '123456')
|
6
|
+
headers = {'Authorization' => 'Basic dXNlckBlbWFpbC5jb206MTIzNDU2', 'Accept' => 'application/xml'}
|
6
7
|
ActiveResource::HttpMock.respond_to do |mock|
|
7
|
-
mock.get '/api_v1/users.xml',
|
8
|
+
mock.get '/api_v1/users.xml', headers, fixture_for('users', 'xml'), 200
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugherd-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rafael George
|
@@ -15,14 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-24 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
type: :runtime
|
23
|
-
|
24
|
-
name: activesupport
|
25
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
24
|
none: false
|
27
25
|
requirements:
|
28
26
|
- - ">="
|
@@ -31,12 +29,12 @@ dependencies:
|
|
31
29
|
segments:
|
32
30
|
- 0
|
33
31
|
version: "0"
|
34
|
-
|
32
|
+
version_requirements: *id001
|
33
|
+
name: activesupport
|
34
|
+
prerelease: false
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
type: :runtime
|
37
|
-
|
38
|
-
name: activeresource
|
39
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
42
40
|
- - ">="
|
@@ -45,12 +43,12 @@ dependencies:
|
|
45
43
|
segments:
|
46
44
|
- 0
|
47
45
|
version: "0"
|
48
|
-
|
46
|
+
version_requirements: *id002
|
47
|
+
name: activeresource
|
48
|
+
prerelease: false
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
type: :development
|
51
|
-
|
52
|
-
name: rspec
|
53
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
52
|
none: false
|
55
53
|
requirements:
|
56
54
|
- - ~>
|
@@ -61,12 +59,12 @@ dependencies:
|
|
61
59
|
- 3
|
62
60
|
- 0
|
63
61
|
version: 2.3.0
|
64
|
-
|
62
|
+
version_requirements: *id003
|
63
|
+
name: rspec
|
64
|
+
prerelease: false
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
type: :development
|
67
|
-
|
68
|
-
name: bundler
|
69
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
68
|
none: false
|
71
69
|
requirements:
|
72
70
|
- - ~>
|
@@ -77,12 +75,12 @@ dependencies:
|
|
77
75
|
- 0
|
78
76
|
- 0
|
79
77
|
version: 1.0.0
|
80
|
-
|
78
|
+
version_requirements: *id004
|
79
|
+
name: bundler
|
80
|
+
prerelease: false
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
type: :development
|
83
|
-
|
84
|
-
name: jeweler
|
85
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
86
84
|
none: false
|
87
85
|
requirements:
|
88
86
|
- - ~>
|
@@ -93,12 +91,12 @@ dependencies:
|
|
93
91
|
- 6
|
94
92
|
- 4
|
95
93
|
version: 1.6.4
|
96
|
-
|
94
|
+
version_requirements: *id005
|
95
|
+
name: jeweler
|
96
|
+
prerelease: false
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
type: :development
|
99
|
-
|
100
|
-
name: rcov
|
101
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
99
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
102
100
|
none: false
|
103
101
|
requirements:
|
104
102
|
- - ">="
|
@@ -107,7 +105,9 @@ dependencies:
|
|
107
105
|
segments:
|
108
106
|
- 0
|
109
107
|
version: "0"
|
110
|
-
|
108
|
+
version_requirements: *id006
|
109
|
+
name: rcov
|
110
|
+
prerelease: false
|
111
111
|
description: BugherdAPI wrapper
|
112
112
|
email: george.rafael@gmail.com
|
113
113
|
executables: []
|
@@ -120,6 +120,7 @@ extra_rdoc_files:
|
|
120
120
|
files:
|
121
121
|
- .document
|
122
122
|
- .rspec
|
123
|
+
- .rvmrc
|
123
124
|
- Gemfile
|
124
125
|
- Gemfile.lock
|
125
126
|
- LICENSE.txt
|
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
178
|
requirements: []
|
178
179
|
|
179
180
|
rubyforge_project:
|
180
|
-
rubygems_version: 1.
|
181
|
+
rubygems_version: 1.6.1
|
181
182
|
signing_key:
|
182
183
|
specification_version: 3
|
183
184
|
summary: BugherdAPI wrapper
|