Sha256: 166bcd7bb81010ee962d85f11a9eb7f0cab1a726ef02190dfb3616eae2697d1b

Contents?: true

Size: 1.77 KB

Versions: 2

Compression:

Stored size: 1.77 KB

Contents

require 'hoe'
require './lib/spreedly/version.rb'

ENV["COPYFILE_DISABLE"] = "true" # Lose all the fugly ._ files when tar'ing

hoe = nil
Hoe.new('spreedly', Spreedly::VERSION) do |project|
  hoe = project
  project.rubyforge_name = 'terralien'
  project.developer('Nathaniel Talbott', 'nathaniel@terralien.com')
  project.test_globs = ["test/**/*_test.rb"]
  project.extra_dev_deps = ["thoughtbot-shoulda"]
end

def remove_task(*task_names)
  task_names.each do |task_name|
    Rake.application.instance_eval{@tasks.delete(task_name.to_s)}
  end
end
 
def replace_task(task_name, *args, &block)
  name = (task_name.is_a?(Hash) ? task_name.keys.first : task_name)
  remove_task(name)
  task(task_name, *args, &block)
end

remove_task :docs, 'doc/index.html'
Rake::RDocTask.new(:docs) do |rd|
  rd.main = hoe.readme_file
  rd.rdoc_dir = 'doc'

  rd.rdoc_files += ['lib/spreedly.rb', 'lib/spreedly/common.rb', hoe.readme_file]

  title = "Terralien's Spreedly Gem (#{hoe.version}) Documentation"

  rd.options << "-t" << title << "-f" << "darkfish"
end

replace_task :publish_docs => [:clean, :docs] do
  host = "terralien@terralien.biz"

  remote_dir = "/var/www/terralien/www/shared/static/projects/spreedly-gem"
  local_dir = 'doc'

  sh %{rsync #{hoe.rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
end

desc "Run tests with and without mocking."
replace_task :test do
  ruby hoe.make_test_cmd

  ENV["SPREEDLY_TEST"] = "REAL"
  ruby hoe.make_test_cmd
end

desc "Run only mock tests."
task :test_mock do
  ruby hoe.make_test_cmd
end

desc "Run only real tests."
task :test_real do
  ENV["SPREEDLY_TEST"] = "REAL"
  ruby hoe.make_test_cmd
end

desc "Run both sets of tests under multiruby"
replace_task :multi do
  ruby hoe.make_test_cmd(:multi)
  ENV["SPREEDLY_TEST"] = "REAL"
  ruby hoe.make_test_cmd(:multi)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spreedly-1.1.0 Rakefile
spreedly-1.2.0 Rakefile