big_keeper 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/big_keeper/command/feature_finish.rb +1 -1
- data/lib/big_keeper/command/feature_start.rb +6 -1
- data/lib/big_keeper/command/feature_switch.rb +1 -1
- data/lib/big_keeper/command/feature_update.rb +1 -1
- data/lib/big_keeper/service/module_service.rb +13 -3
- data/lib/big_keeper/util/git_operator.rb +10 -0
- data/lib/big_keeper/util/gitflow_operator.rb +4 -3
- data/lib/big_keeper/util/podfile_operator.rb +6 -6
- data/lib/big_keeper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 614030e993375adb543b94c896f0a9c140e1aeb7
|
4
|
+
data.tar.gz: ee9dae88f9b0f8057907240b11a0bc4d74cd1a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e407a4b7fcdc8c12247476dca57d04df0bf159d66d360235d06f45870e877b6c525c8730327e57f64063335c8904e29b59b2ff8f72e3d7f8c7f39db8f3e50b4
|
7
|
+
data.tar.gz: 567f52bb566f129a5bd6e232d3c1269a3b18df5afeb7c3f7f0ff994950ec22ab06b618a848c2a4a0168cee0e28793a720bf23c40f353133781ea9829b6fb12f6
|
data/Gemfile.lock
CHANGED
@@ -26,7 +26,7 @@ module BigKeeper
|
|
26
26
|
BigkeeperParser.module_names.each do |module_name|
|
27
27
|
module_git = BigkeeperParser.module_git(module_name)
|
28
28
|
PodfileOperator.new.find_and_replace("#{path}/Podfile",
|
29
|
-
|
29
|
+
module_name,
|
30
30
|
ModuleType::GIT,
|
31
31
|
GitInfo.new(module_git, GitType::BRANCH, 'develop'))
|
32
32
|
end
|
@@ -38,6 +38,11 @@ module BigKeeper
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# Start home feature
|
41
|
+
GitOperator.new.git_checkout(path, 'master') if GitOperator.new.has_remote_branch(path, 'master')
|
42
|
+
GitOperator.new.git_checkout(path, 'develop') if GitOperator.new.has_remote_branch(path, 'develop')
|
43
|
+
|
44
|
+
GitOperator.new.pull(path, 'develop') if GitOperator.new.has_remote_branch(path, 'develop')
|
45
|
+
|
41
46
|
GitflowOperator.new.start(path, feature_name, GitflowType::FEATURE)
|
42
47
|
|
43
48
|
# Modify podfile as path and Start modules feature
|
@@ -53,7 +58,7 @@ module BigKeeper
|
|
53
58
|
GitOperator.new.push(path, branch_name)
|
54
59
|
|
55
60
|
# Open home workspace
|
56
|
-
|
61
|
+
`open #{path}/*.xcworkspace`
|
57
62
|
ensure
|
58
63
|
end
|
59
64
|
end
|
@@ -45,7 +45,7 @@ module BigKeeper
|
|
45
45
|
branch_name = GitOperator.new.current_branch(module_full_path)
|
46
46
|
|
47
47
|
PodfileOperator.new.find_and_replace("#{path}/Podfile",
|
48
|
-
|
48
|
+
module_name,
|
49
49
|
ModuleType::GIT,
|
50
50
|
GitInfo.new(module_git, GitType::BRANCH, branch_name))
|
51
51
|
|
@@ -58,6 +58,16 @@ module BigKeeper
|
|
58
58
|
branch_name = "#{GitflowType.name(type)}/#{name}"
|
59
59
|
module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
|
60
60
|
|
61
|
+
if !File.exist? module_full_path
|
62
|
+
module_git = BigkeeperParser.module_git(module_name)
|
63
|
+
GitOperator.new.clone(File.expand_path("#{module_full_path}/../"), module_git)
|
64
|
+
end
|
65
|
+
|
66
|
+
GitOperator.new.git_checkout(module_full_path, 'master') if GitOperator.new.has_remote_branch(module_full_path, 'master')
|
67
|
+
GitOperator.new.git_checkout(module_full_path, 'develop') if GitOperator.new.has_remote_branch(module_full_path, 'develop')
|
68
|
+
|
69
|
+
GitOperator.new.pull(module_full_path, 'develop') if GitOperator.new.has_remote_branch(module_full_path, 'develop')
|
70
|
+
|
61
71
|
GitflowOperator.new.start(module_full_path, name, type)
|
62
72
|
GitOperator.new.push(module_full_path, branch_name)
|
63
73
|
|
@@ -65,7 +75,7 @@ module BigKeeper
|
|
65
75
|
|
66
76
|
module_path = BigkeeperParser.module_path(user, module_name)
|
67
77
|
PodfileOperator.new.find_and_replace("#{path}/Podfile",
|
68
|
-
|
78
|
+
module_name,
|
69
79
|
ModuleType::PATH,
|
70
80
|
module_path)
|
71
81
|
end
|
@@ -82,7 +92,7 @@ module BigKeeper
|
|
82
92
|
module_git = BigkeeperParser.module_git(module_name)
|
83
93
|
|
84
94
|
PodfileOperator.new.find_and_replace("#{path}/Podfile",
|
85
|
-
|
95
|
+
module_name,
|
86
96
|
ModuleType::GIT,
|
87
97
|
GitInfo.new(module_git, GitType::BRANCH, 'develop'))
|
88
98
|
end
|
@@ -7,6 +7,16 @@ module BigKeeper
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
def has_remote_branch(path, branch_name)
|
11
|
+
has_branch = false
|
12
|
+
IO.popen("cd #{path}; git branch -a") do |io|
|
13
|
+
io.each do |line|
|
14
|
+
has_branch = true if line =~ /remotes\/origin\/#{branch_name}/
|
15
|
+
end
|
16
|
+
end
|
17
|
+
has_branch
|
18
|
+
end
|
19
|
+
|
10
20
|
def has_branch(path, branch_name)
|
11
21
|
has_branch = false
|
12
22
|
IO.popen("cd #{path}; git branch -a") do |io|
|
@@ -16,9 +16,10 @@ module BigKeeper
|
|
16
16
|
clear_flag = 'Already initialized for gitflow'
|
17
17
|
IO.popen('git flow init -d') do |io|
|
18
18
|
io.each do |line|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
if !line.include? clear_flag
|
20
|
+
GitOperator.new.push(module_full_path, 'master') if !GitOperator.new.has_remote_branch(module_full_path, 'master')
|
21
|
+
GitOperator.new.push(module_full_path, 'develop') if !GitOperator.new.has_remote_branch(module_full_path, 'develop')
|
22
|
+
break
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -55,21 +55,21 @@ module BigKeeper
|
|
55
55
|
def generate_module_config(module_name, module_type, source)
|
56
56
|
module_config = ''
|
57
57
|
if ModuleType::PATH == module_type
|
58
|
-
module_config = %Q(
|
58
|
+
module_config = %Q( pod '#{module_name}', :path => '#{source}')
|
59
59
|
elsif ModuleType::GIT == module_type
|
60
60
|
# puts source.base
|
61
61
|
# puts source.addition
|
62
62
|
if GitType::BRANCH == source.type
|
63
|
-
module_config = %Q(
|
63
|
+
module_config = %Q( pod '#{module_name}', :git => '#{source.base}', :branch => '#{source.addition}')
|
64
64
|
elsif GitType::TAG == source.type
|
65
|
-
module_config = %Q(
|
65
|
+
module_config = %Q( pod '#{module_name}', :git => '#{source.base}', :tag => '#{source.addition}')
|
66
66
|
elsif GitType::COMMIT == source.type
|
67
|
-
module_config = %Q(
|
67
|
+
module_config = %Q( pod '#{module_name}', :git => '#{source.base}', :commit => '#{source.addition}')
|
68
68
|
else
|
69
|
-
module_config = %Q(
|
69
|
+
module_config = %Q( pod '#{module_name}', :git => '#{source.base}')
|
70
70
|
end
|
71
71
|
else
|
72
|
-
module_config = %Q(
|
72
|
+
module_config = %Q( pod '#{module_name}', '#{source}')
|
73
73
|
end
|
74
74
|
module_config
|
75
75
|
end
|
data/lib/big_keeper/version.rb
CHANGED