-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
86 lines (69 loc) · 2.85 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
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
# coding: UTF-8
require 'spec'
require "spec/rake/spectask"
desc "Runs all examples."
Spec::Rake::SpecTask.new('spec' => :thrift) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--options', 'spec/spec.opts']
end
# This compiles the various thrift files that tests use.
#
compile_integration = file 'spec/integration/protocol/gen-rb/test.rb' => %w(spec/integration/protocol/test.thrift) do
rm_rf 'spec/integration/protocol/gen-rb' rescue nil
sh %Q{thrift --gen rb -o spec/integration/protocol spec/integration/protocol/test.thrift }
end
desc "Compiles thrift IDL definitions into Ruby code."
task :thrift => compile_integration
require "rubygems"
require "rake/gempackagetask"
require "rake/rdoctask"
task :default => :spec
# 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 = "toamqp"
s.version = "0.3.1"
s.summary = "Allows thrift RPC via an AMQP broker"
s.author = "Kaspar Schiess"
s.email = "[email protected]"
s.homepage = "http://blog.absurd.li"
s.description = %Q{Transports thrift RPC calls via an AMQP broker. This is really the ruby way of using a message broker – enterprise class messaging combined with simple setup and DRY code.}
s.has_rdoc = false
s.extra_rdoc_files = %w(README.textile)
s.rdoc_options = %w(--main README.textile)
# Add any extra files to include in the gem
s.files = %w(
History.txt
Rakefile
README.textile ) +
Dir.glob("{spec,lib,examples}/**/*")
s.require_paths = ["lib"]
# If you want to depend on other gems, add them here, along with any
# relevant versions
s.add_dependency("bunny", "~> 0.6.0")
s.add_dependency("metaid", "~> 1.0.0")
s.add_development_dependency("rspec")
s.add_development_dependency("flexmock")
# If you want to publish automatically to rubyforge, you'll may need
# to tweak this, and the publishing task below too.
# s.rubyforge_project = "thrift_amqp_transport"
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.
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
# Generate the gemspec file for github.
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
File.open(file, "w") {|f| f << spec.to_ruby }
end
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end
# End of Rake ----------------------------------------------------------------