extface 0.5.5 → 0.5.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: d6649c38c68097bd3139b52d76cd71fb9e6c5aa8
4
- data.tar.gz: d990d58d8584459b9b8f6c412f8419c69f579c44
3
+ metadata.gz: 620cf1cae6f685a39efb3726ba1474369c1aa605
4
+ data.tar.gz: aedfc5fa2883237c560248fb3a36131e7673e5c5
5
5
  SHA512:
6
- metadata.gz: 9f5f8c0ee1ef326ca941f7c6f9e69a97ed514262ad706ebf6921c2d8dead109aea6799472ff45a16ed07a672c4c5221965944051eefecab1157508b45614116c
7
- data.tar.gz: b62354f3c6bbfe8a0e2602134dc75438cc381febf81706f17de82f13d4a70720587b27ecae55d4f5896c058e2fb662a920efc6a6d6905268edf296e9bdf9e1a1
6
+ metadata.gz: 7c40d300bc4137822f75ab451e727a98f8b191f872c6ba0b2c3f93198b9d4e1860ca54e39b90749651cf32f15a186dc141a5743cfee51d22314936dba3b45a1c
7
+ data.tar.gz: 24177763e1a4e467be1bb10577103036625d29b2034dad8bc36a164491c277a7c1ef900768784647116f6822e6fd3ee7de65287844bc0d2fe549e3bb03ea82a7
@@ -100,7 +100,7 @@ module Extface
100
100
 
101
101
  # Only allow a trusted parameter "white list" through.
102
102
  def device_params
103
- params.require(:device).permit(:uuid, :name, :driver_class, :driver_id)
103
+ params.require(:device).permit(:uuid, :name, :driver_class, :driver_id, :encoding)
104
104
  end
105
105
  end
106
106
  end
@@ -13,7 +13,14 @@ module Extface
13
13
  FISCAL = false #cash registers, fiscal printers
14
14
  REPORT = false #only transmit data that must be parsed by handler, CDR, report devices
15
15
 
16
- alias_method :print, :push
16
+ #alias_method :print, :push
17
+ def print(text)
18
+ if device.encoding.present?
19
+ push text.encode(device.encoding)
20
+ else
21
+ push text
22
+ end
23
+ end
17
24
 
18
25
  def print_test_page(times = 1)
19
26
  device.session("Print Test Page") do |s|
@@ -17,6 +17,12 @@
17
17
  <%= render 'object_errors', object: f.object %>
18
18
 
19
19
  <%= form_group f, :name, :text_field %>
20
+ <div class='form-group'>
21
+ <%= f.label(:encoding, class: 'col-sm-2 control-label') %>
22
+ <div class='col-sm-6 col-md-4'>
23
+ <%= f.select :encoding, Encoding.aliases.collect{ |k,v| ["#{v} (#{k})", k]}.sort, { include_blank: true }, class: "form-control" %>
24
+ </div>
25
+ </div>
20
26
 
21
27
  <div class="form-group">
22
28
  <%= f.label :driver, class: 'col-sm-2 control-label' %>
@@ -31,6 +31,9 @@
31
31
 
32
32
  <dt><%= t('.driver') %></dt>
33
33
  <dd><%= @device.driver_name %></dd>
34
+
35
+ <dt><%= t('.encoding') %></dt>
36
+ <dd><%= @device.encoding %></dd>
34
37
  </dl>
35
38
  </div>
36
39
  <div class='col-sm-6'>
@@ -0,0 +1,5 @@
1
+ class AddEncodingToExtfaceDevice < ActiveRecord::Migration
2
+ def change
3
+ add_column :extface_devices, :encoding, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Extface
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -149,6 +149,7 @@ files:
149
149
  - db/migrate/20140303122506_change_driver_polymorphic_to_belongs_to_extface_devices.rb
150
150
  - db/migrate/20140303123022_change_polymorphic_to_has_one_to_extface_serial_configs.rb
151
151
  - db/migrate/20160103154233_add_started_at_to_extface_job.rb
152
+ - db/migrate/20160828052036_add_encoding_to_extface_device.rb
152
153
  - lib/extface.rb
153
154
  - lib/extface/engine.rb
154
155
  - lib/extface/extfaceable.rb