big_keeper 0.3.0 → 0.4.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52955ae921730c15a2fdb6f0f82153d78bea2739
4
- data.tar.gz: 52760849a27d986991b9ea512b31a36bbd7ad9ca
3
+ metadata.gz: 18a0e9bf18ad96844aa32421e09b56aa48681fd9
4
+ data.tar.gz: 63ea947213a94d6b8707acf5232d2dc7e475f9ed
5
5
  SHA512:
6
- metadata.gz: 2099cceb030a28c55f9b6f6e776e238fbdb26cae48a8f4082c0c6ac00115da47c878fc89e2b63cf2690758de23bec4ef10a8bcbde1177ae68ea750674ffeb4bc
7
- data.tar.gz: fc6c444d0abb77deea22741ab4ea2dcd2279d11e2bb62d195c7eeadff72f4c2585e444c800859d7ec64de95dceba67e8623bd779c8d0b61637dede46113b27aa
6
+ metadata.gz: af8e302003e39f9b0b5c020eb45429166843420fa0ec01fcff02e8eff2be215b33d6f5195e645e0e44f292e7994abb36db532af24aa8175251d4ea6864a3e3c8
7
+ data.tar.gz: 30fcdf96aeecee91a1518944c029b92d2e6f6b04aa0d43d967e060dc6bf5fd2a02dfbe4e75664345a3afde80bf7f18e8d566e5835ea85197921e5b126747c4ba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- big_keeper (0.2.0)
4
+ big_keeper (0.3.0)
5
5
  big_stash (~> 0.1)
6
6
  cocoapods
7
7
  gli (~> 2.16)
@@ -14,9 +14,8 @@ module BigKeeper
14
14
  ModuleService.new.pull(path, user, module_name, branch_name)
15
15
  end
16
16
 
17
- p 'Start pulling home...'
17
+ p "Pull branch #{branch_name} for home..."
18
18
  GitOperator.new.pull(path, branch_name)
19
- p 'Finish pulling home...'
20
19
  ensure
21
20
  end
22
21
  end
@@ -16,20 +16,18 @@ module BigKeeper
16
16
  module_branch_name = GitOperator.new.current_branch(module_full_path)
17
17
 
18
18
  if GitOperator.new.has_changes(module_full_path)
19
- p "Start pushing #{module_name}..."
19
+ p "Push branch #{branch_name} for module #{module_name}..."
20
20
  GitOperator.new.commit(module_full_path, comment)
21
21
  GitOperator.new.push(module_full_path, module_branch_name)
22
- p "Finish pushing #{module_name}..."
23
22
  else
24
23
  p "Nothing to push for #{module_name}."
25
24
  end
26
25
  end
27
26
 
28
27
  if GitOperator.new.has_changes(path)
29
- p "Start pushing home..."
28
+ p "Push branch #{branch_name} for home..."
30
29
  GitOperator.new.commit(path, comment)
31
30
  GitOperator.new.push(path, branch_name)
32
- p "Finish pushing home..."
33
31
  else
34
32
  p "Nothing to push for home."
35
33
  end
@@ -11,23 +11,23 @@ module BigKeeper
11
11
  GitOperator.new.clone(File.expand_path("#{module_full_path}/../"), module_git)
12
12
  GitOperator.new.git_checkout(module_full_path, branch_name)
13
13
  else
14
- module_branch_name = GitOperator.new.current_branch(module_full_path)
15
- if module_branch_name != branch_name
16
- p "Current branch of #{module_name} is #{module_branch_name},\
14
+ current_branch_name = GitOperator.new.current_branch(module_full_path)
15
+ if current_branch_name != branch_name
16
+ p "Current branch of #{module_name} is #{current_branch_name},\
17
17
  stash it and checkout #{branch_name}..."
18
- BigStash::StashOperator.new(module_full_path).stash(module_branch_name)
18
+ BigStash::StashOperator.new(module_full_path).stash(current_branch_name)
19
19
  GitOperator.new.git_checkout(module_full_path, branch_name)
20
20
  end
21
- p "Start pulling #{module_name}..."
21
+ p "Pull branch #{branch_name} for module #{module_name}..."
22
22
  GitOperator.new.pull(module_full_path, branch_name)
23
- p "Finish pulling #{module_name}..."
24
23
  end
25
24
  end
26
25
 
27
26
  def switch(path, user, module_name, branch_name)
28
27
  module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
29
28
 
30
- p "Start switching #{module_name}..."
29
+ p "Switch to branch #{branch_name} for module #{module_name}..."
30
+
31
31
  if !File.exist? module_full_path
32
32
  module_git = BigkeeperParser.module_git(module_name)
33
33
  GitOperator.new.clone(File.expand_path("#{module_full_path}/../"), module_git)
@@ -36,7 +36,6 @@ module BigKeeper
36
36
  GitOperator.new.git_checkout(module_full_path, branch_name)
37
37
  GitOperator.new.pull(module_full_path, branch_name)
38
38
  end
39
- p "Finish switching #{module_name}..."
40
39
  end
41
40
 
42
41
  def finish(path, user, module_name)
@@ -44,6 +43,8 @@ module BigKeeper
44
43
  module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
45
44
  branch_name = GitOperator.new.current_branch(module_full_path)
46
45
 
46
+ p "Finish branch #{branch_name} for module #{module_name}..."
47
+
47
48
  PodfileOperator.new.find_and_replace("#{path}/Podfile",
48
49
  module_name,
49
50
  ModuleType::GIT,
@@ -56,15 +57,25 @@ module BigKeeper
56
57
 
57
58
  def add(path, user, module_name, name, type)
58
59
  branch_name = "#{GitflowType.name(type)}/#{name}"
60
+
61
+ p "Add branch #{branch_name} for module #{module_name}..."
62
+
59
63
  module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
60
64
 
65
+ # clone module if not exist
61
66
  if !File.exist? module_full_path
62
67
  module_git = BigkeeperParser.module_git(module_name)
63
68
  GitOperator.new.clone(File.expand_path("#{module_full_path}/../"), module_git)
64
69
  end
65
70
 
71
+ # stash current branch
72
+ current_branch_name = GitOperator.new.current_branch(module_full_path)
73
+ BigStash::StashOperator.new(module_full_path).stash(current_branch_name)
74
+
75
+ # start new feature/hotfix
66
76
  GitService.new.start(module_full_path, name, type)
67
77
 
78
+ # apply stash
68
79
  BigStash::StashOperator.new(module_full_path).apply_stash(branch_name)
69
80
 
70
81
  module_path = BigkeeperParser.module_path(user, module_name)
@@ -76,6 +87,9 @@ module BigKeeper
76
87
 
77
88
  def del(path, user, module_name, name, type)
78
89
  branch_name = "#{GitflowType.name(type)}/#{name}"
90
+
91
+ p "del branch #{branch_name} for module #{module_name}..."
92
+
79
93
  module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
80
94
 
81
95
  BigStash::StashOperator.new(module_full_path).stash(branch_name)
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli