remove global vars

This commit is contained in:
Chris Elsworth 2020-02-02 19:01:51 +00:00
parent bcfeaac852
commit b3be969fc5
2 changed files with 4 additions and 11 deletions

View File

@ -1,7 +1,4 @@
---
Style/GlobalVars:
Enabled: no
Metrics/LineLength:
Max: 120

View File

@ -12,21 +12,17 @@ unless octopus.price
exit 255
end
lc = LuxController.new(host: CONFIG['lxp']['host'],
lc = LuxController.new(host: CONFIG['lxp']['host'], # rubocop:disable Lint/UselessAssignment
port: CONFIG['lxp']['port'],
serial: CONFIG['lxp']['serial'],
datalog: CONFIG['lxp']['datalog'])
ls = LuxStatus.new(host: CONFIG['server']['host'],
ls = LuxStatus.new(host: CONFIG['server']['host'], # rubocop:disable Lint/UselessAssignment
port: CONFIG['server']['port'])
gpio = GPIO.new(gpios: CONFIG['gpios']) # abstraction of RPi::GPIO
# abstraction of RPi::GPIO
gpio = GPIO.new(gpios: CONFIG['gpios']) # rubocop:disable Lint/UselessAssignment
raise('rules.rb not found!') unless File.readable?('rules.rb')
# transitioning to local vars rather than globals to make web rules easier
$octopus = octopus
$lc = lc
$ls = ls
instance_eval(File.read('rules.rb'), 'rules.rb')