taskmapper-basecamp 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/VERSION +1 -1
- data/lib/provider/project.rb +21 -42
- data/spec/projects_spec.rb +43 -41
- data/spec/spec_helper.rb +1 -0
- data/taskmapper-basecamp.gemspec +4 -3
- metadata +95 -103
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.2@taskmapper-basecamp --create
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/lib/provider/project.rb
CHANGED
@@ -10,59 +10,38 @@ module TaskMapper::Provider
|
|
10
10
|
class Project < TaskMapper::Provider::Base::Project
|
11
11
|
API = BasecampAPI::Project
|
12
12
|
|
13
|
-
def initialize(*
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
else
|
24
|
-
hash = object
|
25
|
-
end
|
26
|
-
super hash
|
13
|
+
def initialize(*backend_info)
|
14
|
+
@system_data ||= {}
|
15
|
+
data = backend_info.first
|
16
|
+
case data
|
17
|
+
when Hash
|
18
|
+
super data.to_hash
|
19
|
+
else
|
20
|
+
@system_data[:client] = data
|
21
|
+
super data.attributes
|
27
22
|
end
|
28
23
|
end
|
29
|
-
|
24
|
+
|
30
25
|
def description
|
31
26
|
announcement
|
32
27
|
end
|
33
|
-
|
34
|
-
def description=(desc)
|
35
|
-
announcement = desc
|
36
|
-
end
|
37
|
-
|
28
|
+
|
38
29
|
def created_at
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
created_on
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def created_at=(created)
|
47
|
-
created_on = created
|
30
|
+
created_on.to_time
|
31
|
+
rescue
|
32
|
+
created_on
|
48
33
|
end
|
49
|
-
|
34
|
+
|
50
35
|
def updated_at
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
last_changed_on
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def updated_at=(updated)
|
59
|
-
last_changed_on = updated
|
36
|
+
last_changed_on.to_time
|
37
|
+
rescue
|
38
|
+
last_changed_on
|
60
39
|
end
|
61
|
-
|
40
|
+
|
62
41
|
def ticket!(attributes_hash)
|
63
42
|
provider_parent(self.class)::Ticket.create attributes_hash.merge :project_id => id
|
64
43
|
end
|
65
|
-
|
44
|
+
|
66
45
|
def self.find_by_id(id)
|
67
46
|
self.new API.find(id)
|
68
47
|
end
|
@@ -75,7 +54,7 @@ module TaskMapper::Provider
|
|
75
54
|
projects = API.find(:all).collect { |project| self.new project }
|
76
55
|
search_by_attribute(projects, options, limit)
|
77
56
|
end
|
78
|
-
|
57
|
+
|
79
58
|
# copy from this.copy(that) copies that into this
|
80
59
|
def copy(project)
|
81
60
|
project.tickets.each do |ticket|
|
data/spec/projects_spec.rb
CHANGED
@@ -1,71 +1,73 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
1
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
3
|
describe TaskMapper::Provider::Basecamp::Project do
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
@wheaders = @headers.merge('Content-Type' => 'application/xml')
|
8
|
-
end
|
9
|
-
|
5
|
+
let(:headers) { {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'} }
|
6
|
+
let(:wheaders) { headers.merge('Content-Type' => 'application/xml') }
|
10
7
|
let(:tm) { TaskMapper.new(:basecamp, :token => '000000', :domain => 'ticketmaster.basecamphq.com') }
|
11
8
|
let(:project_class) { TaskMapper::Provider::Basecamp::Project }
|
12
9
|
let(:project_id) { 5220065 }
|
13
10
|
|
14
|
-
|
11
|
+
context "When I retrieve projects" do
|
15
12
|
before(:each) do
|
16
13
|
ActiveResource::HttpMock.respond_to do |mock|
|
17
|
-
mock.get '/projects.xml',
|
18
|
-
mock.get '/projects/5220065.xml',
|
14
|
+
mock.get '/projects.xml', headers, fixture_for('projects'), 200
|
15
|
+
mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
|
16
|
+
mock.get '/projects.xml', headers, fixture_for('projects'), 200
|
19
17
|
end
|
20
18
|
end
|
19
|
+
describe :projects do
|
20
|
+
let(:projects) { tm.projects }
|
21
|
+
subject { projects }
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
it { should be_an_instance_of(Array) }
|
24
|
+
describe :first do
|
25
|
+
subject { projects.first }
|
26
|
+
it { should be_an_instance_of(project_class) }
|
27
|
+
end
|
27
28
|
|
28
|
-
context "when calling #projects using an array of id's" do
|
29
|
-
subject { tm.projects([project_id]) }
|
30
|
-
it { subject.should be_an_instance_of(Array) }
|
31
|
-
it { subject.first.should be_an_instance_of(project_class) }
|
32
|
-
it { subject.first.id.should be_eql(project_id) }
|
33
29
|
end
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
it { subject.first.should be_an_instance_of(project_class) }
|
39
|
-
it { subject.first.id.should be_eql(project_id) }
|
40
|
-
end
|
41
|
-
end
|
31
|
+
describe "#projects with array of id's" do
|
32
|
+
let(:projects) { tm.projects [project_id] }
|
33
|
+
subject { projects }
|
42
34
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
it { should be_an_instance_of Array }
|
36
|
+
describe :first do
|
37
|
+
subject { projects.first }
|
38
|
+
it { should be_an_instance_of project_class }
|
39
|
+
its(:id) { should be_eql project_id }
|
48
40
|
end
|
49
41
|
end
|
50
42
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
43
|
+
describe "#projects with a hash of project attributes" do
|
44
|
+
let(:projects) { tm.projects :id => project_id }
|
45
|
+
subject { projects }
|
46
|
+
|
47
|
+
it { should be_an_instance_of(Array) }
|
48
|
+
describe :first do
|
49
|
+
subject { projects.first }
|
50
|
+
it { should be_an_instance_of(project_class) }
|
51
|
+
its(:id) { should be_eql(project_id) }
|
52
|
+
end
|
55
53
|
end
|
56
54
|
|
57
|
-
|
58
|
-
subject { tm.project
|
59
|
-
it { should be_an_instance_of
|
60
|
-
|
55
|
+
describe :project do
|
56
|
+
subject { tm.project project_id }
|
57
|
+
it { should be_an_instance_of project_class }
|
58
|
+
its(:id) { should be_eql project_id }
|
59
|
+
its(:name) { should == 'Ticketmaster-basecamp' }
|
60
|
+
its(:description) { should == 'Announcement.' }
|
61
|
+
its(:created_at) { should be_an_instance_of Time }
|
62
|
+
its(:updated_at) { should be_an_instance_of Time }
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
64
66
|
describe "Creation and update" do
|
65
67
|
before(:each) do
|
66
68
|
ActiveResource::HttpMock.respond_to do |mock|
|
67
|
-
mock.post '/projects.xml',
|
68
|
-
mock.get '/projects/5220065.xml',
|
69
|
+
mock.post '/projects.xml', wheaders, '', 200
|
70
|
+
mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
data/spec/spec_helper.rb
CHANGED
data/taskmapper-basecamp.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "taskmapper-basecamp"
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["HybridGroup"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-08-16"
|
13
13
|
s.description = "This gem provides an interface to basecamp through the taskmapper gem"
|
14
14
|
s.email = "hong.quach@abigfisch.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
+
".rvmrc",
|
21
22
|
".travis.yml",
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
@@ -67,7 +68,7 @@ Gem::Specification.new do |s|
|
|
67
68
|
]
|
68
69
|
s.homepage = "http://github.com/kiafaldorius/taskmapper-basecamp"
|
69
70
|
s.require_paths = ["lib"]
|
70
|
-
s.rubygems_version = "1.8.
|
71
|
+
s.rubygems_version = "1.8.24"
|
71
72
|
s.summary = "The basecamp provider for taskmapper"
|
72
73
|
|
73
74
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,123 +1,122 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskmapper-basecamp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 0
|
10
|
-
version: 0.6.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- HybridGroup
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: taskmapper
|
22
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.8'
|
23
22
|
type: :runtime
|
24
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
26
|
+
requirements:
|
27
27
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
- 0
|
32
|
-
- 8
|
33
|
-
version: "0.8"
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.8'
|
30
|
+
- !ruby/object:Gem::Dependency
|
36
31
|
name: xml-simple
|
37
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.1'
|
38
38
|
type: :runtime
|
39
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
|
-
requirements:
|
42
|
+
requirements:
|
42
43
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
|
46
|
-
- 1
|
47
|
-
- 1
|
48
|
-
version: "1.1"
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.1'
|
46
|
+
- !ruby/object:Gem::Dependency
|
51
47
|
name: rspec
|
52
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.3'
|
53
54
|
type: :development
|
54
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
57
|
none: false
|
56
|
-
requirements:
|
58
|
+
requirements:
|
57
59
|
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
- 2
|
62
|
-
- 3
|
63
|
-
version: "2.3"
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
66
63
|
name: jeweler
|
67
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.6'
|
68
70
|
type: :development
|
69
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
73
|
none: false
|
71
|
-
requirements:
|
74
|
+
requirements:
|
72
75
|
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
76
|
-
- 1
|
77
|
-
- 6
|
78
|
-
version: "1.6"
|
79
|
-
version_requirements: *id004
|
80
|
-
- !ruby/object:Gem::Dependency
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.6'
|
78
|
+
- !ruby/object:Gem::Dependency
|
81
79
|
name: simplecov
|
82
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0.5'
|
83
86
|
type: :development
|
84
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
89
|
none: false
|
86
|
-
requirements:
|
90
|
+
requirements:
|
87
91
|
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
|
91
|
-
- 0
|
92
|
-
- 5
|
93
|
-
version: "0.5"
|
94
|
-
version_requirements: *id005
|
95
|
-
- !ruby/object:Gem::Dependency
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0.5'
|
94
|
+
- !ruby/object:Gem::Dependency
|
96
95
|
name: rcov
|
97
|
-
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '1.0'
|
98
102
|
type: :development
|
99
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
105
|
none: false
|
101
|
-
requirements:
|
106
|
+
requirements:
|
102
107
|
- - ~>
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
segments:
|
106
|
-
- 1
|
107
|
-
- 0
|
108
|
-
version: "1.0"
|
109
|
-
version_requirements: *id006
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.0'
|
110
110
|
description: This gem provides an interface to basecamp through the taskmapper gem
|
111
111
|
email: hong.quach@abigfisch.com
|
112
112
|
executables: []
|
113
|
-
|
114
113
|
extensions: []
|
115
|
-
|
116
|
-
extra_rdoc_files:
|
114
|
+
extra_rdoc_files:
|
117
115
|
- LICENSE
|
118
116
|
- README.md
|
119
|
-
files:
|
117
|
+
files:
|
120
118
|
- .document
|
119
|
+
- .rvmrc
|
121
120
|
- .travis.yml
|
122
121
|
- Gemfile
|
123
122
|
- Gemfile.lock
|
@@ -166,36 +165,29 @@ files:
|
|
166
165
|
- taskmapper-basecamp.gemspec
|
167
166
|
homepage: http://github.com/kiafaldorius/taskmapper-basecamp
|
168
167
|
licenses: []
|
169
|
-
|
170
168
|
post_install_message:
|
171
169
|
rdoc_options: []
|
172
|
-
|
173
|
-
require_paths:
|
170
|
+
require_paths:
|
174
171
|
- lib
|
175
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
173
|
none: false
|
177
|
-
requirements:
|
178
|
-
- -
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
|
181
|
-
segments:
|
174
|
+
requirements:
|
175
|
+
- - ! '>='
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
segments:
|
182
179
|
- 0
|
183
|
-
|
184
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
hash: -845405475
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
182
|
none: false
|
186
|
-
requirements:
|
187
|
-
- -
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
|
190
|
-
segments:
|
191
|
-
- 0
|
192
|
-
version: "0"
|
183
|
+
requirements:
|
184
|
+
- - ! '>='
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
193
187
|
requirements: []
|
194
|
-
|
195
188
|
rubyforge_project:
|
196
|
-
rubygems_version: 1.8.
|
189
|
+
rubygems_version: 1.8.24
|
197
190
|
signing_key:
|
198
191
|
specification_version: 3
|
199
192
|
summary: The basecamp provider for taskmapper
|
200
193
|
test_files: []
|
201
|
-
|