Class: MRuby::Command
- Extended by:
- Forwardable
- Includes:
- Rake::DSL
- Defined in:
- ext/enterprise_script_service/mruby/lib/mruby/build/command.rb
Defined Under Namespace
Classes: Archiver, Compiler, CrossTestRunner, Git, Gperf, Linker, Mrbc, Yacc
Constant Summary collapse
- NotFoundCommands =
{}
Instance Attribute Summary collapse
-
#build ⇒ Object
Returns the value of attribute build.
-
#command ⇒ Object
Returns the value of attribute command.
Instance Method Summary collapse
-
#clone ⇒ Object
clone is deep clone without @build.
-
#initialize(build) ⇒ Command
constructor
A new instance of Command.
- #shellquote(s) ⇒ Object
Constructor Details
#initialize(build) ⇒ Command
Returns a new instance of Command.
10 11 12 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 10 def initialize(build) @build = build end |
Instance Attribute Details
#build ⇒ Object
Returns the value of attribute build.
8 9 10 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 8 def build @build end |
#command ⇒ Object
Returns the value of attribute command.
8 9 10 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 8 def command @command end |
Instance Method Details
#clone ⇒ Object
clone is deep clone without @build
15 16 17 18 19 20 21 22 23 24 25 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 15 def clone target = super excepts = %w(@build) instance_variables.each do |attr| unless excepts.include?(attr.to_s) val = Marshal::load(Marshal.dump(instance_variable_get(attr))) # deep clone target.instance_variable_set(attr, val) end end target end |
#shellquote(s) ⇒ Object
27 28 29 30 31 32 33 |
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 27 def shellquote(s) if ENV['OS'] == 'Windows_NT' "\"#{s}\"" else "#{s}" end end |