Skip to content

Commit 4e6dde7

Browse files
committed
Update ruby version and rubocop
1 parent 1129302 commit 4e6dde7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+141
-119
lines changed

Gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
source 'https://rubygems.org'
22

3+
ruby '3.3.5'
4+
35
gemspec
6+
7+
group :development, :test do
8+
gem 'byebug', '11.1.3'
9+
gem 'guard', '~> 2.19.0'
10+
gem 'guard-rspec', '~> 4.7.3'
11+
gem 'pdf-inspector', '~> 1.3.0'
12+
gem 'rake', '13.2.1'
13+
gem 'rspec', '3.13.0'
14+
gem 'rubocop', '~> 1.75.3'
15+
gem 'rubocop-performance', '~> 1.19.0'
16+
gem 'rubocop-rspec', '~> 2.25.0'
17+
gem 'simplecov', '0.22.0'
18+
gem 'simplecov-html', '0.13.1'
19+
end

Gemfile.lock

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ GEM
2727
mutex_m
2828
tzinfo (~> 2.0)
2929
afm (0.2.2)
30-
ast (2.4.2)
30+
ast (2.4.3)
3131
barby (0.6.9)
3232
base64 (0.2.0)
3333
bigdecimal (3.1.6)
@@ -62,6 +62,9 @@ GEM
6262
hashery (2.1.2)
6363
i18n (1.14.5)
6464
concurrent-ruby (~> 1.0)
65+
json (2.11.3)
66+
language_server-protocol (3.17.0.4)
67+
lint_roller (1.1.0)
6568
listen (3.9.0)
6669
rb-fsevent (~> 0.10, >= 0.10.3)
6770
rb-inotify (~> 0.9, >= 0.9.10)
@@ -78,9 +81,10 @@ GEM
7881
notiffany (0.1.3)
7982
nenv (~> 0.1)
8083
shellany (~> 0.0)
81-
parallel (1.21.0)
82-
parser (3.0.2.0)
84+
parallel (1.27.0)
85+
parser (3.3.8.0)
8386
ast (~> 2.4.1)
87+
racc
8488
pdf-core (0.10.0)
8589
pdf-inspector (1.3.0)
8690
pdf-reader (>= 1.0, < 3.0.a)
@@ -96,18 +100,17 @@ GEM
96100
ttfunk (~> 1.8)
97101
prawn-table (0.2.2)
98102
prawn (>= 1.3.0, < 3.0.0)
103+
prism (1.4.0)
99104
pry (0.14.2)
100105
coderay (~> 1.1)
101106
method_source (~> 1.0)
102107
racc (1.8.1)
103-
rainbow (3.0.0)
108+
rainbow (3.1.1)
104109
rake (13.2.1)
105110
rb-fsevent (0.11.2)
106111
rb-inotify (0.11.1)
107112
ffi (~> 1.0)
108-
regexp_parser (2.1.1)
109-
rexml (3.3.3)
110-
strscan
113+
regexp_parser (2.10.0)
111114
rqrcode (2.2.0)
112115
chunky_png (~> 1.0)
113116
rqrcode_core (~> 1.0)
@@ -125,24 +128,34 @@ GEM
125128
diff-lcs (>= 1.2.0, < 2.0)
126129
rspec-support (~> 3.13.0)
127130
rspec-support (3.13.1)
128-
rubocop (0.93.1)
131+
rubocop (1.75.3)
132+
json (~> 2.3)
133+
language_server-protocol (~> 3.17.0.2)
134+
lint_roller (~> 1.1.0)
129135
parallel (~> 1.10)
130-
parser (>= 2.7.1.5)
136+
parser (>= 3.3.0.2)
131137
rainbow (>= 2.2.2, < 4.0)
132-
regexp_parser (>= 1.8)
133-
rexml
134-
rubocop-ast (>= 0.6.0)
138+
regexp_parser (>= 2.9.3, < 3.0)
139+
rubocop-ast (>= 1.44.0, < 2.0)
135140
ruby-progressbar (~> 1.7)
136-
unicode-display_width (>= 1.4.0, < 2.0)
137-
rubocop-ast (1.13.0)
138-
parser (>= 3.0.1.1)
139-
rubocop-performance (1.10.2)
140-
rubocop (>= 0.90.0, < 2.0)
141+
unicode-display_width (>= 2.4.0, < 4.0)
142+
rubocop-ast (1.44.1)
143+
parser (>= 3.3.7.2)
144+
prism (~> 1.4)
145+
rubocop-capybara (2.22.1)
146+
lint_roller (~> 1.1)
147+
rubocop (~> 1.72, >= 1.72.1)
148+
rubocop-factory_bot (2.27.1)
149+
lint_roller (~> 1.1)
150+
rubocop (~> 1.72, >= 1.72.1)
151+
rubocop-performance (1.19.1)
152+
rubocop (>= 1.7.0, < 2.0)
141153
rubocop-ast (>= 0.4.0)
142-
rubocop-rspec (1.44.1)
143-
rubocop (~> 0.87)
144-
rubocop-ast (>= 0.7.1)
145-
ruby-progressbar (1.11.0)
154+
rubocop-rspec (2.25.0)
155+
rubocop (~> 1.40)
156+
rubocop-capybara (~> 2.17)
157+
rubocop-factory_bot (~> 2.22)
158+
ruby-progressbar (1.13.0)
146159
ruby-rc4 (0.1.5)
147160
ruby2_keywords (0.0.5)
148161
shellany (0.0.1)
@@ -152,13 +165,14 @@ GEM
152165
simplecov_json_formatter (~> 0.1)
153166
simplecov-html (0.13.1)
154167
simplecov_json_formatter (0.1.4)
155-
strscan (3.1.0)
156168
thor (1.3.2)
157169
ttfunk (1.8.0)
158170
bigdecimal (~> 3.1)
159171
tzinfo (2.0.6)
160172
concurrent-ruby (~> 1.0)
161-
unicode-display_width (1.8.0)
173+
unicode-display_width (3.1.4)
174+
unicode-emoji (~> 4.0, >= 4.0.4)
175+
unicode-emoji (4.0.4)
162176

