capflow 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,13 +1,12 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
2
+
5
3
  gem 'capistrano'
6
4
  gem 'stringex'
5
+ gem 'hashie'
7
6
  gem 'versionomy'
8
7
  gem 'rainbow'
9
- # Add dependencies to develop your gem here.
10
- # Include everything needed to run rake, tests, features, etc.
8
+ gem "ablerc", "~> 0.1.0"
9
+
11
10
  group :development do
12
11
  gem "shoulda", "~> 3.0.0.beta2"
13
12
  gem 'active_support'
@@ -18,3 +17,5 @@ group :development do
18
17
  gem "jeweler", "~> 1.6.4"
19
18
  gem "rcov", ">= 0"
20
19
  end
20
+
21
+ gemspec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 2.0.0
data/capflow.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capflow"
8
- s.version = "0.6.4"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Spencer Markowski"]
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
29
29
  "features/support/env.rb",
30
30
  "lib/capflow.rb",
31
31
  "lib/capistrano/capflow.rb",
32
- "lib/capistrano/helpers/capflow_helper.rb",
33
32
  "lib/railtie.rb",
34
33
  "lib/tasks/capflow.rake",
35
34
  "recipes/capflow_recipes.rb",
data/lib/capflow.rb CHANGED
@@ -1,3 +1,22 @@
1
+ require 'capflow/configuration'
2
+ require 'capflow/version'
3
+
4
+ if defined?(Bundler)
5
+ #Bundler.setup
6
+ #Bundler.require(:default)
7
+ end
8
+
1
9
  module Capflow
2
- require 'railtie' if defined?(Rails)
10
+
11
+ if defined?(Rails)
12
+ require 'railtie'
13
+ Capflow::Version.base_dir = Rails.root
14
+ end
15
+
16
+ def self.root
17
+ File.expand_path '../..', __FILE__
18
+ end
19
+
20
+ Configuration.load! Configuration::PROJECT_CONFIG_FILE if Capflow::Configuration.project_settings?
21
+
3
22
  end
@@ -1,11 +1,11 @@
1
1
  require 'capistrano'
2
- require 'capistrano/helpers/capflow_helper'
2
+ require File.join(File.expand_path('../..', __FILE__), 'capflow')
3
3
  require 'versionomy'
4
4
  require 'stringex'
5
5
  require 'rainbow'
6
6
 
7
7
  module Capistrano
8
- class Capflow
8
+ class CapflowApplicator
9
9
  trap("SIGINT") { puts "Leaving Capflow!".color(:red); exit }
10
10
  # I gave up for now, since namespace can't call include
11
11
  # include Capistrano::Helpers::CapflowHelper
@@ -51,24 +51,19 @@ module Capistrano
51
51
  end
52
52
 
53
53
  def available_tags
54
- Capistrano::CLI.ui.say "Available Tags:"
55
- Capistrano::CLI.ui.say "#{non_release_tags.join("\n")}"
54
+ Capistrano::CLI.ui.say "Available Tags:".color :green
55
+ Capistrano::CLI.ui.say "#{releases.sort.reverse.take(Capflow::Configuration.previous_releases.to_i).join("\n")}"
56
56
  end
57
57
 
58
58
  def available_releases
59
59
  Capistrano::CLI.ui.say "\nAvailable Releases:".color :green
60
- Capistrano::CLI.ui.say "#{releases.sort.reverse.join("\n")}"
60
+ Capistrano::CLI.ui.say "#{releases.reverse.take(Capflow::Configuration.previous_releases.to_i).join("\n")}"
61
61
  end
62
62
 
63
63
  def banner
64
64
 
65
65
  <<-BANNER
66
66
  \nCapflow for Gitflow
67
- ,-------------.
68
- (o) _ __ _____ )--.
69
- `-------------' )
70
- ( /
71
- `---'
72
67
  BANNER
73
68
  end
74
69
 
@@ -193,5 +188,5 @@ Please make sure you have pulled and pushed all code before deploying:
193
188
  end
194
189
 
195
190
  if Capistrano::Configuration.instance
196
- Capistrano::Capflow.load_into(Capistrano::Configuration.instance)
191
+ Capistrano::CapflowApplicator.load_into(Capistrano::Configuration.instance)
197
192
  end
@@ -29,7 +29,43 @@ end
29
29
 
30
30
  namespace :capflow do
31
31
  desc "Show available releases"
32
- task :releases do
32
+ task :releases do
33
33
  puts `git tag`.split("\n").compact.collect{|version| Versionomy.parse(version)}.sort.reverse
