Permalink
Browse files

Use configuration when running lints

  • Loading branch information...
1 parent 6986c37 commit fadc801d121a71df1acadc0970f0b4ef96469c6c @solnic solnic committed Feb 15, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −0 .pelusa.yml
  2. +9 −1 lib/pelusa.rb
  3. +3 −1 lib/pelusa/cli.rb
View
@@ -0,0 +1 @@
+sources: lib/**/*.rb
View
@@ -2,12 +2,20 @@ module Pelusa
# Public: Runs the runner on a set of files.
#
# Returns an Array of results of a given Reporter
- def self.run(files=[], reporter=StdoutReporter, lints=Lint.all)
+ def self.run(files=[], reporter=StdoutReporter)
+ lints = configuration.enabled_lints
runner = Runner.new(lints, reporter)
runner.run(files)
end
+
+ # Return configuration
+ def self.configuration
+ @configuration ||= Configuration.new
+ end
end
+require 'yaml'
+
require 'pelusa/configuration'
require 'pelusa/cli'
require 'pelusa/runner'
View
@@ -21,7 +21,9 @@ def files
if glob = @args.detect { |arg| arg =~ /\*/ }
return Dir[glob]
end
- @args.select { |arg| arg =~ /\.rb/ }
+ _files = @args.select { |arg| arg =~ /\.rb/ }
+ _files = Dir[Pelusa.configuration.sources] if _files.empty?
+ _files
end
end
end

0 comments on commit fadc801

Please sign in to comment.