summaryrefslogtreecommitdiff
path: root/lib/oxidized/source/csv.rb
diff options
context:
space:
mode:
authorElvin Efendi <elvin.efendiev@shopify.com>2015-10-27 14:49:52 -0400
committerElvin Efendi <elvin.efendiev@shopify.com>2015-11-13 11:12:31 -0500
commitf2da63369fcb754e3715091cc4fd2f93db42106e (patch)
tree0e985374cc7b4bd8111c012072c39218335881ef /lib/oxidized/source/csv.rb
parent1400b842f6dc61e662ce15f72f578a55126ffc06 (diff)
better test framework, more specs and Travis CI
Diffstat (limited to 'lib/oxidized/source/csv.rb')
-rw-r--r--lib/oxidized/source/csv.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/oxidized/source/csv.rb b/lib/oxidized/source/csv.rb
index 5064e5e..a0ce848 100644
--- a/lib/oxidized/source/csv.rb
+++ b/lib/oxidized/source/csv.rb
@@ -1,17 +1,17 @@
module Oxidized
class CSV < Source
def initialize
- @cfg = CFG.source.csv
+ @cfg = Oxidized.config.source.csv
super
end
def setup
if @cfg.empty?
- CFGS.user.source.csv.file = File.join(Config::Root, 'router.db')
- CFGS.user.source.csv.delimiter = /:/
- CFGS.user.source.csv.map.name = 0
- CFGS.user.source.csv.map.model = 1
- CFGS.save :user
+ Oxidized.asetus.user.source.csv.file = File.join(Config::Root, 'router.db')
+ Oxidized.asetus.user.source.csv.delimiter = /:/
+ Oxidized.asetus.user.source.csv.map.name = 0
+ Oxidized.asetus.user.source.csv.map.model = 1
+ Oxidized.asetus.save :user
raise NoConfig, 'no source csv config, edit ~/.config/oxidized/config'
end
end
@@ -19,7 +19,7 @@ class CSV < Source
def load
nodes = []
open(File.expand_path @cfg.file).each_line do |line|
- next if line.match /^\s*#/
+ next if line.match(/^\s*#/)
data = line.chomp.split @cfg.delimiter
next if data.empty?
# map node parameters