Permalink
Browse files

bye jeweler + added friendlier versioning

  • Loading branch information...
1 parent a543acb commit 220035a7d49808e3f6aeaf14d3321e4de1cd4089 @cldwalker committed Jun 11, 2010
Showing with 49 additions and 45 deletions.
  1. +1 −1 LICENSE.txt
  2. +24 −38 Rakefile
  3. +0 −4 VERSION.yml
  4. +20 −0 gemspec
  5. +3 −0 lib/core/version.rb
  6. +1 −2 test/manager_test.rb
View
@@ -1,6 +1,6 @@
The MIT LICENSE
-Copyright (c) 2009 Gabriel Horner
+Copyright (c) 2010 Gabriel Horner
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -1,49 +1,35 @@
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-begin
- require 'rcov/rcovtask'
+require 'fileutils'
- Rcov::RcovTask.new do |t|
- t.libs << 'test'
- t.test_files = FileList['test/**/*_test.rb']
- t.rcov_opts = ["-T -x '/Library/Ruby/*'"]
- t.verbose = true
- end
-rescue LoadError
- puts "Rcov not available. Install it for rcov-related tasks with: sudo gem install rcov"
+def gemspec
+ @gemspec ||= eval(File.read('gemspec'), binding, 'gemspec')
end
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |s|
- s.name = "core"
- s.description = "Manages using and sharing ruby extension libraries ie ActiveSupport, facets"
- s.summary = s.description
- s.email = "gabriel.horner@gmail.com"
- s.homepage = "http://github.com/cldwalker/core"
- s.authors = ["Gabriel Horner"]
- s.files = FileList["VERSION.yml", "Rakefile", "README.rdoc", "LICENSE.txt", "{bin,lib,test}/**/*"]
- s.has_rdoc = true
- s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt" ]
- end
+desc "Build the gem"
+task :gem=>:gemspec do
+ sh "gem build gemspec"
+ FileUtils.mkdir_p 'pkg'
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg'
+end
+
+desc "Install the gem locally"
+task :install => :gem do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
-rescue LoadError
- puts "Jeweler not available. Install it for jeweler-related tasks with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+desc "Generate the gemspec"
+task :generate do
+ puts gemspec.to_ruby
end
-Rake::TestTask.new do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
+desc "Validate the gemspec"
+task :gemspec do
+ gemspec.validate
end
-Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'test'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+desc 'Run tests'
+task :test do |t|
+ sh 'bacon -q -Ilib -I. test/*_test.rb'
end
-task :default => :test
+task :default => :test
View
@@ -1,4 +0,0 @@
----
-:major: 0
-:minor: 1
-:patch: 0
View
20 gemspec
@@ -0,0 +1,20 @@
+# -*- encoding: utf-8 -*-
+require 'rubygems' unless Object.const_defined?(:Gem)
+require File.dirname(__FILE__) + "/lib/core/version"
+
+Gem::Specification.new do |s|
+ s.name = "core"
+ s.version = Core::VERSION
+ s.authors = ["Gabriel Horner"]
+ s.email = "gabriel.horner@gmail.com"
+ s.homepage = "http://github.com/cldwalker/core"
+ s.summary = "Manages using and sharing ruby extension libraries ie ActiveSupport, facets"
+ s.description = "Incomplete. Much more to do."
+ s.required_rubygems_version = ">= 1.3.6"
+ s.rubyforge_project = 'tagaholic'
+ s.add_development_dependency 'bacon'
+ s.add_development_dependency 'mocha'
+ s.add_development_dependency 'mocha-on-bacon'
+ s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c}]) + %w{Rakefile gemspec}
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
+end
View
@@ -0,0 +1,3 @@
+module Core
+ VERSION = '0.1.0'
+end
View
@@ -1,6 +1,5 @@
require File.join(File.dirname(__FILE__), 'test_helper')
-# class Core::ManagerTest < Test::Unit::TestCase
describe "Manager" do
before_all { eval "module ::Base; end" }
before { Core::Manager.reset_libraries }
@@ -54,4 +53,4 @@
capture_stdout {Core::Manager.default_library = :blah}.should =~ /not found/
end
end
-end
+end

0 comments on commit 220035a

Please sign in to comment.