Class: MrHyde::Toolii
- Inherits:
-
Object
- Object
- MrHyde::Toolii
- Extended by:
- GLI::App
- Defined in:
- lib/mrhyde/cli/main.rb
Overview
NOTE: gli added function are class methods (thus, wrap class Toolii in Tool for now)
Class Method Summary collapse
- .fetch_script(name) ⇒ Object
- .logger ⇒ Object
- .logger=(value) ⇒ Object
- .opts ⇒ Object
-
.opts=(value) ⇒ Object
todo: find a better name e.g.
Instance Method Summary collapse
-
#verbose ⇒ Object
todo: use -w for short form? check ruby interpreter if in use too?.
Class Method Details
.fetch_script(name) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mrhyde/cli/main.rb', line 50 def self.fetch_script( name ) ## first try local version in working folder text = '' local_script = "./#{name}.rb" if File.exist?( local_script ) text = File.read_utf8( local_script ) else ## fetch remote script url = "https://github.com/mrhydescripts/scripts/raw/master/#{name}.rb" puts "GET #{url}" ## todo - add color e.g. .bold.green ## assume utf8 text encoding for now worker = Fetcher::Worker.new text = worker.read_utf8!( url ) end text end |
.logger ⇒ Object
25 |
# File 'lib/mrhyde/cli/main.rb', line 25 def self.logger() @@logger; end |
.logger=(value) ⇒ Object
24 |
# File 'lib/mrhyde/cli/main.rb', line 24 def self.logger=(value) @@logger=value; end |
.opts ⇒ Object
29 |
# File 'lib/mrhyde/cli/main.rb', line 29 def self.opts() @@opts; end |
.opts=(value) ⇒ Object
todo: find a better name e.g. change to settings? config? safe_opts? why? why not?
28 |
# File 'lib/mrhyde/cli/main.rb', line 28 def self.opts=(value) @@opts = value; end |
Instance Method Details
#verbose ⇒ Object
todo: use -w for short form? check ruby interpreter if in use too?
44 |
# File 'lib/mrhyde/cli/main.rb', line 44 switch [:verbose], negatable: false |