Class: ESRuby::Build::Configuration
- Inherits:
-
Object
- Object
- ESRuby::Build::Configuration
- Defined in:
- lib/esruby/build/configuration.rb
Instance Attribute Summary collapse
-
#appended_js_sources ⇒ Object
readonly
Returns the value of attribute appended_js_sources.
-
#build_mode ⇒ Object
Returns the value of attribute build_mode.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#gems ⇒ Object
readonly
Returns the value of attribute gems.
-
#mruby_directory ⇒ Object
Returns the value of attribute mruby_directory.
-
#output ⇒ Object
Returns the value of attribute output.
-
#prepended_js_sources ⇒ Object
readonly
Returns the value of attribute prepended_js_sources.
-
#ruby_sources ⇒ Object
readonly
Returns the value of attribute ruby_sources.
Instance Method Summary collapse
- #add_appended_js_source(path) ⇒ Object
- #add_gem(arg) ⇒ Object
- #add_prepended_js_source(path) ⇒ Object
- #add_ruby_source(path) ⇒ Object
- #build_directory ⇒ Object
- #build_directory=(new_build_directory) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #project_directory ⇒ Object
- #project_directory=(new_project_directory) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/esruby/build/configuration.rb', line 10 def initialize @project_directory = nil @build_directory = nil @mruby_directory = "#{ESRuby.gem_directory}/resources/mruby" @output = 'output.js' @ruby_sources = [] @prepended_js_sources = [] @appended_js_sources = [] @gems = [] @flags = [] end |
Instance Attribute Details
#appended_js_sources ⇒ Object (readonly)
Returns the value of attribute appended_js_sources.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def appended_js_sources @appended_js_sources end |
#build_mode ⇒ Object
Returns the value of attribute build_mode.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def build_mode @build_mode end |
#flags ⇒ Object
Returns the value of attribute flags.
8 9 10 |
# File 'lib/esruby/build/configuration.rb', line 8 def flags @flags end |
#gems ⇒ Object (readonly)
Returns the value of attribute gems.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def gems @gems end |
#mruby_directory ⇒ Object
Returns the value of attribute mruby_directory.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def mruby_directory @mruby_directory end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def output @output end |
#prepended_js_sources ⇒ Object (readonly)
Returns the value of attribute prepended_js_sources.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def prepended_js_sources @prepended_js_sources end |
#ruby_sources ⇒ Object (readonly)
Returns the value of attribute ruby_sources.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def ruby_sources @ruby_sources end |
Instance Method Details
#add_appended_js_source(path) ⇒ Object
41 42 43 |
# File 'lib/esruby/build/configuration.rb', line 41 def add_appended_js_source(path) @appended_js_sources << File.(path, project_directory) end |
#add_gem(arg) ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/esruby/build/configuration.rb', line 69 def add_gem(arg) if arg.is_a?(String) arg = File.(arg, project_directory) raise "gem #{arg} not found" unless File.directory?(arg) end @gems << arg end |
#add_prepended_js_source(path) ⇒ Object
37 38 39 |
# File 'lib/esruby/build/configuration.rb', line 37 def add_prepended_js_source(path) @prepended_js_sources << File.(path, project_directory) end |
#add_ruby_source(path) ⇒ Object
33 34 35 |
# File 'lib/esruby/build/configuration.rb', line 33 def add_ruby_source(path) @ruby_sources << File.(path, project_directory) end |
#build_directory ⇒ Object
45 46 47 |
# File 'lib/esruby/build/configuration.rb', line 45 def build_directory @build_directory || File.('build', project_directory) end |
#build_directory=(new_build_directory) ⇒ Object
49 50 51 |
# File 'lib/esruby/build/configuration.rb', line 49 def build_directory=(new_build_directory) @build_directory = File.(new_build_directory, project_directory) end |
#project_directory ⇒ Object
22 23 24 25 |
# File 'lib/esruby/build/configuration.rb', line 22 def project_directory raise "'project_directory' not set" unless @project_directory @project_directory end |
#project_directory=(new_project_directory) ⇒ Object
27 28 29 30 31 |
# File 'lib/esruby/build/configuration.rb', line 27 def project_directory=(new_project_directory) new_project_directory = File.(new_project_directory) raise "'project_directory' not found" unless File.directory?(new_project_directory) @project_directory = new_project_directory end |