Class: MisterBin::Runner
- Inherits:
-
Object
- Object
- MisterBin::Runner
- Defined in:
- lib/mister_bin/runner.rb
Instance Attribute Summary collapse
-
#basedir ⇒ Object
readonly
Returns the value of attribute basedir.
-
#basefile ⇒ Object
readonly
Returns the value of attribute basefile.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(basefile) ⇒ Runner
constructor
A new instance of Runner.
- #run(argv = []) ⇒ Object
Constructor Details
#initialize(basefile) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 13 |
# File 'lib/mister_bin/runner.rb', line 9 def initialize(basefile) @basefile = basefile @basedir = File.dirname basefile @name = File.basename basefile end |
Instance Attribute Details
#basedir ⇒ Object (readonly)
Returns the value of attribute basedir.
3 4 5 |
# File 'lib/mister_bin/runner.rb', line 3 def basedir @basedir end |
#basefile ⇒ Object (readonly)
Returns the value of attribute basefile.
3 4 5 |
# File 'lib/mister_bin/runner.rb', line 3 def basefile @basefile end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mister_bin/runner.rb', line 3 def name @name end |
Class Method Details
.run(basefile, argv = []) ⇒ Object
5 6 7 |
# File 'lib/mister_bin/runner.rb', line 5 def self.run(basefile, argv=[]) new(basefile).run argv end |
Instance Method Details
#run(argv = []) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/mister_bin/runner.rb', line 15 def run(argv=[]) if argv.empty? show_subs else execute argv end end |