Skip to content

Commit

Permalink
use jeweler
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Jan 2, 2010
1 parent e723574 commit f1230ac
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 48 deletions.
79 changes: 33 additions & 46 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
$:.unshift File.dirname(__FILE__) + '/lib'
require 'rubygems'
require 'kvs'
require 'spec/rake/spectask'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'

name = 'kvs'
version = KVS::VERSION

spec = Gem::Specification.new do |s|
s.name = name
s.version = version
s.summary = "simple key value store."
s.description = "KVS is a simple key value store."
s.files = %w(Rakefile README.markdown ChangeLog) + Dir.glob("{lib,spec}/**/*.rb")
s.authors = %w(jugyo)
s.email = 'jugyo.org@gmail.com'
s.homepage = 'http://github.com/jugyo/kvs'
s.rubyforge_project = 'kvs'
s.has_rdoc = false
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "kvs"
gem.summary = %Q{Key Value Store.}
gem.description = %Q{KVS is a simple key value store.}
gem.email = "jugyo.org@gmail.com"
gem.homepage = "http://github.com/jugyo/kvs"
gem.authors = ["jugyo"]
gem.add_development_dependency "rspec", ">= 1.2.9"
end
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

Rake::GemPackageTask.new(spec) do |p|
p.need_tar = true
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end

task :gemspec do
filename = "#{name}.gemspec"
open(filename, 'w') do |f|
f.write spec.to_ruby
end
puts <<-EOS
Successfully generated gemspec
Name: #{name}
Version: #{version}
File: #{filename}
EOS
Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end

task :install => [ :package ] do
sh %{sudo gem install pkg/#{name}-#{version}.gem}
end
task :spec => :check_dependencies

task :uninstall => [ :clean ] do
sh %{sudo gem uninstall #{name}}
end
task :default => :spec

desc 'run all specs'
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['-c']
end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

CLEAN.include ['pkg']
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "kvs #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0
2 changes: 0 additions & 2 deletions lib/kvs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require 'yaml'

module KVS
VERSION = '0.3.0'

class <<self
attr_accessor :dir

Expand Down

0 comments on commit f1230ac

Please sign in to comment.