ianwhite-garlic 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,13 @@
1
+ == 0.1.6 2008-11-27
2
+
3
+ * 3 minor enhancements
4
+ * Updated Readme/TODO
5
+ * Some crufty output is now suppressed/removed
6
+ * garlic all command cleans the work path
7
+
8
+ * 1 bugfix
9
+ * --targets, -t option now actually works
10
+
1
11
  == 0.1.5 2008-11-25
2
12
 
3
13
  * 4 minor enhancements
data/README.textile CHANGED
@@ -1,7 +1,7 @@
1
1
  h1. garlic: lightweight continuous integration for rails using git
2
2
 
3
3
  This is not a CI server, use cruisecontrol.rb for that. This is a simple set
4
- of rake tasks that let you specify a bunch of rails builds to run against, and
4
+ of commands (or rake tasks) that let you specify a bunch of rails builds to run against, and
5
5
  dependencies to install.
6
6
 
7
7
  This is aimed at testing plugins (or apps) against multiple versions of rails,
@@ -15,10 +15,14 @@ Garlic works by cloning git repos for all your dependencies (so they all must be
15
15
  git repos), and then using git to checkout various tags and branches to build
16
16
  your app against.
17
17
 
18
+ "Here's an example of running a plugin against 3 different rails verisons and 3 different rspec versions":http://gist.github.com/28786
19
+
18
20
  h2. It's still new, and not shiny yet
19
21
 
20
22
  Please feel free to make it shinier. I'm successfully using it on most of my plugins, and I test
21
- with garlic and cucumber.
23
+ with rspec and cucumber.
24
+
25
+ Check out the "TODO LIST":http://github.com/ianwhite/garlic/tree/master/Todo.txt
22
26
 
23
27
  h2. Get up and running quickly
24
28
 
@@ -89,7 +93,12 @@ Check dis out
89
93
  garlic shell # "Example output":http://gist.github.com/28795
90
94
 
91
95
  You can pipe any thing into garlic shell and it will execute across all of your garlic targets
92
-
96
+
97
+ h2. Rake tasks
98
+
99
+ If you prefer to use garlic via rake tasks, then just require 'garlic/tasks' and you'll get a bunch of em.
100
+ Once required, do rake -T to see descriptions.
101
+
93
102
  h2. Lend a hand
94
103
 
95
104
  This is an early release, so there is plenty of scope for changes and improvement
@@ -103,6 +112,6 @@ h2. Lent a hand
103
112
  Thanks very much to:
104
113
 
105
114
  * Pat Allan
106
- * Dr Nic Williams
115
+ * Dr Nic Williams (API suggestions)
107
116
 
108
117
 
data/Todo.txt CHANGED
@@ -1,4 +1,4 @@
1
- * add 'gem' dependency - should it freeze the gem? or use ginger?
1
+ * add 'gem' command - should it freeze the gem in to vendor/gems?
2
+ * BETTER OUTPUT - even less uninteresting cruft in the output please
2
3
  * specs!
3
4
  * cucumber features!
4
- * rewrite using grit? (research: is grit the defacto standard for ruby controlling git?)
data/bin/garlic CHANGED
@@ -23,8 +23,9 @@ OPTIONS:
23
23
  --help -h You're reading it
24
24
  --verbose -v Show work
25
25
  --config CONFIG -c Specify a different location of garlic config
26
- --targets TARGETS -t Specify subset of targets, e.g. edge,2.1.0 (default all)
27
- --backtrace Show ruby bakctrace on error
26
+ --backtrace Show ruby backtrace on error
27
+ --targets TARGETS -t Specify subset of targets comma separated or
28
+ regexp part e.g. -t 2-1,2-2
28
29
 
29
30
  You can generate a sample garlic.rb with
30
31
  garlic generate [TEMPLATE [PLUGIN_NAME]] (Available templates: #{available_templates.join(', ')})
@@ -59,10 +60,9 @@ begin
59
60
  verbose(@verbose)
60
61
 
61
62
  # configure the garlic runner
62
- garlic @config_file do
63
- verbose @verbose
64
- run_targets @run_targets
65
- end
63
+ garlic(@config_file) # load up the garlic instance
64
+ garlic.verbose = @verbose
65
+ garlic.run_targets = @run_targets
66
66
 
67
67
  # run the command
68
68
  ARGV << 'default' if ARGV.empty?
@@ -61,6 +61,7 @@ module Garlic
61
61
  define_command :all, "Install and update all repos, prepare and run TARGETs" do
62
62
  install_repos
63
63
  update_repos
64
+ clean
64
65
  prepare
65
66
  run
66
67
  end
@@ -94,11 +95,7 @@ module Garlic
94
95
  end
95
96
 
96
97
  define_command :prepare, "Prepare each garlic TARGET" do
97
- begin
98
- determine_targets.each {|target| target.prepare }
99
- ensure
100
- repo('rails').checkout('master') # we get rails back to master if something goes wrong
101
- end
98
+ determine_targets.each {|target| target.prepare }
102
99
  end
103
100
 
104
101
  define_command :shell, "Run shell commands from stdin across specified targets" do |*path|
@@ -137,7 +134,7 @@ protected
137
134
  end
138
135
 
139
136
  def determine_targets
140
- run_targets ? targets.select{|t| run_targets.include?(t.name)} : targets
137
+ run_targets ? targets.select{|t| t.name =~ /(?:#{run_targets.join("|")})/i} : targets
141
138
  end
142
139
  end
143
140
  end
data/lib/garlic/target.rb CHANGED
@@ -58,26 +58,24 @@ module Garlic
58
58
  puts "Rails app for #{name} exists"
59
59
  else
60
60
  puts "Creating rails app for #{name}..."
61
- sh "ruby #{rails_repo.path}/railties/bin/rails #{path}", :verbose => false
61
+ `ruby #{rails_repo.path}/railties/bin/rails #{path}`
62
62
  end
63
- install_dependency(rails_repo, 'vendor/rails') { sh "rake rails:update" }
63
+ install_dependency(rails_repo, 'vendor/rails') { `rake rails:update` }
64
64
  end
65
65
 
66
66
  def install_dependency(repo, install_path = ".", options = {}, &block)
67
67
  repo = garlic.repo(repo) unless repo.is_a?(Repo)
68
68
  tree_ish = Repo.tree_ish(options)
69
69
 
70
- puts tree_ish
71
-
72
70
  if options[:clone]
73
71
  if Repo.path?(install_path)
74
72
  puts "#{install_path} exists, and is a repo"
75
- cd(install_path) { sh "git fetch origin" }
73
+ cd(install_path) { `git fetch origin` }
76
74
  else
77
75
  puts "cloning #{repo.name} to #{install_path}"
78
76
  repo.clone_to(File.join(path, install_path))
79
77
  end
80
- cd(install_path) { sh "git checkout #{tree_ish || repo.head_sha}" }
78
+ cd(install_path) { `git checkout #{tree_ish || repo.head_sha}` }
81
79
 
82
80
  else
83
81
  if read_sha(install_path) == repo.head_sha
data/lib/garlic.rb CHANGED
@@ -11,7 +11,7 @@ module Garlic
11
11
  module Version
12
12
  Major = 0
13
13
  Minor = 1
14
- Tiny = 5
14
+ Tiny = 6
15
15
 
16
16
  String = [Major, Minor, Tiny].join('.')
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ianwhite-garlic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian White
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-25 00:00:00 -08:00
12
+ date: 2008-11-27 00:00:00 -08:00
13
13
  default_executable: garlic
14
14
  dependencies: []
15
15