webtranslateit-payday 1.2.8 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48219daa28bf526859301ccbf350ef69adbccd37a40ef09dc8d2a4ae12e3c1b5
4
- data.tar.gz: 7073dc6c8a5eda28373d62130df1b82f86bde07b071d48f12c2234dc3d9d0f52
3
+ metadata.gz: b871576cd6bbd5c6047d8b19d06f6e866619ffad6f9a87d8b87d4e5c232d62fb
4
+ data.tar.gz: 4f46751e69cbf6c16acb4d47b35da624a813bbe51e25973c8b261fb0ac5c09d8
5
5
  SHA512:
6
- metadata.gz: 368bb0df2e6c4a15b3e1c96d14f76ee30dd5d837a9aad8c25be444a2c90c9eea5fa7a9dc680037b4669329d1cf844eb9cb083155f7705b529f47c45d788ff4e1
7
- data.tar.gz: 16633a6e818cc4a08750996259a42d442a8b7dbd87aa0c2763b6a2f9582adb02e56f8cc503425cc812f7f8855017c7b25fe9338368e8fc9257736045f99fad1e
6
+ metadata.gz: 8269db93891aec3995c0036a525818a65838c8a7ff3247b6f45e95e5669b4f197e763e21cb2f3bf1e3393511be3eee1175679150393f0495b72e2977440f863f
7
+ data.tar.gz: adc4cb0553f11f927d8df25e39e3827935d0bb4ed5f1828e99180784f9f99101ce893ac361005b6a7313e862288703240a3b06283071b15a97ef108b7525fb39
@@ -9,25 +9,23 @@ name: Ruby
9
9
 
10
10
  on:
11
11
  push:
12
- branches: [ main ]
12
+ branches:
13
13
  pull_request:
14
- branches: [ main ]
14
+ branches:
15
15
 
16
16
  jobs:
17
17
  test:
18
-
19
18
  runs-on: ubuntu-latest
20
19
  strategy:
21
20
  matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
21
+ ruby-version: ['3.0', '3.1']
23
22
 
24
23
  steps:
25
24
  - uses: actions/checkout@v2
26
25
  - name: Set up Ruby
27
26
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
27
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
- # uses: ruby/setup-ruby@v1
30
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
28
+ uses: ruby/setup-ruby@v1
31
29
  with:
32
30
  ruby-version: ${{ matrix.ruby-version }}
33
31
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
@@ -46,7 +44,7 @@ jobs:
46
44
  - name: Install ruby and gems
47
45
  uses: ruby/setup-ruby@v1
48
46
  with:
49
- ruby-version: 2.6.9 # Use .ruby-version file instead of duplicating here and in Gemfile?
47
+ ruby-version: 3.0.4 # Use .ruby-version file instead of duplicating here and in Gemfile?
50
48
  bundler-cache: true
51
49
 
52
50
  - name: Run ruby linter
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
+ TargetRubyVersion: 3.0
4
5
  Exclude:
5
6
  - lib/generators/**/*
6
7
 
@@ -9,3 +10,142 @@ inherit_mode:
9
10
  - Exclude
10
11
 
11
12
  require: rubocop-rspec
