crossroads_capistrano 1.3.3 → 1.3.4

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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "crossroads_capistrano"
6
- s.version = "1.3.3"
6
+ s.version = "1.3.4"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
9
9
  s.email = ["it_dept@crossroads.org.hk"]
@@ -9,6 +9,9 @@ namespace :deploy do
9
9
  require File.join(rails_root,'config','initializers','hoptoad')
10
10
  require 'hoptoad_tasks'
11
11
 
12
+ # Format HoptoadTasks output nicely.
13
+ HoptoadTasks.module_eval do; def self.puts(str); super " ** #{str}\n\n"; end; end
14
+
12
15
  rails_env = fetch(:hoptoad_env, fetch(:rails_env, "production"))
13
16
  local_user = ENV['USER'] || ENV['USERNAME']
14
17
 
@@ -16,15 +19,13 @@ namespace :deploy do
16
19
  * \033[0;32m== Notifying Hoptoad of Deploy\033[0m
17
20
  - \033[0;33mUser:\033[0m #{local_user}
18
21
  - \033[0;33mRails Environment:\033[0m #{rails_env}
19
- - \033[0;33mRevision:\033[0m #{current_revision}
22
+ - \033[0;33mRevision:\033[1;37m #{current_revision[0,7]}\033[0m
20
23
  - \033[0;33mRepository:\033[0m #{repository}\n\n}
21
24
 
22
25
  HoptoadTasks.deploy(:rails_env => rails_env,
23
26
  :scm_revision => current_revision,
24
27
  :scm_repository => repository,
25
28
  :local_username => local_user)
26
-
27
- puts "\n Hoptoad Notification Complete.\n\n"
28
29
  end
29
30
  end
30
31
 
@@ -2,25 +2,26 @@ namespace :deploy do
2
2
  desc "Show currently deployed revision on server."
3
3
  task :revisions, :roles => :app do
4
4
  current, previous, latest = current_revision[0,7], previous_revision[0,7], real_revision[0,7]
5
- puts "\n" << "-"*63
6
- puts "===== Master Revision: \033[1;33m#{latest}\033[0m\n\n"
7
- puts "===== [ \033[1;36m#{application} - #{stage}\033[0m ]"
8
- puts "=== Deployed Revision: \033[1;32m#{current}\033[0m"
9
- puts "=== Previous Revision: \033[1;32m#{previous}\033[0m\n\n"
5
+ branch_indent = " "*(i=10-branch.size;i<0 ? 0 : i) << branch.capitalize
6
+ current_is_deployed = current == latest
7
+ puts "\n * \033[0;32m== Showing revisions and diffs for [\033[1;32m#{application} #{stage}\033[0;32m]\033[0m\n\n"
8
+ puts " \033[1;33m#{branch_indent} Branch: \033[1;37m#{latest}\033[0m"
9
+ puts " \033[#{current == latest ? 1 : 0};33mDeployed Revision: \033[#{current == latest ? 1 : 0};37m#{current}\033[0m"
10
+ puts " \033[#{previous == latest ? 1 : 0};33mPrevious Revision: \033[#{previous == latest ? 1 : 0};37m#{previous}\033[0m\n\n"
10
11
 
11
12
  # If deployed and master are the same, show the difference between the last 2 deployments.
12
13
  base_label, new_label, base_rev, new_rev = latest != current ? \
13
- ["deployed", "master", current, latest] : \
14
- ["previous", "deployed", previous, current]
14
+ ["deployed revision", "#{branch} branch", current, latest] : \
15
+ ["previous revision", "deployed revision", previous, current]
15
16
 
16
17
  # Show difference between master and deployed revisions.
17
18
  if (diff = `git log #{base_rev}..#{new_rev} --oneline`) != ""
18
19
  # Colorize refs
19
- diff.gsub!(/^([a-f0-9]+) /, "\033[1;32m\\1\033[0m - ")
20
- diff = " " << diff.gsub("\n", "\n ") << "\n"
20
+ diff.gsub!(/^([a-f0-9]+) /, "\033[1;37m\\1\033[0m: ")
21
+ diff = " "*18 << diff.gsub("\n", "\n ") << "\n"
21
22
  # Indent commit messages nicely, max 80 chars per line, line has to end with space.
22
- diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*14).gsub(/([^ ]*)\n {14}/m,"\n"<<" "*14<<"\\1")}.join("\n")
23
- puts "=== Difference between #{base_label} revision and #{new_label} revision:\n\n"
23
+ diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*28).gsub(/([^ ]*)\n {28}/m,"\n"<<" "*28<<"\\1")}.join("\n")
24
+ puts " * \033[0;32m== Difference between \033[1;32m#{base_label}\033[0;32m and \033[1;32m#{new_label}\033[0;32m:\033[0m\n\n"
24
25
  puts diff
25
26
  end
26
27
  end
metadata CHANGED
@@ -1,26 +1,31 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: crossroads_capistrano
3
- version: !ruby/object:Gem::Version
4
- version: 1.3.3
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 1.3.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Steve Kenworthy
9
9
  - Ben Tillman
10
10
  - Nathan Broadbent
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-05-19 00:00:00.000000000 +08:00
14
+
15
+ date: 2011-05-20 00:00:00 +08:00
15
16
  default_executable:
16
17
  dependencies: []
18
+
17
19
  description: A Crossroads Foundation collection of generic capistrano recipes.
18
- email:
20
+ email:
19
21
  - it_dept@crossroads.org.hk
20
22
  executables: []
23
+
21
24
  extensions: []
25
+
22
26
  extra_rdoc_files: []
23
- files:
27
+
28
+ files:
24
29
  - .gitignore
25
30
  - Gemfile
26
31
  - README.textile
@@ -46,26 +51,30 @@ files:
46
51
  has_rdoc: true
47
52
  homepage: http://www.crossroads.org.hk
48
53
  licenses: []
54
+
49
55
  post_install_message:
50
56
  rdoc_options: []
51
- require_paths:
57
+
58
+ require_paths:
52
59
  - lib
53
- required_ruby_version: !ruby/object:Gem::Requirement
60
+ required_ruby_version: !ruby/object:Gem::Requirement
54
61
  none: false
55
- requirements:
56
- - - ! '>='
57
- - !ruby/object:Gem::Version
58
- version: '0'
59
- required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
67
  none: false
61
- requirements:
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
64
- version: '0'
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
65
72
  requirements: []
73
+
66
74
  rubyforge_project: crossroads_capistrano
67
- rubygems_version: 1.6.2
75
+ rubygems_version: 1.6.0
68
76
  signing_key:
69
77
  specification_version: 3
70
78
  summary: Crossroads capistrano recipes
71
79
  test_files: []
80
+