class Object
We need a “valid” method thtat determines if a string is suitable for use in the gem specification.
Public Instance Methods
alias_task( fq_name )
click to toggle source
# File lib/bones/rake_override_task.rb, line 9 def alias_task( fq_name ) new_name = "#{fq_name}:original" @tasks[new_name] = @tasks.delete(fq_name) end
ensure_in_path( *args )
click to toggle source
Adds the given arguments to the include path if they are not already there
# File lib/bones/helpers.rb, line 117 def ensure_in_path( *args ) args.each do |path| path = File.expand_path(path) $:.unshift(path) if test(?d, path) and not $:.include?(path) end end
override_task( *args, &block )
click to toggle source
# File lib/bones/rake_override_task.rb, line 23 def override_task( *args, &block ) name = Rake.application.resolve_args(args.dup).first fq_name = Rake.application.instance_variable_get(:@scope).dup.push(name).join(':') alias_task(fq_name) Rake::Task.define_task(*args, &block) end
remove_task( fq_name )
click to toggle source
# File lib/bones/rake_override_task.rb, line 14 def remove_task( fq_name ) @tasks.delete(fq_name.to_s) end
Also aliased as: remove_tasks
valid?()
click to toggle source
# File lib/bones/helpers.rb, line 110 def valid? return !(self.empty? or self == "\000") if self.respond_to?(:to_str) return false end