13
+
14
+ Gemspec/DateAssignment: # new in 1.10
15
+ Enabled: true
16
+ Gemspec/DeprecatedAttributeAssignment: # new in 1.30
17
+ Enabled: true
18
+ Gemspec/RequireMFA: # new in 1.23
19
+ Enabled: true
20
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
21
+ Enabled: true
22
+ Layout/SpaceBeforeBrackets: # new in 1.7
23
+ Enabled: true
24
+ Lint/AmbiguousAssignment: # new in 1.7
25
+ Enabled: true
26
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
27
+ Enabled: true
28
+ Lint/AmbiguousRange: # new in 1.19
29
+ Enabled: true
30
+ Lint/DeprecatedConstants: # new in 1.8
31
+ Enabled: true
32
+ Lint/DuplicateBranch: # new in 1.3
33
+ Enabled: true
34
+ Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
35
+ Enabled: true
36
+ Lint/EmptyBlock: # new in 1.1
37
+ Enabled: true
38
+ Lint/EmptyClass: # new in 1.3
39
+ Enabled: true
40
+ Lint/EmptyInPattern: # new in 1.16
41
+ Enabled: true
42
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
43
+ Enabled: true
44
+ Lint/LambdaWithoutLiteralBlock: # new in 1.8
45
+ Enabled: true
46
+ Lint/NoReturnInBeginEndBlocks: # new in 1.2
47
+ Enabled: true
48
+ Lint/NumberedParameterAssignment: # new in 1.9
49
+ Enabled: true
50
+ Lint/OrAssignmentToConstant: # new in 1.9
51
+ Enabled: true
52
+ Lint/RedundantDirGlobSort: # new in 1.8
53
+ Enabled: true
54
+ Lint/RefinementImportMethods: # new in 1.27
55
+ Enabled: true
56
+ Lint/RequireRelativeSelfPath: # new in 1.22
57
+ Enabled: true
58
+ Lint/SymbolConversion: # new in 1.9
59
+ Enabled: true
60
+ Lint/ToEnumArguments: # new in 1.1
61
+ Enabled: true
62
+ Lint/TripleQuotes: # new in 1.9
63
+ Enabled: true
64
+ Lint/UnexpectedBlockArity: # new in 1.5
65
+ Enabled: true
66
+ Lint/UnmodifiedReduceAccumulator: # new in 1.1
67
+ Enabled: true
68
+ Lint/UselessRuby2Keywords: # new in 1.23
69
+ Enabled: true
70
+ Naming/BlockForwarding: # new in 1.24
71
+ Enabled: true
72
+ Security/CompoundHash: # new in 1.28
73
+ Enabled: true
74
+ Security/IoMethods: # new in 1.22
75
+ Enabled: true
76
+ Style/ArgumentsForwarding: # new in 1.1
77
+ Enabled: true
78
+ Style/CollectionCompact: # new in 1.2
79
+ Enabled: true
80
+ Style/DocumentDynamicEvalDefinition: # new in 1.1
81
+ Enabled: true
82
+ Style/EndlessMethod: # new in 1.8
83
+ Enabled: true
84
+ Style/EnvHome: # new in 1.29
85
+ Enabled: true
86
+ Style/FetchEnvVar: # new in 1.28
87
+ Enabled: true
88
+ Style/FileRead: # new in 1.24
89
+ Enabled: true
90
+ Style/FileWrite: # new in 1.24
91
+ Enabled: true
92
+ Style/HashConversion: # new in 1.10
93
+ Enabled: true
94
+ Style/HashExcept: # new in 1.7
95
+ Enabled: true
96
+ Style/IfWithBooleanLiteralBranches: # new in 1.9
97
+ Enabled: true
98
+ Style/InPatternThen: # new in 1.16
99
+ Enabled: true
100
+ Style/MapCompactWithConditionalBlock: # new in 1.30
101
+ Enabled: true
102
+ Style/MapToHash: # new in 1.24
103
+ Enabled: true
104
+ Style/MultilineInPatternThen: # new in 1.16
105
+ Enabled: true
106
+ Style/NegatedIfElseCondition: # new in 1.2
107
+ Enabled: true
108
+ Style/NestedFileDirname: # new in 1.26
109
+ Enabled: true
110
+ Style/NilLambda: # new in 1.3
111
+ Enabled: true
112
+ Style/NumberedParameters: # new in 1.22
113
+ Enabled: true
114
+ Style/NumberedParametersLimit: # new in 1.22
115
+ Enabled: true
116
+ Style/ObjectThen: # new in 1.28
117
+ Enabled: true
118
+ Style/OpenStructUse: # new in 1.23
119
+ Enabled: true
120
+ Style/QuotedSymbols: # new in 1.16
121
+ Enabled: true
122
+ Style/RedundantArgument: # new in 1.4
123
+ Enabled: true
124
+ Style/RedundantInitialize: # new in 1.27
125
+ Enabled: true
126
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
127
+ Enabled: true
128
+ Style/SelectByRegexp: # new in 1.22
129
+ Enabled: true
130
+ Style/StringChars: # new in 1.12
131
+ Enabled: true
132
+ Style/SwapValues: # new in 1.1
133
+ Enabled: true
134
+ RSpec/BeEq: # new in 2.9.0
135
+ Enabled: true
136
+ RSpec/BeNil: # new in 2.9.0
137
+ Enabled: true
138
+ RSpec/ChangeByZero: # new in 2.11.0
139
+ Enabled: true
140
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
141
+ Enabled: true
142
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
143
+ Enabled: true
144
+ RSpec/SubjectDeclaration: # new in 2.5
145
+ Enabled: true
146
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
147
+ Enabled: true
148
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
149
+ Enabled: true
150
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
151
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.3.0 (2022-06-14)
4
+
5
+ * Target ruby 3.0.
6
+ * Verified compatibility with ruby 3.1.
7
+ * Update dependencies.
8
+
3
9
  ## 1.2.8 (2022-04-01)
