git_fonky 0.3.0 → 0.5.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: 075ddc336d9482d77d083db40a4b6ff7553ece62c759b3213a92df3bf277cfe9
4
- data.tar.gz: bc74101affa62955eb5a1ed03a430cce6f59038aad66aeb99f3821dc264a55c4
3
+ metadata.gz: 0bd9807def500bd1e7286efca533211095677446bc0584da352701faff3b70a6
4
+ data.tar.gz: 2a0ea855b1bd0f879eb0a565b96543841f98ae930dde9957186f43a376ddcb2e
5
5
  SHA512:
6
- metadata.gz: c2b26d77154d1281978063c57be33fe6f31d82c09879f81b41081542eceaaf7af032c05824fadba674d8fb5d7388253119756c9d0b9f433cc6831ff48c655674
7
- data.tar.gz: ca914d2c8d384f32b37b91f0ba87cdcefc9ff40bb8cbd6bfaa42a93415899cae27ec592d5b9afbda35d57a0fe7010347c493fd9bf4fa08442f923ac5c7c22754
6
+ metadata.gz: '0956e4742a538e2127bbd899673c4b0c02827961746e16fd7b4eb8f68e8f588a4660736269de450c6fcc73099891a6be7a9c819403cee078b757df985a28603a'
7
+ data.tar.gz: 978574bcfe3da9f6195aab61c15b9254f10690400f98f12656fb95d94ce733dc2f8527e2f7d0bff8bed43c4c7f5eec13f176f2677458ab821b832dcd40191c16
@@ -1,9 +1,10 @@
1
1
  module GitFonky
2
2
  class Command
3
- attr_reader :repo_dir
3
+ attr_reader :repo_dir, :reporter
4
4
 
5
- def initialize(repo_dir)
5
+ def initialize(repo_dir:, reporter:)
6
6
  @repo_dir = repo_dir
7
+ @reporter = reporter
7
8
  end
8
9
 
9
10
  def current_branch
@@ -11,24 +12,18 @@ module GitFonky
11
12
  end
12
13
 
13
14
  def fetch_upstream
14
- announce("fetching")
15
+ reporter.announce("fetching")
15
16
  `git fetch upstream #{repo_dir.branch} 2>&1`
16
17
  end
17
18
 
18
19
  def pull_upstream
19
- announce("pulling")
20
+ reporter.announce("pulling")
20
21
  `git pull upstream #{repo_dir.branch} 2>&1`
21
22
  end
22
23
 
23
24
  def push_to_origin
24
- announce("pushing", "to", "origin")
25
+ reporter.announce("pushing", "to", "origin")
25
26
  `git push origin #{repo_dir.branch} 2>&1`
26
27
  end
27
-
28
- private
29
-
30
- def announce(action, direction = "from", remote = "upstream")
31
- puts "-----> #{action} #{direction} #{remote} #{repo_dir.branch}"
32
- end
33
28
  end
34
29
  end
@@ -6,9 +6,9 @@ module GitFonky
6
6
  attr_reader :command, :dirname, :reporter
7
7
 
8
8
  def initialize(dirname)
9
- @command = Command.new(self)
10
9
  @dirname = dirname
11
10
  @reporter = Reporter.new(self)
11
+ @command = Command.new(repo_dir: self, reporter: reporter)
12
12
  end
13
13
 
14
14
  def branch
@@ -6,6 +6,10 @@ module GitFonky
6
6
  @repo_dir = repo_dir
7
7
  end
8
8
 
9
+ def announce(action, direction = "from", remote = "upstream")
10
+ puts "-----> #{action} #{direction} #{remote} #{repo_dir.branch}"
11
+ end
12
+
9
13
  def announce_success
10
14
  puts "-----> Successfully updated #{repo_dir.dirname} | #{repo_dir.branch} branch"
11
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFonky
4
- VERSION = "0.3.0"
4
+ VERSION = "0.5.0"
5
5
  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.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collin Jilbert