Class: Mirah::Util::CompilationState
- Inherits:
-
Object
- Object
- Mirah::Util::CompilationState
- Defined in:
- lib/mirah/util/compilation_state.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#bootclasspath ⇒ Object
Returns the value of attribute bootclasspath.
-
#bytecode_version ⇒ Object
readonly
Returns the value of attribute bytecode_version.
-
#classpath ⇒ Object
Returns the value of attribute classpath.
-
#command ⇒ Object
Returns the value of attribute command.
-
#compiler_class ⇒ Object
Returns the value of attribute compiler_class.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#help_printed ⇒ Object
Returns the value of attribute help_printed.
-
#loggers ⇒ Object
Returns the value of attribute loggers.
-
#running ⇒ Object
(also: #running?)
Returns the value of attribute running.
-
#save_extensions ⇒ Object
Returns the value of attribute save_extensions.
-
#target_jvm_version ⇒ Object
readonly
Returns the value of attribute target_jvm_version.
-
#type_system ⇒ Object
Returns the value of attribute type_system.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#version_printed ⇒ Object
Returns the value of attribute version_printed.
Instance Method Summary collapse
-
#initialize ⇒ CompilationState
constructor
A new instance of CompilationState.
- #set_jvm_version(ver_str) ⇒ Object
- #supports_invokedynamic? ⇒ Boolean
Constructor Details
#initialize ⇒ CompilationState
Returns a new instance of CompilationState.
21 22 23 24 |
# File 'lib/mirah/util/compilation_state.rb', line 21 def initialize @save_extensions = true set_jvm_version ENV_JAVA['java.specification.version'] end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
33 34 35 |
# File 'lib/mirah/util/compilation_state.rb', line 33 def args @args end |
#bootclasspath ⇒ Object
Returns the value of attribute bootclasspath.
38 39 40 |
# File 'lib/mirah/util/compilation_state.rb', line 38 def bootclasspath @bootclasspath end |
#bytecode_version ⇒ Object (readonly)
Returns the value of attribute bytecode_version.
39 40 41 |
# File 'lib/mirah/util/compilation_state.rb', line 39 def bytecode_version @bytecode_version end |
#classpath ⇒ Object
Returns the value of attribute classpath.
38 39 40 |
# File 'lib/mirah/util/compilation_state.rb', line 38 def classpath @classpath end |
#command ⇒ Object
Returns the value of attribute command.
34 35 36 |
# File 'lib/mirah/util/compilation_state.rb', line 34 def command @command end |
#compiler_class ⇒ Object
Returns the value of attribute compiler_class.
32 33 34 |
# File 'lib/mirah/util/compilation_state.rb', line 32 def compiler_class @compiler_class end |
#destination ⇒ Object
Returns the value of attribute destination.
26 27 28 |
# File 'lib/mirah/util/compilation_state.rb', line 26 def destination @destination end |
#help_printed ⇒ Object
Returns the value of attribute help_printed.
28 29 30 |
# File 'lib/mirah/util/compilation_state.rb', line 28 def help_printed @help_printed end |
#loggers ⇒ Object
Returns the value of attribute loggers.
35 36 37 |
# File 'lib/mirah/util/compilation_state.rb', line 35 def loggers @loggers end |
#running ⇒ Object Also known as: running?
Returns the value of attribute running.
30 31 32 |
# File 'lib/mirah/util/compilation_state.rb', line 30 def running @running end |
#save_extensions ⇒ Object
Returns the value of attribute save_extensions.
29 30 31 |
# File 'lib/mirah/util/compilation_state.rb', line 29 def save_extensions @save_extensions end |
#target_jvm_version ⇒ Object (readonly)
Returns the value of attribute target_jvm_version.
39 40 41 |
# File 'lib/mirah/util/compilation_state.rb', line 39 def target_jvm_version @target_jvm_version end |
#type_system ⇒ Object
Returns the value of attribute type_system.
36 37 38 |
# File 'lib/mirah/util/compilation_state.rb', line 36 def type_system @type_system end |
#verbose ⇒ Object
Returns the value of attribute verbose.
26 27 28 |
# File 'lib/mirah/util/compilation_state.rb', line 26 def verbose @verbose end |
#version_printed ⇒ Object
Returns the value of attribute version_printed.
27 28 29 |
# File 'lib/mirah/util/compilation_state.rb', line 27 def version_printed @version_printed end |
Instance Method Details
#set_jvm_version(ver_str) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mirah/util/compilation_state.rb', line 41 def set_jvm_version(ver_str) @target_jvm_version = ver_str @bytecode_version = case ver_str when '1.4' then BiteScript::JAVA1_4 when '1.5' then BiteScript::JAVA1_5 when '1.6' then BiteScript::JAVA1_6 when '1.7' then BiteScript::JAVA1_7 when '1.8' then BiteScript::JAVA1_8 else $stderr.puts "invalid bytecode version specified: #{ver_str}" end BiteScript.bytecode_version = @bytecode_version end |
#supports_invokedynamic? ⇒ Boolean
55 56 57 |
# File 'lib/mirah/util/compilation_state.rb', line 55 def supports_invokedynamic? @bytecode_version == BiteScript::JAVA1_7 end |