4
10
 
5
- * Releax dependency to ruby 2.2.
11
+ * Relax dependency to ruby 2.2.
6
12
 
7
13
  ## 1.2.7 (2022-02-04)
8
14
 
@@ -1,5 +1,5 @@
1
1
  # This is Payday!
2
2
  module Payday
3
3
  # Current Version
4
- VERSION = '1.2.8'.freeze
4
+ VERSION = '1.3.0'.freeze
5
5
  end
data/payday.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'payday/version'
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'webtranslateit-payday'
6
6
  s.version = Payday::VERSION
7
- s.required_ruby_version = '>= 2.2'
7
+ s.required_ruby_version = '>= 3.0'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ['Alan Johnson', 'Edouard Briere']
10
10
  s.email = ['edouard@webtranslateit.com']
@@ -13,23 +13,24 @@ Gem::Specification.new do |s|
13
13
  s.description = 'Payday is a library for rendering invoices to pdf.'
14
14
 
15
15
  s.add_dependency 'activesupport'
16
- s.add_dependency('i18n', '>= 0.7', '< 2.0')
17
- s.add_dependency('money', '~> 6.5')
18
- s.add_dependency('prawn', '>= 1.0', '< 2.5')
19
- s.add_dependency('prawn-svg', '>= 0.15.0', '< 0.32.1')
20
- s.add_dependency('prawn-table', '>= 0.2.2')
16
+ s.add_dependency 'i18n', '>= 0.7'
17
+ s.add_dependency 'money', '~> 6.16'
18
+ s.add_dependency 'prawn', '>= 2.0'
19
+ s.add_dependency 'prawn-svg', '>= 0.32.0'
20
+ s.add_dependency 'prawn-table', '>= 0.2.2'
21
21
  s.add_dependency 'rexml'
22
22
 
23
- s.add_development_dependency('guard')
24
- s.add_development_dependency('guard-rspec')
23
+ s.add_development_dependency 'guard'
24
+ s.add_development_dependency 'guard-rspec'
25
25
  s.add_development_dependency 'guard-rubocop'
26
- s.add_development_dependency('rspec', '~> 3.10.0')
27
- s.add_development_dependency('rubocop')
28
- s.add_development_dependency('rubocop-rspec')
26
+ s.add_development_dependency 'matrix' # for compat reasons, required in builds
27
+ s.add_development_dependency 'rspec', '~> 3.11.0'
28
+ s.add_development_dependency 'rubocop'
29
+ s.add_development_dependency 'rubocop-rspec'
29
30
 
30
31
  s.files = `git ls-files`.split("\n")
31
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
32
32
  s.executables =
