Skip to content

[APPS-7391] Update ruby support #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'
steps:
- uses: zendesk/checkout@v3
- uses: zendesk/setup-ruby@v1
Expand Down
14 changes: 7 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
AllCops:
TargetRubyVersion: 2.6
NewCops: enable
Include:
- 'Gemfile'
- 'Rakefile'
Exclude:
- 'vendor/**/*'

ClassLength:
Metrics/ClassLength:
Enabled: false

Documentation:
Style/Documentation:
Enabled: false

MethodLength:
Metrics/MethodLength:
Enabled: false

Style/Alias:
Expand All @@ -21,10 +21,10 @@ Style/Alias:
Layout/FirstArrayElementIndentation:
Enabled: false

HashSyntax:
Style/HashSyntax:
EnforcedStyle: ruby19

Metrics/LineLength:
Layout/LineLength:
Max: 120

Metrics/BlockLength:
Expand All @@ -35,7 +35,7 @@ Metrics/ModuleLength:
CountComments: false # count full line comments?
Max: 200

CommentAnnotation:
Style/CommentAnnotation:
Keywords:
- TODO
- FIXME
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Naming/BinaryOperatorParameterName:
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/zendesk_apps_support/package.rb'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.8
3.2.8
52 changes: 30 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
ast (2.4.3)
bump (0.5.4)
byebug (9.0.6)
byebug (11.1.3)
concurrent-ruby (1.2.2)
crass (1.0.6)
diff-lcs (1.5.0)
Expand All @@ -32,25 +32,28 @@ GEM
image_size (2.0.2)
ipaddress_2 (0.13.0)
json (2.6.3)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
marcel (1.0.2)
mini_portile2 (2.8.2)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
mini_portile2 (2.8.8)
nokogiri (1.18.8)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.12.1)
parser (3.0.2.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc (1.6.2)
rainbow (3.0.0)
racc
prism (1.4.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
regexp_parser (2.1.1)
rexml (3.3.9)
regexp_parser (2.10.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -64,34 +67,39 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.20.0)
rubocop (1.75.3)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
unicode-display_width (2.0.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)

PLATFORMS
ruby

DEPENDENCIES
bump (~> 0.5.1)
bundler (~> 2.2)
byebug (~> 9.0.6)
byebug
faker
parallel (= 1.12.1)
rake
Expand All @@ -100,4 +108,4 @@ DEPENDENCIES
zendesk_apps_support!

BUNDLED WITH
2.4.12
2.4.19
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ standard_i18n_file = project_root.join('config/locales/en.yml')

file standard_i18n_file => zendesk_i18n_file do |task|
header = "# This is a generated file. Do NOT edit directly.\n# To update, run 'bundle exec rake i18n:standardize'.\n"
input = YAML.safe_load(File.read(task.prerequisites.first))
input = YAML.safe_load_file(task.prerequisites.first)
translations = input['parts'].map { |part| part['translation'] }
yaml = YAML.dump('en' => array_to_nested_hash(translations))
File.open(task.name, 'w') { |f| f << header + yaml }
File.open(task.name, 'w') { |f| f << (header + yaml) }
end

namespace :i18n do
Expand Down
4 changes: 2 additions & 2 deletions lib/zendesk_apps_support/validations/secrets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Secrets
].freeze

APPLICATION_SECRETS = {
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
'Slack Token' => /(xox[p|b|o|a]-*.[a-z0-9])/,
'RSA Private Key' => /-----BEGIN RSA PRIVATE KEY-----/,
'SSH Private Key (OpenSSH)' => /-----BEGIN OPENSSH PRIVATE KEY-----/,
Expand Down Expand Up @@ -45,7 +45,7 @@ module Secrets
'Attachment Token Key' => /(attachment_token_key.*.[0-9a-f]{24,72})/,
'Password' => /([pP][aA][sS][sS][wW][oO][rR][dD].*.[0-9a-zA-Z+_.-]{4,156})/,
'Token' => /([tT][oO][kK][eE][nN]( [:\"=-]|[:\"=-]).*.[0-9a-zA-Z+_.-]{4,156})/
# rubocop:enable Metrics/LineLength
# rubocop:enable Layout/LineLength
}.freeze

class << self
Expand Down
2 changes: 1 addition & 1 deletion lib/zendesk_apps_support/validations/translations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def call(package, opts = {})
errors << locale_error(file, path_match[1]) << json_error(file) << format_error(file)
next unless errors.compact.empty?
if file.relative_path == 'translations/en.json'
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
errors.push(*validate_marketplace_content(file, package, opts.fetch(:skip_marketplace_translations, false)))
end
end.compact
Expand Down
4 changes: 2 additions & 2 deletions zendesk_apps_support.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.summary = 'Support to help you develop Zendesk Apps.'
s.description = s.summary

s.required_ruby_version = Gem::Requirement.new('>= 2.7')
s.required_ruby_version = Gem::Requirement.new('>= 3.2')
s.required_rubygems_version = '>= 1.3.6'

s.add_runtime_dependency 'i18n', '>= 1.7.1'
Expand All @@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'bump', '~> 0.5.1'
s.add_development_dependency 'faker'
s.add_development_dependency 'rubocop'
s.add_development_dependency 'byebug', '~> 9.0.6'
s.add_development_dependency 'byebug'
s.add_development_dependency 'bundler', '~> 2.2'
s.add_development_dependency 'parallel', '1.12.1'
s.add_development_dependency 'rake'
Expand Down
Loading