harleytt-capistrano-gitflow 1.4.7 → 1.4.8
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/VERSION +1 -1
- data/capistrano-gitflow.gemspec +2 -2
- data/lib/capistrano/gitflow.rb +2 -2
- metadata +4 -5
- data/lib/capistrano/gitflow/natcmp.rb +0 -76
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.8
|
data/capistrano-gitflow.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{harleytt-capistrano-gitflow}
|
8
|
-
s.version = "1.4.
|
8
|
+
s.version = "1.4.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Nichols", "Harley Trung"]
|
12
|
-
s.date = %q{2011-08-
|
12
|
+
s.date = %q{2011-08-18}
|
13
13
|
s.description = %q{Capistrano recipe for a deployment workflow based on git tags}
|
14
14
|
s.summary = %q{Capistrano recipe for a deployment workflow based on git tags}
|
15
15
|
s.email = %q{harley.trung@gmail.com}
|
data/lib/capistrano/gitflow.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'capistrano'
|
2
|
-
require File.join(File.dirname(__FILE__), 'gitflow', 'natcmp')
|
3
2
|
require 'stringex'
|
4
3
|
|
5
4
|
module Capistrano
|
@@ -66,7 +65,7 @@ module Capistrano
|
|
66
65
|
def get_from_tag(stage_name)
|
67
66
|
case stage_name
|
68
67
|
when :production
|
69
|
-
last_production_tag
|
68
|
+
last_production_tag || 'undefined'
|
70
69
|
when :staging
|
71
70
|
last_staging_tag
|
72
71
|
else
|
@@ -80,6 +79,7 @@ module Capistrano
|
|
80
79
|
when :production
|
81
80
|
last_staging_tag
|
82
81
|
when :staging
|
82
|
+
# get SHA of master
|
83
83
|
`git rev-list master | head -n 1`.chomp
|
84
84
|
else
|
85
85
|
raise "Unsupported stage #{stage}"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harleytt-capistrano-gitflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 8
|
10
|
+
version: 1.4.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Nichols
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-18 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -79,7 +79,6 @@ files:
|
|
79
79
|
- VERSION
|
80
80
|
- capistrano-gitflow.gemspec
|
81
81
|
- lib/capistrano/gitflow.rb
|
82
|
-
- lib/capistrano/gitflow/natcmp.rb
|
83
82
|
- recipes/gitflow_recipes.rb
|
84
83
|
- spec/gitflow_spec.rb
|
85
84
|
- spec/spec.opts
|
@@ -1,76 +0,0 @@
|
|
1
|
-
# natcmp.rb
|
2
|
-
#
|
3
|
-
# Natural order comparison of two strings
|
4
|
-
# e.g. "my_prog_v1.1.0" < "my_prog_v1.2.0" < "my_prog_v1.10.0"
|
5
|
-
# which does not follow alphabetically
|
6
|
-
#
|
7
|
-
# Based on Martin Pool's "Natural Order String Comparison" originally written in C
|
8
|
-
# http://sourcefrog.net/projects/natsort/
|
9
|
-
#
|
10
|
-
# This implementation is Copyright (C) 2003 by Alan Davies
|
11
|
-
# <cs96and_AT_yahoo_DOT_co_DOT_uk>
|
12
|
-
#
|
13
|
-
# This software is provided 'as-is', without any express or implied
|
14
|
-
# warranty. In no event will the authors be held liable for any damages
|
15
|
-
# arising from the use of this software.
|
16
|
-
#
|
17
|
-
# Permission is granted to anyone to use this software for any purpose,
|
18
|
-
# including commercial applications, and to alter it and redistribute it
|
19
|
-
# freely, subject to the following restrictions:
|
20
|
-
#
|
21
|
-
# 1. The origin of this software must not be misrepresented; you must not
|
22
|
-
# claim that you wrote the original software. If you use this software
|
23
|
-
# in a product, an acknowledgment in the product documentation would be
|
24
|
-
# appreciated but is not required.
|
25
|
-
# 2. Altered source versions must be plainly marked as such, and must not be
|
26
|
-
# misrepresented as being the original software.
|
27
|
-
# 3. This notice may not be removed or altered from any source distribution.
|
28
|
-
|
29
|
-
class String
|
30
|
-
|
31
|
-
# 'Natural order' comparison of two strings
|
32
|
-
def String.natcmp(str1, str2, caseInsensitive=false)
|
33
|
-
str1, str2 = str1.dup, str2.dup
|
34
|
-
compareExpression = /^(\D*)(\d*)(.*)$/
|
35
|
-
|
36
|
-
if caseInsensitive
|
37
|
-
str1.downcase!
|
38
|
-
str2.downcase!
|
39
|
-
end
|
40
|
-
|
41
|
-
# Remove all whitespace
|
42
|
-
str1.gsub!(/\s*/, '')
|
43
|
-
str2.gsub!(/\s*/, '')
|
44
|
-
|
45
|
-
while (str1.length > 0) or (str2.length > 0) do
|
46
|
-
# Extract non-digits, digits and rest of string
|
47
|
-
str1 =~ compareExpression
|
48
|
-
chars1, num1, str1 = $1.dup, $2.dup, $3.dup
|
49
|
-
|
50
|
-
str2 =~ compareExpression
|
51
|
-
chars2, num2, str2 = $1.dup, $2.dup, $3.dup
|
52
|
-
|
53
|
-
# Compare the non-digits
|
54
|
-
case (chars1 <=> chars2)
|
55
|
-
when 0 # Non-digits are the same, compare the digits...
|
56
|
-
# If either number begins with a zero, then compare alphabetically,
|
57
|
-
# otherwise compare numerically
|
58
|
-
if (num1[0] != 48) and (num2[0] != 48)
|
59
|
-
num1, num2 = num1.to_i, num2.to_i
|
60
|
-
end
|
61
|
-
|
62
|
-
case (num1 <=> num2)
|
63
|
-
when -1 then return -1
|
64
|
-
when 1 then return 1
|
65
|
-
end
|
66
|
-
when -1 then return -1
|
67
|
-
when 1 then return 1
|
68
|
-
end # case
|
69
|
-
|
70
|
-
end # while
|
71
|
-
|
72
|
-
# Strings are naturally equal
|
73
|
-
return 0
|
74
|
-
end
|
75
|
-
|
76
|
-
end # class String
|