svn_command_helper 0.8.0 → 0.9.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 +4 -4
- data/lib/svn_command_helper/version.rb +1 -1
- data/lib/svn_command_helper.rb +37 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f604e3f587e384d6e6b790e1e72bb85511a0470e
|
4
|
+
data.tar.gz: 2caa2170e32bd2779914365454e34b0c389b349a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33b69c7d11200c05147e18a9abff5d5d5bae063ba16e09ad04c910735dd2ad31014340d7ba4a07aa8887b8d5664f8e21cbe6f19b5340a3aa09b2e7d8fcb08e13
|
7
|
+
data.tar.gz: 067457d881f8cd082df9cbcffb079d3d6e23c7915d52a2b081c4cbdc643b9f7e66d6b5c908cddf3ad90ffa9ad7eaa3685e5dd477ee55bc43c32228f1a2f1463f
|
data/lib/svn_command_helper.rb
CHANGED
@@ -223,6 +223,43 @@ module SvnCommandHelper
|
|
223
223
|
end.to_s
|
224
224
|
end
|
225
225
|
|
226
|
+
# svn diff
|
227
|
+
# @param [String] from_uri from uri
|
228
|
+
# @param [String] to_uri to uri
|
229
|
+
# @param [Boolean] ignore_properties --ignore-properties
|
230
|
+
# @param [Boolean] ignore_eol_style -x --ignore-eol-style
|
231
|
+
# @param [Boolean] ignore_space_change -x --ignore-space-change
|
232
|
+
# @param [Boolean] ignore_all_space -x --ignore-all-space
|
233
|
+
# @return [String] raw diff str
|
234
|
+
def diff(from_uri, to_uri, ignore_properties: false, ignore_eol_style: false, ignore_space_change: false, ignore_all_space: false)
|
235
|
+
options = []
|
236
|
+
options << "-x --ignore-eol-style" if ignore_eol_style
|
237
|
+
options << "-x --ignore-space-change" if ignore_space_change
|
238
|
+
options << "-x --ignore-all-space" if ignore_all_space
|
239
|
+
options << "--ignore-properties" if ignore_properties
|
240
|
+
cap("svn diff #{from_uri} #{to_uri} #{options.join(' ')}")
|
241
|
+
end
|
242
|
+
|
243
|
+
# svn diff --summarize
|
244
|
+
# @param [String] from_uri from uri
|
245
|
+
# @param [String] to_uri to uri
|
246
|
+
# @param [Boolean] ignore_properties | grep -v '^ '
|
247
|
+
# @param [Boolean] ignore_eol_style -x --ignore-eol-style
|
248
|
+
# @param [Boolean] ignore_space_change -x --ignore-space-change
|
249
|
+
# @param [Boolean] ignore_all_space -x --ignore-all-space
|
250
|
+
# @return [Array] diff files list
|
251
|
+
def summarize_diff(from_uri, to_uri, ignore_properties: false, ignore_eol_style: false, ignore_space_change: false, ignore_all_space: false)
|
252
|
+
options = []
|
253
|
+
options << "-x --ignore-eol-style" if ignore_eol_style
|
254
|
+
options << "-x --ignore-space-change" if ignore_space_change
|
255
|
+
options << "-x --ignore-all-space" if ignore_all_space
|
256
|
+
options << "| grep -v '^ '" if ignore_properties
|
257
|
+
cap("svn diff --summarize #{from_uri} #{to_uri} #{options.join(' ')}")
|
258
|
+
.each_line.map(&:chomp)
|
259
|
+
.map {|line| line.match(/^(\s*\S+)\s+(\S.*)$/)}
|
260
|
+
.map {|result| OpenStruct.new({diff: result[1], file: result[2]})}
|
261
|
+
end
|
262
|
+
|
226
263
|
# copy single transaction
|
227
264
|
# @param [SvnFileCopyTransaction] transaction from and to info
|
228
265
|
# @param [String] message commit message
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svn_command_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Narazaka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: system_command_helper
|