socialcast-git-extensions 2.2.5 → 2.2.6

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/bin/git-integrate CHANGED
@@ -9,6 +9,8 @@ include Socialcast::Gitx
9
9
  include Socialcast::Git
10
10
 
11
11
  branch = current_branch
12
+ protect_reserved_branches!(branch, 'integrate')
13
+ exit 1
12
14
 
13
15
  run_cmd 'git update'
14
16
  integrate(branch, 'prototype')
data/bin/git-promote CHANGED
@@ -5,6 +5,9 @@ include Socialcast::Gitx
5
5
  include Socialcast::Git
6
6
 
7
7
  branch = current_branch
8
+ protect_reserved_branches!(branch, 'promote')
9
+
10
+ exit 1
8
11
 
9
12
  run_cmd 'git update'
10
13
  integrate(branch, 'staging')
data/bin/git-release CHANGED
@@ -5,7 +5,7 @@ include Socialcast::Gitx
5
5
  include Socialcast::Git
6
6
 
7
7
  branch = current_branch
8
- abort("Cannot release reserved branch") if %w{master staging prototype}.include?(branch)
8
+ protect_reserved_branches!(branch, 'release')
9
9
 
10
10
  exit unless HighLine.agree("<%= color('Release #{branch} to production? (y/n)', :green) %>")
11
11
 
@@ -8,6 +8,4 @@ head_branch = ARGV.first || 'master'
8
8
  reset_branch('prototype', head_branch)
9
9
  reset_branch('last_known_good_prototype', head_branch)
10
10
 
11
- HighLine.say "\n<%= color('Updating the following tickets to no longer be in prototype:', :red) %>"
12
-
13
11
  share "#worklog resetting prototype branch #scgitx"
@@ -4,6 +4,9 @@ require 'socialcast-git-extensions/github'
4
4
 
5
5
  module Socialcast
6
6
  module Gitx
7
+ def protect_reserved_branches!(branch, mode)
8
+ abort("Cannot #{mode} reserved branch") if Socialcast::Git::RESERVED_BRANCHES.include?(branch)
9
+ end
7
10
  def run_cmd(cmd)
8
11
  HighLine.say "\n> <%= color('#{cmd.gsub("'", '')}', :red) %>"
9
12
  raise "#{cmd} failed" unless system cmd
@@ -4,6 +4,7 @@ require 'grit'
4
4
  module Socialcast
5
5
  module Git
6
6
  include Socialcast::Gitx
7
+ RESERVED_BRANCHES = %w{ HEAD master last_known_good_master staging last_known_good_staging next_release last_known_good_next_release }
7
8
 
8
9
  def current_branch
9
10
  repo = Grit::Repo.new(Dir.pwd)
@@ -11,7 +12,6 @@ module Socialcast
11
12
  end
12
13
  def branches(options = {})
13
14
  branches = []
14
- reserved_branches = %w{ HEAD master last_known_good_master staging last_known_good_staging next_release last_known_good_next_release }
15
15
  args = []
16
16
  args << '-r' if options[:remote]
17
17
  args << '--merged' if options[:merged]
@@ -19,7 +19,7 @@ module Socialcast
19
19
  output.each do |branch|
20
20
  branch = branch.gsub(/\*/, '').strip.split(' ').first
21
21
  branch = branch.split('/').last if options[:remote]
22
- branches << branch unless reserved_branches.include?(branch)
22
+ branches << branch unless RESERVED_BRANCHES.include?(branch)
23
23
  end
24
24
  branches
25
25
  end
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "2.2.5"
3
+ VERSION = "2.2.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast-git-extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
- - 5
10
- version: 2.2.5
9
+ - 6
10
+ version: 2.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-26 00:00:00 Z
18
+ date: 2011-11-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: grit