Skip to content

Commit

Permalink
Updated gemspec and Rakefile. Added namespaces to Rake tasks, and gem…
Browse files Browse the repository at this point in the history
… building tasks.
  • Loading branch information
djberg96 committed Jan 16, 2010
1 parent 3471617 commit 21a623a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 42 deletions.
42 changes: 22 additions & 20 deletions Rakefile
Expand Up @@ -3,32 +3,34 @@ require 'rake/testtask'
require 'rbconfig'
include Config

desc 'Install the memoize library (non-gem)'
task :install do
sitelibdir = CONFIG['sitelibdir']
file = 'lib/memoize.rb'
FileUtils.cp(file, sitelibdir, :verbose => true)
end
namespace :gem do
desc 'Build the memoize gem'
task :build do
spec = eval(IO.read('memoize.gemspec'))
Gem::Builder.new(spec).build
end

desc 'Install the memoize library as a gem'
task :install_gem do
ruby 'memoize.gemspec'
file = Dir['*.gem'].first
sh 'gem install #{file}'
desc 'Install the memoize library'
task :install => [:build] do
file = Dir['*.gem'].first
sh 'gem install #{file}'
end
end

desc 'Run the fibonacci example & benchmarks'
task :example_fib do
ruby '-Ilib examples/example_fibonacci.rb'
end
namespace :example do
desc 'Run the fibonacci example & benchmarks'
task :fib do
ruby '-Ilib examples/example_fibonacci.rb'
end

desc 'Run the memoize example & benchmarks'
task :example_memoize do
ruby '-Ilib examples/example_memoize.rb'
task :memoize do
ruby '-Ilib examples/example_memoize.rb'
end
end

Rake::TestTask.new do |t|
t.libs << 'test'
t.verbose = true
t.warning = true
t.libs << 'test'
t.verbose = true
t.warning = true
end
44 changes: 22 additions & 22 deletions memoize.gemspec
@@ -1,28 +1,28 @@
require 'rubygems'

spec = Gem::Specification.new do |gem|
gem.name = 'memoize'
gem.version = '1.3.1'
gem.author = 'Daniel J. Berger'
gem.license = 'Artistic 2.0'
gem.email = 'djberg96@gmail.com'
gem.homepage = 'http://www.rubyforge.org/projects/shards'
gem.platform = Gem::Platform::RUBY
gem.summary = 'Speeds up methods at the cost of memory (or disk space)'
gem.test_file = 'test/test_memoize.rb'
gem.has_rdoc = true
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
# Build the gem with the 'rake gem:build' command.

gem.rubyforge_project = 'shards'
gem.extra_rdoc_files = ['MANIFEST', 'README', 'CHANGES']
Gem::Specification.new do |spec|
spec.name = 'memoize'
spec.version = '1.3.2'
spec.author = 'Daniel J. Berger'
spec.license = 'Artistic 2.0'
spec.email = 'djberg96@gmail.com'
spec.homepage = 'http://www.rubyforge.org/projects/shards'
spec.platform = Gem::Platform::RUBY
spec.summary = 'Speeds up methods at the cost of memory (or disk space)'
spec.test_file = 'test/test_memoize.rb'
spec.has_rdoc = true
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }

spec.rubyforge_project = 'shards'
spec.extra_rdoc_files = ['MANIFEST', 'README', 'CHANGES']

gem.add_development_dependency('test-unit', '>= 2.0.2')
spec.add_development_dependency('test-unit', '>= 2.0.2')

gem.description = <<-EOF
The memoize library allows you to cache methods for faster lookup.
Cached results can either be stored in memory (the default) or to
a file.
EOF
spec.description = <<-EOF
The memoize library allows you to cache methods for faster lookup.
Cached results can either be stored in memory (the default) or to
a file.
EOF
end

Gem::Builder.new(spec).build

0 comments on commit 21a623a

Please sign in to comment.