svn_command_helper 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/svn_command_helper/version.rb +1 -1
- data/lib/svn_command_helper.rb +15 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c22304c19784905f71c155efce383dbddd09979
|
4
|
+
data.tar.gz: 1b12f365b9b012ebcc935519cf1ef1d098466e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ce3f606d37b89661396c7c745709cb0565d688e12a1578e2bb162ca264c3274c7e6c43ca18239c7c0158ba7e04fc521e54817aef5e851a058ead5789454503f
|
7
|
+
data.tar.gz: 6f29ad070f88b16596eea0b4f7ed5883fcb81505325f8a24ea9a4b9396185828da5ebcb7414ddbcabd66544bd34b8da8de74ef63efada641f731412410a1882b
|
data/lib/svn_command_helper.rb
CHANGED
@@ -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
|
-
|
37
|
-
|
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
|