bellboy 0.2.6 → 0.3.0

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/lib/bellboy.rb CHANGED
@@ -18,6 +18,8 @@
18
18
  require 'berkshelf'
19
19
  require 'ridley'
20
20
 
21
+ require 'bellboy/mixin/berkshelf.rb'
22
+
21
23
  require 'bellboy/errors'
22
24
  require 'bellboy/logger'
23
25
  require 'bellboy/versioner'
@@ -32,7 +32,7 @@ module Bellboy
32
32
  Bellboy.logger.debug "Source: #{source.cached_cookbook.path}"
33
33
 
34
34
  if File.exists?(File.join(source.cached_cookbook.path, @bellboyfile))
35
- site = berksfile.locations.select { |loc| loc[:type] == :site }.first
35
+ site = berksfile.locations.select { |loc| loc[:type] == :databags }.first
36
36
 
37
37
  fail Berkshelf::InvalidChefAPILocation if site.nil?
38
38
 
@@ -79,7 +79,7 @@ module Bellboy
79
79
  end
80
80
 
81
81
  def download_item(site, databag, item, itempath)
82
- location = File.join("#{site[:value]}", 'databags', databag, item)
82
+ location = File.join("#{site[:value]}", databag, item)
83
83
 
84
84
  Bellboy.logger.log "Downloading data bag item #{databag}/#{item} from '#{location}'"
85
85
 
@@ -0,0 +1,25 @@
1
+ module Bellboy
2
+ module BerksfileBellboy
3
+
4
+ def self.included(base)
5
+ base.class_eval do
6
+ expose_method :databags
7
+ end
8
+ end
9
+
10
+ # Add a 'Databags' default location which will be used to resolve databag sources.
11
+ #
12
+ # @example
13
+ # databags "http://example.com/databags"
14
+ #
15
+ # @param [String] value
16
+ #
17
+ # @return [Hash]
18
+ def databags(value)
19
+ add_location(:databags, value)
20
+ end
21
+
22
+ end
23
+
24
+ Berkshelf::Berksfile.send(:include, BerksfileBellboy)
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bellboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-15 00:00:00.000000000 Z
12
+ date: 2014-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -112,6 +112,7 @@ files:
112
112
  - lib/bellboy/errors.rb
113
113
  - lib/bellboy/installer.rb
114
114
  - lib/bellboy/logger.rb
115
+ - lib/bellboy/mixin/berkshelf.rb
115
116
  - lib/bellboy/uploader.rb
116
117
  - lib/bellboy/versioner.rb
117
118
  - spec/cli_spec.rb