rgitflow 0.1.0.pre.alpha.pre.10 → 0.1.0.pre.alpha.pre.11

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmI5ZWZjYzhjYmYwMDljY2Q4M2RlNjgzZTMzMmQyNTNkZWJhMDA2NA==
4
+ YzUxOWI3MjgwZTk1YTA0NGYyMjFhYzlhNTlkOTZiMjlmYmFiNjc5Nw==
5
5
  data.tar.gz: !binary |-
6
- ZWQ5OTBhYzQ1MWU2YWVkMTYwNTJhNjY4NjJkZjk4ZjM1ZTRkM2ZjNw==
6
+ MzhhNjI5YjFhMjM3NTI0YjQ4NTdjYzEyMDM0M2M3NmY5Y2QwYzc0NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDEzZmE0NjQwMWNlMzE0YTI3Y2JjMjE2OTQ0ZjFmZTA3Y2I4NzhlZDkyNDI2
10
- MjFkMzYyMGVjYjEzNjllMGU4ZmZhNGE2NjIyYjAxZDJiN2U2ODMwOWQ4MDQx
11
- YmFjNWEyOWQ2ODBhZDA0N2ZkNGY2NDRiZTU1OGE2ODBmNzFmODE=
9
+ OGRhMjE1MWI3NWQ0ZjE1N2YzZWU2ZGUzNWZhMDMzZjdlYmIzZjAzMTc4ZDBk
10
+ NjBmMjA0ODhlYWRhNTYxYWFiMDI5OTQ2ZDYwYzk0OGFkZGU1ZDU0NTI4NmVh
11
+ YmFiM2Q0N2I0NzA1YWQ1NTU4NjE1MDBiYzRkZTQ3NTJhOGY5ZmE=
12
12
  data.tar.gz: !binary |-
13
- YTliZmMzMjllNTQwYjRmMDdmMzRkYWE4MjI3YjBjYzdiNWQ2MTkzNWJmYWVk
14
- OTFhM2RiZGI1MzhjYWEwMDlhMDcxNDdiZjY0YTM1MmRkZjlkZGY5NTRjOGEw
15
- OWNlYmE2YzE5YjVkZTgyNWYwMWRjMGQ4ZTQ2ZjRhZDAxNWY3NTM=
13
+ MjliMzAwNzc1NTA3ZGI2ZmJlNmQwYzA5MWUyYzc0MDIyZGVlMmQzN2I4MmYy
14
+ ZDgzNDVjOGYwYmU4YTBkOTlmODdjNzgzMDkzYmY3ZmFkYTAyOGVjNTczMjIw
15
+ ZWEwOTI0OTJiNzFiZjBlZWJjZGI5ZmYyNjY3ODk0NDg1YmI3YWI=
@@ -26,6 +26,12 @@ module RGitFlow
26
26
 
27
27
  require 'rgitflow/tasks/feature/tasks'
28
28
  RGitFlow::Tasks::Feature.install_tasks({:git => @git})
29
+
30
+ require 'rgitflow/tasks/hotfix/tasks'
31
+ RGitFlow::Tasks::Hotfix.install_tasks({:git => @git})
32
+
33
+ require 'rgitflow/tasks/release/tasks'
34
+ RGitFlow::Tasks::Release.install_tasks({:git => @git})
29
35
  end
30
36
  end
31
37
  end
