receipts 2.1.0 → 2.2.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +11 -1
- data/examples/invoice.pdf +0 -0
- data/examples/receipt.pdf +0 -0
- data/examples/statement.pdf +0 -0
- data/lib/receipts/base.rb +2 -2
- data/lib/receipts/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd904f28ec977eac50dff178d568a07708de3c80deddd2119047ff8728337f7
|
4
|
+
data.tar.gz: 28e46c6f307fef00ccce4c4f1a7358ae1b528fb4f6ee65795aba514218ec3929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99713c6cecafbf19d75c298e94eb66ef11c3e643ec102214eb9d5010ec947b8719ec1df7261afb5a15a796fb7d3994acdab001cede3499bbbd526e5fe29f2d65
|
7
|
+
data.tar.gz: b6f3e79761afdd71d4b5c482763732eac98881ac4394ddc522def91ebaada25685ef968b5614088f1d4361d9921f320764f8614cb66dfa29c8b7c1081aebc2c0
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
### Unreleased
|
2
2
|
|
3
|
+
* Allow specifiying other page sizes - @excid3
|
4
|
+
* Add `logo_height:` option to specify the height of the logo image
|
5
|
+
|
3
6
|
### 2.1.0
|
4
7
|
|
5
8
|
* Add `Receipts.default_font` - @excid3
|
9
|
+
>>>>>>> 65dc0260770f3d751f67dc5433be09127367b83b
|
6
10
|
|
7
11
|
### 2.0.0
|
8
12
|
|
data/README.md
CHANGED
@@ -76,7 +76,6 @@ Receipts.default_font = {
|
|
76
76
|
}
|
77
77
|
```
|
78
78
|
|
79
|
-
|
80
79
|
### Options
|
81
80
|
|
82
81
|
You can pass the following options to generate a PDF:
|
@@ -118,6 +117,8 @@ You can pass the following options to generate a PDF:
|
|
118
117
|
}
|
119
118
|
```
|
120
119
|
|
120
|
+
* `logo_height` - An integer value of how tall the logo should be. Defaults to `16`
|
121
|
+
|
121
122
|
Here's an example of where each option is displayed.
|
122
123
|
|
123
124
|

|
@@ -128,6 +129,15 @@ Here's an example of where each option is displayed.
|
|
128
129
|
|
129
130
|
See [the Prawn docs](https://prawnpdf.org/api-docs/2.3.0/Prawn/Text.html#text-instance_method) for more information.
|
130
131
|
|
132
|
+
|
133
|
+
##### Page Size
|
134
|
+
|
135
|
+
You can specify a different page size by passing in the `page_size` keyword argument:
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
receipt = Receipts::Receipt.new page_size: "A4"
|
139
|
+
```
|
140
|
+
|
131
141
|
### Internationalization (I18n)
|
132
142
|
|
133
143
|
You can use `I18n.t` when rendering your receipts to internationalize them.
|
data/examples/invoice.pdf
CHANGED
Binary file
|
data/examples/receipt.pdf
CHANGED
Binary file
|
data/examples/statement.pdf
CHANGED
Binary file
|
data/lib/receipts/base.rb
CHANGED
@@ -7,7 +7,7 @@ module Receipts
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def initialize(attributes = {})
|
10
|
-
super
|
10
|
+
super page_size: attributes.delete(:page_size) || "LETTER"
|
11
11
|
setup_fonts attributes.fetch(:font, Receipts.default_font)
|
12
12
|
|
13
13
|
@title = attributes.fetch(:title, self.class.title)
|
@@ -19,7 +19,7 @@ module Receipts
|
|
19
19
|
return if attributes.empty?
|
20
20
|
|
21
21
|
company = attributes.fetch(:company)
|
22
|
-
header company: company
|
22
|
+
header company: company, height: attributes.fetch(:logo_height, 16)
|
23
23
|
render_details attributes.fetch(:details)
|
24
24
|
render_billing_details company: company, recipient: attributes.fetch(:recipient)
|
25
25
|
render_line_items attributes.fetch(:line_items)
|
data/lib/receipts/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: receipts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.4.4
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Receipts for your Rails application that works with any payment provider.
|