svn_command_helper 0.7.0 → 0.8.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
  SHA1:
3
- metadata.gz: 473a682621ce0f8423b8be51fead333becdd3b2f
4
- data.tar.gz: eee8e3adda5ca606288174952cd81eb10b052e0d
3
+ metadata.gz: 4c22304c19784905f71c155efce383dbddd09979
4
+ data.tar.gz: 1b12f365b9b012ebcc935519cf1ef1d098466e2c
5
5
  SHA512:
6
- metadata.gz: 7ce776c91106a12049c74df657e2a98b3d69ba17e996941a4d218581ea8b648a2a0335e42bc2818e96ba99b2c64c4a9a76dda912757ef24450b43b568020b649
7
- data.tar.gz: 94f8feb724b65a45a9dda3767fc9094a41e818bcd3061dbaf7f234bf85a055102294862fd5b18045e4f205a77e2f55a3f8d9107fb72a4ea1eb77557e9c017fec
6
+ metadata.gz: 9ce3f606d37b89661396c7c745709cb0565d688e12a1578e2bb162ca264c3274c7e6c43ca18239c7c0158ba7e04fc521e54817aef5e851a058ead5789454503f
7
+ data.tar.gz: 6f29ad070f88b16596eea0b4f7ed5883fcb81505325f8a24ea9a4b9396185828da5ebcb7414ddbcabd66544bd34b8da8de74ef63efada641f731412410a1882b
@@ -1,4 +1,4 @@
1
1
  module SvnCommandHelper
2
2
  # version
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.0"
4
4
  end
@@ -33,8 +33,14 @@ module SvnCommandHelper
33
33
  # @param [Boolean] recursive --recursive
34
34
  # @return [Array<String>] paths
35
35
  def list(uri, recursive = false)
36
- cap("svn list #{recursive ? '-R' : ''} #{uri}").split(/\n/).compact
37
- .reject {|path| path.empty?}
36
+ if @list_cache && @list_cache[uri]
37
+ @list_cache[uri]
38
+ else
39
+ list = cap("svn list #{recursive ? '-R' : ''} #{uri}").split(/\n/).compact
40
+ .reject {|path| path.empty?}
41
+ @list_cache[uri] = list if @list_cache
42
+ list
43
+ end
38
44
  end
39
45
 
40
46
  # svn list --recursive
@@ -59,6 +65,13 @@ module SvnCommandHelper
59
65
  list_files(uri, true)
60
66
  end
61
67
 
68
+ # svn list cache block
69
+ def list_cache(&block)
70
+ @list_cache = {}
71
+ block.call
72
+ @list_cache = nil
73
+ end
74
+
62
75
  # check svn uri exists or not
63
76
  # @param [uri string like] uri target uri
64
77
  # @return [Boolean] true if exists
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svn_command_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka