Class: Yapt::Runner

Inherits:
Boson::Runner
  • Object
show all
Defined in:
lib/yapt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunner

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_timeObject (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")

  permission = ask("Make this move?  ").downcase
  if %w(y yes).include?(permission)
    mover.execute!
    puts "Moved!"
  else
    puts "Aborted. Oh well."
  end
end

#open(id = nil) ⇒ Object



101
102
103
# File 'lib/yapt.rb', line 101

def open(id = nil)
 system_open Story.just_url(id)
end

#show(id) ⇒ Object



96
97
98
99
# File 'lib/yapt.rb', line 96

def show(id)
  @story = Story.find(id)
  output View.new([@story]).display("detail")
end