Class: Webruby::Config
- Inherits:
-
Object
- Object
- Webruby::Config
- Defined in:
- lib/webruby/config.rb
Instance Attribute Summary collapse
-
#append_file ⇒ Object
Returns the value of attribute append_file.
-
#build_dir ⇒ Object
Returns the value of attribute build_dir.
-
#cflags ⇒ Object
Returns the value of attribute cflags.
-
#compile_mode ⇒ Object
Returns the value of attribute compile_mode.
-
#entrypoint ⇒ Object
Returns the value of attribute entrypoint.
-
#ldflags ⇒ Object
Returns the value of attribute ldflags.
-
#loading_mode ⇒ Object
Returns the value of attribute loading_mode.
-
#output_name ⇒ Object
Returns the value of attribute output_name.
-
#selected_gemboxes ⇒ Object
Returns the value of attribute selected_gemboxes.
-
#selected_gems ⇒ Object
Returns the value of attribute selected_gems.
-
#source_processor ⇒ Object
Returns the value of attribute source_processor.
-
#static_libs ⇒ Object
Returns the value of attribute static_libs.
Instance Method Summary collapse
- #gem(g) ⇒ Object
- #gem_lines ⇒ Object
- #gembox(gb) ⇒ Object
- #gembox_lines ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #is_release_mode ⇒ Object
- #optimization_flag ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/webruby/config.rb', line 7 def initialize @entrypoint = 'app/app.rb' @build_dir = 'build' @selected_gemboxes = ['default'] @selected_gems = [] @compile_mode = 'debug' # debug or release @loading_mode = 2 @output_name = 'webruby.js' @source_processor = :mrubymix @cflags = %w(-Wall -Werror-implicit-function-declaration -Wno-warn-absolute-paths) + [optimization_flag] @ldflags = [] @static_libs = [] end |
Instance Attribute Details
#append_file ⇒ Object
Returns the value of attribute append_file.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def append_file @append_file end |
#build_dir ⇒ Object
Returns the value of attribute build_dir.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def build_dir @build_dir end |
#cflags ⇒ Object
Returns the value of attribute cflags.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def cflags @cflags end |
#compile_mode ⇒ Object
Returns the value of attribute compile_mode.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def compile_mode @compile_mode end |
#entrypoint ⇒ Object
Returns the value of attribute entrypoint.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def entrypoint @entrypoint end |
#ldflags ⇒ Object
Returns the value of attribute ldflags.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def ldflags @ldflags end |
#loading_mode ⇒ Object
Returns the value of attribute loading_mode.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def loading_mode @loading_mode end |
#output_name ⇒ Object
Returns the value of attribute output_name.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def output_name @output_name end |
#selected_gemboxes ⇒ Object
Returns the value of attribute selected_gemboxes.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def selected_gemboxes @selected_gemboxes end |
#selected_gems ⇒ Object
Returns the value of attribute selected_gems.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def selected_gems @selected_gems end |
#source_processor ⇒ Object
Returns the value of attribute source_processor.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def source_processor @source_processor end |
#static_libs ⇒ Object
Returns the value of attribute static_libs.
3 4 5 |
# File 'lib/webruby/config.rb', line 3 def static_libs @static_libs end |
Instance Method Details
#gem(g) ⇒ Object
29 30 31 |
# File 'lib/webruby/config.rb', line 29 def gem(g) selected_gems << g end |
#gem_lines ⇒ Object
41 42 43 |
# File 'lib/webruby/config.rb', line 41 def gem_lines generate_conf_lines(selected_gems, 'gem') end |
#gembox(gb) ⇒ Object
33 34 35 |
# File 'lib/webruby/config.rb', line 33 def gembox(gb) selected_gemboxes << gb end |
#gembox_lines ⇒ Object
37 38 39 |
# File 'lib/webruby/config.rb', line 37 def gembox_lines generate_conf_lines(selected_gemboxes, 'gembox') end |
#is_release_mode ⇒ Object
21 22 23 |
# File 'lib/webruby/config.rb', line 21 def is_release_mode compile_mode == 'release' end |
#optimization_flag ⇒ Object
25 26 27 |
# File 'lib/webruby/config.rb', line 25 def optimization_flag is_release_mode ? "-O2" : "-O0" end |