git_fonky 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: fedc3ea4cef24087688dad0840fcf2430663e021b6859cdd849400d58d07b7ac
4
- data.tar.gz: 4c8473ee344f81d98b5f5343b3490bdeb1969de0b52b3faf0211479098e44d4a
3
+ metadata.gz: 25baa00e3edcbddf36eb6d5565e3932666268d06a2429734fd51b842bec0fac3
4
+ data.tar.gz: e43f2d96ce2b617994ef2d898e18cfdf6d8ad78f2ccb3c10652cc24da11f3159
5
5
  SHA512:
6
- metadata.gz: 946149e9bf2329e7598810279af9512e5823c3b9f7533bda8bc2bc5ecd2606c8bee63e156adff73da47d28413666c2ffbbebd0590bfd2c87e68ae3fed8edac3f
7
- data.tar.gz: 16301de2e6b7da6d295453f77d6e9790b1aa4e207666f55e8e48a2ac48751b028c5f225b1125afb84464fb44cc69b925b92941656b3eea8874fe73574b99630a
6
+ metadata.gz: 71e58c2e8f0494c80d7f92fa3c68de56ad34dfdca3312aabec1e9cb29e8e19789b0fe68549feda406372ab9efae32df3f38116f97b3cf54804b4f41375852f96
7
+ data.tar.gz: bb929fdc4346b7281d7b8bed3c7f063e22a4bbf1b323063f4610886c1173b5092368860ee3a174151a61e713561f2c3e70b81afd5162b9a6a5d284c823107d0d
@@ -11,14 +11,19 @@ module GitFonky
11
11
  end
12
12
 
13
13
  def sync
14
- announce_update
15
- fetch_upstream
16
- pull_upstream
17
- if $?.success?
18
- push_to_origin
19
- else
20
- failed_pull_msg
14
+ Dir.chdir dirname do
15
+ announce_update
16
+ next invalid_branch_msg if on_invalid_branch?
17
+ fetch_upstream
18
+ pull_upstream
19
+ if $?.success?
20
+ push_to_origin
21
+ announce_success
22
+ else
23
+ failed_pull_msg
24
+ end
21
25
  end
26
+ puts "\n\n"
22
27
  end
23
28
 
24
29
  def on_invalid_branch?
@@ -50,10 +55,16 @@ module GitFonky
50
55
  end
51
56
 
52
57
  def announce_update
53
- update_msg = "Updating -> #{dirname} | #{branch} branch "
54
- puts "=" * update_msg.length
55
- puts update_msg
56
- puts "=" * update_msg.length
58
+ msg = "Updating -> #{dirname} | #{branch} branch "
59
+ border = border_for(msg, "=")
60
+
61
+ puts border
62
+ puts msg.center(border.length)
63
+ puts border
64
+ end
65
+
66
+ def announce_success
67
+ puts "-----> Successfully updated #{dirname} | #{branch} branch"
57
68
  end
58
69
 
59
70
  def announce(action, direction = "from", remote = "upstream")
@@ -61,7 +72,7 @@ module GitFonky
61
72
  end
62
73
 
63
74
  def fetch_upstream
64
- # announce("fetching")
75
+ announce("fetching")
65
76
  `git fetch upstream #{branch} 2>&1`
66
77
  end
67
78
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFonky
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/git_fonky.rb CHANGED
@@ -10,17 +10,7 @@ module GitFonky
10
10
  def self.sync_repos
11
11
  Dir.chdir "#{Dir.home}/code" do
12
12
  WORK_REPO_NAMES.each do |dir|
13
- repo = RepoDir.new(dir)
14
-
15
- Dir.chdir repo.dirname do
16
- puts repo.dirname.upcase
17
-
18
- next repo.invalid_branch_msg if repo.on_invalid_branch?
19
-
20
- repo.sync
21
- end
22
-
23
- puts "\n\n"
13
+ RepoDir.new(dir).sync
24
14
  end
25
15
  end
26
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_fonky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collin Jilbert