Module: Jax::Generators::Usage::ClassMethods

Defined in:
lib/jax/generators/commands.rb

Instance Method Summary collapse

Instance Method Details

#base_pathObject



28
29
30
# File 'lib/jax/generators/commands.rb', line 28

def base_path
  @base_path || raise("Jax Command base path was not found")
end

#base_path=(path) ⇒ Object



32
33
34
# File 'lib/jax/generators/commands.rb', line 32

def base_path=(path)
  @base_path = path
end

#start(given_args = ARGV, config = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/jax/generators/commands.rb', line 15

def start(given_args=ARGV, config={})
  if (given_args.length == 0)
    puts usage
  else
    super
  end
end

#usageObject



23
24
25
26
# File 'lib/jax/generators/commands.rb', line 23

def usage
  usage = ERB.new(File.read(File.expand_path("USAGE", base_path)), nil, '-')
  usage.result(binding)
end