pivotal_angel 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pivotal_angel/project.rb +46 -43
- data/lib/pivotal_angel/version.rb +1 -1
- data/pivotal_angel.gemspec +1 -1
- metadata +9 -9
@@ -8,52 +8,55 @@ module PivotalAngel
|
|
8
8
|
|
9
9
|
new_project = new_project.create
|
10
10
|
|
11
|
+
raise "Uh Oh: #{new_project.errors.errors.join("\n")}" if new_project.errors.errors.to_a.size > 0
|
12
|
+
|
11
13
|
puts "Copying stories from #{source_project.name} to #{new_project.name}"
|
12
14
|
source_project.stories.all.each do |story|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
15
|
+
# new story will get the requested_by/owned_by of the api token owner
|
16
|
+
# to preserve users, you would need to clone the project first
|
17
|
+
# and add all users that were ever on the project to the
|
18
|
+
# new project first through the pivotal tracker website
|
19
|
+
description = "#{story.description}\n\nOriginally owned by #{story.owned_by}\nOriginally requested by #{story.requested_by}"
|
20
|
+
|
21
|
+
new_story = new_project.stories.create name: story.name,
|
22
|
+
description: description,
|
23
|
+
estimate: story.estimate,
|
24
|
+
story_type: story.story_type,
|
25
|
+
current_state: story.current_state,
|
26
|
+
accepted_at: story.accepted_at,
|
27
|
+
created_at: story.created_at,
|
28
|
+
labels: story.labels
|
29
|
+
|
30
|
+
raise "Uh Oh: #{new_story.errors.join("\n")}" if new_story.errors.to_a.size > 0
|
31
|
+
|
32
|
+
story.tasks.all.each do |task|
|
33
|
+
new_task = nil
|
34
|
+
begin
|
35
|
+
new_task = new_story.tasks.create description: task.description,
|
36
|
+
complete: task.complete
|
37
|
+
putc "t"
|
38
|
+
rescue
|
39
|
+
puts "0"*80
|
40
|
+
puts "unable to create #{new_task.inspect}"
|
41
|
+
puts "0"*80
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
story.notes.all.each do |note|
|
46
|
+
new_note = nil
|
47
|
+
begin
|
48
|
+
new_note = new_story.notes.create text: "#{note.text}\n\nOriginally by #{note.author}",
|
49
|
+
noted_at: note.noted_at.to_s,
|
50
|
+
author: note.author
|
51
|
+
|
52
|
+
putc "n"
|
53
|
+
rescue
|
54
|
+
puts "%"*80
|
55
|
+
puts "unable to create #{new_note.inspect}"
|
56
|
+
puts "%"*80
|
57
|
+
end
|
54
58
|
end
|
55
|
-
|
56
|
-
putc "."
|
59
|
+
putc "."
|
57
60
|
end
|
58
61
|
puts "Done"
|
59
62
|
new_project
|
data/pivotal_angel.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivotal_angel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-05-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &70145905482980 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,18 +22,18 @@ dependencies:
|
|
22
22
|
version: '2.6'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70145905482980
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: pivotal-tracker
|
28
|
-
requirement: &
|
28
|
+
requirement: &70145905482300 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.5.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70145905482300
|
37
37
|
description: Pivotal Tracker helpers for project and labels
|
38
38
|
email:
|
39
39
|
- rad@aelogica.com
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.8.
|
78
|
+
rubygems_version: 1.8.11
|
79
79
|
signing_key:
|
80
80
|
specification_version: 3
|
81
81
|
summary: Deep clone a project, add, remove and rename labels
|