Class: PhoneGap::Builder
- Inherits:
-
Object
- Object
- PhoneGap::Builder
- Defined in:
- lib/phonegap/builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#build_path ⇒ Object
readonly
Returns the value of attribute build_path.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#web_path ⇒ Object
readonly
Returns the value of attribute web_path.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
- #generate ⇒ Object
-
#initialize(path, options) ⇒ Builder
constructor
A new instance of Builder.
- #process ⇒ Object
Constructor Details
#initialize(path, options) ⇒ Builder
Returns a new instance of Builder.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/phonegap/builder.rb', line 23 def initialize(path, ) @options = @path = Pathname.new(path) @web_path = @path.join("public") if @path.join("public").exist? @web_path = @path.join("www") if @path.join("www").exist? if !@web_path && @path.exist? @web_path = @path.dup @path = @path.parent end @build_path = @path.join("build", platform) @build_path.mkpath end |
Instance Attribute Details
#build_path ⇒ Object (readonly)
Returns the value of attribute build_path.
21 22 23 |
# File 'lib/phonegap/builder.rb', line 21 def build_path @build_path end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/phonegap/builder.rb', line 21 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'lib/phonegap/builder.rb', line 21 def path @path end |
#web_path ⇒ Object (readonly)
Returns the value of attribute web_path.
21 22 23 |
# File 'lib/phonegap/builder.rb', line 21 def web_path @web_path end |
Class Method Details
.platform ⇒ Object
12 13 14 |
# File 'lib/phonegap/builder.rb', line 12 def platform @platform end |
.process(path, options) ⇒ Object
16 17 18 |
# File 'lib/phonegap/builder.rb', line 16 def process(path, ) self.new(path, ).process end |
Instance Method Details
#build ⇒ Object
48 49 50 |
# File 'lib/phonegap/builder.rb', line 48 def build raise "Implement" end |
#generate ⇒ Object
44 45 46 |
# File 'lib/phonegap/builder.rb', line 44 def generate raise "Implement" end |
#process ⇒ Object
39 40 41 42 |
# File 'lib/phonegap/builder.rb', line 39 def process generate if [:generate] build if [:build] end |