fidius-cvedb 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/fidius-cvedb CHANGED
@@ -49,7 +49,31 @@ end
49
49
  def symlink_rake_tasks
50
50
  Dir.glob(File.join GEM_BASE, 'tasks', '*.rake') do |rake|
51
51
  dest = File.join 'lib', 'tasks', File.basename(rake)
52
- FileUtils.ln_s(rake, dest)
52
+ begin
53
+ FileUtils.ln_s(rake, dest)
54
+ rescue Errno::EEXIST
55
+ puts "#{dest} already exists, do you want to override it? (y/n)"
56
+ if override_it?
57
+ FileUtils.rm(dest)
58
+ FileUtils.ln_s(rake, dest)
59
+ puts "Answer was 'yes', overriding the file."
60
+ else
61
+ puts "Answer was 'no', skipping this file."
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ def override_it?
68
+ while answer = gets
69
+ case answer
70
+ when "y\n"
71
+ return true
72
+ when "n\n"
73
+ return false
74
+ else
75
+ puts "I don't know what you mean, enter 'y' for yes or 'n' for no."
76
+ end
53
77
  end
54
78
  end
55
79
 
@@ -1,5 +1,5 @@
1
1
  module FIDIUS
2
2
  module CveDb
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -1,7 +1,13 @@
1
1
  class FIDIUS::CveDb::CveConnection < ActiveRecord::Base
2
+ self.abstract_class = true
3
+
2
4
  # If the application is using the cve_db as foreign database this should be
3
5
  # uncommented.
4
6
  database_yml = YAML.load_file('config/database.yml')
7
+ unless database_yml['cve_db']
8
+ puts "WARNING: There is no \"cve_db\" entry in your database.yml, this "+
9
+ "will likely lead to an error."
10
+ end
5
11
  establish_connection database_yml['cve_db']
6
- self.abstract_class = true
12
+
7
13
  end
@@ -2,7 +2,7 @@ require 'yaml'
2
2
 
3
3
  namespace :nvd do
4
4
  desc 'Execute NVD migrations'
5
- task :migrate do
5
+ task :migrate => :environment do
6
6
  db_connect
7
7
  ActiveRecord::Migrator.migrate(File.join FIDIUS::CveDb::GEM_BASE, 'db', 'migrate')
8
8
  end
@@ -5,6 +5,7 @@ $LOAD_PATH.unshift LIB_DIR
5
5
  require 'parser'
6
6
  require 'test/unit'
7
7
 
8
+ # Tests the parsing funcionality of the NVD parser.
8
9
  class TestCveParser < Test::Unit::TestCase
9
10
 
10
11
  include FIDIUS::NVDParser
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andreas Bender
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-25 00:00:00 +01:00
18
+ date: 2011-03-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency