ianwhite-garlic 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/garlic CHANGED
@@ -15,7 +15,7 @@ garlic - run a command in different versions of rails
15
15
  USAGE: garlic [options] [command]
16
16
 
17
17
  COMMANDS:
18
- #{Garlic::Runner.commands_with_description.map{|method, desc| " %-17s %s" % [method, desc]}.join("\n")}
18
+ #{Garlic::Session.commands_with_description.map{|method, desc| " %-17s %s" % [method, desc]}.join("\n")}
19
19
 
20
20
  The default command is "default"
21
21
 
@@ -31,6 +31,8 @@ You can generate a sample garlic.rb with
31
31
 
32
32
  end_doc
33
33
 
34
+ @verbose = false
35
+
34
36
  GetoptLong.new(
35
37
  ['--help', '-h', GetoptLong::NO_ARGUMENT],
36
38
  ['--verbose', '-v', GetoptLong::NO_ARGUMENT],
@@ -48,14 +50,14 @@ GetoptLong.new(
48
50
  end
49
51
 
50
52
  begin
51
- # generate a config file
52
53
  if ARGV.first == 'generate'
53
54
  generate_config(*ARGV[1..-1])
54
-
55
- # run a garlic command
56
55
  else
57
- raise "Unknown command: #{ARGV.first}" unless ARGV.empty? || Garlic::Runner.commands.include?(ARGV.first)
56
+ # run a garlic command
57
+ raise "Unknown command: #{ARGV.first}" unless ARGV.empty? || Garlic::Session.commands.include?(ARGV.first)
58
58
 
59
+ verbose(@verbose)
60
+
59
61
  # configure the garlic runner
60
62
  garlic @config_file do
61
63
  verbose @verbose
@@ -1,6 +1,6 @@
1
1
  module Garlic
2
2
  # this class runs the top level garlic commands
3
- class Runner
3
+ class Session
4
4
  attr_reader :actor, :run_targets
5
5
  attr_accessor :repos, :targets, :all_targets, :repo_path, :work_path, :verbose
6
6
 
data/lib/garlic/tasks.rb CHANGED
@@ -14,7 +14,7 @@ task :garlic do
14
14
  end
15
15
 
16
16
  namespace :garlic do
17
- Garlic::Runner.commands_with_description.each do |command, description|
17
+ Garlic::Session.commands_with_description.each do |command, description|
18
18
  desc description
19
19
  task command do
20
20
  garlic.send command
data/lib/garlic.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "garlic/runner"
1
+ require "garlic/session"
2
2
  require "garlic/configurator"
3
3
  require "garlic/repo"
4
4
  require "garlic/target"
@@ -11,14 +11,14 @@ module Garlic
11
11
  module Version
12
12
  Major = 0
13
13
  Minor = 1
14
- Tiny = 2
14
+ Tiny = 3
15
15
 
16
16
  String = [Major, Minor, Tiny].join('.')
17
17
  end
18
18
 
19
- # return the current garlic runner
19
+ # return the current garlic session
20
20
  def garlic(config = nil, &block)
21
- @garlic ||= Garlic::Runner.new(self)
21
+ @garlic ||= Garlic::Session.new(self)
22
22
  load_config(config)
23
23
  @garlic.configure(&block) if block_given?
24
24
  @garlic
@@ -0,0 +1,7 @@
1
+ require "garlic/session"
2
+
3
+ TabTab::Definition.register('garlic', :import => '--help') do |g|
4
+ Garlic::Session.commands.each do |c|
5
+ g.command c
6
+ end
7
+ 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.2
4
+ version: 0.1.3
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-02 00:00:00 -07:00
12
+ date: 2008-11-23 00:00:00 -08:00
13
13
  default_executable: garlic
14
14
  dependencies: []
15
15
 
@@ -25,11 +25,12 @@ files:
25
25
  - lib/garlic/configurator.rb
26
26
  - lib/garlic/generator.rb
27
27
  - lib/garlic/repo.rb
28
- - lib/garlic/runner.rb
28
+ - lib/garlic/session.rb
29
29
  - lib/garlic/shell.rb
30
30
  - lib/garlic/target.rb
31
31
  - lib/garlic/tasks.rb
32
32
  - lib/garlic.rb
33
+ - lib/tabtab_definition.rb
33
34
  - templates/default.rb
34
35
  - templates/rspec.rb
35
36
  - templates/shoulda.rb