Class: Hotspots::Main
- Inherits:
-
Object
- Object
- Hotspots::Main
- Defined in:
- lib/hotspots.rb
Instance Attribute Summary collapse
-
#cutoff ⇒ Object
readonly
Returns the value of attribute cutoff.
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#exit_strategy ⇒ Object
readonly
Returns the value of attribute exit_strategy.
-
#file_filter ⇒ Object
readonly
Returns the value of attribute file_filter.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#message_filters ⇒ Object
readonly
Returns the value of attribute message_filters.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(opts = nil) ⇒ Main
constructor
TODO : change this signature - this method should get resolved options as parameters initialize is not responsible for invoking option parsing.
- #output ⇒ Object (also: #execute!)
-
#run ⇒ Object
TODO : this method should be private.
-
#set ⇒ Object
TODO : this method should be private.
-
#validate ⇒ Object
(also: #validate!)
TODO : this method should be private.
Constructor Details
#initialize(opts = nil) ⇒ Main
TODO : change this signature - this method should get resolved options as parameters initialize is not responsible for invoking option parsing
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hotspots.rb', line 15 def initialize(opts = nil) = opts.nil? ? Hotspots::OptionsParser.new.parse(*ARGV) : Hotspots::OptionsParser..merge(opts) @logger = Hotspots::Logger.new @repository = [:repository] @verbose = [:verbose] @exit_strategy = [:exit_strategy] @time = [:time] @message_filters = [:message_filters] @file_filter = [:file_filter] @cutoff = [:cutoff] end |
Instance Attribute Details
#cutoff ⇒ Object (readonly)
Returns the value of attribute cutoff.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def cutoff @cutoff end |
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def driver @driver end |
#exit_strategy ⇒ Object (readonly)
Returns the value of attribute exit_strategy.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def exit_strategy @exit_strategy end |
#file_filter ⇒ Object (readonly)
Returns the value of attribute file_filter.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def file_filter @file_filter end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def logger @logger end |
#message_filters ⇒ Object (readonly)
Returns the value of attribute message_filters.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def @message_filters end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def parser @parser end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def repository @repository end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def store @store end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def time @time end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
9 10 11 |
# File 'lib/hotspots.rb', line 9 def verbose @verbose end |
Instance Method Details
#output ⇒ Object Also known as: execute!
29 30 31 32 33 |
# File 'lib/hotspots.rb', line 29 def output validate set run end |
#run ⇒ Object
TODO : this method should be private
49 50 51 |
# File 'lib/hotspots.rb', line 49 def run #:nodoc: puts store.to_s end |
#set ⇒ Object
TODO : this method should be private
42 43 44 45 46 |
# File 'lib/hotspots.rb', line 42 def set #:nodoc: set_logger_if_verbose set_path assign end |
#validate ⇒ Object Also known as: validate!
TODO : this method should be private
36 37 38 39 |
# File 'lib/hotspots.rb', line 36 def validate #:nodoc: exit_if_not_git_repository end |