Module: CappRuby

Defined in:
lib/cappruby/app_builder.rb,
lib/cappruby.rb,
lib/cappruby/ruby_builder.rb,
lib/cappruby/app_generator.rb,
lib/cappruby/framework_builder.rb

Overview

framework.rb cappruby

Created by Adam Beynon. Copyright 2010 Adam Beynon.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Classes: AppBuilder, AppGenerator, FrameworkBuilder, RubyBuilder

Constant Summary collapse

ROOTPATH =
File.join(File.dirname(__FILE__), '..')

Class Method Summary collapse

Class Method Details



67
68
69
# File 'lib/cappruby.rb', line 67

def self.print_usage
  puts "Usage: cappruby gen <app name>"
end

.require_libsObject



71
72
73
74
# File 'lib/cappruby.rb', line 71

def self.require_libs
  libs = File.join(File.dirname(__FILE__), 'cappruby', '**', '*.rb')
  Dir.glob(libs).each { |f| require f }
end

.tools(args) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cappruby.rb', line 37

def self.tools(args)
  
  cmd = args.shift
  if cmd.nil? || cmd == "-h" || cmd == '--help'
    print_usage
    exit
  end
  
  case cmd
  when "gen"
    if args.length == 0
      print_usage 
      exit
    end
    
    require_libs
    AppGenerator.new(args).gen!
  when "build"
    
    require_libs
    AppBuilder.new(args).build!
  when "-f"
    puts "update frameworks"
  else
    print_usage
    exit
  end
  
end