Module: CappRuby

Defined in:
lib/cappruby/app_builder.rb,
lib/cappruby.rb,
lib/cappruby/ruby_builder.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, FrameworkBuilder, RubyBuilder

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.gen(args) ⇒ Object



64
65
66
# File 'lib/cappruby.rb', line 64

def self.gen(args)
  puts "gen.."
end


60
61
62
# File 'lib/cappruby.rb', line 60

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

.require_libsObject



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

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
# 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"
    gen args
  when "build"
    require_libs
    AppBuilder.new(args).build!
  when "-f"
    puts "update frameworks"
  else
    print_usage
    exit
  end
  
end