Permalink
Browse files

Update pivotal tracker gem to 0.5.4

  • Loading branch information...
Cecille Manalang authored and stalcottsmith committed May 8, 2012
1 parent 15ea81c commit c45e9943ed642a4944aebcf61e1c2f5496573146
Showing with 47 additions and 44 deletions.
  1. +46 −43 lib/pivotal_angel/project.rb
  2. +1 −1 pivotal_angel.gemspec
@@ -8,52 +8,55 @@ def deep_clone(source_project, name)
new_project = new_project.create
+ raise "Uh Oh: #{new_project.errors.errors.join("\n")}" if new_project.errors.errors.to_a.size > 0
+
puts "Copying stories from #{source_project.name} to #{new_project.name}"
source_project.stories.all.each do |story|
- # new story will get the requested_by/owned_by of the api token owner
- # to preserve users, you would need to clone the project first
- # and add all users that were ever on the project to the
- # new project first through the pivotal tracker website
- description = "#{story.description}\n\nOriginally owned by #{story.owned_by}\nOriginally requested by #{story.requested_by}"
-
- new_story = new_project.stories.create name: story.name,
- description: description,
- estimate: story.estimate,
- story_type: story.story_type,
- current_state: story.current_state,
- accepted_at: story.accepted_at,
- created_at: story.created_at,
- labels: story.labels
-
- raise "Uh Oh: #{new_story.errors.join("\n")}" if new_story.errors.to_a.size > 0
-
- story.tasks.all.each do |task|
- new_task = nil
- begin
- new_task = new_story.tasks.create description: task.description,
- complete: task.complete
- putc "t"
- rescue
- puts "0"*80
- puts "unable to create #{new_task.inspect}"
- puts "0"*80
- end
- end
-
- story.notes.all.each do |note|
- begin
- new_story.notes.create text: "#{note.text}\n\nOriginally by #{note.author}",
- noted_at: note.noted_at.to_s,
- author: note.author
-
- putc "n"
- rescue
- puts "%"*80
- puts "unable to create #{note.inspect}"
- puts "%"*80
+ # new story will get the requested_by/owned_by of the api token owner
+ # to preserve users, you would need to clone the project first
+ # and add all users that were ever on the project to the
+ # new project first through the pivotal tracker website
+ description = "#{story.description}\n\nOriginally owned by #{story.owned_by}\nOriginally requested by #{story.requested_by}"
+
+ new_story = new_project.stories.create name: story.name,
+ description: description,
+ estimate: story.estimate,
+ story_type: story.story_type,
+ current_state: story.current_state,
+ accepted_at: story.accepted_at,
+ created_at: story.created_at,
+ labels: story.labels
+
+ raise "Uh Oh: #{new_story.errors.join("\n")}" if new_story.errors.to_a.size > 0
+
+ story.tasks.all.each do |task|
+ new_task = nil
+ begin
+ new_task = new_story.tasks.create description: task.description,
+ complete: task.complete
+ putc "t"
+ rescue
+ puts "0"*80
+ puts "unable to create #{new_task.inspect}"
+ puts "0"*80
+ end
+ end
+
+ story.notes.all.each do |note|
+ new_note = nil
+ begin
+ new_note = new_story.notes.create text: "#{note.text}\n\nOriginally by #{note.author}",
+ noted_at: note.noted_at.to_s,
+ author: note.author
+
+ putc "n"
+ rescue
+ puts "%"*80
+ puts "unable to create #{new_note.inspect}"
+ puts "%"*80
+ end
end
- end
- putc "."
+ putc "."
end
puts "Done"
new_project
View
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec", "~> 2.6"
- gem.add_dependency "pivotal-tracker"
+ gem.add_dependency "pivotal-tracker", "~> 0.5.4"
end

0 comments on commit c45e994

Please sign in to comment.