Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding rake tasks to generate gemspec (which shouldn't be ignored, ne…

…eded by github) and run specs
  • Loading branch information...
commit e51f36a691a9c65535b29d4a8c01771c748c9ec9 1 parent 6af39a7
Pat Allan pat authored
Showing with 93 additions and 1 deletion.
  1. +54 −0 Rakefile
  2. +28 −0 garlic.gemspec
  3. +11 −1 lib/garlic.rb
54 Rakefile
View
@@ -0,0 +1,54 @@
+require 'rubygems'
+require 'spec'
+require 'rake/rdoctask'
+require 'spec/rake/spectask'
+require 'rake/gempackagetask'
+
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
+
+require 'garlic'
+
+spec = Gem::Specification.new do |s|
+ s.name = "garlic"
+ s.version = Garlic::Version::String
+ s.summary = "Lightweight set of rake tasks to help with CI."
+ s.description = "Lightweight set of rake tasks to help with CI."
+ s.author = "Ian White"
+ s.email = "ian.w.white@gmail.com"
+ s.homepage = "http://github.com/ianwhite/garlic/tree"
+ s.has_rdoc = false
+ s.test_files = FileList["spec/**/*_spec.rb"]
+ s.files = FileList[
+ "lib/**/*.rb",
+ "MIT-LICENCE",
+ "README.rdoc",
+ "TODO"
+ ]
+end
+
+Rake::GemPackageTask.new(spec) do |p|
+ p.gem_spec = spec
+ p.need_tar = true
+ p.need_zip = true
+end
+
+desc "Generate garlic.gemspec file"
+task :build do
+ File.open('garlic.gemspec', 'w') { |f|
+ f.write spec.to_ruby
+ }
+end
+
+desc "Run the specs under spec"
+Spec::Rake::SpecTask.new do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts << "-c"
+end
+
+desc "Generate RCov reports"
+Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.libs << 'lib'
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec', '--exclude', 'gems']
+end
28 garlic.gemspec
View
@@ -0,0 +1,28 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{garlic}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Ian White"]
+ s.date = %q{2008-10-11}
+ s.description = %q{Lightweight set of rake tasks to help with CI.}
+ s.email = %q{ian.w.white@gmail.com}
+ s.files = ["lib/garlic/configurator.rb", "lib/garlic/garlic.rb", "lib/garlic/repo.rb", "lib/garlic/target.rb", "lib/garlic.rb", "lib/garlic_tasks.rb", "MIT-LICENCE", "README.rdoc", "TODO", "spec/garlic/repo_spec.rb"]
+ s.homepage = %q{http://github.com/ianwhite/garlic/tree}
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.0}
+ s.summary = %q{Lightweight set of rake tasks to help with CI.}
+ s.test_files = ["spec/garlic/repo_spec.rb"]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
12 lib/garlic.rb
View
@@ -1,4 +1,14 @@
require "garlic/garlic"
require "garlic/configurator"
require "garlic/repo"
-require "garlic/target"
+require "garlic/target"
+
+module Garlic
+ module Version
+ Major = 0
+ Minor = 1
+ Tiny = 0
+
+ String = [Major, Minor, Tiny].join('.')
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.