Permalink
Browse files

put insurance.db into insurance/, but this isn't quite complete/robust.

  • Loading branch information...
Scott Barron
Scott Barron committed Apr 18, 2006
1 parent 3e78c4b commit dacc690d0fcde7d00e199be713459bb52dd79605
Showing with 7 additions and 5 deletions.
  1. +1 −1 bin/railscov
  2. +5 −3 lib/insurance/analyzer.rb
  3. +1 −1 lib/insurance/generators/rails/insurance/templates/insurance.rake
View
@@ -50,7 +50,7 @@ if options[:apply_to]
end
if options[:report]
- reportdb = options[:report_db] || 'insurance.db'
+ reportdb = options[:report_db] || 'insurance/insurance.db'
outdir = options[:report_out] || 'insurance'
puts "Running the report from #{reportdb}, output to #{outdir}"
@@ -11,14 +11,16 @@ module Insurance
x[k] = v.lines
end
- if File.exist?('insurance.db')
- data = Marshal.load(open('insurance.db'))
+ FileUtils.mkdir_p "insurance" unless File.exist?('insurance')
+
+ if File.exist?('insurance/insurance.db')
+ data = Marshal.load(open('insurance/insurance.db'))
else
data = {}
end
data[section] = x
- open('insurance.db', 'w').write(Marshal.dump(data))
+ open('insurance/insurance.db', 'w').write(Marshal.dump(data))
}
class Analyzer
@@ -26,7 +26,7 @@ namespace 'insurance' do
desc 'Clean up Insurance temporary database'
task :clean do
- rm_f 'insurance.db'
+ rm_f 'insurance/insurance.db'
end
desc 'Generate the Insurance report'

0 comments on commit dacc690

Please sign in to comment.