From afdb5f423502ba6ed07c033729b5e5b1735024fb Mon Sep 17 00:00:00 2001 From: Tam Grosser Date: Sat, 19 Nov 2016 13:55:34 -0800 Subject: [PATCH] make sub classing flay work --- lib/flay.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/flay.rb b/lib/flay.rb index 288a000..8f854bb 100755 --- a/lib/flay.rb +++ b/lib/flay.rb @@ -27,13 +27,13 @@ class Location < Struct.new(:file, :line, :fuzzy) end def self.run args = ARGV - extensions = ["rb"] + Flay.load_plugins + extensions = ["rb"] + load_plugins glob = "**/*.{#{extensions.join ","}}" expander = PathExpander.new args, glob files = expander.filter_files expander.process, DEFAULT_IGNORE - flay = Flay.new Flay.parse_options args + flay = new parse_options args flay.process(*files) flay end @@ -63,7 +63,7 @@ def self.parse_options args = ARGV OptionParser.new do |opts| opts.banner = "flay [options] files_or_dirs" - opts.version = Flay::VERSION + opts.version = ERSION opts.separator "" opts.separator "Specific options:" @@ -113,7 +113,7 @@ def self.parse_options args = ARGV options[:timeout] = t.to_i end - extensions = ["rb"] + Flay.load_plugins + extensions = ["rb"] + load_plugins opts.separator "" opts.separator "Known extensions: #{extensions.join(", ")}" @@ -170,7 +170,7 @@ def self.load_plugins # Create a new instance of Flay with +option+s. def initialize option = nil - @option = option || Flay.default_options + @option = option || self.class.default_options @hashes = Hash.new { |h,k| h[k] = [] } self.identical = {}