tilia-vobject 4.0.0.pre.alpha4 → 4.0.0.pre.alpha5

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: b9a25648ed541c29492f805734327e8cc4438aef
4
- data.tar.gz: a7554324ae3d755529b9b7bd09fa52f22833c57b
3
+ metadata.gz: 4bb045bffc5a4f09ec5b42bf531c93af195bb13c
4
+ data.tar.gz: aee0bcf064936a2edf655b1233b07d6e17ee9363
5
5
  SHA512:
6
- metadata.gz: ff95ab96237bfbdf5f59bf14af3a27e1080eee2afef19846909e72ac9629296f61dc45a41b8cf5ad5a8b114db53316c9961d0411ad9c1eee1d8f10671e60f87a
7
- data.tar.gz: 3eea394b3de90edcfe065d86b9ec8638716c81634680ea522aeef2d1677addd9fe5d0be2e3966b218e709c95403bd7dd4df9e081fef6200040cdd600b71f0307
6
+ metadata.gz: fde2b577247818ebaa90fa4432b12ce6186af67f3b37c29322857ad416e0a770d870001aab010b3b9b223b8aa386fa36ffcf46956f3d34d93a241e559e967a97
7
+ data.tar.gz: b09d50a778617b84cbc219f95b9d9a993cbcff17deedba818b15c15653336723494a1cd08f5565be4134c0bfd27e330834c9ac5a93743a2d608ec92c6574db31
@@ -138,8 +138,8 @@ module Tilia
138
138
  #
139
139
  # @return void
140
140
  def input=(input)
141
- input = input.readlines.join('') if input.respond_to?(:readlines)
142
- input = JSON.parse(input) if input.is_a?(String)
141
+ input = input.read unless input.is_a?(String)
142
+ input = JSON.parse(input)
143
143
 
144
144
  @input = input
145
145
  end
@@ -56,7 +56,7 @@ module Tilia
56
56
  stream.write(input)
57
57
  stream.rewind
58
58
  @input = stream
59
- elsif input.respond_to?(:readlines)
59
+ elsif input.respond_to?(:read)
60
60
  @input = input
61
61
  else
62
62
  fail ArgumentError, 'This parser can only read from strings or streams.'
@@ -292,7 +292,7 @@ module Tilia
292
292
  #
293
293
  # @return void
294
294
  def input=(input)
295
- input = input.readlines.join('') if input.respond_to?(:readlines)
295
+ input = input.read unless input.is_a?(String)
296
296
 
297
297
  if input.is_a?(String)
298
298
  reader = Tilia::Xml::Reader.new
@@ -3,7 +3,7 @@ module Tilia
3
3
  # This class contains the version number for the VObject package.
4
4
  class Version
5
5
  # Full version number.
6
- VERSION = '4.0.0-alpha4'
6
+ VERSION = '4.0.0-alpha5'
7
7
  end
8
8
  end
9
9
  end
@@ -91,7 +91,7 @@ ICS
91
91
  version = Tilia::VObject::Version::VERSION
92
92
  assert_equal(
93
93
  '["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-//Tilia//Tilia VObject ' + version + '//EN"],["fn",{},"text","Cowboy Henk"]]]',
94
- @cli.stdout.readlines.join('')
94
+ @cli.stdout.read
95
95
  )
96
96
  end
97
97
 
@@ -121,7 +121,7 @@ ICS
121
121
  "version",
122
122
  JCARD
123
123
 
124
- assert_equal(expected, @cli.stdout.readlines.join('')[0..39])
124
+ assert_equal(expected, @cli.stdout.read[0..39])
125
125
  end
126
126
 
127
127
  def test_convert_j_cal_fail
@@ -191,7 +191,7 @@ FN:Cowboy Henk
191
191
  END:VCARD
192
192
  VCF
193
193
 
194
- assert_equal(expected, @cli.stdout.readlines.join('').gsub("\r\n", "\n"))
194
+ assert_equal(expected, @cli.stdout.read.gsub("\r\n", "\n"))
195
195
  end
196
196
 
197
197
  def test_convert_default_formats
@@ -239,7 +239,7 @@ FN:Cowboy Henk
239
239
  END:VCARD
240
240
  VCF
241
241
 
242
- assert_equal(expected, @cli.stdout.readlines.join('').gsub("\r\n", "\n"))
242
+ assert_equal(expected, @cli.stdout.read.gsub("\r\n", "\n"))
243
243
  end
244
244
 
245
245
  def test_v_card4030
@@ -270,7 +270,7 @@ FN:Cowboy Henk
270
270
  END:VCARD
271
271
  VCF
272
272
 
273
- assert_equal(expected, @cli.stdout.readlines.join('').gsub("\r\n", "\n"))
273
+ assert_equal(expected, @cli.stdout.read.gsub("\r\n", "\n"))
274
274
  end
275
275
 
276
276
  def test_v_card4021
@@ -357,7 +357,7 @@ VCF
357
357
  assert_equal(2, @cli.main(['repair', '-']))
358
358
 
359
359
  @cli.stdout.rewind
360
- assert(@cli.stdout.readlines.join('') =~ /BEGIN:VCARD\r\nVERSION:2.1\r\nUID:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\r\nEND:VCARD\r\n$/)
360
+ assert(@cli.stdout.read =~ /BEGIN:VCARD\r\nVERSION:2.1\r\nUID:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\r\nEND:VCARD\r\n$/)
361
361
  end
362
362
 
363
363
  def test_repair_nothing
@@ -382,7 +382,7 @@ VCF
382
382
  result = @cli.main(['repair', '-'])
383
383
 
384
384
  @cli.stderr.rewind
385
- error = @cli.stderr.readlines.join('')
385
+ error = @cli.stderr.read
386
386
 
387
387
  assert_equal(0, result, "This should have been error free. stderr output:\n#{error}")
388
388
  end
@@ -419,7 +419,7 @@ VCF
419
419
  result = @cli.main(['color', '-'])
420
420
 
421
421
  @cli.stderr.rewind
422
- error = @cli.stderr.readlines.join('')
422
+ error = @cli.stderr.read
423
423
 
424
424
  assert_equal(0, result, "This should have been error free. stderr output:\n#{error}")
425
425
  end
@@ -451,7 +451,7 @@ VCF
451
451
  result = @cli.main(['color', '-'])
452
452
 
453
453
  @cli.stderr.rewind
454
- error = @cli.stderr.readlines.join('')
454
+ error = @cli.stderr.read
455
455
 
456
456
  assert_equal(0, result, "This should have been error free. stderr output:\n#{error}")
457
457
  end
@@ -13,7 +13,7 @@ module Tilia
13
13
  # CALSCALE will automatically get removed if it's set to GREGORIAN.
14
14
  def assert_v_obj_equals(expected, actual, message = '')
15
15
  get_obj = lambda do |input|
16
- input = input.readlines.join("\n") if input.respond_to?(:readlines)
16
+ input = input.read if input.respond_to?(:read)
17
17
 
18
18
  input = Tilia::VObject::Reader.read(input) if input.is_a?(String)
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tilia-vobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre.alpha4
4
+ version: 4.0.0.pre.alpha5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Sack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilia-xml