webtranslateit-payday 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.rubocop.yml +17 -3
- data/.rubocop_todo.yml +0 -7
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/Guardfile +2 -0
- data/Rakefile +2 -0
- data/lib/payday/config.rb +2 -0
- data/lib/payday/i18n.rb +2 -0
- data/lib/payday/invoice.rb +2 -0
- data/lib/payday/invoiceable.rb +2 -0
- data/lib/payday/line_item.rb +2 -0
- data/lib/payday/line_itemable.rb +2 -0
- data/lib/payday/pdf_renderer.rb +4 -2
- data/lib/payday/version.rb +3 -1
- data/lib/payday.rb +2 -0
- data/payday.gemspec +3 -1
- data/spec/invoice_spec.rb +4 -2
- data/spec/line_item_spec.rb +2 -0
- data/spec/pdf_renderer_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/asset_matchers.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eef54cccb42602b271a63975e2bd13edae13befdf6929503a4989abe4f74bd2a
|
4
|
+
data.tar.gz: 2be86b92427a04b532e5b60a2fe2d1f60c907c498f2f217afbf5146ce217a3b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d3e648695eb670d0af8c63c1627eb3e0b30c3efbae7ab908b57288d7b6f269fc267f253acc86bdd2fd7bad51825fa43dadc787e3c13ea4bb09a00780ed155c2
|
7
|
+
data.tar.gz: b2f65b6742a6d4ce0d44d285aab50a92fbcec61eb7987cc6ec08923d4bb5abb0af81ec9ed21c3c531f0a6ad573a5d5d639cef0b3814c2a904f89a972f2a329e9
|
data/.github/workflows/ci.yml
CHANGED
@@ -18,7 +18,7 @@ jobs:
|
|
18
18
|
runs-on: ubuntu-latest
|
19
19
|
strategy:
|
20
20
|
matrix:
|
21
|
-
ruby-version: ['3.
|
21
|
+
ruby-version: ['3.1']
|
22
22
|
|
23
23
|
steps:
|
24
24
|
- uses: actions/checkout@v2
|
@@ -44,7 +44,7 @@ jobs:
|
|
44
44
|
- name: Install ruby and gems
|
45
45
|
uses: ruby/setup-ruby@v1
|
46
46
|
with:
|
47
|
-
ruby-version: 3.
|
47
|
+
ruby-version: 3.1.2 # Use .ruby-version file instead of duplicating here and in Gemfile?
|
48
48
|
bundler-cache: true
|
49
49
|
|
50
50
|
- name: Run ruby linter
|
data/.rubocop.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion: 3.
|
4
|
+
TargetRubyVersion: 3.1
|
5
5
|
Exclude:
|
6
6
|
- lib/generators/**/*
|
7
7
|
|
@@ -11,8 +11,6 @@ inherit_mode:
|
|
11
11
|
|
12
12
|
require: rubocop-rspec
|
13
13
|
|
14
|
-
Gemspec/DateAssignment: # new in 1.10
|
15
|
-
Enabled: true
|
16
14
|
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
17
15
|
Enabled: true
|
18
16
|
Gemspec/RequireMFA: # new in 1.23
|
@@ -149,3 +147,19 @@ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
|
|
149
147
|
Enabled: true
|
150
148
|
RSpec/Rails/AvoidSetupHook: # new in 2.4
|
151
149
|
Enabled: true
|
150
|
+
Layout/LineContinuationLeadingSpace: # new in 1.31
|
151
|
+
Enabled: true
|
152
|
+
Layout/LineContinuationSpacing: # new in 1.31
|
153
|
+
Enabled: true
|
154
|
+
Lint/ConstantOverwrittenInRescue: # new in 1.31
|
155
|
+
Enabled: true
|
156
|
+
Lint/NonAtomicFileOperation: # new in 1.31
|
157
|
+
Enabled: true
|
158
|
+
Lint/RequireRangeParentheses: # new in 1.32
|
159
|
+
Enabled: true
|
160
|
+
Style/EmptyHeredoc: # new in 1.32
|
161
|
+
Enabled: true
|
162
|
+
RSpec/Capybara/SpecificMatcher: # new in 2.12
|
163
|
+
Enabled: true
|
164
|
+
RSpec/Rails/HaveHttpStatus: # new in 2.12
|
165
|
+
Enabled: true
|
data/.rubocop_todo.yml
CHANGED
@@ -13,10 +13,3 @@ Style/Documentation:
|
|
13
13
|
- 'spec/**/*'
|
14
14
|
- 'test/**/*'
|
15
15
|
- 'lib/generators/payday/setup/setup_generator.rb'
|
16
|
-
|
17
|
-
# Offense count: 19
|
18
|
-
# Cop supports --auto-correct.
|
19
|
-
# Configuration parameters: EnforcedStyle.
|
20
|
-
# SupportedStyles: always, always_true, never
|
21
|
-
Style/FrozenStringLiteralComment:
|
22
|
-
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
data/Rakefile
CHANGED
data/lib/payday/config.rb
CHANGED
data/lib/payday/i18n.rb
CHANGED
data/lib/payday/invoice.rb
CHANGED
data/lib/payday/invoiceable.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Include {Payday::Invoiceable} in your Invoice class to make it Payday compatible. Payday
|
2
4
|
# expects that a +line_items+ method containing an Enumerable of {Payday::LineItem} compatible
|
3
5
|
# elements exists. Those LineItem objects primarily need to include quantity, price, and description methods.
|
data/lib/payday/line_item.rb
CHANGED
data/lib/payday/line_itemable.rb
CHANGED
data/lib/payday/pdf_renderer.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Payday
|
2
4
|
# The PDF renderer. We use this internally in Payday to render pdfs, but really you should just need to call
|
3
5
|
# {{Payday::Invoiceable#render_pdf}} to render pdfs yourself.
|
@@ -75,10 +77,10 @@ module Payday
|
|
75
77
|
end
|
76
78
|
|
77
79
|
if File.extname(image) == '.svg'
|
78
|
-
logo_info = pdf.svg(File.read(image), at: pdf.bounds.top_left, width
|
80
|
+
logo_info = pdf.svg(File.read(image), at: pdf.bounds.top_left, width:, height:)
|
79
81
|
logo_height = logo_info[:height]
|
80
82
|
else
|
81
|
-
logo_info = pdf.image(image, at: pdf.bounds.top_left, width
|
83
|
+
logo_info = pdf.image(image, at: pdf.bounds.top_left, width:, height:)
|
82
84
|
logo_height = logo_info.scaled_height
|
83
85
|
end
|
84
86
|
|
data/lib/payday/version.rb
CHANGED
data/lib/payday.rb
CHANGED
data/payday.gemspec
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
2
4
|
require 'payday/version'
|
3
5
|
|
4
6
|
Gem::Specification.new do |s|
|
5
7
|
s.name = 'webtranslateit-payday'
|
6
8
|
s.version = Payday::VERSION
|
7
|
-
s.required_ruby_version = '>= 3.
|
9
|
+
s.required_ruby_version = '>= 3.1'
|
8
10
|
s.platform = Gem::Platform::RUBY
|
9
11
|
s.authors = ['Alan Johnson', 'Edouard Briere']
|
10
12
|
s.email = ['edouard@webtranslateit.com']
|
data/spec/invoice_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
module Payday # rubocop:todo Metrics/ModuleLength
|
@@ -138,7 +140,7 @@ module Payday # rubocop:todo Metrics/ModuleLength
|
|
138
140
|
|
139
141
|
describe 'rendering' do
|
140
142
|
before do
|
141
|
-
|
143
|
+
FileUtils.mkdir_p('tmp')
|
142
144
|
Config.default.reset
|
143
145
|
end
|
144
146
|
|
@@ -146,7 +148,7 @@ module Payday # rubocop:todo Metrics/ModuleLength
|
|
146
148
|
let(:invoice_params) { {} }
|
147
149
|
|
148
150
|
it 'renders to a file' do
|
149
|
-
|
151
|
+
FileUtils.rm_rf('tmp/testing.pdf')
|
150
152
|
|
151
153
|
invoice.render_pdf_to_file('tmp/testing.pdf')
|
152
154
|
|
data/spec/line_item_spec.rb
CHANGED
data/spec/pdf_renderer_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
|
3
5
|
# Usage: expect(renderer.render).to match_binary_asset('pdf/test.pdf')
|
@@ -20,7 +22,7 @@ RSpec::Matchers.define(:match_binary_asset) do |file_name|
|
|
20
22
|
expected_output_path = File.join('spec/assets', file_name)
|
21
23
|
actual_output_path = File.join('tmp/rendered_output', file_name)
|
22
24
|
|
23
|
-
"expected output to match '#{expected_output_path}' "\
|
25
|
+
"expected output to match '#{expected_output_path}' " \
|
24
26
|
"(see #{actual_output_path})"
|
25
27
|
end
|
26
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webtranslateit-payday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Johnson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -270,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
270
|
requirements:
|
271
271
|
- - ">="
|
272
272
|
- !ruby/object:Gem::Version
|
273
|
-
version: '3.
|
273
|
+
version: '3.1'
|
274
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
276
|
- - ">="
|
277
277
|
- !ruby/object:Gem::Version
|
278
278
|
version: '0'
|
279
279
|
requirements: []
|
280
|
-
rubygems_version: 3.3.
|
280
|
+
rubygems_version: 3.3.7
|
281
281
|
signing_key:
|
282
282
|
specification_version: 4
|
283
283
|
summary: A simple library for rendering invoices.
|