-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
59 lines (49 loc) · 1.6 KB
/
Rakefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'rake'
require 'rake/gempackagetask'
GEM = "rubygems_snapshot"
GEM_VERSION = "0.2.0"
SUMMARY = "Command to import/export gems"
DESCRIPTION = "Adds snapshot command to gem. This command allow import/export of gems."
AUTHOR = "Roger Leite"
EMAIL = "[email protected]"
HOMEPAGE = "http://github.com/rogerleite/rubygems_snapshot"
spec = Gem::Specification.new do |s|
s.name = GEM
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.summary = SUMMARY
s.description = DESCRIPTION
s.require_paths = ["lib"]
s.files = FileList['lib/**/*', 'README*'].to_a
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.rubyforge_project = GEM # GitHub bug, gem isn't being build when this miss
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
s.post_install_message = <<MESSAGE
===============================================================================
Thanks for installing RubygemsSnapshot! You can now run:
gem snapshot export example
gem snapshot import example
***
gem help snapshot for help! ;)
OR http://github.com/rogerleite/rubygems_snapshot
===============================================================================
MESSAGE
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Install the gem locally"
task :install => [:package] do
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
end
desc "Create a gemspec file"
task :make_spec do
File.open("#{GEM}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
Dir["tasks/*.rake"].each do |rake_file|
load rake_file
end