vagrant-librarian-chef 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f82c78cb2f10176747923991aa039a126977137
4
- data.tar.gz: 1caa6e7aa66ad97550fa8544fa18e7a4dccc9c7d
3
+ metadata.gz: 00f7e7254040996cf4d3b0ac0199a51d9f099d21
4
+ data.tar.gz: da9cf5d32d649532a5a2e5fa286c88ffbf51f4dc
5
5
  SHA512:
6
- metadata.gz: fc92ee30b9a65c1635d937506152326733862285abd97f6607440c86e10ef5365a2dcafc29c2893d9c8f0c60d7405fef8e57edeee121e2aefe875aef960197b3
7
- data.tar.gz: 7be1d74e3311bf624e4b335d0dbe34cd0817b649d7c355f99f9ab45559dc68f1be4cb1e3bea90da6283b0b99d8e4b12bde4f78d5b957720708f0d5ada176cff3
6
+ metadata.gz: 8edd1b1483d55b266713a02ea420c77050bea37cb19876fb9c7344bd5756cbd89981559f679d49a083849fc771e04a3babe3dffd3a04931b10c7e4af3f1204e8
7
+ data.tar.gz: 7c4a84c08da63f960b909bba6c27f56ad984050c5657e12541ae394df4d7738fa52708ff04924aa1bea3909bc513658f79571bbba6cb178d3bf63dd44cb6e1b0
@@ -13,18 +13,30 @@ module VagrantPlugins
13
13
 
14
14
  def call(env)
15
15
  config = env[:global_config].librarian_chef
16
- # look for a Cheffile in the configured cheffile_dir
17
- if FileTest.exist? File.join(env[:root_path], config.cheffile_path)
16
+
17
+ project_path = get_project_path(env, config)
18
+ if project_path
18
19
  env[:ui].info "Installing Chef cookbooks with Librarian-Chef..."
19
20
  environment = Librarian::Chef::Environment.new({
20
- :project_path => File.join(env[:root_path], config.cheffile_dir)
21
+ :project_path => project_path
21
22
  })
22
23
  Librarian::Action::Ensure.new(environment).run
23
24
  Librarian::Action::Resolve.new(environment).run
24
25
  Librarian::Action::Install.new(environment).run
26
+ else
27
+ env[:ui].info "Couldn't find Cheffile at #{config.cheffile_path}."
25
28
  end
26
29
  @app.call(env)
27
30
  end
31
+
32
+ def get_project_path(env, config)
33
+ # look for a Cheffile in the configured cheffile_dir
34
+ if FileTest.exist? config.cheffile_path
35
+ return config.cheffile_dir
36
+ elsif FileTest.exist? File.join(env[:root_path], config.cheffile_path)
37
+ return File.join(env[:root_path], config.cheffile_dir)
38
+ end
39
+ end
28
40
  end
29
41
  end
30
42
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module LibrarianChef
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-librarian-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-13 00:00:00.000000000 Z
11
+ date: 2013-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: librarian-chef
@@ -111,3 +111,4 @@ signing_key:
111
111
  specification_version: 4
112
112
  summary: A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
113
113
  test_files: []
114
+ has_rdoc: