plc_access 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: ea4474ee3c239bf4ea53ed84004db1baefed352db8528a013784338b7d7389bb
4
- data.tar.gz: 8190d2cfd63a13e9160b90ceff602476a2a4193eff863df04db3006081da0ebe
3
+ metadata.gz: 64e62d7a3897342a72e3a3e93a95eabf0df0b4362d81454cf5d86842dc74a754
4
+ data.tar.gz: 890d303add93fe36f6f77ac48db506d4105e5379a883c491814bb97eb0691d8c
5
5
  SHA512:
6
- metadata.gz: a5f6a4d7aeb2020f284987417bb63f5773c2b60b48dc5934c7f85037781960ff47139d552dc66d3334fa5d344672a422db7e1c6b6b779cbda83cbd56e9ced369
7
- data.tar.gz: 2e6cbe4aa87d259a36c34699420c889850ab9b62682e91034228f2b5d5c5a387e6f8d66be9ff475c26ba51fb676bd863b14dc0e965b2e4d23b9f66b98bfd6c0b
6
+ metadata.gz: e9ad8b4663e0980bfe8c10e37fc4a8221934e6d612c738ed2a3fe5c1a43492db3dc99371e5f75c399442d89255f6282ae6aaddd7a967a6bc7858cbe76f0b2efb
7
+ data.tar.gz: 05511e4e58e042681e64b5f69a98f04eed22d2738e96c217032a5b92c9cada9078aa87eeaa046639a15553ca3fc8434f673de35774aa73a6ae631427cbbb7293
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plc_access (0.2.1)
4
+ plc_access (0.2.3)
5
5
  serialport (~> 1.3, >= 1.3.1)
6
6
 
7
7
  GEM
@@ -30,6 +30,7 @@ module PlcAccess
30
30
  def initialize(a, b = nil)
31
31
  super
32
32
  @suffix = 'R' if @suffix.nil? || @suffix.length.zero?
33
+ raise ArgumentError, "Invalid device suffix: #{@suffix}" unless ESC_SUFFIXES.include?(@suffix)
33
34
  end
34
35
 
35
36
  def +(other)
@@ -57,6 +57,7 @@ module PlcAccess
57
57
  @number = ::Regexp.last_match(2).to_i(p_adic_number)
58
58
  end
59
59
  end
60
+ raise ArgumentError, "Invalid device suffix: #{@suffix}" if @suffix && !SUFFIXES.include?(@suffix)
60
61
  end
61
62
 
62
63
  def valid?
@@ -52,6 +52,7 @@ module PlcAccess
52
52
  @bit = ::Regexp.last_match(4).to_i if ::Regexp.last_match(4)
53
53
  end
54
54
  end
55
+ raise ArgumentError, "Invalid device suffix: #{@suffix}" if @suffix && !SUFFIXES.include?(@suffix)
55
56
  case @suffix
56
57
  when 'T', 'C'
57
58
  raise "#{name} is not allowed as a bit device." if @bit
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlcAccess
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plc_access
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuyoshi Ito