citrusbyte / openfriends

Ruby bindings for OpenFriends

This URL has Read+Write access

openfriends / Rakefile
100644 39 lines (30 sloc) 0.897 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'rubygems'
require 'rake/gempackagetask'
require 'rubygems/specification'
require 'date'
require 'spec/rake/spectask'
 
gem_spec_file = 'openfriends.gemspec'
 
gem_spec = eval(File.read(gem_spec_file)) rescue nil
 
Rake::GemPackageTask.new(gem_spec) do |pkg|
  pkg.need_zip = false
  pkg.need_tar = false
  pkg.gem_spec = gem_spec
  rm_f FileList['pkg/**/*.*']
end if gem_spec
 
task :default => :spec
 
desc "Run all specs"
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_opts = ['--options', "\"spec/spec.opts\""]
  t.spec_files = FileList['spec/**/*_spec.rb']
end
 
desc "Generate the gemspec file."
task :gemspec do
  require 'erb'
 
  File.open(gem_spec_file, 'w') do |f|
    f.write ERB.new(File.read("#{gem_spec_file}.erb")).result(binding)
  end
end
 
desc "Builds and installs the gem."
task :install => :repackage do
  `sudo gem install pkg/#{gem_spec.name}-#{gem_spec.version}.gem`
end