Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up options parser, implemented block configuration
- Loading branch information
1 parent
e34d80f
commit 50002c7
Showing
4 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
module Coyote | |||
class Configuration | |||
attr_accessor :input, :output, :options | |||
|
|||
def initialize | |||
@input = ""; @output = ""; @options = {} | |||
end | |||
end | |||
end | |||
|
|||
|
|||
def coyote(method, &block) | |||
config = Coyote::Configuration.new | |||
yield config | |||
|
|||
if config.input.empty? | |||
notify "Coyote: Input filepath must be defined", :failure | |||
exit 0 | |||
end | |||
|
|||
if config.output.empty? | |||
notify "Coyote: Output filepath must be defined", :failure | |||
exit 0 | |||
end | |||
|
|||
if method == :watch | |||
config.options[:watch] = true | |||
end | |||
|
|||
Coyote::run config.input, config.output, config.options | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters