Sha256: 6bee558e131a50c01ae04aa5668001859f0e3408804f3310043d2b4a0c4a5a17

Contents?: true

Size: 1.13 KB

Versions: 19

Compression:

Stored size: 1.13 KB

Contents

require 'rubygems'
require 'rake'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'gemspec'

desc "Generate gemspec"
task :gemspec do
  File.open("#{Dir.pwd}/#{GEM_NAME}.gemspec", 'w') do |f|
    f.write(GEM_SPEC.to_ruby)
  end
end

desc "Install gem"
task :install do
  Rake::Task['gem'].invoke
  `sudo gem uninstall #{GEM_NAME} -x`
  `sudo gem install pkg/#{GEM_NAME}*.gem`
  `rm -Rf pkg`
end

desc "Package gem"
Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
  pkg.gem_spec = GEM_SPEC
end

desc "Setup project"
task :setup do
  name = File.basename(Dir.pwd)
  `rm -Rf .git`
  begin
    dir = Dir['**/gem_template*']
    from = dir.pop
    if from
      rb = from.include?('.rb')
      to = File.dirname(from) + "/#{name}#{'.rb' if rb}"
      FileUtils.mv(from, to)
    end
  end while dir.length > 0
  Dir["**/*"].each do |path|
    next if path.include?('Rakefile')
    if File.file?(path)
      `sed -i "" 's/gem_template/#{name}/g' #{path}`
    end
  end
  `git init`
end

desc "Run specs"
Spec::Rake::SpecTask.new do |t|
  t.rcov = true
  t.spec_opts = ["--format", "specdoc", "--colour"]
  t.spec_files = FileList["spec/**/*_spec.rb"]
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
winton-active_wrapper-0.1.0 Rakefile
winton-active_wrapper-0.1.1 Rakefile
winton-active_wrapper-0.1.2 Rakefile
winton-active_wrapper-0.1.3 Rakefile
winton-active_wrapper-0.1.4 Rakefile
winton-active_wrapper-0.1.5 Rakefile
winton-active_wrapper-0.1.6 Rakefile
winton-active_wrapper-0.1.7 Rakefile
winton-active_wrapper-0.1.8 Rakefile
winton-active_wrapper-0.1.9 Rakefile
winton-active_wrapper-0.2.0 Rakefile
winton-rbackup-0.1.0 Rakefile
winton-rbackup-0.1.1 Rakefile
winton-rbackup-0.1.2 Rakefile
winton-rbackup-0.1.3 Rakefile
rbackup-0.1.5 Rakefile
active_wrapper-0.2.1 Rakefile
rbackup-0.1.4 Rakefile
active_wrapper-0.2.0 Rakefile