Class: Sammy::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/sammy/install/install_generator.rb

Constant Summary collapse

@@default_version =
"0.6.2"

Instance Method Summary collapse

Instance Method Details

#download_sammyObject



9
10
11
12
13
14
15
16
# File 'lib/generators/sammy/install/install_generator.rb', line 9

def download_sammy
  say_status("fetching", "Sammy #{options.version}", :green)
  get_sammy(options.version)
rescue OpenURI::HTTPError
  say_status("warning", "could not find Sammy #{options.version}", :yellow)
  say_status("fetching", "Sammy #{@@default_version}", :green)
  get_sammy(@@default_version)
end