Skip to content
Browse files

Allow options specified in ./.cane to be added to a rake task

  • Loading branch information...
1 parent 373795e commit ac8dbdb54a5dd98f9df14793798c24a7c6972d9f @DanielHeath DanielHeath committed with xaviershay
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/cane/rake_task.rb
View
7 lib/cane/rake_task.rb
@@ -2,6 +2,7 @@
require 'rake/tasklib'
require 'cane/cli/options'
+require 'cane/cli/parser'
module Cane
# Creates a rake task to run cane with given configuration.
@@ -42,6 +43,12 @@ def use(check, options = {})
@options[:checks] = @options[:checks] + [check]
end
+ def canefile=(file)
+ canefile = Cane::CLI::Parser.new
+ canefile.parser.parse!(canefile.get_default_options)
+ options.merge! canefile.options
+ end
+
def initialize(task_name = nil)
self.name = task_name || :cane
@gte = []

0 comments on commit ac8dbdb

Please sign in to comment.
Something went wrong with that request. Please try again.