git_chain 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 39beb1bd625ee428f7c842e9da4d0e156f36841bd6b34a695a8b39aebe084f63
4
- data.tar.gz: 392fa9912685006163752ad506ed02e3a032bc5fd775e8ca37798c9c6d1cc79e
3
+ metadata.gz: 7a22352bffc57cfd0247b473b0d97ba324d6c3615f5aaacb86557256238055da
4
+ data.tar.gz: 8c53da36caa505cf00b1360e113a80b24eeace3409536229bb1757b4df0b769b
5
5
  SHA512:
6
- metadata.gz: 5c3a0bab7113d83a59f78efe0829cd4cca75824b1d63841afc95217c85eaf75e74369e87c8e58b9f8800cf176b4792f9d5dc1c6fccbefb12511d075fe0178f5e
7
- data.tar.gz: e2e1b0521c2a9ef2f3fd6d1339a14440e4b759f537965a826e8932a23a1266c72eeb09d0d6abb76db7ea1aba013090090b44f6800a5231071335f8de54d9198d
6
+ metadata.gz: 80e8eb067de48b781870c385c13d98188a4d9e793d654c837bcab39a5f1a9c43f8e531df12048b2a91ac5d2ec8909d86d28214fb6af7035b75d97ac18401a401
7
+ data.tar.gz: 2caad184771ff601caab73286fa4aadac3e6717d1060ef585576b2493a14a6b3f49cac1ce6f3a842b280c47df2ffd7b1329290fca4c2fa7b2eb7dbbbda8d6b4b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_chain (0.1.2)
4
+ git_chain (0.1.3)
5
5
  git
6
6
 
7
7
  GEM
@@ -9,25 +9,48 @@ class GitChain::Runner
9
9
 
10
10
  def call(command, *args)
11
11
  case command
12
+ when 'show'
13
+ show(branch: args[0])
12
14
  when 'list'
13
- # storage.save_data
14
- storage.print
15
+ list()
15
16
  when 'add'
16
- chain.mark_branch_as_dependent(
17
- child: git.current_branch,
18
- parent: args[0],
19
- old_base: args[1]
20
- )
17
+ add(parent: args[0], old_base: args[1])
21
18
  when 'rebase'
22
- if args.first == 'all'
23
- chain.rebase_all(git.current_branch)
24
- else
25
- chain.rebase(git.current_branch)
26
- end
19
+ rebase(sub_command: args.first)
27
20
  else
28
21
  raise "Unknown Command: #{command}"
29
22
  end
30
23
  end
31
24
 
25
+ def show(branch: nil)
26
+ if branch
27
+ storage.print_branch(branch: branch)
28
+ else
29
+ storage.print_branch(branch: git.current_branch)
30
+ end
31
+ end
32
+
33
+ def list
34
+ storage.print
35
+ end
36
+
37
+ def add(parent:, old_base: nil)
38
+ chain.mark_branch_as_dependent(
39
+ child: git.current_branch,
40
+ parent: parent,
41
+ old_base: old_base
42
+ )
43
+ end
44
+
45
+ def rebase(sub_command: nil)
46
+ if sub_command == 'all'
47
+ chain.rebase_all(git.current_branch)
48
+ else
49
+ chain.rebase(git.current_branch)
50
+ end
51
+ end
52
+
53
+
54
+
32
55
 
33
56
  end
@@ -32,6 +32,10 @@ class GitChain::Storage
32
32
  pp data
33
33
  end
34
34
 
35
+ def print_branch(branch: )
36
+ pp record_for(branch)
37
+ end
38
+
35
39
  private
36
40
 
37
41
  def records
@@ -1,3 +1,3 @@
1
1
  module GitChain
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_chain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan McGarvey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git