Class: Moses::Application

Inherits:
Object
  • Object
show all
Includes:
Moses
Defined in:
lib/moses/application.rb

Constant Summary

Constants included from Moses

HELP_FILE, VERSION_FILE

Instance Attribute Summary collapse

Attributes included from Moses

#args, #command, #default_command, #default_option_commands, #options

Instance Method Summary collapse

Methods included from Moses

#default_commands, included, #output, #run

Constructor Details

#initialize(root_path = Dir.getwd) ⇒ Application

Returns a new instance of Application.



10
11
12
# File 'lib/moses/application.rb', line 10

def initialize(root_path = Dir.getwd)
  @root_path = root_path
end

Instance Attribute Details

#root_pathObject (readonly)

Returns the value of attribute root_path.



8
9
10
# File 'lib/moses/application.rb', line 8

def root_path
  @root_path
end

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/moses/application.rb', line 14

def create
  if @args.first
    @app_name = @args.first
    create_app_dir
    create_help_file
    create_version_file
    create_bin_dir
    create_bin_file
    create_lib_dir
    create_application_class
  else
    output.puts "You need to name your application: moses create myapp"
  end
end