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.



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

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

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



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

def app_name
  @app_name
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



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

def root_path
  @root_path
end

Instance Method Details

#createObject



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

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