-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
107 lines (89 loc) · 3 KB
/
Rakefile
File metadata and controls
107 lines (89 loc) · 3 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
require 'rake'
require 'rdoc/task'
require "bundler/setup"
require 'rspec/core/rake_task'
desc "Run all examples"
RSpec::Core::RakeTask.new(:specs)
task :default => :specs
require "rubygems"
require "rubygems/package_task"
GEM_VERSION = "0.1.3"
# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
# http://rubygems.org/read/chapter/20
#
spec = Gem::Specification.new do |s|
# Change these as appropriate
s.name = "github-downloads"
s.version = GEM_VERSION
s.summary = "Manages downloads for your Github projects"
s.author = "Luke Redpath"
s.email = "luke@lukeredpath.co.uk"
s.homepage = "http://lukeredpath.co.uk"
s.has_rdoc = false
# s.extra_rdoc_files = %w(README)
# s.rdoc_options = %w(--main README)
# Add any extra files to include in the gem
s.files = %w(Gemfile Gemfile.lock Rakefile README.md) + Dir.glob("{bin,spec,lib}/**/*")
s.executables = FileList["bin/**"].map { |f| File.basename(f) }
s.require_paths = ["lib"]
# If you want to depend on other gems, add them here, along with any
# relevant versions
gem "rest-client"
gem "json"
gem "simpleconsole"
gem "hirb"
gem "mime-types"
gem "highline"
s.add_dependency("rest-client")
s.add_dependency("json")
s.add_dependency("simpleconsole")
s.add_dependency("hirb")
s.add_dependency("mime-types")
s.add_dependency("highline")
# If your tests use any gems, include them here
s.add_development_dependency("rspec")
s.add_development_dependency("mocha")
s.add_development_dependency("mimic")
s.add_development_dependency("awesome_print")
end
# This task actually builds the gem. We also regenerate a static
# .gemspec file, which is useful if something (i.e. GitHub) will
# be automatically building a gem for this project. If you're not
# using GitHub, edit as appropriate.
#
# To publish your gem online, install the 'gemcutter' gem; Read more
# about that here: http://gemcutter.org/pages/gem_docs
Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Build the gemspec file #{spec.name}.gemspec"
task :gemspec do
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
File.open(file, "w") {|f| f << spec.to_ruby }
end
desc "Run bundler"
task :bundle => :gemspec do
system "bundle"
end
# If you don't want to generate the .gemspec file, just remove this line. Reasons
# why you might want to generate a gemspec:
# - using bundler with a git source
# - building the gem without rake (i.e. gem build blah.gemspec)
# - maybe others?
task :package => :gemspec
# Generate documentation
RDoc::Task.new do |rd|
rd.main = "README"
rd.rdoc_files.include("README", "lib/**/*.rb")
rd.rdoc_dir = "rdoc"
end
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end
desc 'Publish gem'
task :publish => :gem do
system "gem push pkg/#{spec.file_name}"
end