Class: PivotalToTrello::Core
- Inherits:
-
Object
- Object
- PivotalToTrello::Core
- Defined in:
- lib/pivotal_to_trello/core.rb
Overview
The core entry point of the gem, which handles the import process.
Instance Method Summary collapse
-
#import! ⇒ Object
Generates a film clip based on the given input audio file, and saves it to the given output path.
-
#initialize(options = OpenStruct.new) ⇒ Core
constructor
Constructor.
-
#options ⇒ Object
Returns the options struct.
Constructor Details
#initialize(options = OpenStruct.new) ⇒ Core
Constructor
9 10 11 |
# File 'lib/pivotal_to_trello/core.rb', line 9 def initialize( = OpenStruct.new) @options = end |
Instance Method Details
#import! ⇒ Object
Generates a film clip based on the given input audio file, and saves it to the given output path.
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 54 55 56 57 58 59 60 61 |
# File 'lib/pivotal_to_trello/core.rb', line 15 def import! prompt_for_details puts "\nBeginning import..." pivotal.stories(.pivotal_project_id).each do |story| list_id = label = nil if story.current_state == 'accepted' list_id = .accepted_list_id elsif story.current_state == 'rejected' list_id = .rejected_list_id elsif story.current_state == 'finished' list_id = .finished_list_id elsif story.current_state == 'delivered' list_id = .delivered_list_id elsif story.current_state == 'started' list_id = .current_list_id elsif story.current_state == 'unscheduled' list_id = .icebox_list_id elsif story.current_state == 'unstarted' && story.story_type == 'feature' list_id = .feature_list_id elsif story.current_state == 'unstarted' && story.story_type == 'chore' list_id = .chore_list_id elsif story.current_state == 'unstarted' && story.story_type == 'bug' list_id = .bug_list_id elsif story.current_state == 'unstarted' && story.story_type == 'release' list_id = .release_list_id else puts "Ignoring story #{story.id} - type is '#{story.story_type}', state is '#{story.current_state}'" end if story.story_type == 'bug' && .bug_label label = .bug_label elsif story.story_type == 'feature' && .feature_label label = .feature_label elsif story.story_type == 'chore' && .chore_label label = .chore_label elsif story.story_type == 'release' && .release_label label = .release_label end if list_id card = trello.create_card(list_id, story) trello.add_label(card, label) unless label.nil? end end end |
#options ⇒ Object
Returns the options struct.
64 65 66 |
# File 'lib/pivotal_to_trello/core.rb', line 64 def @options end |