Class: Thunderstorm::Lightning

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/thunderstorm/cli.rb

Instance Method Summary collapse

Instance Method Details

#boltObject



11
12
13
14
# File 'lib/thunderstorm/cli.rb', line 11

def bolt()
  install('thunderstorm.yml')
  system('dream sleep')
end

#rain(thunderstorm, dream) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/thunderstorm/cli.rb', line 16

def rain(thunderstorm,dream)
  if !File.exist?(thunderstorm)
    puts 'Error: Unable to locate thunderstorm.yml'
    puts 'Shutting down...'
  elsif !File.exists?(dream)
    puts 'Error: Unable to locate dream.yml'
    puts 'Shutting down...'
  else
    thunder = Thunderstorm::Cloud.new(YAML::load_file(thunderstorm),YAML::load_file(dream))
    thunder.rain()
    puts thunder.shine()
  end
end