libbin 1.0.6 → 1.0.7

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
  SHA256:
3
- metadata.gz: d3a9557a12a5d4ef9ed048592358290c19bebb42cb55d5dacf5d234e62aee6c0
4
- data.tar.gz: 319fffa88af207c7613209e632b10e1c16a70bea0b5ddfbf7de6b1f54bb74cbf
3
+ metadata.gz: 2d6b93ee63ec0916ee685a6b1b646a4fb6a742e31158049bc46f387db3a4ee27
4
+ data.tar.gz: dc8c1ea1218694f5b4ad8a53baa60e721a7b533474db9674939b40d25cb7ee06
5
5
  SHA512:
6
- metadata.gz: a07e150714b61ea44cb2a7df3442e6ed7257d4b601bc8e2353e2329fc9eaaddcef56318dac85c2277a1eff3e8f6407919b4f43320e4e9d02506cce2bcea6bf35
7
- data.tar.gz: 2d4ef297ce1c616ce464d2b3a667061959965ba8ca63113e699348e6313f3ab8ba15165c3041cc84cded5dc70ba5b5e5f31bcf338221f5a2a4bb725440636fad
6
+ metadata.gz: 808407aad8f8de68723199114b84434027b3a936360496785574cfdb34567c6cf6bcffcfb044c02885c9211794bd34b25fb916323724cedfd69dfddd34cf0254
7
+ data.tar.gz: 005fb654400e4b7eaa5c9137aa7ea55d30f61b62d9c4c6f13b385046118b5dcbddda3347331397d1f1cb6cf217c3aef3a50ebd493dc123ea1c8a8f792d6fcb69
@@ -3,9 +3,10 @@ module LibBin
3
3
  module RangeRefinement
4
4
  refine Range do
5
5
  def +(other)
6
- Range::new(first <= other.first ? first : other.first,
7
- last >= other.last ? last : other.last,
8
- exclude_end?)
6
+ return other.dup unless min
7
+ return self.dup unless other.min
8
+ Range::new(min <= other.min ? min : other.min,
9
+ max >= other.max ? max : other.max)
9
10
  end
10
11
  end
11
12
  end
@@ -26,7 +27,7 @@ module LibBin
26
27
  @members = nil
27
28
  else
28
29
  @members = args[0]
29
- @range = @members.values.flatten.compact.collect(&:range).reduce { |memo, obj| memo + obj }
30
+ @range = @members.values.flatten.compact.collect(&:range).reduce(:+)
30
31
  end
31
32
  end
32
33
 
@@ -52,7 +53,7 @@ module LibBin
52
53
  if args.length == 2
53
54
  @range = Range::new(args[0], args[1])
54
55
  else
55
- @range = args[0].values.flatten.compact.collect(&:range).reduce { |memo, obj| memo + obj }
56
+ @range = args[0].values.flatten.compact.collect(&:range).reduce(:+)
56
57
  end
57
58
  end
58
59
 
data/lib/libbin.rb CHANGED
@@ -335,11 +335,11 @@ module LibBin
335
335
  self
336
336
  end
337
337
 
338
- def self.convert(input, output, input_big = LibBin::default_big?, output_big = !LibBin::default_big?, parent = nil, index = nil, length = nil)
338
+ def self.convert(input, output, input_big = LibBin::default_big?, output_big = !input_big, parent = nil, index = nil, length = nil)
339
339
  if length
340
340
  length.times.collect {
341
341
  h = self::new
342
- h.__load(input, input_big, parent, index)
342
+ h.__convert(input, output, input_big, output_big, parent, index)
343
343
  }
344
344
  else
345
345
  h = self::new
data/libbin.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'libbin'
3
- s.version = "1.0.6"
3
+ s.version = "1.0.7"
4
4
  s.author = "Brice Videau"
5
- s.email = "brice.videau@imag.fr"
5
+ s.email = "brice.videau@gmail.com"
6
6
  s.homepage = "https://github.com/kerilk/libbin"
7
7
  s.summary = "Library for loading and converting binary files"
8
8
  s.description = "Read, write and convert Binary data in Ruby."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice Videau
@@ -31,7 +31,7 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.3.0
33
33
  description: Read, write and convert Binary data in Ruby.
34
- email: brice.videau@imag.fr
34
+ email: brice.videau@gmail.com
35
35
  executables: []
36
36
  extensions:
37
37
  - ext/libbin/extconf.rb