receipts 3.0.0 → 3.0.1
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 +9 -1
- data/lib/receipts/pdf/inline_format.rb +1 -1
- data/lib/receipts/version.rb +1 -1
- data/receipts.gemspec +31 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b54a405f797e01a8f310f3ea6e69483bce31f98206f081a0b208d23a7e2e51be
|
|
4
|
+
data.tar.gz: fee97dc98d48d413634b9dedeb47ad2fb1dfa738f17762914a711701000cde2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d7a5cb4a395a4259fe4e45d42e1230e91f954e995af1963bd2c6634a244d5fa560a5afbfefa3f7af5cf83a16247693999e0454b2f06e2d2a0b0f1eb73906fcd
|
|
7
|
+
data.tar.gz: 7342bca2f4b131981fa8028b004ab4f4b7a65ba36ceddbbe5822b76273e85ddf16df5b28ef0c1fab85cf321f2c06c050566d97c4542243319d7b6d7bd25d7445
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Receipts, Invoices, and Statements for your Rails application that works with any payment provider. PDFs are generated in pure Ruby with no dependencies.
|
|
6
6
|
|
|
7
|
-
Check out the [example PDFs](
|
|
7
|
+
Check out the [example PDFs](examples/).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -280,6 +280,14 @@ resources :charges
|
|
|
280
280
|
<%= link_to "View Receipt", charge_path(@charge, format: :pdf) %>
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
## Attaching PDFs in Rails mailers
|
|
284
|
+
|
|
285
|
+
Pass `render` to `attachments` in your mailer:
|
|
286
|
+
|
|
287
|
+
```ruby
|
|
288
|
+
attachments["receipt.pdf"] = @charge.receipt.render
|
|
289
|
+
```
|
|
290
|
+
|
|
283
291
|
## Invoices
|
|
284
292
|
|
|
285
293
|
Invoices follow the exact same set of steps as above. You'll simply want to modify the `details` to include other information for the Invoice such as the Issue Date, Due Date, etc.
|
|
@@ -9,7 +9,7 @@ module Receipts
|
|
|
9
9
|
# Each fragment is a Hash with :text and any of :styles, :color, :link,
|
|
10
10
|
# :font, :size and :character_spacing.
|
|
11
11
|
module InlineFormat
|
|
12
|
-
TAG = %r{<(/?)(b|strong|i|em|u|strikethrough|sub|sup|font|color|link|a|br)(\s[^>]
|
|
12
|
+
TAG = %r{<(/?)(b|strong|i|em|u|strikethrough|sub|sup|font|color|link|a|br)(\s[^>]*)?/?>}i
|
|
13
13
|
ATTRIBUTE = /(\w+)\s*=\s*(?:"([^"]*)"|'([^']*)')/
|
|
14
14
|
ENTITIES = {"<" => "<", ">" => ">", "&" => "&"}.freeze
|
|
15
15
|
STYLES = {
|
data/lib/receipts/version.rb
CHANGED
data/receipts.gemspec
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/receipts/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "receipts"
|
|
7
|
+
spec.version = Receipts::VERSION
|
|
8
|
+
spec.authors = ["Chris Oliver"]
|
|
9
|
+
spec.email = ["excid3@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Receipts for your Rails application that works with any payment provider."
|
|
12
|
+
spec.description = "Receipts for your Rails application that works with any payment provider."
|
|
13
|
+
spec.homepage = "https://github.com/excid3/receipts"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
spec.required_ruby_version = ">= 2.7"
|
|
16
|
+
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/excid3/receipts/blob/main/CHANGELOG.md"
|
|
20
|
+
|
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
spec.bindir = "exe"
|
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
30
|
+
spec.require_paths = ["lib"]
|
|
31
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: receipts
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Oliver
|
|
@@ -45,13 +45,14 @@ files:
|
|
|
45
45
|
- lib/receipts/receipt.rb
|
|
46
46
|
- lib/receipts/statement.rb
|
|
47
47
|
- lib/receipts/version.rb
|
|
48
|
+
- receipts.gemspec
|
|
48
49
|
homepage: https://github.com/excid3/receipts
|
|
49
50
|
licenses:
|
|
50
51
|
- MIT
|
|
51
52
|
metadata:
|
|
52
53
|
homepage_uri: https://github.com/excid3/receipts
|
|
53
54
|
source_code_uri: https://github.com/excid3/receipts
|
|
54
|
-
changelog_uri: https://github.com/excid3/receipts/blob/
|
|
55
|
+
changelog_uri: https://github.com/excid3/receipts/blob/main/CHANGELOG.md
|
|
55
56
|
rdoc_options: []
|
|
56
57
|
require_paths:
|
|
57
58
|
- lib
|
|
@@ -66,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
67
|
- !ruby/object:Gem::Version
|
|
67
68
|
version: '0'
|
|
68
69
|
requirements: []
|
|
69
|
-
rubygems_version: 4.0.
|
|
70
|
+
rubygems_version: 4.0.20
|
|
70
71
|
specification_version: 4
|
|
71
72
|
summary: Receipts for your Rails application that works with any payment provider.
|
|
72
73
|
test_files: []
|