Module: Bgem::New

Defined in:
lib/bgem/lib.rb,
lib/bgem/new.rb,
lib/bgem/print_help.rb

Defined Under Namespace

Classes: Lib

Class Method Summary collapse

Class Method Details



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bgem/print_help.rb', line 3

def self.print_help
  puts "    A CLI to generate new Bgem projects.\n\n    Usage:\n      bgem-new TYPE NAME\n      \n      For example:\n        bgem-new lib SomeConstant\n\n      TYPE: the type of the project to be generated.\n            Possible values:\n              lib\n              cli\n      NAME: the name of the constant to be worked on in the project.\n            Nested constants should be given using ':' as a delimiter.\n            \n            For example:\n              Constant\n              Constant:InSomeNested:Namespace\n  S\nend\n"

.runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bgem/new.rb', line 3

def self.run
  command, name = ARGV

  case command
  when nil
    require_relative 'print_help'
    print_help
  when 'lib'
    require_relative 'lib'
    Lib.new name
  when 'cli'
    p 'Not implemented yet.'
  else
    p "Unknown command #{command}."
  end
end