34
+ exit
35
+ end
36
+
37
+ task :configuration do
38
+ puts "Gitflow"
39
+ Capflow::Configuration.ablerc.stub.generate :local
40
+ exit
41
+ end
42
+ end
43
+
44
+ # from https://github.com/technicalpickles/jeweler/blob/master/lib/jeweler/tasks.rb
45
+ namespace :version do
46
+ desc "Writes out an explicit version. Respects the following environment variables, or defaults to 0: MAJOR, MINOR, PATCH. Also recognizes BUILD, which defaults to nil"
47
+ task :write do
48
+ version = Capflow::Version.write_version( :major => ENV['MAJOR'].to_i, :minor => ENV['MINOR'].to_i, :tiny => ENV['PATCH'].to_i, :build => (ENV['BUILD'] || nil ) )
49
+ $stdout.puts "Updated version: #{version.to_s}"
50
+ end
51
+
52
+ namespace :bump do
53
+ desc "Bump the major version by 1"
54
+ task :major => [:version_required, :version] do
55
+ #jeweler.bump_major_version
56
+ $stdout.puts "Updated version: #{jeweler.version}"
57
+ end
58
+
59
+ desc "Bump the a minor version by 1"
60
+ task :minor => [:version_required, :version] do
61
+ #jeweler.bump_minor_version
62
+ $stdout.puts "Updated version: #{jeweler.version}"
63
+ end
64
+
65
+ desc "Bump the patch version by 1"
66
+ task :patch => [:version_required, :version] do
67
+ #jeweler.bump_patch_version
68
+ $stdout.puts "Updated version: #{jeweler.version}"
69
+ end
34
70
  end
35
71
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capflow
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 4
10
- version: 0.6.4
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Spencer Markowski
@@ -18,8 +18,6 @@ cert_chain: []
18
18
  date: 2013-03-07 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: capistrano
22
- prerelease: false
23
21
  requirement: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
@@ -29,11 +27,11 @@ dependencies:
29
27
  segments:
30
28
  - 0
31
29
  version: "0"
32
- type: :runtime
33
30
  version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: stringex
31
+ name: capistrano
36
32
  prerelease: false
33
+ type: :runtime
34
+ - !ruby/object:Gem::Dependency
37
35
  requirement: &id002 !ruby/object:Gem::Requirement
38
36
  none: false
39
37
  requirements:
@@ -43,11 +41,11 @@ dependencies:
43
41
  segments:
44
42
  - 0
45
43
  version: "0"
46
- type: :runtime
47
44
  version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: versionomy
45
+ name: stringex
50
46
  prerelease: false
47
+ type: :runtime
48
+ - !ruby/object:Gem::Dependency
51
49
  requirement: &id003 !ruby/object:Gem::Requirement
52
50
  none: false
53
51
  requirements:
@@ -57,11 +55,11 @@ dependencies:
57
55
  segments:
58
56
  - 0
59
57
  version: "0"
60
- type: :runtime
61
58
  version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: rainbow
59
+ name: versionomy
64
60
  prerelease: false
61
+ type: :runtime
62
+ - !ruby/object:Gem::Dependency
65
63
  requirement: &id004 !ruby/object:Gem::Requirement
66
64
  none: false
67
65
  requirements:
@@ -71,17 +69,17 @@ dependencies:
71
69
  segments:
72
70
  - 0
73
71
  version: "0"
74
- type: :runtime
75
72
  version_requirements: *id004
76
- - !ruby/object:Gem::Dependency
77
- name: shoulda
73
+ name: rainbow
78
74
  prerelease: false
75
+ type: :runtime
76
+ - !ruby/object:Gem::Dependency
79
77
  requirement: &id005 !ruby/object:Gem::Requirement
80
78
  none: false
81
79
  requirements:
82
80
  - - ~>
83
81
  - !ruby/object:Gem::Version
84
- hash: 2327717285
82
+ hash: -3339270128
85
83
  segments:
86
84
  - 3
87
85
  - 0
@@ -89,11 +87,11 @@ dependencies:
89
87
  - beta
90
88
  - 2
91
89
  version: 3.0.0.beta2
92
- type: :development
93
90
  version_requirements: *id005
94
- - !ruby/object:Gem::Dependency
95
- name: active_support
91
+ name: shoulda
96
92
  prerelease: false
93
+ type: :development
94
+ - !ruby/object:Gem::Dependency
97
95
  requirement: &id006 !ruby/object:Gem::Requirement
98
96
  none: false
99
97
  requirements:
@@ -103,11 +101,11 @@ dependencies:
103
101
  segments:
104
102
  - 0
105
103
  version: "0"
106
- type: :development
107
104
  version_requirements: *id006
108
- - !ruby/object:Gem::Dependency
109
- name: i18n
105
+ name: active_support
110
106
  prerelease: false
107
+ type: :development
108
+ - !ruby/object:Gem::Dependency
111
109
  requirement: &id007 !ruby/object:Gem::Requirement
112
110
  none: false
113
111
  requirements:
@@ -117,11 +115,11 @@ dependencies:
117
115
  segments:
118
116
  - 0
119
117
  version: "0"
120
- type: :development
121
118
  version_requirements: *id007
