opscode-ohai 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +56 -0
  3. data/Rakefile +58 -0
  4. data/bin/ohai +58 -0
  5. data/lib/ohai.rb +27 -0
  6. data/lib/ohai/config.rb +118 -0
  7. data/lib/ohai/exception.rb +23 -0
  8. data/lib/ohai/log.rb +89 -0
  9. data/lib/ohai/log/formatter.rb +57 -0
  10. data/lib/ohai/mixin/command.rb +198 -0
  11. data/lib/ohai/mixin/from_file.rb +36 -0
  12. data/lib/ohai/plugins/command.rb +19 -0
  13. data/lib/ohai/plugins/darwin/hostname.rb +20 -0
  14. data/lib/ohai/plugins/darwin/kernel.rb +31 -0
  15. data/lib/ohai/plugins/darwin/network.rb +154 -0
  16. data/lib/ohai/plugins/darwin/platform.rb +34 -0
  17. data/lib/ohai/plugins/darwin/ps.rb +21 -0
  18. data/lib/ohai/plugins/darwin/ssh_host_key.rb +24 -0
  19. data/lib/ohai/plugins/ec2.rb +41 -0
  20. data/lib/ohai/plugins/hostname.rb +23 -0
  21. data/lib/ohai/plugins/kernel.rb +24 -0
  22. data/lib/ohai/plugins/keys.rb +20 -0
  23. data/lib/ohai/plugins/languages.rb +19 -0
  24. data/lib/ohai/plugins/linux/block_device.rb +36 -0
  25. data/lib/ohai/plugins/linux/cpu.rb +58 -0
  26. data/lib/ohai/plugins/linux/filesystem.rb +55 -0
  27. data/lib/ohai/plugins/linux/hostname.rb +20 -0
  28. data/lib/ohai/plugins/linux/kernel.rb +31 -0
  29. data/lib/ohai/plugins/linux/lsb.rb +36 -0
  30. data/lib/ohai/plugins/linux/memory.rb +81 -0
  31. data/lib/ohai/plugins/linux/network.rb +103 -0
  32. data/lib/ohai/plugins/linux/platform.rb +41 -0
  33. data/lib/ohai/plugins/linux/ps.rb +21 -0
  34. data/lib/ohai/plugins/linux/ssh_host_key.rb +24 -0
  35. data/lib/ohai/plugins/linux/uptime.rb +26 -0
  36. data/lib/ohai/plugins/network.rb +48 -0
  37. data/lib/ohai/plugins/ohai_time.rb +19 -0
  38. data/lib/ohai/plugins/os.rb +34 -0
  39. data/lib/ohai/plugins/platform.rb +23 -0
  40. data/lib/ohai/plugins/ruby.rb +33 -0
  41. data/lib/ohai/plugins/uptime.rb +42 -0
  42. data/lib/ohai/system.rb +163 -0
  43. data/spec/ohai/log/log_formatter_spec.rb +50 -0
  44. data/spec/ohai/log_spec.rb +63 -0
  45. data/spec/ohai/mixin/from_file_spec.rb +53 -0
  46. data/spec/ohai/plugins/darwin/hostname_spec.rb +34 -0
  47. data/spec/ohai/plugins/darwin/kernel_spec.rb +35 -0
  48. data/spec/ohai/plugins/darwin/platform_spec.rb +67 -0
  49. data/spec/ohai/plugins/hostname_spec.rb +33 -0
  50. data/spec/ohai/plugins/kernel_spec.rb +41 -0
  51. data/spec/ohai/plugins/linux/cpu_spec.rb +128 -0
  52. data/spec/ohai/plugins/linux/hostname_spec.rb +34 -0
  53. data/spec/ohai/plugins/linux/kernel_spec.rb +31 -0
  54. data/spec/ohai/plugins/linux/lsb_spec.rb +59 -0
  55. data/spec/ohai/plugins/linux/platform_spec.rb +51 -0
  56. data/spec/ohai/plugins/linux/uptime_spec.rb +61 -0
  57. data/spec/ohai/plugins/ohai_time_spec.rb +46 -0
  58. data/spec/ohai/plugins/os_spec.rb +58 -0
  59. data/spec/ohai/plugins/platform_spec.rb +56 -0
  60. data/spec/ohai/plugins/ruby_spec.rb +49 -0
  61. data/spec/ohai/system_spec.rb +130 -0
  62. data/spec/ohai_spec.rb +27 -0
  63. data/spec/rcov.opts +2 -0
  64. data/spec/spec.opts +2 -0
  65. data/spec/spec_helper.rb +47 -0
  66. metadata +138 -0
