karo 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of karo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/karo.gemspec +1 -0
- data/lib/karo/cli.rb +4 -0
- data/lib/karo/common.rb +25 -0
- data/lib/karo/version.rb +1 -1
- data/lib/karo/workflow.rb +41 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ca7082a6e2718a8c2c027623a794191a5fee07
|
4
|
+
data.tar.gz: 250465beeecb6d0bd96c02fe51823c706ce0ca3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea774911562aa8dc3e2c7a32ef2acdd9783527e9bdc7935dfd71c9a89acffd2631a93d59bc670aa7bc1330b11bb9ae8a281da3212a867bd644056617f3a7c0ee
|
7
|
+
data.tar.gz: 9399116b443b49488c23627aec7124ad2ffb2bbc007285c85fad46372124502d6403b677897bd27049ed11d5de02f52054fe343e0e7fed77a7411ec3e799097e
|
data/CHANGELOG.md
CHANGED
data/karo.gemspec
CHANGED
data/lib/karo/cli.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'karo/workflow'
|
1
2
|
require 'karo/version'
|
2
3
|
require 'karo/common'
|
3
4
|
require 'karo/assets'
|
@@ -28,6 +29,9 @@ module Karo
|
|
28
29
|
desc "db [pull, push, console]", "syncs MySQL database between server and localhost"
|
29
30
|
subcommand "db", Db
|
30
31
|
|
32
|
+
desc "workflow [feature, bugfix]", "basic git workflow to create feature and bugfix branches"
|
33
|
+
subcommand "workflow", Workflow
|
34
|
+
|
31
35
|
desc "config", "displays server configuration stored in a config file"
|
32
36
|
def config
|
33
37
|
configuration = Config.load_configuration(options)
|
data/lib/karo/common.rb
CHANGED
@@ -24,6 +24,31 @@ module Karo
|
|
24
24
|
system cmd
|
25
25
|
end
|
26
26
|
|
27
|
+
def git_repo
|
28
|
+
Grit::Repo.new(".")
|
29
|
+
end
|
30
|
+
|
31
|
+
def branch_exists?(name)
|
32
|
+
git_repo.branches.find { |b| b.name.start_with?(name) }
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_branch(name)
|
36
|
+
run_it "git branch #{name}", options[:verbose]
|
37
|
+
end
|
38
|
+
|
39
|
+
def checkout_branch(name)
|
40
|
+
run_it "git checkout #{name}", options[:verbose]
|
41
|
+
end
|
42
|
+
|
43
|
+
def current_branch
|
44
|
+
git_repo.head.name
|
45
|
+
end
|
46
|
+
|
47
|
+
def create_and_checkout_branch(name)
|
48
|
+
create_branch name
|
49
|
+
checkout_branch name
|
50
|
+
end
|
51
|
+
|
27
52
|
end
|
28
53
|
|
29
54
|
end
|
data/lib/karo/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'karo/common'
|
2
|
+
require 'thor'
|
3
|
+
require 'grit'
|
4
|
+
|
5
|
+
module Karo
|
6
|
+
|
7
|
+
class Workflow < Thor
|
8
|
+
|
9
|
+
include Karo::Common
|
10
|
+
|
11
|
+
desc "feature", "create a feature branch for a given name"
|
12
|
+
def feature(name)
|
13
|
+
branch_name = "feature/#{name}"
|
14
|
+
|
15
|
+
if current_branch.eql?(branch_name)
|
16
|
+
say "You are already on #{branch_name} this feature branch", :red
|
17
|
+
elsif branch_exists? branch_name
|
18
|
+
say "Feature branch #{branch_name} already exists! so checking it out", :red
|
19
|
+
checkout_branch branch_name
|
20
|
+
else
|
21
|
+
create_and_checkout_branch branch_name
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "bugfix", "create a bug fix branch for a given name"
|
26
|
+
def bugfix(name)
|
27
|
+
branch_name = "bugfix/#{name}"
|
28
|
+
|
29
|
+
if current_branch.eql?(branch_name)
|
30
|
+
say "You are already on #{branch_name} this bug fix branch", :red
|
31
|
+
elsif branch_exists? branch_name
|
32
|
+
say "Bug fix branch #{branch_name} already exists! so checking it out", :red
|
33
|
+
checkout_branch branch_name
|
34
|
+
else
|
35
|
+
create_and_checkout_branch branch_name
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rahul Trikha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: grit
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: thor
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +166,7 @@ files:
|
|
152
166
|
- lib/karo/db.rb
|
153
167
|
- lib/karo/templates/karo.yml
|
154
168
|
- lib/karo/version.rb
|
169
|
+
- lib/karo/workflow.rb
|
155
170
|
- test/tc_something.rb
|
156
171
|
homepage: http://rahult.github.io/karo/
|
157
172
|
licenses:
|