star_ethernet 0.1.9 → 0.1.10

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: fcf7e42b216ddd71b01fb77004c946ad4da47b2da21e2d2b9114c6515cb8e401
4
- data.tar.gz: ec60d9667830eadbb01e9e886b0e7584bad501cb0c2f1d2995784169d77a256b
3
+ metadata.gz: 83280458b18283e860c6c06ea48156aa57e54df9f7ed3112c58426cf007417de
4
+ data.tar.gz: 717be784b2926d2478bcd75a5a4d6d756912120a122147aaa0c76e8056e6244f
5
5
  SHA512:
6
- metadata.gz: a63b97c70ff83086ef076c61d07b576a95db7645d22632a77eaeaeae440c8232c9ca2e7b67ec785faf4e781d0c0e77fe982f2bff207e4b97f5ae328559363d48
7
- data.tar.gz: f32e1809b3af60e53f2d1dc6b77d454bf360db01bc49e70bc2b380d6ed22e296ae00279ec6257aa3447e22cf13ba7168984421ae8ea248022302690312596983
6
+ metadata.gz: 6e0bced26daff4e3259766e931560beeced4752c73740aa64db6c455419619d64010084ca7889b562c6ce06602aab39249717a2b03948156b0f31c66e1a955cd
7
+ data.tar.gz: 05f41ecae4e625abd39719a0161b56c77c35e4f51c12cdfae6e106e6c496df4de65c860eda776da68f916faa0e41afd1bd77fc81b6dac71e6cdf8261f4d9514e
data/.travis.yml CHANGED
@@ -3,7 +3,5 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.4.1
7
- - 2.5
8
6
  - 2.5.3
9
7
  before_install: gem install bundler -v 2.0.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- star_ethernet (0.1.9)
4
+ star_ethernet (0.1.10)
5
5
  net-telnet
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -4,7 +4,7 @@ star_ethernet [![Build Status](https://travis-ci.org/shinsukeimai/star_ethernet.
4
4
  Star Micronics thermal printer controller via ethernet card(IFBD-HE07/08-BE07)
5
5
 
6
6
  ## Description
7
- This library makes it possible to print via IDBD-HE07/08-BE07 ethernet I/F Card by ruby command.
7
+ This library makes it possible to print via IFBD-HE07/08-BE07 ethernet I/F Card by ruby command.
8
8
  According to [user manual's Raw Socket Print](https://www.starmicronics.com/Support/Mannualfolder/UsersManual_IFBD_HE0708BE07_EN.pdf) document, this library is developed.
9
9
  Currently this supports only Raw Socket Print(TCP Port 9100), Gets Printer Status(TCP Port 9101) and Reset with authentication, gets settings information(TCP Port 22222).
10
10
 
@@ -453,7 +453,7 @@ module StarEthernet
453
453
  end
454
454
 
455
455
  def self.set_2_byte_kanji_character_left_right_spaces(n1, n2)
456
- [0x1b, 0x73, 0x73, n1, n2].pack('C*')
456
+ [0x1b, 0x73, n1, n2].pack('C*')
457
457
  end
458
458
 
459
459
  def self.set_1_byte_kanji_character_left_right_spaces(n1, n2)
@@ -5,6 +5,8 @@ module StarEthernet
5
5
  end
6
6
  end
7
7
 
8
+ class StatusFetchFailed < PrinterError; end
9
+
8
10
  class EtbCountUpFailed < PrinterError; end
9
11
 
10
12
  class PrintFailed < EtbCountUpFailed; end
@@ -76,12 +76,16 @@ module StarEthernet
76
76
  end
77
77
 
78
78
  def fetch_status(purpose = '')
79
- socket = socket(StarEthernet.configuration.status_acquisition_port)
80
- socket.print(StarEthernet::Command.status_acquisition)
81
- asb_status = socket.read(StarEthernet.configuration.asb_status_size)
82
- @status.set_status(asb_status, purpose)
83
- socket.close
84
- @status.current_status
79
+ begin
80
+ socket = socket(StarEthernet.configuration.status_acquisition_port)
81
+ socket.print(StarEthernet::Command.status_acquisition)
82
+ asb_status = socket.read(StarEthernet.configuration.asb_status_size)
83
+ @status.set_status(asb_status, purpose)
84
+ socket.close
85
+ @status.current_status
86
+ rescue => e
87
+ raise StarEthernet::StatusFetchFailed.new(e.full_message)
88
+ end
85
89
  end
86
90
 
87
91
  def reboot
@@ -1,3 +1,3 @@
1
1
  module StarEthernet
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: star_ethernet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinsuke IMAI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-14 00:00:00.000000000 Z
11
+ date: 2019-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-telnet