class HappySeed::Cli

Public Instance Methods

engine( *args ) click to toggle source
# File lib/happy_seed/cli.rb, line 24
def engine( *args )
  require 'generators/happy_seed/plugin/plugin_generator'
  ARGV << "--mountable"
  HappySeed::Generators::PluginGenerator.start
end
plugin( *args ) click to toggle source
# File lib/happy_seed/cli.rb, line 18
def plugin( *args )
  require 'generators/happy_seed/plugin/plugin_generator'
  HappySeed::Generators::PluginGenerator.start
end
rails( *args ) click to toggle source
# File lib/happy_seed/cli.rb, line 12
def rails( *args )
  seedrb = gem_file_path( "happy_seed.rb")
  system "rails new -m #{seedrb} #{args.join( " " )} --skip-turbolinks --skip-test-unit"
end
reference() click to toggle source
# File lib/happy_seed/cli.rb, line 43
def reference    
  puts File.read( File.expand_path( "../../happy_seed.txt", File.dirname( __FILE__ ) ) )   
end
static( name ) click to toggle source
# File lib/happy_seed/cli.rb, line 31
def static( name )
  require 'generators/happy_seed/static/static_generator'
  HappySeed::Generators::StaticGenerator.start
end
static_blog( name ) click to toggle source
# File lib/happy_seed/cli.rb, line 37
def static_blog( name )
  require 'generators/happy_seed/static_blog/static_blog_generator'
  HappySeed::Generators::StaticBlogGenerator.start
end
version() click to toggle source
# File lib/happy_seed/cli.rb, line 7
def version
  puts "You are running seed version #{HappySeed::VERSION}"
end

Private Instance Methods

gem_file_path( filename ) click to toggle source
# File lib/happy_seed/cli.rb, line 48
def gem_file_path( filename )
  spec = Gem::Specification.find_by_name("happy_seed")
  gem_root = spec.gem_dir

  File.join( gem_root, filename )
end