@@ -0,0 +1,36 @@
1
+ require 'rgitflow/tasks/task'
2
+
3
+ module RGitFlow
4
+ module Tasks
5
+ class Hotfix
6
+ class Finish < RGitFlow::Tasks::Task
7
+ def initialize(git)
8
+ super(git, 'finish', 'Finish a hotfix branch', ['rgitflow', 'hotfix'])
9
+ end
10
+
11
+ protected
12
+
13
+ def run
14
+ status 'Finishing hotfix branch...'
15
+
16
+ branch = @git.current_branch
17
+
18
+ unless branch.start_with? RGitFlow::Config.options[:hotfix]
19
+ error 'Cannot finish a hotfix branch unless you are in a hotfix branch'
20
+ abort
21
+ end
22
+
23
+ @git.branch(RGitFlow::Config.options[:master]).checkout
24
+ @git.merge branch
25
+
26
+ @git.push
27
+ @git.push('origin', branch, {:delete => true})
28
+
29
+ @git.branch(branch).delete
30
+
31
+ status "Finished hotfix branch #{branch}!"
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,49 @@
1
+ require 'rgitflow/tasks/task'
2
+
3
+ module RGitFlow
4
+ module Tasks
5
+ class Hotfix
6
+ class Start < RGitFlow::Tasks::Task
7
+ def initialize(git)
8
+ super(git, 'start', 'Start a hotfix branch', ['rgitflow', 'hotfix'])
9
+ end
10
+
11
+ protected
12
+
13
+ def run
14
+ status 'Starting hotfix branch...'
15
+
16
+ unless @git.current_branch == RGitFlow::Config.options[:master]
17
+ error 'Cannot start a hotfix branch unless you are in the master branch'
18
+ abort
19
+ end
20
+
21
+ branch = ENV['BRANCH']
22
+
23
+ while branch.blank?
24
+ error 'Cannot create a branch with an empty name!'
25
+ prompt 'Please enter a name for your hotfix branch:'
26
+ branch = STDIN.gets.chomp
27
+ end
28
+
29
+ branch = [RGitFlow::Config.options[:hotfix], branch].join('/')
30
+
31
+ if @git.is_local_branch? branch
32
+ error 'Cannot create a branch that already exists locally'
33
+ abort
34
+ end
35
+
36
+ if @git.is_remote_branch? branch
37
+ error 'Cannot create a branch that already exists remotely'
38
+ abort
39
+ end
40
+
41
+ @git.branch(branch).create
42
+ @git.branch(branch).checkout
43
+
44
+ status "Started hotfix branch #{branch}!"
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,27 @@
1
+ module RGitFlow
2
+ module Tasks
3
+ class Hotfix
4
+ autoload :Start, 'rgitflow/tasks/hotfix/start'
5
+ autoload :Finish, 'rgitflow/tasks/hotfix/finish'
6
+
7
+ class << self
8
+ attr_accessor :instance
9
+
10
+ def install_tasks(opts = {})
11
+ new(opts[:git]).install
12
+ end
13
+ end
14
+
15
+ attr_reader :git
16
+
17
+ def initialize(git = nil)
18
+ @git = git || Git.open(Pathname.pwd)
19
+ end
20
+
21
+ def install
22
+ Start.new @git
23
+ Finish.new @git
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,36 @@
1
+ require 'rgitflow/tasks/task'
2
+
3
+ module RGitFlow
4
+ module Tasks
5
+ class Release
6
+ class Finish < RGitFlow::Tasks::Task
7
+ def initialize(git)
8
+ super(git, 'finish', 'Finish a release branch', ['rgitflow', 'release'])
9
+ end
10
+
11
+ protected
12
+
13
+ def run
14
+ status 'Finishing release branch...'
15
+
16
+ branch = @git.current_branch
17
+
18
+ unless branch.start_with? RGitFlow::Config.options[:release]
19
+ error 'Cannot finish a release branch unless you are in a release branch'
20
+ abort
21
+ end
22
+
23
+ @git.branch(RGitFlow::Config.options[:master]).checkout
24
+ @git.merge branch
25
+
26
+ @git.push
27
+ @git.push('origin', branch, {:delete => true})
28
+
29
+ @git.branch(branch).delete
30
+
31
+ status "Finished release branch #{branch}!"
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,49 @@
1
+ require 'rgitflow/tasks/task'
2
+
3
+ module RGitFlow
4
+ module Tasks
5
+ class Release
6
+ class Start < RGitFlow::Tasks::Task
7
+ def initialize(git)
8
+ super(git, 'start', 'Start a release branch', ['rgitflow', 'release'])
9
+ end
10
+
11
+ protected
12
+
13
+ def run
14
+ status 'Starting release branch...'
15
+
16
+ unless @git.current_branch == RGitFlow::Config.options[:develop]
17
+ error 'Cannot create release branch unless on development branch'
18
+ abort
19
+ end
20
+
21
+ branch = ENV['BRANCH']
22
+
23
+ while branch.blank?
24
+ error 'Cannot create a branch with an empty name!'
25
+ prompt 'Please enter a name for your release branch:'
26
+ branch = STDIN.gets.chomp
27
+ end
28
+
29
+ branch = [RGitFlow::Config.options[:release], branch].join('/')
30
+
31
+ if @git.is_local_branch? branch
32
+ error 'Cannot create a branch that already exists locally'
33
+ abort
34
+ end
35
+
36
+ if @git.is_remote_branch? branch
37
+ error 'Cannot create a branch that already exists remotely'
38
+ abort
39
+ end
40
+
41
+ @git.branch(branch).create
42
+ @git.branch(branch).checkout
43
+
44
+ status "Started release branch #{branch}!"
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,27 @@
1
+ module RGitFlow
2
+ module Tasks
3
+ class Release
4
+ autoload :Start, 'rgitflow/tasks/release/start'
5
+ autoload :Finish, 'rgitflow/tasks/release/finish'
6
+
7
+ class << self
8
+ attr_accessor :instance
9
+
10
+ def install_tasks(opts = {})
11
+ new(opts[:git]).install
12
+ end
13
+ end
14
+
15
+ attr_reader :git
16
+
17
+ def initialize(git = nil)
18
+ @git = git || Git.open(Pathname.pwd)
19
+ end
20
+
21
+ def install
22
+ Start.new @git
23
+ Finish.new @git
24
+ end
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgitflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.pre.10
4
+ version: 0.1.0.pre.alpha.pre.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Harrah
@@ -142,6 +142,12 @@ files:
142
142
  - lib/rgitflow/tasks/feature/finish.rb
143
143
  - lib/rgitflow/tasks/feature/start.rb
144
144
  - lib/rgitflow/tasks/feature/tasks.rb
145
+ - lib/rgitflow/tasks/hotfix/finish.rb
146
+ - lib/rgitflow/tasks/hotfix/start.rb
147
+ - lib/rgitflow/tasks/hotfix/tasks.rb
148
+ - lib/rgitflow/tasks/release/finish.rb
149
+ - lib/rgitflow/tasks/release/start.rb
150
+ - lib/rgitflow/tasks/release/tasks.rb
145
151
  - lib/rgitflow/tasks/scm/status.rb
146
152
  - lib/rgitflow/tasks/task.rb
147
153
  - lib/rgitflow/version.rb