Sha256: c28ba4e1ae47c3a06522e2a84df2c47531ad4cea0ac57185c1396b0c9de5ac36
Contents?: true
Size: 1004 Bytes
Versions: 6
Compression:
Stored size: 1004 Bytes
Contents
require 'yaml' class New::Task def self.inherited task_class task_class.name = caller.first[/[a-z_]+?(?=\.rb)/].to_sym end def initialize project_config @project_config = project_config run end def self.name= name @name = name end def self.name; @name; end def name; self.class.name.to_sym; end # Return ALL available options # def project_options custom_options = New.custom_config project_options = @project_config all_options = custom_options.deep_merge(project_options) # Groom tasks (prevent tasks from the custom config from polluting the project config) all_options[:tasks].each_key do |task| all_options[:tasks].delete(task) unless project_options[:tasks].has_key?(task) end @project_options ||= all_options end # Return only the options for the given task # def options default_options = self.class::OPTIONS rescue {} @options ||= default_options.deep_merge(project_options[:tasks][name]) end end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
new-0.0.6 | lib/new/task.rb |
new-0.0.5 | lib/new/task.rb |
new-0.0.4 | lib/new/task.rb |
new-0.0.3 | lib/new/task.rb |
new-0.0.2 | lib/new/task.rb |
new-0.0.0 | lib/new/task.rb |