Skip to content

Commit

Permalink
Rails/TimeZone-20230310233258 (#844)
Browse files Browse the repository at this point in the history
* 🚓 regenerate rubocop todo

* 🚓 Rails/TimeZone

* 🚓 regenerate rubocop todo

---------

Co-authored-by: Rubocop Challenger <rubocop@payrollhero.com>
Co-authored-by: Mathieu Jobin <99191+mathieujobin@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 20, 2023
1 parent e273d55 commit 92f115f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1443,14 +1443,6 @@ Rails/RootPathnameMethods:
- 'spec/lib/rake_spec.rb'
- 'spec/lib/swagger/rake_swagger_spec.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Rails/TimeZone:
Exclude:
- 'lib/tasks/apipie.rake'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/IoMethods:
Expand Down
8 changes: 4 additions & 4 deletions lib/tasks/apipie.rake
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ namespace :apipie do
# Default output dir ('public/apipie_cache') can be changed with OUT=/some/dir
desc "Generate cache to avoid production dependencies on markup languages"
task :cache => :environment do
puts "#{Time.now} | Started"
puts "#{Time.zone.now} | Started"
cache_part = ENV['cache_part']
generate_index = (cache_part == 'resources' ? false : true)
generate_resources = (cache_part == 'index' ? false : true)
with_loaded_documentation do
puts "#{Time.now} | Documents loaded..."
puts "#{Time.zone.now} | Documents loaded..."
([nil] + Apipie.configuration.languages).each do |lang|
I18n.locale = lang || Apipie.configuration.default_locale
puts "#{Time.now} | Processing docs for #{lang}"
puts "#{Time.zone.now} | Processing docs for #{lang}"
cache_dir = ENV["OUT"] || Apipie.configuration.cache_dir
subdir = Apipie.configuration.doc_base_url.sub(/\A\//,"")
subdir_levels = subdir.split('/').length
Expand Down Expand Up @@ -159,7 +159,7 @@ namespace :apipie do
end
end
end
puts "#{Time.now} | Finished"
puts "#{Time.zone.now} | Finished"
end

# Attempt to use the Rails application views, otherwise default to built in views
Expand Down

0 comments on commit 92f115f

Please sign in to comment.