ghq-cache 0.3.0 → 0.3.1

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: 029edda1d5f7d745b5e4716a54cac2da429fb476
4
- data.tar.gz: 2d5a4ba671db6667b1704c7b72a4ce1306b7f67c
3
+ metadata.gz: 0d9368162f00c4bdb0adea8729c40ababe4be28a
4
+ data.tar.gz: 0bd77faae814a37885104b29af27f389634849de
5
5
  SHA512:
6
- metadata.gz: 1cb1143dabf1600831a6ca22f07575b88044e7cccd76074f09c9da9bec9ba37095350cf856ac77bd2f1f151202c77c08f43a4cf759206c26907980fbf99d0108
7
- data.tar.gz: 756f5a3794784ce4c690b051214c70729b429d4f11b881e686a6fe4d47a1f58553ac5465ff887601d7acd4ea7516a864f22c30dbde6cf6353c2aee5b4d393248
6
+ metadata.gz: 12b8366e9cb0392821e2034d63e9c5fa3fd51ef825d6fc4cb02a80a30feb9f719ed46057dfa64a40a3cffb660f29c9a374da79a4ea20f62eedd041cb8a19a6ad
7
+ data.tar.gz: 1d80ecb3bb9d73875edede2c6c0729599abce865ad0ed5f7cf19daec55f470b784660d3cacb964bf2ecfa72e0c1f9736162c46407a1c5bda0bb51b83d890b039
@@ -17,7 +17,7 @@ module Ghq
17
17
  dirs = flatten(root).sort_by do |dir|
18
18
  sort_key(dir)
19
19
  end.reverse
20
- cache = dirs.map(&:full_path).join("\n").concat("\n")
20
+ cache = dirs.map(&:path_from_root).join("\n").concat("\n")
21
21
  File.write(CACHE_PATH, cache)
22
22
  end
23
23
 
@@ -40,9 +40,9 @@ module Ghq
40
40
  self.name.include?('/')
41
41
  end
42
42
 
43
- def full_path
44
- return name unless parent
45
- File.join(parent.full_path, name)
43
+ def path_from_root
44
+ return name if parent.nil? || parent.root?
45
+ File.join(parent.path_from_root, name)
46
46
  end
47
47
 
48
48
  private
@@ -1,5 +1,5 @@
1
1
  module Ghq
2
2
  module Cache
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghq-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun