Class: Yapt::Runner
- Inherits:
-
Boson::Runner
- Object
- Boson::Runner
- Yapt::Runner
- Defined in:
- lib/yapt.rb
Instance Attribute Summary collapse
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Instance Method Summary collapse
- #git(since_until) ⇒ Object
- #images(id) ⇒ Object
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #list(*args) ⇒ Object
- #move(id, destination) ⇒ Object
- #open(id = nil) ⇒ Object
- #show(id) ⇒ Object
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
79 80 81 82 |
# File 'lib/yapt.rb', line 79 def initialize @start_time = Time.now super end |
Instance Attribute Details
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
78 79 80 |
# File 'lib/yapt.rb', line 78 def start_time @start_time end |
Instance Method Details
#git(since_until) ⇒ Object
84 85 86 87 |
# File 'lib/yapt.rb', line 84 def git(since_until) commits = GitLogShiv.find(since_until) output GitView.new(commits).display("git") end |
#images(id) ⇒ Object
105 106 107 |
# File 'lib/yapt.rb', line 105 def images(id) system_open Story.images_url(id) end |
#list(*args) ⇒ Object
89 90 91 92 93 94 |
# File 'lib/yapt.rb', line 89 def list(*args) display_config = View.extract_display_config(args) @stories = Story.find(args) display_config ||= (@stories.length > 1) ? "simple" : "detail" output View.new(@stories).display(display_config) end |
#move(id, destination) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/yapt.rb', line 109 def move(id, destination) mover = Move.setup(id, destination) puts puts mover.description puts View.new([mover.to_move, mover.target]).display("simple") = ask("Make this move? ").downcase if %w(y yes).include?() mover.execute! puts "Moved!" else puts "Aborted. Oh well." end end |