udrs 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/udrs/engine.rb +2 -1
- data/lib/udrs/renderers/escp_renderer.rb +5 -0
- data/lib/udrs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4794ca81b2f3ee52215f6f3f87b2cb74cc0f21e
|
4
|
+
data.tar.gz: 03107ce7b20b089c42b1a6f4e1f09ce44ba4814f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2500cb3ff03644a35b1427f548530456b2fe9aa2a4cd79382f0738d35da0745dea0b4bf84ea63f58542bed56048638453c56475fb99b874c3c9de313e19ca0c
|
7
|
+
data.tar.gz: 439e27fa7ea467a13c5dd6fca3915459e4f17257893fe7e01783596639cb9d484f18950e1f81b502cfed3c900cf4cc5a08be28a043d38ba0c50deb8a3a1b7f43
|
data/lib/udrs/engine.rb
CHANGED
@@ -11,7 +11,8 @@ module UDRS
|
|
11
11
|
Mime::Type.register_alias('application/octet-stream', :escp) if !Mime::Type.lookup_by_extension(:escp)
|
12
12
|
|
13
13
|
ActionController::MimeResponds::Collector.send(:define_method, 'udrs') do |&block|
|
14
|
-
|
14
|
+
pdf(&block)
|
15
|
+
escp(&block)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -49,6 +49,7 @@ module UDRS
|
|
49
49
|
@buffer << "#{ESC}p#{0.chr}#{100.chr}#{100.chr}"
|
50
50
|
|
51
51
|
# Render the items
|
52
|
+
@last_item = :page_end
|
52
53
|
render_item(container)
|
53
54
|
render_page_end(nil)
|
54
55
|
|
@@ -68,8 +69,12 @@ module UDRS
|
|
68
69
|
##############################
|
69
70
|
|
70
71
|
def render_page_end(page_end)
|
72
|
+
return if @last_item == :page_end
|
73
|
+
|
71
74
|
# Cut the paper at page end
|
72
75
|
@buffer << "\n\n\n\n\n\x1DV1\n"
|
76
|
+
|
77
|
+
@last_item = :page_end
|
73
78
|
end
|
74
79
|
|
75
80
|
def render_spacer(spacer)
|
data/lib/udrs/version.rb
CHANGED