Permalink
Browse files

garlic gem now available on gemcutter and rubyforge

  • Loading branch information...
1 parent 0812d0c commit a489c92cd30505c6c7913b06922aaf75ab668ab2 @ianwhite committed Oct 5, 2009
Showing with 171 additions and 145 deletions.
  1. +1 −3 .gitignore
  2. +9 −2 History.txt
  3. +60 −78 README.textile
  4. +38 −37 Rakefile
  5. +1 −0 VERSION
  6. +5 −1 bin/garlic
  7. +44 −10 garlic.gemspec
  8. +2 −5 lib/garlic.rb
  9. +2 −0 lib/garlic/generator.rb
  10. +3 −3 templates/default.rb
  11. +3 −3 templates/rspec.rb
  12. +3 −3 templates/shoulda.rb
View
4 .gitignore
@@ -1,5 +1,3 @@
.DS_Store
-work/*
-repos/*
-*.tmproj
garlic-*.gem
+doc
View
11 History.txt
@@ -1,10 +1,17 @@
+== 0.1.10
+
+* 2 minor enhancements
+ * updated gemspec for gemcutter and rubyforge
+ * templates now include rails 2.3
+
+
== 0.1.9
* 1 major enhancement
- * added garlic shell commands (sh/garlic.sh) for easing the galric workflow
+ * added garlic shell commands (sh/garlic.sh) for easing the garlic workflow
to use them, add this to your ~/.profile
- source `gem environment gemdir`/gems/ianwhite-garlic*/sh/garlic.sh
+ source `garlic --path`/sh/garlic.sh
== 0.1.8
View
138 README.textile
@@ -1,6 +1,8 @@
-h1. garlic: lightweight continuous integration for rails using git
+= garlic
-This is not a CI server, use cruisecontrol.rb for that. This is a simple set
+<b>lightweight continuous integration for rails using git</b>
+
+This is not a CI server, use cruisecontrol.rb or integrity for that. This is a simple set
of commands (or rake tasks) that let you specify a bunch of rails builds to run against, and
dependencies to install.
@@ -9,151 +11,131 @@ and allows specifying other plugin dependencies (and their versions and any
setup requried).
If you want to run your specs (or whatever) against different versions of gems
-that you have installed, then check out "ginger":http://github.com/freelancing-god/ginger by "Pat Allen":http://github.com/freelancing-god
+that you have installed, then check out {ginger}[http://github.com/freelancing-god/ginger] by {Pat Allen}[http://github.com/freelancing-god]
Garlic works by cloning git repos for all your dependencies (so they all must be
git repos), and then using git to checkout various tags and branches to build
your app against.
-"Here's an example of running a plugin against 3 different rails verisons and 3 different rspec versions":http://gist.github.com/28786
+Here's an example of running a plugin against 3 different rails verisons and 3 different rspec versions: {gist 28786}[http://gist.github.com/28786]
-h2. It's still new, and not shiny yet
+== It's still new, and not shiny yet
Please feel free to make it shinier. I'm successfully using it on most of my plugins, and I test
with rspec and cucumber.
-Check out the "TODO LIST":http://github.com/ianwhite/garlic/tree/master/Todo.txt
+Check out the {TODO LIST}[http://github.com/ianwhite/garlic/tree/master/Todo.txt]
-h2. Get up and running quickly
+== Get up and running quickly
You have a plugin and you want it tested against different versions of rails?
-* install garlic as a gem (see below)
-* cd into your (say, rspec tested) plugin directory
+<b>1.</b> install garlic as a gem (see below)
+
+<b>2.</b> cd into your (say, rspec tested) plugin directory
-<pre>
- garlic generate rspec > garlic.rb
- garlic install_repos
- garlic
-</pre>
+ garlic generate rspec > garlic.rb
+ garlic install_repos
+ garlic
-* See what happens, edit garlic.rb to change rails versions and other stuff.
+<b>3.</b> See what happens, edit garlic.rb to change rails versions and other stuff.
-<pre>
- garlic --help # will probably help
-</pre>
+ garlic --help # will probably help
-h2. Installing
+== Installing
Install the garlic gem
-<pre>
- sudo gem install ianwhite-garlic --source=http://gems.github.com
-</pre>
+ # from rubyforge or gemcutter
+ sudo gem install garlic
+
+ # from github
+ sudo gem install ianwhite-garlic --source=http://gems.github.com
(if you want the very latest version)
-<pre>
- git clone git://github.com/ianwhite/garlic
- cd garlic
- rake package
- sudo gem install pkg/garlic-<code>*</code>.gem
-</pre>
+ git clone git://github.com/ianwhite/garlic
+ cd garlic
+ rake package
+ sudo gem install pkg/garlic-<code>*</code>.gem
+
+== Example
-h2. Example
+To see garlic in action, download resources_controller_, a rails plugin that uses garlic for CI.
-To see garlic in action, download response_for, a rails plugin that uses
-garlic for CI.
+ git clone git://github.com/ianwhite/resources_controller
-<pre>
- git clone git://github.com/ianwhite/response_for
-</pre>
run garlic
-<pre>
- garlic all
-</pre>
+ garlic all
-This will clone all the required git repos (done only once), set up the target
-railses (done once), then run the targets.
+This will clone all the required git repos (done only once), set up the target railses (done once), then run the targets.
-h3. Once you've made some changes
+=== Once you've committed some changes
You can prepare and run all the targets again (without fetching remote repos) by doing
-<pre>
- garlic
-</pre>
+ garlic
This will prepare all the targets, using the current HEAD of the repos, and run the
CI task again.
-h3. Specifying particular targets
+=== Specifying particular targets
-If you just want to run against a particular target or targets, you can use the TARGET or TARGETS
-env var.
+If you just want to run against a particular target or targets, you can use the -t option,
+or if using Rake, the TARGET or TARGETS env var.
-<pre>
- garlic -t edge
-</pre>
+ garlic -t edge
-h2. Running Shell commands across multiple targets
+== Running Shell commands across multiple targets
Check dis out
-<pre>
- garlic shell # "Example output":http://gist.github.com/28795
-</pre>
+ garlic shell # {Example output}[http://gist.github.com/28795]
You can pipe any thing into garlic shell and it will execute across all of your garlic targets
-h2. Rake tasks
+== Rake tasks
If you prefer to use garlic via rake tasks, then just require 'garlic/tasks' and you'll get a bunch of em.
Once required, do rake -T to see descriptions.
-h2. garlic workflow shell commands
+== garlic workflow shell commands
If you add the following line to your .profile
-<pre>
- source `gem environment gemdir`/gems/ianwhite-garlic-<code>*</code>/sh/garlic.sh
-</pre>
+ source `garlic --path`/sh/garlic.sh
Then you'll get these 4 new shell commands:
-<pre>
- gcd [target] cds into the specified target working repo
- gcdp [target] cds into the specified target plugin in the working repo
- gup cds back up to the garlic'd repo from within a working path
- gpush [branch] from within a working repo, pushes changes back to the local garlic target, and resets
- local changes in that target to HEAD.
-</pre>
+ gcd [target] cds into the specified target working repo
+ gcdp [target] cds into the specified target plugin in the working repo
+ gup cds back up to the garlic'd repo from within a working path
+ gpush [branch] from within a working repo, pushes changes back to the local garlic target, and resets
+ local changes in that target to HEAD.
This means you might have a workflow as follows (example is for a plugin):
-<pre>
- # run garlic, see probs in '2-2-stable'
-
- gcdp 2-2 # => takes you into the working repo in the '2-2-stable' target
-
- # fix the changes, make some commits
-
- gpush # => pushes the changes back to the enclosing garlic'd repo
- gup # => go back up there
- garlic # => rerun garlic to see how the changes affect the other targets
-</pre>
+ # run garlic, see probs in '2-2-stable'
+
+ gcdp 2-2 # => takes you into the working repo in the '2-2-stable' target
+
+ # fix the changes, make some commits
+
+ gpush # => pushes the changes back to the enclosing garlic'd repo
+ gup # => go back up there
+ garlic # => rerun garlic to see how the changes affect the other targets
-h2. Lend a hand
+== Lend a hand
This is an early release, so there is plenty of scope for changes and improvement
If you want to lend a hand, get in touch.
(c) Ian White 2008-2009 - ian.w.white@gmail.com
MIT Licence
-h2. Lent a hand
+== Lent a hand
Thanks very much to:
View
75 Rakefile
@@ -8,47 +8,48 @@ $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 = "Set of commands/rake-tasks for CI against multiple version of rails/deps."
- s.description = "Set of commands/rake-tasks for CI against multiple version of rails/deps."
- s.author = "Ian White"
- s.email = "ian.w.white@gmail.com"
- s.homepage = "http://github.com/ianwhite/garlic/tree"
- s.has_rdoc = true
- s.rdoc_options << "--title" << "Garlic" << "--line-numbers"
- s.test_files = FileList["spec/**/*_spec.rb"]
- s.files = FileList[
- "lib/**/*.rb", "templates/*.rb", "bin/*", "sh/*",
- "License.txt", "README.textile", "Todo.txt", "History.txt"
- ]
- s.executables = ["garlic"]
-end
+begin
+ require 'jeweler'
+
+ Jeweler::Tasks.new do |s|
+ s.name = "garlic"
+ s.version = Garlic::Version::String
+ s.summary = "Test your project across multiple versions of rails/dependencies"
+ s.description = "CI tool to test your project across multiple versions of rails/dependencies"
+ s.email = "ian.w.white@gmail.com"
+ s.homepage = "http://github.com/ianwhite/garlic"
+ s.authors = ["Ian White"]
+ s.rubyforge_project = 'garlic'
+ end
+
+ Jeweler::GemcutterTasks.new
-Rake::GemPackageTask.new(spec) do |p|
- p.gem_spec = spec
- p.need_tar = true
- p.need_zip = true
+ Jeweler::RubyforgeTasks.new do |rubyforge|
+ rubyforge.doc_task = "rdoc"
+ end
+
+rescue LoadError
+ puts "Jeweler not available for gem tasks. Install it with: sudo gem install jeweler"
end
-desc "Generate garlic.gemspec file"
-task :build do
- File.open('garlic.gemspec', 'w') { |f|
- f.write spec.to_ruby
- }
+begin
+ require 'hanna/rdoctask'
+rescue LoadError
+end
+
+Rake::RDocTask.new(:doc) do |d|
+ d.options << '--all'
+ d.rdoc_dir = 'doc'
+ d.main = 'README.textile'
+ d.title = "garlic API Docs"
+ d.rdoc_files.include('README.textile', 'History.txt', 'License.txt', 'Todo.txt', 'VERSION', 'lib/**/*.rb')
end
+task :rdoc => :doc
-desc "Run the specs under spec"
-Spec::Rake::SpecTask.new do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts << "-c"
+Spec::Rake::SpecTask.new(:spec) do |t|
+ t.warning = true
end
+task :default => :spec
+
+
-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
View
1 VERSION
@@ -0,0 +1 @@
+0.1.10
View
6 bin/garlic 100644 → 100755
@@ -39,10 +39,14 @@ GetoptLong.new(
['--verbose', '-v', GetoptLong::NO_ARGUMENT],
['--targets', '-t', GetoptLong::REQUIRED_ARGUMENT],
['--config', '-c', GetoptLong::REQUIRED_ARGUMENT],
- ['--backtrace', GetoptLong::NO_ARGUMENT]
+ ['--backtrace', GetoptLong::NO_ARGUMENT],
+ ['--path', GetoptLong::NO_ARGUMENT],
+ ['--version', GetoptLong::NO_ARGUMENT]
).each do |opt, arg|
case opt
when '--help' then STDOUT << HELP; exit true
+ when '--path' then puts File.dirname(File.dirname(File.expand_path(__FILE__))); exit true
+ when '--version' then puts Garlic::Version::String; exit true
when '--verbose' then @verbose = true
when '--config' then @config_file = arg
when '--targets' then @run_targets = arg
View
54 garlic.gemspec
@@ -1,3 +1,6 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE
+# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
@@ -6,23 +9,54 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Ian White"]
- s.date = %q{2009-06-27}
+ s.date = %q{2009-10-05}
s.default_executable = %q{garlic}
- s.description = %q{Set of commands/rake-tasks for CI against multiple version of rails/deps.}
+ s.description = %q{CI tool to test your project across multiple versions of rails/dependencies}
s.email = %q{ian.w.white@gmail.com}
s.executables = ["garlic"]
- s.files = ["lib/garlic/configurator.rb", "lib/garlic/generator.rb", "lib/garlic/repo.rb", "lib/garlic/session.rb", "lib/garlic/shell.rb", "lib/garlic/target.rb", "lib/garlic/tasks.rb", "lib/garlic.rb", "lib/tabtab_definitions/garlic.rb", "templates/default.rb", "templates/rspec.rb", "templates/shoulda.rb", "bin/garlic", "sh/garlic.sh", "License.txt", "README.textile", "Todo.txt", "History.txt", "spec/garlic/repo_spec.rb"]
- s.has_rdoc = true
- s.homepage = %q{http://github.com/ianwhite/garlic/tree}
- s.rdoc_options = ["--title", "Garlic", "--line-numbers"]
+ s.extra_rdoc_files = [
+ "README.textile"
+ ]
+ s.files = [
+ ".gitignore",
+ "History.txt",
+ "License.txt",
+ "README.textile",
+ "Rakefile",
+ "Todo.txt",
+ "VERSION",
+ "bin/garlic",
+ "garlic.gemspec",
+ "lib/garlic.rb",
+ "lib/garlic/configurator.rb",
+ "lib/garlic/generator.rb",
+ "lib/garlic/repo.rb",
+ "lib/garlic/session.rb",
+ "lib/garlic/shell.rb",
+ "lib/garlic/target.rb",
+ "lib/garlic/tasks.rb",
+ "lib/tabtab_definitions/garlic.rb",
+ "sh/garlic.sh",
+ "spec/garlic/repo_spec.rb",
+ "spec/spec_helper.rb",
+ "templates/default.rb",
+ "templates/rspec.rb",
+ "templates/shoulda.rb"
+ ]
+ s.homepage = %q{http://github.com/ianwhite/garlic}
+ s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.1}
- s.summary = %q{Set of commands/rake-tasks for CI against multiple version of rails/deps.}
- s.test_files = ["spec/garlic/repo_spec.rb"]
+ s.rubyforge_project = %q{garlic}
+ s.rubygems_version = %q{1.3.4}
+ s.summary = %q{Test your project across multiple versions of rails/dependencies}
+ s.test_files = [
+ "spec/garlic/repo_spec.rb",
+ "spec/spec_helper.rb"
+ ]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 2
+ s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
View
7 lib/garlic.rb
@@ -9,11 +9,8 @@ module Garlic
include Generator
module Version
- Major = 0
- Minor = 1
- Tiny = 9
-
- String = [Major, Minor, Tiny].join('.')
+ String = File.read(File.dirname(File.dirname(__FILE__)) + '/VERSION').strip
+ Major, Minor, Patch = String.split('.').map{|i| i.to_i}
end
# return the current garlic session
View
2 lib/garlic/generator.rb
@@ -1,3 +1,5 @@
+require 'fileutils'
+
module Garlic
# generate a garlic config file
module Generator
View
6 templates/default.rb
@@ -8,10 +8,10 @@
repo "rails", :url => "git://github.com/rails/rails"
# target railses
- ['origin/master', 'origin/2-2-stable', 'origin/2-1-stable', 'origin/2-0-stable'].each do |rails|
-
+ ['master', '2-3-stable', '2-2-stable', '2-1-stable', '2-0-stable'].each do |rails|
+
# declare how to prepare, and run each CI target
- target "Rails: \#{rails}", :tree_ish => rails do
+ target rails, :tree_ish => "origin/#{rails}" do
prepare do
plugin "#{plugin}", :clone => true # so we can work in targets
end
View
6 templates/rspec.rb
@@ -10,10 +10,10 @@
repo "rspec-rails", :url => "git://github.com/dchelimsky/rspec-rails"
# target railses
- ['origin/master', 'origin/2-2-stable', 'origin/2-1-stable', 'origin/2-0-stable'].each do |rails|
-
+ ['master', '2-3-stable', '2-2-stable', '2-1-stable', '2-0-stable'].each do |rails|
+
# declare how to prepare, and run each CI target
- target "Rails: \#{rails}", :tree_ish => rails do
+ target rails, :tree_ish => "origin/#{rails}" do
prepare do
plugin "#{plugin}", :clone => true # so we can work in targets
plugin "rspec"
View
6 templates/shoulda.rb
@@ -9,10 +9,10 @@
repo "shoulda", :url => "git://github.com/thoughtbot/shoulda"
# target railses
- ['origin/master', 'origin/2-2-stable', 'origin/2-1-stable', 'origin/2-0-stable'].each do |rails|
-
+ ['master', '2-3-stable', '2-2-stable', '2-1-stable', '2-0-stable'].each do |rails|
+
# declare how to prepare, and run each CI target
- target "Rails: \#{rails}", :tree_ish => rails do
+ target rails, :tree_ish => "origin/#{rails}" do
prepare do
plugin "#{plugin}", :clone => true # so we can work in targets
plugin "shoulda"

0 comments on commit a489c92

Please sign in to comment.