knife-essentials 1.0.0.beta5 → 1.0.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.
@@ -82,7 +82,7 @@ module ChefFS
82
82
 
83
83
  def children
84
84
  @children ||=
85
- Dir.entries(file_path).
85
+ Dir.entries(file_path).sort.
86
86
  select { |entry| entry != '.' && entry != '..' }.
87
87
  map { |entry| ChefRepositoryFileSystemEntry.new(entry, self) }.
88
88
  select { |entry| !ignored?(entry) }
@@ -39,7 +39,7 @@ module ChefFS
39
39
 
40
40
  def children
41
41
  begin
42
- @children ||= Dir.entries(file_path).select { |entry| entry != '.' && entry != '..' }.map { |entry| FileSystemEntry.new(entry, self) }
42
+ @children ||= Dir.entries(file_path).sort.select { |entry| entry != '.' && entry != '..' }.map { |entry| FileSystemEntry.new(entry, self) }
43
43
  rescue Errno::ENOENT
44
44
  raise ChefFS::FileSystem::NotFoundError.new(self, $!)
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module ChefFS
2
- VERSION = "1.0.0.beta5"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -109,7 +109,7 @@ EOM
109
109
  'description' => 'woo',
110
110
  'name' => 'x'
111
111
  }
112
- it 'knife show shows the attributes in a predetermined order', :pending => (RUBY_VERSION < "1.8") do
112
+ it 'knife show shows the attributes in a predetermined order', :pending => (RUBY_VERSION < "1.9") do
113
113
  knife('show /environments/x.json').should_succeed <<EOM
114
114
  /environments/x.json:
115
115
  {
@@ -1,3 +1,4 @@
1
+ require 'chef/config'
1
2
  require 'chef/knife'
2
3
  require 'chef/application/knife'
3
4
  require 'logger'
@@ -18,43 +19,53 @@ module KnifeSupport
18
19
  # Make output stable
19
20
  Chef::Config[:concurrency] = 1
20
21
 
21
- # This is Chef::Knife.run without load_commands and load_deps--we'll
22
- # load stuff ourselves, thank you very much
23
- stdout = StringIO.new
24
- stderr = StringIO.new
25
- old_loggers = Chef::Log.loggers
26
- old_log_level = Chef::Log.level
27
- begin
28
- puts "knife: #{args.join(' ')}" if DEBUG
29
- subcommand_class = Chef::Knife.subcommand_class_from(args)
30
- subcommand_class.options = Chef::Application::Knife.options.merge(subcommand_class.options)
31
- instance = subcommand_class.new(args)
32
-
33
- # Capture stdout/stderr
34
- instance.ui = Chef::Knife::UI.new(stdout, stderr, STDIN, {})
35
-
36
- # Don't print stuff
37
- Chef::Config[:verbosity] = ( DEBUG ? 2 : 0 )
38
- instance.configure_chef
39
- logger = Logger.new(stderr)
40
- logger.formatter = proc { |severity, datetime, progname, msg| "#{severity}: #{msg}\n" }
41
- Chef::Log.use_log_devices([logger])
42
- Chef::Log.level = ( DEBUG ? :debug : :warn )
43
- Chef::Log::Formatter.show_time = false
44
-
45
- instance.run
46
-
47
- exit_code = 0
48
-
49
- # This is how rspec catches exit()
50
- rescue SystemExit => e
51
- exit_code = e.status
52
- ensure
53
- Chef::Log.use_log_devices(old_loggers)
54
- Chef::Log.level = old_log_level
55
- end
22
+ # Work on machines where we can't access /var
23
+ checksums_cache_dir = Dir.mktmpdir('checksums') do |checksums_cache_dir|
24
+ old_cache_options = Chef::Config[:cache_options]
25
+ Chef::Config[:cache_options] = {
26
+ :path => checksums_cache_dir,
27
+ :skip_expires => true
28
+ }
29
+
30
+ # This is Chef::Knife.run without load_commands and load_deps--we'll
31
+ # load stuff ourselves, thank you very much
32
+ stdout = StringIO.new
33
+ stderr = StringIO.new
34
+ old_loggers = Chef::Log.loggers
35
+ old_log_level = Chef::Log.level
36
+ begin
37
+ puts "knife: #{args.join(' ')}" if DEBUG
38
+ subcommand_class = Chef::Knife.subcommand_class_from(args)
39
+ subcommand_class.options = Chef::Application::Knife.options.merge(subcommand_class.options)
40
+ instance = subcommand_class.new(args)
41
+
42
+ # Capture stdout/stderr
43
+ instance.ui = Chef::Knife::UI.new(stdout, stderr, STDIN, {})
44
+
45
+ # Don't print stuff
46
+ Chef::Config[:verbosity] = ( DEBUG ? 2 : 0 )
47
+ instance.configure_chef
48
+ logger = Logger.new(stderr)
49
+ logger.formatter = proc { |severity, datetime, progname, msg| "#{severity}: #{msg}\n" }
50
+ Chef::Log.use_log_devices([logger])
51
+ Chef::Log.level = ( DEBUG ? :debug : :warn )
52
+ Chef::Log::Formatter.show_time = false
53
+
54
+ instance.run
55
+
56
+ exit_code = 0
57
+
58
+ # This is how rspec catches exit()
59
+ rescue SystemExit => e
60
+ exit_code = e.status
61
+ ensure
62
+ Chef::Log.use_log_devices(old_loggers)
63
+ Chef::Log.level = old_log_level
64
+ Chef::Config[:cache_options] = old_cache_options
65
+ end
56
66
 
57
- KnifeResult.new(stdout.string, stderr.string, exit_code)
67
+ KnifeResult.new(stdout.string, stderr.string, exit_code)
68
+ end
58
69
  end
59
70
 
60
71
  private
metadata CHANGED
@@ -1,16 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-essentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta5
5
- prerelease: 6
4
+ version: 1.0.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Keiser
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-19 00:00:00.000000000 Z
12
+ date: 2013-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: chef
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: chef-zero
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -43,6 +59,54 @@ dependencies:
43
59
  - - ! '>='
44
60
  - !ruby/object:Gem::Version
45
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rdoc
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: thin
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
46
110
  description: Universal knife verbs that work with your Chef repository
47
111
  email: jkeiser@opscode.com
48
112
  executables: []
@@ -151,9 +215,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
215
  required_rubygems_version: !ruby/object:Gem::Requirement
152
216
  none: false
153
217
  requirements:
154
- - - ! '>'
218
+ - - ! '>='
155
219
  - !ruby/object:Gem::Version
156
- version: 1.3.1
220
+ version: '0'
157
221
  requirements: []
158
222
  rubyforge_project:
159
223
  rubygems_version: 1.8.23