Class: AffirmIt::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/affirmit/commandline.rb

Class Method Summary collapse

Class Method Details

.do_not_start_automaticallyObject



15
16
17
# File 'lib/affirmit/commandline.rb', line 15

def do_not_start_automatically
  @started = true
end

.run(args = ARGV, group_hug_name = $0) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/affirmit/commandline.rb', line 19

def run(args=ARGV, group_hug_name=$0)
  do_not_start_automatically
  affirmation_classes = []
  ::ObjectSpace.each_object(Class) do |c|
    affirmation_classes << c if c < Affirmation
  end
  group_hug = GroupHug.new(group_hug_name)
  affirmation_classes.sort.each { |c| group_hug << c.group_hug }
  
  ui = AffirmIt::UI::ConsoleUI.new
  Facilitator.new(ui).embrace group_hug
end

.started?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/affirmit/commandline.rb', line 11

def started?
  @started or false
end