nstrct 0.1.5 → 0.1.6

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: 7a26c54c7028ec20750d4ee5e4d88509c7f74616
4
- data.tar.gz: 2a89f910a4b0e226174536167c1efa1c05d0309a
3
+ metadata.gz: 07a1b9cf6f2bd4ee746fbcc14a5cd00fc1b77943
4
+ data.tar.gz: 84587496b57c398bf6095d21dd00e8e4a265a709
5
5
  SHA512:
6
- metadata.gz: 6f3e1716890fb3a47fe4506fb6db39fb18f256e0a7fe3ef2f855ff2a1b9eeacba5366b03ea5384234da7c752c9dd7682a11083cad09443f7e0bbec25b31c0b44
7
- data.tar.gz: e7044f1ef72deb00c9502e555f560cd5aae395122b13060baf41145a3149c538a35cb2ffe4b02fbf765a2c8593e464254fe41fcbc472720a8ce17a4652df5aea
6
+ metadata.gz: 181ae7887ac173d4f3b597010ed27ba11b028452746de2257053728c511c4eef69c6814f97c289b0230af08773b3ae04fbf382dfb20b2d4ee126eef33d3fb02c
7
+ data.tar.gz: e316f75f821c6137706eebb8de7663fd813986027f36fcc5684a9c58240f9754f911772e52aebb79723a107239322ac22269c74f7ca933f58d0bf8d626b4b9b8
data/Gemfile CHANGED
@@ -1,8 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
- ruby '2.1.0'
5
-
6
4
  group :test do
7
5
  gem 'rspec'
8
6
  gem 'rake'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nstrct (0.1.5)
4
+ nstrct (0.1.6)
5
5
  digest-crc
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -27,7 +27,7 @@ bytes = instruction.pack
27
27
  A more complex example:
28
28
 
29
29
  ```ruby
30
- instruction = Nstrct::Instruction.build_instruction(232, [:boolean, true], [:int8, 2], [:float32, 1.0], [[:uint16], [54, 23, 1973]])
30
+ instruction = Nstrct::Instruction.build_instruction(232, [:boolean, true], [:int8, 2], [:float32, 1.0], [:uint16, [54, 23, 1973]])
31
31
  instruction.pack
32
32
  ```
33
33
 
@@ -18,12 +18,12 @@ module Nstrct
18
18
 
19
19
  # Build an instruction for a code and some arguments.
20
20
  #
21
- # Message.build_instruction 54, [ :boolean, true], [[:int8], [7, 8, 9]] ]
21
+ # Message.build_instruction 54, [:int8, [7, 8, 9]]
22
22
  #
23
23
  def self.build(code, *args)
24
24
  arguments = args.map do |arg|
25
- if arg[0].is_a?(Array)
26
- Nstrct::Argument.new(arg[0][0], arg[1], true)
25
+ if arg[1].is_a?(Array)
26
+ Nstrct::Argument.new(arg[0], arg[1], true)
27
27
  else
28
28
  Nstrct::Argument.new(arg[0], arg[1], false)
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Nstrct
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
@@ -31,7 +31,7 @@ describe Nstrct::Instruction do
31
31
  end
32
32
 
33
33
  it 'should pack and unpack an instructionw with arguments' do
34
- instruction1 = Nstrct::Instruction.build(232, [:float32, 1.0 ], [[:boolean], []], [:boolean, true], [:int8, 2], [:float32, 1.0], [[:uint16], [54, 23, 1973]])
34
+ instruction1 = Nstrct::Instruction.build(232, [:float32, 1.0 ], [:boolean, []], [:boolean, true], [:int8, 2], [:float32, 1.0], [:uint16, [54, 23, 1973]])
35
35
  instruction2 = Nstrct::Instruction.parse(instruction1.pack)
36
36
  expect(instruction1.inspect).to eq(instruction2.inspect)
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nstrct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joël Gähwiler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest-crc