@@ -0,0 +1,27 @@
1
+ #
2
+ # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Copyright:: Copyright (c) 2008 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 File.dirname(__FILE__) + '/spec_helper.rb'
20
+
21
+ describe Ohai do
22
+
23
+ it "should have a version constant defined" do
24
+ Ohai::VERSION.should be_a_kind_of(String)
25
+ end
26
+
27
+ end
@@ -0,0 +1,2 @@
1
+ --exclude
2
+ spec,bin,/Library/Ruby
@@ -0,0 +1,2 @@
1
+ --format specdoc
2
+ --colour
@@ -0,0 +1,47 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
10
+ require 'ohai'
11
+ Ohai::Config[:log_level] = :error
12
+
13
+ def it_should_check_from(plugin, attribute, from, value)
14
+ it "should get the #{attribute} value from '#{from}'" do
15
+ @ohai.should_receive(:from).with(from).and_return(value)
16
+ @ohai._require_plugin(plugin)
17
+ end
18
+
19
+ it "should set the #{attribute} to the value from '#{from}'" do
20
+ @ohai._require_plugin(plugin)
21
+ @ohai[attribute].should == value
22
+ end
23
+ end
24
+
25
+ def it_should_check_from_mash(plugin, attribute, from, value)
26
+ it "should get the #{plugin}[:#{attribute}] value from '#{from}'" do
27
+ @ohai.should_receive(:from).with(from).and_return(value)
28
+ @ohai._require_plugin(plugin)
29
+ end
30
+
31
+ it "should set the #{plugin}[:#{attribute}] to the value from '#{from}'" do
32
+ @ohai._require_plugin(plugin)
33
+ @ohai[plugin][attribute].should == value
34
+ end
35
+ end
36
+
37
+ def it_should_check_from_deep_mash(plugin, mash, attribute, from, value)
38
+ it "should get the #{mash}[:#{attribute}] value from '#{from}'" do
39
+ @ohai.should_receive(:from).with(from).and_return(value)
40
+ @ohai._require_plugin(plugin)
41
+ end
42
+
43
+ it "should set the #{mash}[:#{attribute}] to the value from '#{from}'" do
44
+ @ohai._require_plugin(plugin)
45
+ @ohai[mash][attribute].should == value
46
+ end
47
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opscode-ohai
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Adam Jacob
8
+ autorequire: ohai
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-15 00:00:00 -08:00
13
+ default_executable: ohai
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: json
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: Ohai profiles your system and emits JSON
25
+ email: adam@opscode.com
26
+ executables:
27
+ - ohai
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - LICENSE
34
+ - README.rdoc
35
+ - Rakefile
36
+ - extras/facter.rb
37
+ - lib/ohai
38
+ - lib/ohai/config.rb
39
+ - lib/ohai/exception.rb
40
+ - lib/ohai/log
41
+ - lib/ohai/log/formatter.rb
42
+ - lib/ohai/log.rb
43
+ - lib/ohai/mixin
44
+ - lib/ohai/mixin/command.rb
45
+ - lib/ohai/mixin/from_file.rb
46
+ - lib/ohai/plugins
47
+ - lib/ohai/plugins/command.rb
48
+ - lib/ohai/plugins/darwin
49
+ - lib/ohai/plugins/darwin/hostname.rb
50
+ - lib/ohai/plugins/darwin/kernel.rb
51
+ - lib/ohai/plugins/darwin/network.rb
52
+ - lib/ohai/plugins/darwin/platform.rb
53
+ - lib/ohai/plugins/darwin/ps.rb
54
+ - lib/ohai/plugins/darwin/ssh_host_key.rb
55
+ - lib/ohai/plugins/hostname.rb
56
+ - lib/ohai/plugins/kernel.rb
57
+ - lib/ohai/plugins/keys.rb
58
+ - lib/ohai/plugins/languages.rb
59
+ - lib/ohai/plugins/linux
60
+ - lib/ohai/plugins/linux/block_device.rb
61
+ - lib/ohai/plugins/linux/cpu.rb
62
+ - lib/ohai/plugins/linux/filesystem.rb
63
+ - lib/ohai/plugins/linux/hostname.rb
64
+ - lib/ohai/plugins/linux/kernel.rb
65
+ - lib/ohai/plugins/linux/lsb.rb
66
+ - lib/ohai/plugins/linux/memory.rb
67
+ - lib/ohai/plugins/linux/network.rb
68
+ - lib/ohai/plugins/linux/platform.rb
69
+ - lib/ohai/plugins/linux/ps.rb
70
+ - lib/ohai/plugins/linux/ssh_host_key.rb
71
+ - lib/ohai/plugins/linux/uptime.rb
72
+ - lib/ohai/plugins/ec2.rb
73
+ - lib/ohai/plugins/network.rb
74
+ - lib/ohai/plugins/ohai_time.rb
75
+ - lib/ohai/plugins/os.rb
76
+ - lib/ohai/plugins/platform.rb
77
+ - lib/ohai/plugins/ruby.rb
78
+ - lib/ohai/plugins/uptime.rb
79
+ - lib/ohai/system.rb
80
+ - lib/ohai.rb
81
+ - spec/ohai
82
+ - spec/ohai/log
83
+ - spec/ohai/log/log_formatter_spec.rb
84
+ - spec/ohai/log_spec.rb
85
+ - spec/ohai/mixin
86
+ - spec/ohai/mixin/from_file_spec.rb
87
+ - spec/ohai/plugins
88
+ - spec/ohai/plugins/darwin
89
+ - spec/ohai/plugins/darwin/hostname_spec.rb
90
+ - spec/ohai/plugins/darwin/kernel_spec.rb
91
+ - spec/ohai/plugins/darwin/platform_spec.rb
92
+ - spec/ohai/plugins/hostname_spec.rb
93
+ - spec/ohai/plugins/kernel_spec.rb
94
+ - spec/ohai/plugins/linux
95
+ - spec/ohai/plugins/linux/cpu_spec.rb
96
+ - spec/ohai/plugins/linux/hostname_spec.rb
97
+ - spec/ohai/plugins/linux/kernel_spec.rb
98
+ - spec/ohai/plugins/linux/lsb_spec.rb
99
+ - spec/ohai/plugins/linux/platform_spec.rb
100
+ - spec/ohai/plugins/linux/uptime_spec.rb
101
+ - spec/ohai/plugins/ohai_time_spec.rb
102
+ - spec/ohai/plugins/os_spec.rb
103
+ - spec/ohai/plugins/platform_spec.rb
104
+ - spec/ohai/plugins/ruby_spec.rb
105
+ - spec/ohai/system_spec.rb
106
+ - spec/ohai_spec.rb
107
+ - spec/rcov.opts
108
+ - spec/spec.opts
109
+ - spec/spec_helper.rb
110
+ - bin/ohai
111
+ has_rdoc: true
112
+ homepage: http://wiki.opscode.com/display/ohai
113
+ post_install_message:
114
+ rdoc_options: []
115
+
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: "0"
123
+ version:
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: "0"
129
+ version:
130
+ requirements: []
131
+
132
+ rubyforge_project:
133
+ rubygems_version: 1.2.0
134
+ signing_key:
135
+ specification_version: 2
136
+ summary: Ohai profiles your system and emits JSON
137
+ test_files: []
138
+