Skip to content

Commit

Permalink
switch to jeweler for package management
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Jul 16, 2009
1 parent 3d8d8f5 commit 19531db
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 129 deletions.
114 changes: 0 additions & 114 deletions Manifest.txt

This file was deleted.

54 changes: 43 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
require 'rubygems'
require 'hoe'

Hoe.new('god', '0.7.13') do |p|
p.rubyforge_name = 'god'
p.author = 'Tom Preston-Werner'
p.email = 'tom@rubyisawesome.com'
p.url = 'http://god.rubyforge.org/'
p.summary = 'Like monit, only awesome'
p.description = "God is an easy to configure, easy to extend monitoring framework written in Ruby."
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
p.spec_extras = {:extensions => ['ext/god/extconf.rb']}
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "god"
gem.summary = 'Like monit, only awesome'
gem.description = "God is an easy to configure, easy to extend monitoring framework written in Ruby."
gem.email = "tom@mojombo.com"
gem.homepage = "http://god.rubyforge.org/"
gem.authors = ["Tom Preston-Werner"]
gem.require_paths = ["lib", "ext"]
gem.files.include("ext")
gem.extensions << 'ext/god/extconf.rb'
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end

rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

task :default => :test

desc "Open an irb session preloaded with this library"
task :console do
sh "irb -rubygems -r ./lib/god.rb"
Expand All @@ -32,4 +49,19 @@ task :coverage do
`rm -fr coverage`
`rcov test/test_*.rb`
`open coverage/index.html`
end

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION.yml')
config = YAML.load(File.read('VERSION.yml'))
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
else
version = ""
end

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "god #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
4 changes: 4 additions & 0 deletions VERSION.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
:major: 0
:minor: 7
:patch: 13
7 changes: 5 additions & 2 deletions lib/god.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ def safe_attr_accessor(*args)
end

module God
VERSION = '0.7.13'

LOG_BUFFER_SIZE_DEFAULT = 100
PID_FILE_DIRECTORY_DEFAULTS = ['/var/run/god', '~/.god/pids']
DRB_PORT_DEFAULT = 17165
Expand Down Expand Up @@ -626,6 +624,11 @@ def self.start
self.main.join
end

def self.version
yml = YAML.load(File.read(File.join(File.dirname(__FILE__), *%w[.. VERSION.yml])))
"#{yml[:major]}.#{yml[:minor]}.#{yml[:patch]}"
end

# To be called on program exit to start god
#
# Returns nothing
Expand Down
4 changes: 2 additions & 2 deletions lib/god/cli/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ def self.version
require 'god'

# print version
puts "Version #{God::VERSION}"
puts "Version #{God.version}"
exit
end

def self.version_extended
puts "Version: #{God::VERSION}"
puts "Version: #{God.version}"
puts "Polls: enabled"
puts "Events: " + God::EventHandler.event_system

Expand Down

0 comments on commit 19531db

Please sign in to comment.