Class: Waffle::Maker::Filter
- Inherits:
-
Object
- Object
- Waffle::Maker::Filter
- Defined in:
- lib/waffle/maker.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
#initialize(argv) ⇒ Filter
Returns a new instance of Filter.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/waffle/maker.rb', line 30 def initialize(argv) ( = Waffle::Maker::Config.).tap do || OptionParser.new { |o| o. = "Usage: #{$0}" o.on("-f number", "Column number that contains the rails path") { |v| [:f] << v.to_i } o.on("-w number", "Column number that contains the waf path") { |v| [:w] << v.to_i } o.on("--silent-error", "Hide parsing errors, default is false") { |v| [:silent_error] << v } }.parse!(argv) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
22 23 24 |
# File 'lib/waffle/maker.rb', line 22 def end |
Class Method Details
.execute ⇒ Object
25 26 27 |
# File 'lib/waffle/maker.rb', line 25 def execute Waffle::Maker::Filter.new(ARGV.dup).execute end |
Instance Method Details
#execute ⇒ Object
41 42 43 44 45 |
# File 'lib/waffle/maker.rb', line 41 def execute wafs.each do |waf| puts waf[:raw] if Waffle::Maker::Matcher.new(waf[:path], routes).matched? end end |