122
- - !ruby/object:Gem::Dependency
123
- name: minitest-rg
119
+ name: i18n
124
120
  prerelease: false
121
+ type: :development
122
+ - !ruby/object:Gem::Dependency
125
123
  requirement: &id008 !ruby/object:Gem::Requirement
126
124
  none: false
127
125
  requirements:
@@ -131,11 +129,11 @@ dependencies:
131
129
  segments:
132
130
  - 0
133
131
  version: "0"
134
- type: :development
135
132
  version_requirements: *id008
136
- - !ruby/object:Gem::Dependency
137
- name: cucumber
133
+ name: minitest-rg
138
134
  prerelease: false
135
+ type: :development
136
+ - !ruby/object:Gem::Dependency
139
137
  requirement: &id009 !ruby/object:Gem::Requirement
140
138
  none: false
141
139
  requirements:
@@ -145,11 +143,11 @@ dependencies:
145
143
  segments:
146
144
  - 0
147
145
  version: "0"
148
- type: :development
149
146
  version_requirements: *id009
150
- - !ruby/object:Gem::Dependency
151
- name: bundler
147
+ name: cucumber
152
148
  prerelease: false
149
+ type: :development
150
+ - !ruby/object:Gem::Dependency
153
151
  requirement: &id010 !ruby/object:Gem::Requirement
154
152
  none: false
155
153
  requirements:
@@ -159,11 +157,11 @@ dependencies:
159
157
  segments:
160
158
  - 0
161
159
  version: "0"
162
- type: :development
163
160
  version_requirements: *id010
164
- - !ruby/object:Gem::Dependency
165
- name: jeweler
161
+ name: bundler
166
162
  prerelease: false
163
+ type: :development
164
+ - !ruby/object:Gem::Dependency
167
165
  requirement: &id011 !ruby/object:Gem::Requirement
168
166
  none: false
169
167
  requirements:
@@ -175,11 +173,11 @@ dependencies:
175
173
  - 6
176
174
  - 4
177
175
  version: 1.6.4
178
- type: :development
179
176
  version_requirements: *id011
180
- - !ruby/object:Gem::Dependency
181
- name: rcov
177
+ name: jeweler
182
178
  prerelease: false
179
+ type: :development
180
+ - !ruby/object:Gem::Dependency
183
181
  requirement: &id012 !ruby/object:Gem::Requirement
184
182
  none: false
185
183
  requirements:
@@ -189,8 +187,10 @@ dependencies:
189
187
  segments:
190
188
  - 0
191
189
  version: "0"
192
- type: :development
193
190
  version_requirements: *id012
191
+ name: rcov
192
+ prerelease: false
193
+ type: :development
194
194
  description: An unrestictive way to deploy using gitflow and capistrano
195
195
  email: spencer@theablefew.com
196
196
  executables: []
@@ -213,7 +213,6 @@ files:
213
213
  - features/support/env.rb
214
214
  - lib/capflow.rb
215
215
  - lib/capistrano/capflow.rb
216
- - lib/capistrano/helpers/capflow_helper.rb
217
216
  - lib/railtie.rb
218
217
  - lib/tasks/capflow.rake
219
218
  - recipes/capflow_recipes.rb
@@ -1,62 +0,0 @@
1
- module Capistrano
2
- module Helpers
3
- module CapflowHelper
4
-
5
- def who
6
- identity = (`git config user.name` || `whoami`)
7
- identity.chomp.to_url
8
- end
9
-
10
- def tags
11
- `git tag`.split("\n").compact
12
- end
13
-
14
- def non_release_tags
15
- tags - releases
16
- end
17
-
18
- def current_branch
19
- branches.select{|b| b =~ /^\*\s/}.first.gsub(/^\*\s/,"")
20
- end
21
-
22
- def branches
23
- `git branch --no-color`.split("\n")
24
- end
25
-
26
- def version_tag_prefix
27
- `git config gitflow.prefix.versiontag`.split("\n").first
28
- end
29
-
30
- def releases
31
- tags.select{|t| t =~ /^#{version_tag_prefix}(\d+)/}
32
- end
33
-
34
- def latest_release
35
- releases.sort{|x,y| x.split(version_tag_prefix).last <=> y.split(version_tag_prefix).last}.last
36
- end
37
-
38
- def available_tags
39
- Capistrano::CLI.ui.say "Available Tags:"
40
- Capistrano::CLI.ui.say "#{non_release_tags.join("\n")}"
41
- end
42
-
43
- def available_releases
44
- Capistrano::CLI.ui.say "\nAvailable Releases:"
45
- Capistrano::CLI.ui.say "#{releases.join("\n")}"
46
- end
47
-
48
- def banner
49
-
50
- <<-BANNER
51
- \nCapflow for Gitflow
52
- ,-------------.
53
- (o) _ __ _____ )--.
54
- `-------------' )
55
- ( /
56
- `---'
57
- BANNER
58
- end
59
-
60
- end
61
- end
62
- end