Class: Kompo::Option
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#cache_bundle_path ⇒ Object
Returns the value of attribute cache_bundle_path.
-
#compress ⇒ Object
Returns the value of attribute compress.
-
#context ⇒ Object
Returns the value of attribute context.
-
#dest_dir ⇒ Object
Returns the value of attribute dest_dir.
-
#entrypoint ⇒ Object
Returns the value of attribute entrypoint.
-
#gemfile ⇒ Object
Returns the value of attribute gemfile.
-
#output ⇒ Object
Returns the value of attribute output.
-
#ruby_src_path ⇒ Object
Returns the value of attribute ruby_src_path.
-
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
-
#stdlib ⇒ Object
Returns the value of attribute stdlib.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(dir = Dir.getwd, opt = OptionParser.new) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(dir = Dir.getwd, opt = OptionParser.new) ⇒ Option
Returns a new instance of Option.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kompo.rb', line 18 def initialize(dir = Dir.getwd, opt = OptionParser.new) @entrypoint = File.join(dir, 'main.rb') @output = File.basename(dir) @gemfile = true @stdlib = true @dest_dir = dir @ruby_src_path = nil @cache_bundle_path = nil @ruby_version = "v#{RUBY_VERSION.gsub('.', '_')}" @compress = false @context = dir @opt = opt end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
15 16 17 |
# File 'lib/kompo.rb', line 15 def args @args end |
#cache_bundle_path ⇒ Object
Returns the value of attribute cache_bundle_path.
15 16 17 |
# File 'lib/kompo.rb', line 15 def cache_bundle_path @cache_bundle_path end |
#compress ⇒ Object
Returns the value of attribute compress.
15 16 17 |
# File 'lib/kompo.rb', line 15 def compress @compress end |
#context ⇒ Object
Returns the value of attribute context.
15 16 17 |
# File 'lib/kompo.rb', line 15 def context @context end |
#dest_dir ⇒ Object
Returns the value of attribute dest_dir.
15 16 17 |
# File 'lib/kompo.rb', line 15 def dest_dir @dest_dir end |
#entrypoint ⇒ Object
Returns the value of attribute entrypoint.
15 16 17 |
# File 'lib/kompo.rb', line 15 def entrypoint @entrypoint end |
#gemfile ⇒ Object
Returns the value of attribute gemfile.
15 16 17 |
# File 'lib/kompo.rb', line 15 def gemfile @gemfile end |
#output ⇒ Object
Returns the value of attribute output.
15 16 17 |
# File 'lib/kompo.rb', line 15 def output @output end |
#ruby_src_path ⇒ Object
Returns the value of attribute ruby_src_path.
15 16 17 |
# File 'lib/kompo.rb', line 15 def ruby_src_path @ruby_src_path end |
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
15 16 17 |
# File 'lib/kompo.rb', line 15 def ruby_version @ruby_version end |
#stdlib ⇒ Object
Returns the value of attribute stdlib.
15 16 17 |
# File 'lib/kompo.rb', line 15 def stdlib @stdlib end |
Instance Method Details
#build ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/kompo.rb', line 33 def build @opt.parse!(ARGV) @args = convert_absolute_path_for ARGV self end |