This repository was archived by the owner on Mar 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathRakefile
More file actions
61 lines (48 loc) · 1.75 KB
/
Rakefile
File metadata and controls
61 lines (48 loc) · 1.75 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$: << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
desc "Generate gemspec"
task :gemspec do
require 'rubygems/specification'
require 'ghost/version'
require 'date'
spec = Gem::Specification.new do |s|
s.specification_version = 3 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.author = "Bodaniel Jeanes"
s.email = "me@bjeanes.com"
s.name = 'ghost'
s.version = Ghost::VERSION
s.summary = "Allows you to create, list, and modify local hostnames"
s.description = "#{s.summary} on POSIX systems (e.g. Mac OS X and Linux) and Windows"
s.homepage = "https://github.com/bjeanes/ghost"
s.rubyforge_project = 'ghost'
s.licenses = ["MIT"]
s.date = Date.today.strftime
s.files = %w(LICENSE README.md) + Dir.glob("{bin,lib,spec}/**/*")
s.require_paths = %w[lib]
s.test_files = s.files.select { |path| path =~ /^spec\// }
s.executables += %w[ghost]
s.has_rdoc = false
s.add_dependency 'unindent', '1.0'
s.add_development_dependency "rspec", "2.9.0"
s.add_development_dependency "rake", "0.9.2.2"
end
File.open("ghost.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
task :default => [:spec, :gem]
task :spec do
puts "Running specs\n\n"
unless system("bundle exec rspec spec")
abort "Specs failed!"
end
end
task :gem => :gemspec do
puts "Building gem to pkg/\n\n"
if system("gem build ghost.gemspec")
FileUtils.mkdir_p("pkg")
FileUtils.mv("ghost-#{Ghost::VERSION}.gem", "pkg")
else
abort "Building gem failed!"
end
end