163177
PLATFORMS
164178
ruby
@@ -171,11 +185,14 @@ DEPENDENCIES
171185
pdf-inspector (~> 1.3.0)
172186
rake (= 13.2.1)
173187
rspec (= 3.13.0)
174-
rubocop (~> 0.93.1)
175-
rubocop-performance (~> 1.10.2)
176-
rubocop-rspec (~> 1.44.1)
188+
rubocop (~> 1.75.3)
189+
rubocop-performance (~> 1.19.0)
190+
rubocop-rspec (~> 2.25.0)
177191
simplecov (= 0.22.0)
178192
simplecov-html (= 0.13.1)
179193

194+
RUBY VERSION
195+
ruby 3.3.5p100
196+
180197
BUNDLED WITH
181198
2.5.5

br_danfe.gemspec

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Gem::Specification.new do |spec|
1111
spec.license = 'MIT'
1212

1313
spec.files = `git ls-files`.split("\n")
14-
spec.test_files = `git ls-files -- { test,spec,features }/*`.split("\n")
1514
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
1615
spec.require_paths = ['lib']
1716
spec.required_ruby_version = '>= 3.0'
@@ -24,15 +23,5 @@ Gem::Specification.new do |spec|
2423
spec.add_dependency 'prawn-table', '0.2.2'
2524
spec.add_dependency 'rqrcode', '>= 2.1', '< 2.3'
2625

27-
spec.add_development_dependency 'byebug', '11.1.3'
28-
spec.add_development_dependency 'guard', '~> 2.19.0'
29-
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
30-
spec.add_development_dependency 'pdf-inspector', '~> 1.3.0'
31-
spec.add_development_dependency 'rake', '13.2.1'
32-
spec.add_development_dependency 'rspec', '3.13.0'
33-
spec.add_development_dependency 'rubocop', '~> 0.93.1'
34-
spec.add_development_dependency 'rubocop-performance', '~> 1.10.2'
35-
spec.add_development_dependency 'rubocop-rspec', '~> 1.44.1'
36-
spec.add_development_dependency 'simplecov', '0.22.0'
37-
spec.add_development_dependency 'simplecov-html', '0.13.1'
26+
spec.metadata['rubygems_mfa_required'] = 'true'
3827
end

