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.
@@ -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
- # new story will get the requested_by/owned_by of the api token owner
14
- # to preserve users, you would need to clone the project first
15
- # and add all users that were ever on the project to the
16
- # new project first through the pivotal tracker website
17
- description = "#{story.description}\n\nOriginally owned by #{story.owned_by}\nOriginally requested by #{story.requested_by}"
18
-
19
- new_story = new_project.stories.create name: story.name,
20
- description: description,
21
- estimate: story.estimate,
22
- story_type: story.story_type,
23
- current_state: story.current_state,
24
- accepted_at: story.accepted_at,
25
- created_at: story.created_at,
26
- labels: story.labels
27
-
28
- raise "Uh Oh: #{new_story.errors.join("\n")}" if new_story.errors.to_a.size > 0
29
-
30
- story.tasks.all.each do |task|
31
- new_task = nil
32
- begin
33
- new_task = new_story.tasks.create description: task.description,
34
- complete: task.complete
35
- putc "t"
36
- rescue
37
- puts "0"*80
38
- puts "unable to create #{new_task.inspect}"
39
- puts "0"*80
40
- end
41
- end
42
-
43
- story.notes.all.each do |note|
44
- begin
45
- new_story.notes.create text: "#{note.text}\n\nOriginally by #{note.author}",
46
- noted_at: note.noted_at.to_s,
47
- author: note.author
48
-
49
- putc "n"
50
- rescue
51
- puts "%"*80
52
- puts "unable to create #{note.inspect}"
53
- puts "%"*80
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
- end
56
- putc "."
59
+ putc "."
57
60
  end
58
61
  puts "Done"
59
62
  new_project
@@ -1,3 +1,3 @@
1
1
  module PivotalAngel
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_development_dependency "rspec", "~> 2.6"
19
19
 
20
- gem.add_dependency "pivotal-tracker"
20
+ gem.add_dependency "pivotal-tracker", "~> 0.5.4"
21
21
  end
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.3
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-04-09 00:00:00.000000000 Z
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: &70268966157920 !ruby/object:Gem::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: *70268966157920
25
+ version_requirements: *70145905482980
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: pivotal-tracker
28
- requirement: &70268966155060 !ruby/object:Gem::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: '0'
33
+ version: 0.5.4
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70268966155060
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.17
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