ffi-serial 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ffi-serial/posix.rb +3 -27
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4df3ee55c469455ed931dcfd49c71841ff9e990a
4
- data.tar.gz: 96dac10a98e36b7109978e98cc600caf9d2d5a22
3
+ metadata.gz: 171e00de20624479f57c484dde3675d6020564af
4
+ data.tar.gz: 72cd514955beeb975a37afe754d45e2684b2459d
5
5
  SHA512:
6
- metadata.gz: 0ba5fa92d9da8438db7474d90c32e57ecd1df4b4b125f592169da0f97a2946eecedaf430e32e23b0329306b7fc7e20b0957e4f6d38a83f5bd1f06e928ea34f4e
7
- data.tar.gz: f6406a1f629b0ecc288ba678de3085947f04846da621f06b32bba3997189b9b1b91fdec671bee471ef13bf06f143696b711428d61ff4159607a1b671b712b218
6
+ metadata.gz: 5ffa5a7365668b12655c78042db290c60f617ed9e9c128c1b384b3bcbc9eabb643c98c111d8a6fe421c3f603704b4144212825a727f1a8021b088e98eb62d36e
7
+ data.tar.gz: 648ae77871fb16e3317e8f3815eedd95a6823ca1b5bf51cb06b3251ff0c5a24a629d4e4f44bed79e3b72d7a497c3c2393bd7a8ecbb918a3c3405916d031b5655
@@ -61,37 +61,13 @@ module Serial #:nodoc:
61
61
  # It seems like VMIN and VTIME is broken :(
62
62
  # So this seems to be the only way to implement read the way it should be
63
63
  def read(length = nil, buffer = nil) #:nodoc:
64
- if length.nil?
65
- IO.select([self]) # Block
66
-
67
- if buffer.nil?
68
- return super
69
- else
70
- return super(nil, buffer)
71
- end
72
- end
73
-
74
- read_count = 0
75
- data_read = []
76
- while(length > read_count)
77
- IO.select([self]) # Block
78
- data_read << (partial_read = super(length))
79
- read_count += partial_read.length
80
- end
81
-
82
- data_read = data_read.join
83
- return data_read if buffer.nil?
84
- buffer.gsub!(buffer, data_read) # :sigh: not sure how to do this better
85
- buffer
64
+ IO.select([self]) # Block
65
+ super(length, buffer)
86
66
  end
87
67
 
88
68
  def readpartial(length, buffer = nil) #:nodoc:
89
69
  IO.select([self]) # Block
90
- if buffer.nil?
91
- super(length)
92
- else
93
- super(length, buffer)
94
- end
70
+ super(length, buffer)
95
71
  end
96
72
 
97
73
  def baud #:nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan van der Vyver