svn_command_helper 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c22304c19784905f71c155efce383dbddd09979
4
- data.tar.gz: 1b12f365b9b012ebcc935519cf1ef1d098466e2c
3
+ metadata.gz: f604e3f587e384d6e6b790e1e72bb85511a0470e
4
+ data.tar.gz: 2caa2170e32bd2779914365454e34b0c389b349a
5
5
  SHA512:
6
- metadata.gz: 9ce3f606d37b89661396c7c745709cb0565d688e12a1578e2bb162ca264c3274c7e6c43ca18239c7c0158ba7e04fc521e54817aef5e851a058ead5789454503f
7
- data.tar.gz: 6f29ad070f88b16596eea0b4f7ed5883fcb81505325f8a24ea9a4b9396185828da5ebcb7414ddbcabd66544bd34b8da8de74ef63efada641f731412410a1882b
6
+ metadata.gz: 33b69c7d11200c05147e18a9abff5d5d5bae063ba16e09ad04c910735dd2ad31014340d7ba4a07aa8887b8d5664f8e21cbe6f19b5340a3aa09b2e7d8fcb08e13
7
+ data.tar.gz: 067457d881f8cd082df9cbcffb079d3d6e23c7915d52a2b081c4cbdc643b9f7e66d6b5c908cddf3ad90ffa9ad7eaa3685e5dd477ee55bc43c32228f1a2f1463f
@@ -1,4 +1,4 @@
1
1
  module SvnCommandHelper
2
2
  # version
3
- VERSION = "0.8.0"
3
+ VERSION = "0.9.0"
4
4
  end
@@ -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.8.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-20 00:00:00.000000000 Z
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