webtranslateit-payday 1.3.0 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b871576cd6bbd5c6047d8b19d06f6e866619ffad6f9a87d8b87d4e5c232d62fb
4
- data.tar.gz: 4f46751e69cbf6c16acb4d47b35da624a813bbe51e25973c8b261fb0ac5c09d8
3
+ metadata.gz: eef54cccb42602b271a63975e2bd13edae13befdf6929503a4989abe4f74bd2a
4
+ data.tar.gz: 2be86b92427a04b532e5b60a2fe2d1f60c907c498f2f217afbf5146ce217a3b3
5
5
  SHA512:
6
- metadata.gz: 8269db93891aec3995c0036a525818a65838c8a7ff3247b6f45e95e5669b4f197e763e21cb2f3bf1e3393511be3eee1175679150393f0495b72e2977440f863f
7
- data.tar.gz: adc4cb0553f11f927d8df25e39e3827935d0bb4ed5f1828e99180784f9f99101ce893ac361005b6a7313e862288703240a3b06283071b15a97ef108b7525fb39
6
+ metadata.gz: 0d3e648695eb670d0af8c63c1627eb3e0b30c3efbae7ab908b57288d7b6f269fc267f253acc86bdd2fd7bad51825fa43dadc787e3c13ea4bb09a00780ed155c2
7
+ data.tar.gz: b2f65b6742a6d4ce0d44d285aab50a92fbcec61eb7987cc6ec08923d4bb5abb0af81ec9ed21c3c531f0a6ad573a5d5d639cef0b3814c2a904f89a972f2a329e9
@@ -18,7 +18,7 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  strategy:
20
20
  matrix:
21
- ruby-version: ['3.0', '3.1']
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.0.4 # Use .ruby-version file instead of duplicating here and in Gemfile?
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.0
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
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.0 (2022-06-29)
4
+
5
+ * Target ruby 3.1.
6
+
3
7
  ## 1.3.0 (2022-06-14)
4
8
 
5
9
  * Target ruby 3.0.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  gemspec
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  guard :rspec, cmd: 'bundle exec rspec --color --format progress' do
2
4
  watch(%r{^spec/.+_spec\.rb$})
3
5
  watch('spec/spec_helper.rb') { 'spec' }
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
 
3
5
  require 'rake'
data/lib/payday/config.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Payday
2
4
  # Configuration for Payday. This is a singleton, so to set the company_name you would call
3
5
  # Payday::Config.default.company_name = "Awesome Corp".
data/lib/payday/i18n.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Load everything in the local folder
2
4
  I18n.enforce_available_locales = false
3
5
  I18n.load_path.concat(Dir[File.join(File.dirname(__FILE__), 'locale', '*.yml')])
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Payday
2
4
  # Basically just an invoice. Stick a ton of line items in it, add some details, and then render it out!
3
5
  class Invoice
@@ -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.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Payday
2
4
  # Represents a line item in an invoice.
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Include this module into your line item implementation to make sure that Payday stays happy
2
4
  # with it, or just make sure that your line item implements the amount method.
3
5
  module Payday
@@ -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: width, height: height)
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: width, height: height)
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
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This is Payday!
2
4
  module Payday
3
5
  # Current Version
4
- VERSION = '1.3.0'.freeze
6
+ VERSION = '1.5.0'
5
7
  end
data/lib/payday.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Not much to see here
2
4
  require 'date'
3
5
  require 'time'
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.0'
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
- Dir.mkdir('tmp') unless File.exist?('tmp')
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
- File.unlink('tmp/testing.pdf') if File.exist?('tmp/testing.pdf')
151
+ FileUtils.rm_rf('tmp/testing.pdf')
150
152
 
151
153
  invoice.render_pdf_to_file('tmp/testing.pdf')
152
154
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Payday
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  module Payday
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../lib/payday'
2
4
 
3
5
  # Requires supporting ruby files with custom matchers and macros, etc, in
@@ -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.3.0
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-06-14 00:00:00.000000000 Z
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.0'
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.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.