lib/br_danfe.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
require 'i18n'
1010
require 'br_documents'
1111

12-
Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |f| require f }
12+
Dir["#{File.dirname(__FILE__)}/**/*.rb"].each { |f| require f }
1313

1414
I18n.load_path << File.expand_path('../config/locales/pt-BR.yml', __dir__)
1515
I18n.available_locales = ['pt-BR']

lib/br_danfe/cce_lib/document.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def initialize
1515
@document.line_width = 0.3
1616
end
1717

18-
def method_missing(method_name, *args, &block)
18+
def method_missing(method_name, ...)
1919
if @document.respond_to? method_name
20-
@document.send method_name, *args, &block
20+
@document.send(method_name, ...)
2121
else
2222
super
2323
end

lib/br_danfe/danfe_lib/nfce_lib/document.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def render_blank_line(font_size = 6)
2020
@document.text ' ', size: font_size
2121
end
2222

23-
def method_missing(method_name, *args, &block)
23+
def method_missing(method_name, ...)
2424
if @document.respond_to? method_name
25-
@document.send method_name, *args, &block
25+
@document.send(method_name, ...)
2626
else
2727
super
2828
end

lib/br_danfe/danfe_lib/nfce_lib/header.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def render
2424
def render_company_info
2525
one_line = 1
2626

27-
@pdf.text_box (@xml['emit/xNome']).to_s, at: [x_position, @pdf.cursor], height: 36, size: 9, align: :left, style: :bold, overflow: :shrink_to_fit
27+
@pdf.text_box @xml['emit/xNome'].to_s, at: [x_position, @pdf.cursor], height: 36, size: 9, align: :left, style: :bold, overflow: :shrink_to_fit
2828
@pdf.move_down 36
2929

3030
@pdf.text_box cnpj(@xml['emit/CNPJ']), at: [x_position, @pdf.cursor], height: 9, size: 9, align: :left, overflow: :shrink_to_fit

lib/br_danfe/danfe_lib/nfe_lib/document.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ def initialize
1717
@document.line_width = 0.3
1818
end
1919

20-
def method_missing(method_name, *args, &block)
20+
def method_missing(method_name, ...)
2121
if @document.respond_to? method_name
22-
@document.send method_name, *args, &block
22+
@document.send(method_name, ...)
2323
else
2424
super
2525
end
@@ -97,12 +97,12 @@ def lnumeric(h, w, x, y, xml, xpath, options = {})
9797
end
9898

9999
def inumeric(h, w, x, y, i18n = '', data = '', options = {})
100-
label = i18n != '' ? I18n.t("danfe.#{i18n}") : ''
100+
label = i18n == '' ? '' : I18n.t("danfe.#{i18n}")
101101
numeric [x.cm, Helper.invert(y.cm)], w.cm, h.cm, label, data, options
102102
end
103103

104104
def i18n_lbox(h, w, x, y, i18n = '', info = '', options = {})
105-
label = i18n != '' ? I18n.t("danfe.#{i18n}") : ''
105+
label = i18n == '' ? '' : I18n.t("danfe.#{i18n}")
106106
ibox h, w, x, y, label, info, options
107107
end
108108

lib/br_danfe/danfe_lib/nfe_lib/infadic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def dup_content
113113

114114
def generate_y_position(volumes_number)
115115
if volumes_number > 1
116-
return Y_POSITION + 0.30 + volumes_number * 0.15 + 0.2
116+
return Y_POSITION + 0.30 + (volumes_number * 0.15) + 0.2
117117
end
118118

119119
Y_POSITION + 0.30

lib/br_danfe/document_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module BrDanfe
22
class DocumentBuilder
3-
def self.build(*args, &block)
4-
document = Prawn::Document.new(*args, &block)
3+
def self.build(...)
4+
document = Prawn::Document.new(...)
55

66
document.font_families['tinos'] = {
77
bold: "#{BrDanfe.root_path}/fonts/tinos_bold.ttf",

0 commit comments

Comments
 (0)