Skip to content

Commit

Permalink
Auto corrected by following Lint Ruby Style/RegexpLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesome Code committed Mar 16, 2021
1 parent 828bcc4 commit 9cee931
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rails/convert_active_record_dirty_5_0_to_5_1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def call_after_create

within_files 'app/{models,observers}/**/*.rb' do
within_node type: 'class' do
object_name = node.name.to_source.sub(/Observer$/, '').underscore.gsub(/\//, '_').tableize
object_name = node.name.to_source.sub(/Observer$/, '').underscore.gsub(%r{/}, '_').tableize

with_node type: 'send', receiver: 'self', message: 'table_name=' do
if node.arguments[0].type == :str
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby/iconv_to_encode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
if must_silently_ignore_bad_chars
encode_options = ', invalid: :replace, undef: :replace'
end
cleaned_from_charset = from_charset.to_source.gsub(/\/{2}[^\/']+/, '')
cleaned_to_charset = to_charset.to_source.gsub(/\/{2}[^\/']+/, '')
cleaned_from_charset = from_charset.to_source.gsub(%r{/{2}[^/']+}, '')
cleaned_to_charset = to_charset.to_source.gsub(%r{/{2}[^/']+}, '')
replace_with("force_encoding(#{cleaned_from_charset}).encode(#{cleaned_to_charset}#{encode_options})")
end
end
Expand Down

0 comments on commit 9cee931

Please sign in to comment.