Class: TrelloFlow::Main
- Inherits:
-
Object
- Object
- TrelloFlow::Main
- Defined in:
- lib/trello_flow/main.rb
Instance Method Summary collapse
- #cleanup ⇒ Object
- #finish(options = {}) ⇒ Object
-
#initialize(global_config = GlobalConfig.new, local_config = LocalConfig.new) ⇒ Main
constructor
A new instance of Main.
- #open ⇒ Object
- #start(name) ⇒ Object
Constructor Details
#initialize(global_config = GlobalConfig.new, local_config = LocalConfig.new) ⇒ Main
Returns a new instance of Main.
7 8 9 10 |
# File 'lib/trello_flow/main.rb', line 7 def initialize(global_config = GlobalConfig.new, local_config = LocalConfig.new) Api::Base.configure(key: global_config.key, token: global_config.token) @local_config = local_config end |
Instance Method Details
#cleanup ⇒ Object
32 33 34 |
# File 'lib/trello_flow/main.rb', line 32 def cleanup Cleanup.new(Branch.current.target).run end |
#finish(options = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/trello_flow/main.rb', line 26 def finish( = {}) branch = Branch.current branch.push branch.open_pull_request() end |
#open ⇒ Object
22 23 24 |
# File 'lib/trello_flow/main.rb', line 22 def open Branch.current.open_trello(local_config) end |
#start(name) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/trello_flow/main.rb', line 12 def start(name) Cli.error "Your `trello_flow` version is out of date. Please run `gem update trello_flow`." unless Version.latest? card = create_or_pick_card(name) card.add_member(current_user) card.start Branch.from_card(user: current_user, card: card).checkout rescue Api::Error => error Cli.error(error.) end |