verat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d053a4dae9958ee265f4e7583b0115f6977d59d
4
+ data.tar.gz: 05bd416b24cea589fc527d657e19bd0e4ffa6d68
5
+ SHA512:
6
+ metadata.gz: 1d6f40e95752088bc7a2601c8e5f94eed4b5418c4fe072f0c76feea75e643e5520e461262dd2f710e8091c5e2c6875937ab9d578121c5270f52adba45dd815bd
7
+ data.tar.gz: 9b4f4e6cd3675262b3284ff71784e1a94c3be8a4b9c28d89d94bd3f2a4646f80002d93ca7c1c2a703b7fd898bed073c79bed609e28f22f16e0173ac763ea93ac
data/.editorconfig ADDED
@@ -0,0 +1,11 @@
1
+ # editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ indent_style = space
7
+ indent_size = 2
8
+ end_of_line = lf
9
+ charset = utf-8
10
+ trim_trailing_whitespace = true
11
+ insert_final_newline = true
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in verat.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Adrian Ayala
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ Verat [![Gem Version](https://badge.fury.io/rb/verat.svg)](http://badge.fury.io/rb/verat)
2
+ =====
3
+
4
+ Verat is a gitflow CLI manager. It is inspired in Vincent Driessen's [branching model](http://nvie.com/posts/a-successful-git-branching-model/) and his plugin [gitflow](https://github.com/nvie/gitflow)
5
+
6
+ ##Instalation
7
+ ```
8
+ $ gem install verat
9
+ ```
10
+
11
+ ##Usage
12
+ ###Features:
13
+
14
+ To start a new feature run this command, *FEATURE* will be the name of your new feature.
15
+ ```
16
+ verat feature start FEATURE
17
+ ```
18
+
19
+ Once you finished the feature run this command. It will checkout to your develop branch and merge the feature branch into develop.
20
+ ```
21
+ verat feature finish FEATURE
22
+ ```
23
+
24
+ ###Hotfixes:
25
+ To start a new hotfix run this command, *HOTFIX* will be the name of your new feature.
26
+ ```
27
+ verat feature start HOTFIX
28
+ ```
29
+
30
+ Once you finished the hotfix run this command. It will checkout to master branch, merge the hotfix branch and then checkout to the develop branch and merge the hotfix branch.
31
+ ```
32
+ verat feature finish HOTFIX
33
+ ```
34
+
35
+ ###Releases:
36
+ To start a new release run this command, *RELEASE* will be the version of the release.
37
+ ```
38
+ verat release start RELEASE
39
+ ```
40
+
41
+ Once you finished the release run this command. It will checkout to master branch, merge the release branch and then checkout to the develop branch and merge the release branch. Optionally you can pass the ```-t``` or ```--tag``` to create a tag with the name of the branch
42
+ ```
43
+ verat release finish RELEASE
44
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/verat ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
3
+
4
+ require 'mercenary'
5
+ require 'verat'
6
+
7
+ Mercenary.program(:verat) do |p|
8
+ p.version Verat::VERSION
9
+ p.description 'git-flow CLI manager tool'
10
+ p.syntax 'verat <subcommand>'
11
+
12
+ p.command(:feature) do |feature|
13
+ feature.syntax "feature <subcommand>"
14
+ feature.description "Command for features related actions"
15
+
16
+ feature.command(:start) do |start|
17
+ start.syntax 'start FEATURE'
18
+ start.description 'Creates a new feature branch'
19
+
20
+ start.action do |args, options|
21
+ Verat::Feature.start(args.first)
22
+ end
23
+ end
24
+
25
+ feature.command(:finish) do |finish|
26
+ finish.syntax 'finish FEATURE [options]'
27
+ finish.description 'Finishes a feature branch'
28
+ finish.option 'delete', '-d', '--delete', 'Deletes feature branch'
29
+
30
+ finish.action do |args, options|
31
+ Verat::Feature.finish(args.first, options)
32
+ end
33
+ end
34
+ end
35
+
36
+ p.command(:hotfix) do |hotfix|
37
+ hotfix.syntax "hotfix <subcommand>"
38
+ hotfix.description "Command for hotfixes related actions"
39
+
40
+ hotfix.command(:start) do |start|
41
+ start.syntax 'start HOTFIX'
42
+ start.description 'Creates a new hotfix branch'
43
+
44
+ start.action do |args, options|
45
+ Verat::Hotfix.start(args.first)
46
+ end
47
+ end
48
+
49
+ hotfix.command(:finish) do |finish|
50
+ finish.syntax 'finish HOTFIX [options]'
51
+ finish.description 'Finishes a hotfix branch'
52
+ finish.option 'delete', '-d', '--delete', 'Deletes hotfix branch'
53
+
54
+ finish.action do |args, options|
55
+ Verat::Hotfix.finish(args.first, options)
56
+ end
57
+ end
58
+ end
59
+
60
+ p.command(:release) do |release|
61
+ release.syntax "release <subcommand>"
62
+ release.description "Command for releasees related actions"
63
+
64
+ release.command(:start) do |start|
65
+ start.syntax 'start RELEASE'
66
+ start.description 'Creates a new release branch'
67
+
68
+ start.action do |args, options|
69
+ Verat::release.start(args.first)
70
+ end
71
+ end
72
+
73
+ release.command(:finish) do |finish|
74
+ finish.syntax 'finish RELEASE [options]'
75
+ finish.description 'Finishes a release branch'
76
+ finish.option 'delete', '-d', '--delete', 'Deletes release branch'
77
+ finish.option 'tag', '-t', '--tag', 'Creates a tag with the release version'
78
+
79
+ finish.action do |args, options|
80
+ Verat::Release.finish(args.first, options)
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,38 @@
1
+ require 'git'
2
+
3
+ module Verat
4
+ class Feature
5
+ def self.start(feature)
6
+ puts "Creating branch: feature/#{feature}"
7
+
8
+ repo = Git.open(Dir.pwd)
9
+ repo.branch("feature/#{feature}").checkout
10
+
11
+ puts "Branch created succesfuly. Current branch: feature/#{feature}"
12
+ end
13
+
14
+ def self.finish(feature, options)
15
+ puts "Finishing feature: #{feature}"
16
+
17
+ repo = Git.open(Dir.pwd)
18
+ branch = "feature/#{feature}"
19
+
20
+ if repo.current_branch() != 'develop' and repo.is_branch?(branch)
21
+ repo.checkout('develop')
22
+
23
+ # Temporary fix until git adds options to the merge method
24
+ system("git merge --no-ff #{branch}")
25
+ else
26
+ # Temporary fix until git adds options to the merge method
27
+ system("git merge --no-ff #{branch}")
28
+ end
29
+
30
+ if options['delete'] then
31
+ repo.branch("#{branch}").delete
32
+ puts "Deleting branch: #{branch}"
33
+ end
34
+
35
+ puts "Finished succesfuly. Current branch: develop"
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,46 @@
1
+ require 'git'
2
+
3
+ module Verat
4
+ class Hotfix
5
+ def self.start(hotfix)
6
+ puts "Creating branch: hotfix/#{hotfix}"
7
+
8
+ repo = Git.open(Dir.pwd)
9
+ repo.branch("hotfix/#{hotfix}").checkout
10
+
11
+ puts "Branch created succesfuly. Current branch: hotfix/#{hotfix}"
12
+ end
13
+
14
+ def self.finish(hotfix, options)
15
+ puts "Finishing hotfix: #{hotfix}"
16
+
17
+ repo = Git.open(Dir.pwd)
18
+ branch = "hotfix/#{hotfix}"
19
+
20
+ if repo.current_branch() != 'master' and repo.is_branch?(branch)
21
+ repo.checkout('master')
22
+
23
+ # Temporary fix until git adds options to the merge method
24
+ status = system("git merge --no-ff #{branch}")
25
+ if status
26
+ repo.checkout('develop')
27
+ system("git merge --no-ff #{branch}")
28
+ end
29
+ else
30
+ # Temporary fix until git adds options to the merge method
31
+ status = system("git merge --no-ff #{branch}")
32
+ if status
33
+ repo.checkout('develop')
34
+ system("git merge --no-ff #{branch}")
35
+ end
36
+ end
37
+
38
+ if options['delete'] then
39
+ repo.branch("#{branch}").delete
40
+ puts "Deleting branch: #{branch}"
41
+ end
42
+
43
+ puts "Finished succesfuly. Current branch: develop"
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,49 @@
1
+ require 'git'
2
+
3
+ module Verat
4
+ class Release
5
+ def self.start(release)
6
+ puts "Creating branch: release/#{release}"
7
+
8
+ repo = Git.open(Dir.pwd)
9
+ repo.branch("release/#{release}").checkout
10
+
11
+ puts "Branch created succesfuly. Current branch: release/#{release}"
12
+ end
13
+
14
+ def self.finish(release, options)
15
+ puts "Finishing release: #{release}"
16
+
17
+ repo = Git.open(Dir.pwd)
18
+ branch = "release/#{release}"
19
+
20
+ if repo.current_branch() != 'master' and repo.is_branch?(branch)
21
+ repo.checkout('master')
22
+
23
+ # Temporary fix until git adds options to the merge method
24
+ status = system("git merge --no-ff #{branch}")
25
+ if status
26
+ puts "Creating release tag: #{release}"
27
+ repo.add_tag("#{release}", {:a => true, :message => "v#{release}"})
28
+
29
+ repo.checkout('develop')
30
+ system("git merge --no-ff #{branch}")
31
+ end
32
+ else
33
+ # Temporary fix until git adds options to the merge method
34
+ status = system("git merge --no-ff #{branch}")
35
+ if status
36
+ repo.checkout('develop')
37
+ system("git merge --no-ff #{branch}")
38
+ end
39
+ end
40
+
41
+ if options['delete'] then
42
+ repo.branch("#{branch}").delete
43
+ puts "Deleting release branch: #{branch}"
44
+ end
45
+
46
+ puts "Finished succesfuly. Current branch: develop"
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,3 @@
1
+ module Verat
2
+ VERSION = "0.1.0"
3
+ end
data/lib/verat.rb ADDED
@@ -0,0 +1,9 @@
1
+ lib = File.expand_path('../', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ module Verat
5
+ autoload :VERSION, 'verat/version'
6
+ autoload :Feature, 'verat/feature'
7
+ autoload :Hotfix, 'verat/hotfix'
8
+ autoload :Release, 'verat/release'
9
+ end
data/verat.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'verat/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "verat"
8
+ spec.version = Verat::VERSION
9
+ spec.authors = ["Adrian Ayala"]
10
+ spec.email = ["adrian.ayala17@gmail.com"]
11
+ spec.description = %q{git-flow CLI manager}
12
+ spec.summary = %q{verat is a CLI tool to manage with ease git-flow branching model}
13
+ spec.homepage = "https://github.com/adrrian17/verat"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "git", "~> 1.2.7"
22
+ spec.add_runtime_dependency "mercenary", "~> 0.3.3"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: verat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Adrian Ayala
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: git
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.7
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: mercenary
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: git-flow CLI manager
70
+ email:
71
+ - adrian.ayala17@gmail.com
72
+ executables:
73
+ - verat
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .editorconfig
78
+ - .gitignore
79
+ - Gemfile
80
+ - LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - bin/verat
84
+ - lib/verat.rb
85
+ - lib/verat/feature.rb
86
+ - lib/verat/hotfix.rb
87
+ - lib/verat/release.rb
88
+ - lib/verat/version.rb
89
+ - verat.gemspec
90
+ homepage: https://github.com/adrrian17/verat
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.3.0
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: verat is a CLI tool to manage with ease git-flow branching model
114
+ test_files: []