auto_tagger 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ rdoc/*
4
4
  .DS_Store
5
5
  test_files/*
6
6
  .idea/*
7
+ .bundle/*
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 2010-05-15
2
+
3
+ - Fixed the exit status in autotag executable (thank you Sarah Mei)
4
+
1
5
  2010-04-25
2
6
 
3
7
  - Fixed creating incorrect tags when deploying from a branch, tag, or from head (Brian Takita & Bruce Krysiak)
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source :gemcutter
2
+
3
+ gem "cucumber", "0.6.4"
4
+ gem "capistrano", "2.5.18"
5
+ gem "capistrano-ext", "1.2.1"
6
+ gem "rspec", "1.3.0"
7
+ gem "rr", "0.8.1"
8
+ gem "activesupport", "2.3.5"
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ begin
8
8
  gem.summary = %Q{Helps you automatically create tags for each stage in a multi-stage deploment and deploy from the latest tag from the previous environment}
9
9
  gem.email = "jeff@zilkey.com"
10
10
  gem.homepage = "http://github.com/zilkey/auto_tagger"
11
- gem.authors = ["Jeff Dean", "Brian Takita", "Mike Grafton", "Bruce Krysiak", "Pat Nakajima", "Jay Zeschin", "Mike Barinek"]
11
+ gem.authors = ["Jeff Dean", "Brian Takita", "Mike Grafton", "Bruce Krysiak", "Pat Nakajima", "Jay Zeschin", "Mike Barinek", "Sarah Mei"]
12
12
  gem.add_dependency('capistrano', [">= 2.5.3"])
13
13
  gem.require_paths = ["lib"]
14
14
  gem.executables = ["autotag"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.5
data/auto_tagger.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{auto_tagger}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jeff Dean", "Brian Takita", "Mike Grafton", "Bruce Krysiak", "Pat Nakajima", "Jay Zeschin", "Mike Barinek"]
12
- s.date = %q{2010-04-25}
11
+ s.authors = ["Jeff Dean", "Brian Takita", "Mike Grafton", "Bruce Krysiak", "Pat Nakajima", "Jay Zeschin", "Mike Barinek", "Sarah Mei"]
12
+ s.date = %q{2010-05-15}
13
13
  s.default_executable = %q{autotag}
14
14
  s.email = %q{jeff@zilkey.com}
15
15
  s.executables = ["autotag"]
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".gitignore",
22
22
  "CHANGELOG",
23
+ "Gemfile",
23
24
  "MIT-LICENSE",
24
25
  "README.md",
25
26
  "Rakefile",
data/bin/autotag CHANGED
@@ -22,8 +22,14 @@ end
22
22
  if ARGV[0] && ["-h", "--help", "-?", "--?"].include?(ARGV[0])
23
23
  usage
24
24
  elsif ARGV[0]
25
- AutoTagger::Runner.new(ARGV[0], ARGV[1]).create_tag
26
- exit 1
25
+ begin
26
+ AutoTagger::Runner.new(ARGV[0], ARGV[1]).create_tag
27
+ rescue Exception => e
28
+ puts "Error occured: #{e}"
29
+ exit 1
30
+ else
31
+ exit 0
32
+ end
27
33
  else
28
34
  usage
29
35
  end
@@ -6,34 +6,46 @@ Feature: Deployment
6
6
  Scenario: user runs autotag with no args
7
7
  Given a repo
8
8
  When I run autotag with no arguments
9
- Then I should see "USAGE:"
9
+ And I should see "USAGE:"
10
10
  And no tags should be created
11
+ And exit code should be 0
11
12
 
12
13
  Scenario: user runs autotag with "--help"
13
14
  Given a repo
14
15
  When I run autotag with "--help"
15
- Then I should see "USAGE:"
16
+ And I should see "USAGE:"
16
17
  And no tags should be created
18
+ And exit code should be 0
17
19
 
18
20
  Scenario: user runs autotag with "-h"
19
21
  Given a repo
20
22
  When I run autotag with "-h"
21
- Then I should see "USAGE:"
23
+ And I should see "USAGE:"
22
24
  And no tags should be created
25
+ And exit code should be 0
23
26
 
24
27
  Scenario: user runs autotag with "-?"
25
28
  Given a repo
26
29
  When I run autotag with "-?"
27
- Then I should see "USAGE:"
30
+ And I should see "USAGE:"
28
31
  And no tags should be created
32
+ And exit code should be 0
29
33
 
30
34
  Scenario: user runs autotag with "demo"
31
35
  Given a repo
32
36
  When I run autotag with "demo"
33
- # can't check output here for some reason
34
37
  Then a "demo" tag should be created
38
+ And exit code should be 0
35
39
 
36
40
  Scenario: user runs autotag with "demo ."
37
41
  Given a repo
38
42
  When I run autotag with "demo"
39
43
  Then a "demo" tag should be created
44
+ And exit code should be 0
45
+
46
+ Scenario: autotag cannot successfully complete
47
+ Given a repo
48
+ When I run autotag with "demo /no/such/path"
49
+ Then I should see "Error occured:"
50
+ And exit code should be 1
51
+ And no tags should be created
@@ -10,16 +10,18 @@ end
10
10
  When /^I run autotag with no arguments$/ do
11
11
  puts
12
12
  helpers = StepHelpers.new
13
- @output = helpers.run_autotag
13
+ @output, @exit_code = helpers.run_autotag
14
14
  @tags = helpers.tags
15
+ @exit_code = helpers.exit_code
15
16
  puts
16
17
  end
17
18
 
18
19
  When /^I run autotag with "([^\"]*)"$/ do |args|
19
20
  puts
20
21
  helpers = StepHelpers.new
21
- @output = helpers.run_autotag(args)
22
+ @output, @exit_code = helpers.run_autotag(args)
22
23
  @tags = helpers.tags
24
+ @exit_code = helpers.exit_code
23
25
  puts
24
26
  end
25
27
 
@@ -27,6 +29,10 @@ Then /^I should see "([^\"]*)"$/ do |text|
27
29
  @output.should =~ /#{Regexp.escape(text)}/
28
30
  end
29
31
 
32
+ Then /^the exit code should be "(\d+)"$/ do |code|
33
+ @exit_code.exitstatus.should == code.to_i
34
+ end
35
+
30
36
  Then /^no tags should be created$/ do
31
37
  @tags.strip.should == ""
32
38
  end
@@ -39,3 +45,7 @@ end
39
45
  Then /^a "([^\"]*)" tag should be created$/ do |prefix|
40
46
  @tags.strip.split("\n").any?{|tag| tag.starts_with?("demo")}.should be_true
41
47
  end
48
+
49
+ Then /^exit code should be (\d*)$/ do |exit_code|
50
+ @exit_code.should == exit_code.to_i
51
+ end
@@ -1,5 +1,5 @@
1
1
  class StepHelpers
2
- attr_reader :test_files_dir, :app_dir, :repo_dir
2
+ attr_reader :test_files_dir, :app_dir, :repo_dir, :exit_code
3
3
 
4
4
  def initialize
5
5
  @test_files_dir = File.join(Dir.pwd, "test_files")
@@ -27,7 +27,9 @@ class StepHelpers
27
27
  def run_autotag(args = nil)
28
28
  cmd = "cd #{app_dir} && ../../bin/autotag"
29
29
  cmd += " #{args}" if args
30
- `#{cmd}`
30
+ output = `#{cmd}`
31
+ @exit_code = $?.exitstatus
32
+ return output
31
33
  end
32
34
 
33
35
  def create_app_with_cap_ext_multistage
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeff Dean
@@ -16,11 +16,12 @@ authors:
16
16
  - Pat Nakajima
17
17
  - Jay Zeschin
18
18
  - Mike Barinek
19
+ - Sarah Mei
19
20
  autorequire:
20
21
  bindir: bin
21
22
  cert_chain: []
22
23
 
23
- date: 2010-04-25 00:00:00 -04:00
24
+ date: 2010-05-15 00:00:00 -04:00
24
25
  default_executable: autotag
25
26
  dependencies:
26
27
  - !ruby/object:Gem::Dependency
@@ -49,6 +50,7 @@ files:
49
50
  - .document
50
51
  - .gitignore
51
52
  - CHANGELOG
53
+ - Gemfile
52
54
  - MIT-LICENSE
53
55
  - README.md
54
56
  - Rakefile