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_directory ⇒ Object
Returns the value of attribute build_directory.
-
#build_mode ⇒ Object
Returns the value of attribute build_mode.
-
#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
-
#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.
9 10 11 12 13 14 15 16 17 |
# File 'lib/esruby/build/configuration.rb', line 9 def initialize @project_directory = nil @mruby_directory = "#{ESRuby.gem_directory}/resources/mruby" @output = 'output.js' @ruby_sources = [] @prepended_js_sources = [] @appended_js_sources = [] @gems = [] 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_directory ⇒ Object
Returns the value of attribute build_directory.
5 6 7 |
# File 'lib/esruby/build/configuration.rb', line 5 def build_directory @build_directory 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 |
#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
38 39 40 |
# File 'lib/esruby/build/configuration.rb', line 38 def add_appended_js_source(path) @appended_js_sources << File.(path, project_directory) end |
#add_gem(arg) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/esruby/build/configuration.rb', line 62 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
34 35 36 |
# File 'lib/esruby/build/configuration.rb', line 34 def add_prepended_js_source(path) @prepended_js_sources << File.(path, project_directory) end |
#add_ruby_source(path) ⇒ Object
30 31 32 |
# File 'lib/esruby/build/configuration.rb', line 30 def add_ruby_source(path) @ruby_sources << File.(path, project_directory) end |
#project_directory ⇒ Object
19 20 21 22 |
# File 'lib/esruby/build/configuration.rb', line 19 def project_directory raise "'project_directory' not set" unless @project_directory @project_directory end |
#project_directory=(new_project_directory) ⇒ Object
24 25 26 27 28 |
# File 'lib/esruby/build/configuration.rb', line 24 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 |