33
33
  `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
34
34
  s.require_paths = ['lib']
35
+ s.metadata['rubygems_mfa_required'] = 'true'
35
36
  end
data/spec/invoice_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Payday # rubocop:todo Metrics/ModuleLength
4
- describe Invoice do # rubocop:todo Metrics/BlockLength
4
+ describe Invoice do
5
5
  # rubocop:todo RSpec/MultipleExpectations
6
6
  it 'is able to be initialized with a hash of options' do # rubocop:todo RSpec/ExampleLength, RSpec/MultipleExpectations
7
7
  # rubocop:enable RSpec/MultipleExpectations
@@ -74,37 +74,37 @@ module Payday # rubocop:todo Metrics/ModuleLength
74
74
 
75
75
  it "is overdue when it's past date and unpaid" do
76
76
  i = described_class.new(due_at: Date.today - 1)
77
- expect(i.overdue?).to eq(true)
77
+ expect(i.overdue?).to be(true)
78
78
  end
79
79
 
80
80
  it "isn't overdue when past due date and paid" do
81
81
  i = described_class.new(due_at: Date.today - 1, paid_at: Date.today)
82
- expect(i.overdue?).not_to eq(true)
82
+ expect(i.overdue?).not_to be(true)
83
83
  end
84
84
 
85
85
  it 'is overdue when due date is a time before the current date' do
86
86
  i = described_class.new(due_at: Time.parse('Jan 1 14:33:20 GMT 2011'))
87
- expect(i.overdue?).to eq(true)
87
+ expect(i.overdue?).to be(true)
88
88
  end
89
89
 
90
90
  it 'is not refunded when not marked refunded' do
91
91
  i = described_class.new
92
- expect(i.refunded?).not_to eq(true)
92
+ expect(i.refunded?).not_to be(true)
93
93
  end
94
94
 
95
95
  it 'is refunded when marked as refunded' do
96
96
  i = described_class.new(refunded_at: Date.today)
97
- expect(i.refunded?).to eq(true)
97
+ expect(i.refunded?).to be(true)
98
98
  end
99
99
 
100
100
  it 'is not paid when not marked paid' do
101
101
  i = described_class.new
102
- expect(i.paid?).not_to eq(true)
102
+ expect(i.paid?).not_to be(true)
103
103
  end
104
104
 
105
105
  it 'is paid when marked as paid' do
106
106
  i = described_class.new(paid_at: Date.today)
107
- expect(i.paid?).to eq(true)
107
+ expect(i.paid?).to be(true)
108
108
  end
109
109
 
110
110
  # rubocop:todo RSpec/MultipleExpectations
@@ -136,7 +136,7 @@ module Payday # rubocop:todo Metrics/ModuleLength
136
136
  expect(details).to include(%w[Awesome Absolutely])
137
137
  end
138
138
 
139
- describe 'rendering' do # rubocop:todo Metrics/BlockLength
139
+ describe 'rendering' do
140
140
  before do
141
141
  Dir.mkdir('tmp') unless File.exist?('tmp')
142
142
  Config.default.reset
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,7 @@ require_relative '../lib/payday'
2
2
 
3
3
  # Requires supporting ruby files with custom matchers and macros, etc, in
4
4
  # spec/support/ and its subdirectories.
5
- Dir['spec/support/**/*.rb'].each { |f| require f[5..-1] }
5
+ Dir['spec/support/**/*.rb'].each { |f| require f[5..] }
6
6
 
7
7
  RSpec.configure do |_config|
8
8
  # some (optional) config here
@@ -11,7 +11,7 @@ RSpec::Matchers.define(:match_binary_asset) do |file_name|
11
11
  output_path = File.join('tmp/rendered_output', file_name)
12
12
 
13
13
  FileUtils.mkdir_p(File.dirname(output_path))
14
- File.open(output_path, 'wb') { |f| f.write actual_output }
14
+ File.binwrite(output_path, actual_output)
15
15
  end
16
16
  end
17
17
  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.2.8
4
+ version: 1.3.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-04-01 00:00:00.000000000 Z
12
+ date: 2022-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -32,9 +32,6 @@ dependencies:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0.7'
35
- - - "<"
36
- - !ruby/object:Gem::Version
37
- version: '2.0'
38
35
  type: :runtime
39
36
  prerelease: false
40
37
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,63 +39,48 @@ dependencies:
42
39
  - - ">="
43
40
  - !ruby/object:Gem::Version
44
41
  version: '0.7'
45
- - - "<"
46
- - !ruby/object:Gem::Version
47
- version: '2.0'
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: money
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
46
  - - "~>"
53
47
  - !ruby/object:Gem::Version
54
- version: '6.5'
48
+ version: '6.16'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
53
  - - "~>"
60
54
  - !ruby/object:Gem::Version
61
- version: '6.5'
55
+ version: '6.16'
62
56
  - !ruby/object:Gem::Dependency
63
57
  name: prawn
64
58
  requirement: !ruby/object:Gem::Requirement
65
59
  requirements:
66
60
  - - ">="
67
61
  - !ruby/object:Gem::Version
68
- version: '1.0'
69
- - - "<"
70
- - !ruby/object:Gem::Version
71
- version: '2.5'
62
+ version: '2.0'
72
63
  type: :runtime
73
64
  prerelease: false
74
65
  version_requirements: !ruby/object:Gem::Requirement
75
66
  requirements:
76
67
  - - ">="
77
68
  - !ruby/object:Gem::Version
78
- version: '1.0'
79
- - - "<"
80
- - !ruby/object:Gem::Version
81
- version: '2.5'
69
+ version: '2.0'
82
70
  - !ruby/object:Gem::Dependency
83
71
  name: prawn-svg
84
72
  requirement: !ruby/object:Gem::Requirement
85
73
  requirements:
86
74
  - - ">="
87
75
  - !ruby/object:Gem::Version
88
- version: 0.15.0
89
- - - "<"
90
- - !ruby/object:Gem::Version
91
- version: 0.32.1
76
+ version: 0.32.0
92
77
  type: :runtime
93
78
  prerelease: false
94
79
  version_requirements: !ruby/object:Gem::Requirement
95
80
  requirements:
96
81
  - - ">="
97
82
  - !ruby/object:Gem::Version
98
- version: 0.15.0
99
- - - "<"
100
- - !ruby/object:Gem::Version
101
- version: 0.32.1
83
+ version: 0.32.0
102
84
  - !ruby/object:Gem::Dependency
103
85
  name: prawn-table
104
86
  requirement: !ruby/object:Gem::Requirement
@@ -169,20 +151,34 @@ dependencies:
169
151
  - - ">="
170
152
  - !ruby/object:Gem::Version
171
153
  version: '0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: matrix
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
172
168
  - !ruby/object:Gem::Dependency
173
169
  name: rspec
174
170
  requirement: !ruby/object:Gem::Requirement
175
171
  requirements:
176
172
  - - "~>"
177
173
  - !ruby/object:Gem::Version
178
- version: 3.10.0
174
+ version: 3.11.0
179
175
  type: :development
180
176
  prerelease: false
181
177
  version_requirements: !ruby/object:Gem::Requirement
182
178
  requirements:
183
179
  - - "~>"
184
180
  - !ruby/object:Gem::Version
185
- version: 3.10.0
181
+ version: 3.11.0
186
182
  - !ruby/object:Gem::Dependency
187
183
  name: rubocop
188
184
  requirement: !ruby/object:Gem::Requirement
@@ -264,7 +260,8 @@ files:
264
260
  - spec/support/asset_matchers.rb
265
261
  homepage: https://github.com/webtranslateit/payday
266
262
  licenses: []
267
- metadata: {}
263
+ metadata:
264
+ rubygems_mfa_required: 'true'
268
265
  post_install_message:
269
266
  rdoc_options: []
270
267
  require_paths:
@@ -273,25 +270,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
273
270
  requirements:
274
271
  - - ">="
275
272
  - !ruby/object:Gem::Version
276
- version: '2.2'
273
+ version: '3.0'
277
274
  required_rubygems_version: !ruby/object:Gem::Requirement
278
275
  requirements:
279
276
  - - ">="
280
277
  - !ruby/object:Gem::Version
281
278
  version: '0'
282
279
  requirements: []
283
- rubygems_version: 3.1.6
280
+ rubygems_version: 3.3.3
284
281
  signing_key:
285
282
  specification_version: 4
286
283
  summary: A simple library for rendering invoices.
287
- test_files:
288
- - spec/assets/default_logo.png
289
- - spec/assets/svg.pdf
290
- - spec/assets/testing.pdf
291
- - spec/assets/testing_predefined_amount.pdf
292
- - spec/assets/tiger.svg
293
- - spec/invoice_spec.rb
294
- - spec/line_item_spec.rb
295
- - spec/pdf_renderer_spec.rb
296
- - spec/spec_helper.rb
297
- - spec/support/asset_matchers.rb
284
+ test_files: []