Skip to content

Commit

Permalink
Merge pull request #4 from easybiblabs/bugfix/expand_path
Browse files Browse the repository at this point in the history
Bugfix/expand path
  • Loading branch information
Florian Holzhauer committed Nov 1, 2013
2 parents 2f54f7b + 700f4ac commit 030d08d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions bib-vagrant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|

spec.add_dependency 'thor', '>= 0.18.1'
spec.add_dependency 'colored', '>= 1.2'
spec.add_dependency 'json'

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
Expand Down
9 changes: 6 additions & 3 deletions lib/bib/vagrant/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ def validate!(config)

errors = []
log_level = ['debug', 'info', 'warn', 'error', 'fatal']
bool = [TrueClass, FalseClass]

errors << "nfs: must be a boolean" unless [TrueClass, FalseClass].include?(config['nfs'].class)
errors << "gui: must be a boolean" unless [TrueClass, FalseClass].include?(config['gui'].class)
errors << "cookbook_path: does not exist" unless File.directory?(config['cookbook_path'])
cookbook_path = File.expand_path(config['cookbook_path'])

errors << "nfs: must be a boolean" unless bool.include?(config['nfs'].class)
errors << "gui: must be a boolean" unless bool.include?(config['gui'].class)
errors << "cookbook_path: does not exist" unless File.directory?(cookbook_path)
errors << "chef_log_level: must be one of #{log_level.join}" unless log_level.include?(config['chef_log_level'])

if !config['additional_json'].empty?
Expand Down
2 changes: 1 addition & 1 deletion test/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_validate!
}

config["nfs"] = false
config["cookbook_path"] = @@fixture_dir
config["cookbook_path"] = '~/'

assert(c.validate!(config))

Expand Down

0 comments on commit 030d08d

Please sign in to comment.