knife-essentials 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +3 -0
- data/lib/chef_fs/file_system/chef_repository_file_system_data_bags_dir.rb +35 -0
- data/lib/chef_fs/file_system/chef_repository_file_system_root_dir.rb +3 -3
- data/lib/chef_fs/version.rb +1 -1
- data/spec/integration/chef_repository_file_system_spec.rb +16 -0
- metadata +2 -1
@@ -40,7 +40,10 @@ module ChefFS
|
|
40
40
|
|
41
41
|
def ignored?(entry)
|
42
42
|
return true if !entry.dir?
|
43
|
+
return true if entry.name.start_with?('.')
|
44
|
+
|
43
45
|
result = super(entry)
|
46
|
+
|
44
47
|
if result
|
45
48
|
Chef::Log.warn("Cookbook '#{entry.name}' is empty or entirely chefignored at #{entry.path_for_printing}")
|
46
49
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#
|
2
|
+
# Author:: John Keiser (<jkeiser@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'chef_fs/file_system/chef_repository_file_system_entry'
|
20
|
+
require 'chef_fs/data_handler/data_bag_item_data_handler'
|
21
|
+
|
22
|
+
module ChefFS
|
23
|
+
module FileSystem
|
24
|
+
class ChefRepositoryFileSystemDataBagsDir < ChefRepositoryFileSystemEntry
|
25
|
+
def initialize(name, parent, path = nil)
|
26
|
+
super(name, parent, path, ChefFS::DataHandler::DataBagItemDataHandler.new)
|
27
|
+
end
|
28
|
+
|
29
|
+
def ignored?(entry)
|
30
|
+
return true if entry.dir? && entry.name.start_with?('.')
|
31
|
+
super(entry)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -19,9 +19,9 @@
|
|
19
19
|
require 'chef_fs/file_system/base_fs_dir'
|
20
20
|
require 'chef_fs/file_system/chef_repository_file_system_entry'
|
21
21
|
require 'chef_fs/file_system/chef_repository_file_system_cookbooks_dir'
|
22
|
+
require 'chef_fs/file_system/chef_repository_file_system_data_bags_dir'
|
22
23
|
require 'chef_fs/file_system/multiplexed_dir'
|
23
24
|
require 'chef_fs/data_handler/client_data_handler'
|
24
|
-
require 'chef_fs/data_handler/data_bag_item_data_handler'
|
25
25
|
require 'chef_fs/data_handler/environment_data_handler'
|
26
26
|
require 'chef_fs/data_handler/node_data_handler'
|
27
27
|
require 'chef_fs/data_handler/role_data_handler'
|
@@ -75,12 +75,12 @@ module ChefFS
|
|
75
75
|
end
|
76
76
|
if name == 'cookbooks'
|
77
77
|
dirs = paths.map { |path| ChefRepositoryFileSystemCookbooksDir.new(name, self, path) }
|
78
|
+
elsif name == 'data_bags'
|
79
|
+
dirs = paths.map { |path| ChefRepositoryFileSystemDataBagsDir.new(name, self, path) }
|
78
80
|
else
|
79
81
|
data_handler = case name
|
80
82
|
when 'clients'
|
81
83
|
ChefFS::DataHandler::ClientDataHandler.new
|
82
|
-
when 'data_bags'
|
83
|
-
ChefFS::DataHandler::DataBagItemDataHandler.new
|
84
84
|
when 'environments'
|
85
85
|
ChefFS::DataHandler::EnvironmentDataHandler.new
|
86
86
|
when 'nodes'
|
data/lib/chef_fs/version.rb
CHANGED
@@ -246,4 +246,20 @@ EOM
|
|
246
246
|
end
|
247
247
|
end
|
248
248
|
end
|
249
|
+
|
250
|
+
when_the_repository 'has a cookbook starting with .' do
|
251
|
+
file 'cookbooks/.svn/metadata.rb', ''
|
252
|
+
file 'cookbooks/a.b/metadata.rb', ''
|
253
|
+
it 'knife list does not show it' do
|
254
|
+
knife('list --local -fp /cookbooks').should_succeed "/cookbooks/a.b/\n"
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
when_the_repository 'has a data bag starting with .' do
|
259
|
+
file 'data_bags/.svn/x.json', {}
|
260
|
+
file 'data_bags/a.b/x.json', {}
|
261
|
+
it 'knife list does not show it' do
|
262
|
+
knife('list --local -fp /data_bags').should_succeed "/data_bags/a.b/\n"
|
263
|
+
end
|
264
|
+
end
|
249
265
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-essentials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/chef_fs/file_system/base_fs_dir.rb
|
60
60
|
- lib/chef_fs/file_system/base_fs_object.rb
|
61
61
|
- lib/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb
|
62
|
+
- lib/chef_fs/file_system/chef_repository_file_system_data_bags_dir.rb
|
62
63
|
- lib/chef_fs/file_system/chef_repository_file_system_entry.rb
|
63
64
|
- lib/chef_fs/file_system/chef_repository_file_system_root_dir.rb
|
64
65
|
- lib/chef_fs/file_system/chef_server_root_dir.rb
|