mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 11:02:30 +01:00
Use Rubocop
This commit is contained in:
parent
671cba3c73
commit
bb60fa8eba
2
.rubocop.yml
Normal file
2
.rubocop.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Documentation:
|
||||||
|
Enabled: false
|
@ -1,5 +1,5 @@
|
|||||||
preload_app true
|
preload_app true
|
||||||
worker_processes (ENV['WORKER_PROCESSES'] || 4).to_i
|
worker_processes((ENV['WORKER_PROCESSES'] || 4).to_i)
|
||||||
timeout 10
|
timeout 10
|
||||||
|
|
||||||
before_fork do |_, _|
|
before_fork do |_, _|
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
oldrev, newrev = ARGV
|
oldrev, newrev = ARGV
|
||||||
|
|
||||||
def run(cmd)
|
def run(cmd)
|
||||||
exit($?.exitstatus) unless system "umask 002 && #{cmd}"
|
exit($CHILD_STATUS.exitstatus) unless system "umask 002 && #{cmd}"
|
||||||
end
|
end
|
||||||
|
|
||||||
run "foreman run bundle install --deployment --without development:test"
|
run 'foreman run bundle install --deployment --without development:test'
|
||||||
run "whenever --update-crontab"
|
run 'whenever --update-crontab'
|
||||||
|
|
||||||
tasks = []
|
tasks = []
|
||||||
num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
|
num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
|
||||||
tasks << "db:migrate" if num_migrations > 0
|
tasks << 'db:migrate' if num_migrations > 0
|
||||||
tasks << "rates:update"
|
tasks << 'rates:update'
|
||||||
|
|
||||||
run "foreman run bundle exec rake #{tasks.join(" ")}" if tasks.any?
|
run "foreman run bundle exec rake #{tasks.join(" ")}" if tasks.any?
|
||||||
|
@ -6,7 +6,7 @@ require 'currency'
|
|||||||
class Quote
|
class Quote
|
||||||
include Virtus.value_object
|
include Virtus.value_object
|
||||||
|
|
||||||
DEFAULT_BASE = 'EUR'
|
DEFAULT_BASE = 'EUR'.freeze
|
||||||
|
|
||||||
values do
|
values do
|
||||||
attribute :base, String, default: DEFAULT_BASE
|
attribute :base, String, default: DEFAULT_BASE
|
||||||
@ -53,8 +53,8 @@ class Quote
|
|||||||
rates
|
rates
|
||||||
end
|
end
|
||||||
|
|
||||||
# I'm mimicking the apparent convention of the ECB here.
|
# I'm mimicking the apparent convention of the ECB here.
|
||||||
def round_rate(rate)
|
def round_rate(rate)
|
||||||
Float("%.#{5}g" % rate)
|
Float(format('%.5g', rate))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user