fight_club 0.0.2 → 0.0.3

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: 59f16064978428ca070424adb217906b2754a3ff
4
- data.tar.gz: fe549b71d1fc0447c167e4f2505fe3033f9a0720
3
+ metadata.gz: eaa004e9e6d2df5246cc9bded88a3a5c550d3087
4
+ data.tar.gz: 08d3127c29728b95a431ac5aac4e704ec2099fd2
5
5
  SHA512:
6
- metadata.gz: 61ce80af3d599356d80071b87174b1e4d6f412048e8189d6ca81a198ccde93444fdbc3ead5868e1e99380e9b8d2c4223c794af73f8aebc42100a18f795188585
7
- data.tar.gz: 64267b057799c8897ea4d4897e1ed5cf705a9ffb328a7beaf44d47b112851c228db1536610323d64ecd796ff7f44f35582381e807235f452b5bb2a7dd7a9de0f
6
+ metadata.gz: 13bc67f92f71dd423ad1a05710e9ece8e51bd8233cc1779af3b0309dba3ce3dd35115d63b44b0ab5bc920c3c9704e2c67e743670d43dfb288eb68388e20f652f
7
+ data.tar.gz: 761e2cea0c282c8ac6861b6c274c28026176d892ffdde332e7ad769af4216c71604e9e1856e08f0f0bc517a7cee1320aabb9ea22e08f0b7e6982c3c71e08b644
data/lib/fight_club.rb CHANGED
@@ -3,8 +3,6 @@ require_relative "fight_club/arena"
3
3
  require_relative "fight_club/config"
4
4
 
5
5
  module FightClub
6
- WORKING_DIR = "#{FightClub.config.repos_directory}/repos"
7
-
8
6
  class << self
9
7
  attr_writer :config
10
8
  end
@@ -21,7 +19,11 @@ module FightClub
21
19
  yield(config)
22
20
  end
23
21
 
22
+ def self.working_dir
23
+ "#{FightClub.config.repos_directory}/repos"
24
+ end
25
+
24
26
  def self.git_command
25
- "git '--git-dir=#{FightClub::WORKING_DIR}/#{FightClub.config.repo_name}/.git' '--work-tree=#{FightClub::WORKING_DIR}/#{FightClub.config.repo_name}'"
27
+ "git '--git-dir=#{working_dir}/#{config.repo_name}/.git' '--work-tree=#{working_dir}/#{config.repo_name}'"
26
28
  end
27
29
  end
@@ -43,7 +43,7 @@ module FightClub
43
43
  end
44
44
 
45
45
  def git
46
- @git ||= Git.open("#{FightClub::WORKING_DIR}/#{FightClub.config.repo_name}", log: Logger.new(STDOUT))
46
+ @git ||= Git.open("#{FightClub.working_dir}/#{FightClub.config.repo_name}", log: Logger.new(STDOUT))
47
47
  end
48
48
  end
49
49
  end
@@ -1,16 +1,14 @@
1
1
  module FightClub
2
2
  class Repository
3
- WORKING_DIR = "#{Dir.pwd}/repos"
4
-
5
3
  def update(uri, name)
6
- system("mkdir #{WORKING_DIR}/#{name}") unless Dir.exists? "WORKING_DIR/#{name}"
4
+ system("mkdir #{FightClub.working_dir}/#{name}") unless Dir.exists? "FightClub.working_dir/#{name}"
7
5
 
8
- git = Git.open("#{WORKING_DIR}/#{name}", :log => Logger.new(STDOUT))
6
+ git = Git.open("#{FightClub.working_dir}/#{name}", :log => Logger.new(STDOUT))
9
7
 
10
- unless File.exists?("#{WORKING_DIR}/#{name}/.gitconfig")
8
+ unless File.exists?("#{FightClub.working_dir}/#{name}/.gitconfig")
11
9
  Logger.new(STDOUT).info "Cloning #{name}..."
12
10
 
13
- git.clone(uri, name, :path => WORKING_DIR)
11
+ git.clone(uri, name, :path => FightClub.working_dir)
14
12
  end
15
13
 
16
14
  git.fetch
@@ -1,3 +1,3 @@
1
1
  module FightClub
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fight_club
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Minkov