git_fonky 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 075ddc336d9482d77d083db40a4b6ff7553ece62c759b3213a92df3bf277cfe9
4
- data.tar.gz: bc74101affa62955eb5a1ed03a430cce6f59038aad66aeb99f3821dc264a55c4
3
+ metadata.gz: 2d9e659e91221b3600b3d9924a209748976b7880108f49d724d4ffaaf2189ff6
4
+ data.tar.gz: 947bf8009681841bd4fcdd46c962bcc2d824b39851161aefa3777e75f5b0cd0b
5
5
  SHA512:
6
- metadata.gz: c2b26d77154d1281978063c57be33fe6f31d82c09879f81b41081542eceaaf7af032c05824fadba674d8fb5d7388253119756c9d0b9f433cc6831ff48c655674
7
- data.tar.gz: ca914d2c8d384f32b37b91f0ba87cdcefc9ff40bb8cbd6bfaa42a93415899cae27ec592d5b9afbda35d57a0fe7010347c493fd9bf4fa08442f923ac5c7c22754
6
+ metadata.gz: 83e34338ffc13a6af5f9fe7d6684066bc74796037353122c9ee5bdc73a86e424d9438325d1634a8d5ba35cebd2ef86d3e3ecce2fcc8762bed39624b7e7ae0381
7
+ data.tar.gz: 2601863350da5d6a26b5a263cf9e9b903f43ec5b85858737c760ab122479467b7f535e3531a49255b1aab2b53324a9207d80a0e6e022b6dcc6e4d059dd433f47
@@ -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.4.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.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collin Jilbert