Top Level Namespace

Defined Under Namespace

Modules: Ritual

Instance Method Summary collapse

Instance Method Details

#changelogObject



72
73
74
# File 'lib/ritual.rb', line 72

def changelog
  @changelog ||= Ritual.changelog
end

#cucumber_task(*args, &block) ⇒ Object



93
94
95
96
97
# File 'lib/ritual.rb', line 93

def cucumber_task(*args, &block)
  require 'cucumber/rake/task'
  Cucumber::Rake::Task.new(*args, &block)
rescue LoadError
end

#extension(*args) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/ritual.rb', line 114

def extension(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  args.size <= 1 or
    raise ArgumentError, "wrong number of arguments (#{args.size} for 0..1, plus options)"
  return if (gem = options[:gem]) && Ritual.library_name != gem.to_s

  params = options.merge(:library_name => Ritual.library_name)
  klass = params[:type] == :jruby ? Ritual::Extension::JRuby : Ritual::Extension::Standard
  extension = klass.new(args.first, params)
  extensions << extension
  extension.define_tasks
end

#extensionsObject



76
77
78
# File 'lib/ritual.rb', line 76

def extensions
  @extensions ||= []
end

#library_nameObject



64
65
66
# File 'lib/ritual.rb', line 64

def library_name
  Ritual.library_name
end

#rdoc_task(*args, &block) ⇒ Object



99
100
101
102
# File 'lib/ritual.rb', line 99

def rdoc_task(*args, &block)
  require 'rake/rdoctask'
  Rake::RDocTask.new(*args, &block)
end

#remove_task(name) ⇒ Object



104
105
106
107
# File 'lib/ritual.rb', line 104

def remove_task(name)
  Rake.application.instance_variable_get(:@tasks).delete(name) or
    raise ArgumentError, "task not found: #{name}"
end

#replace_task(name, *args, &block) ⇒ Object



109
110
111
112
# File 'lib/ritual.rb', line 109

def replace_task(name, *args, &block)
  remove_task name
  task(name, *args, &block)
end

#spec_task(*args, &block) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/ritual.rb', line 80

def spec_task(*args, &block)
  require 'rspec/core/rake_task'
  RSpec::Core::RakeTask.new(*args, &block)
rescue LoadError
  begin
    require 'rspec/rake/spectask'
    Spec::Rake::SpecTask.new(*args, &block)
  rescue LoadError
    require 'spec/rake/spectask'
    Spec::Rake::SpecTask.new(*args, &block)
  end
end

#versionObject



68
69
70
# File 'lib/ritual.rb', line 68

def version
  @version ||= Ritual.version_file
end