delano-sysinfo 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGES.txt +7 -0
  2. data/README.rdoc +61 -2
  3. data/Rakefile +1 -1
  4. data/bin/sysinfo +42 -2
  5. data/sysinfo.gemspec +2 -1
  6. metadata +12 -2
data/CHANGES.txt CHANGED
@@ -1,6 +1,13 @@
1
1
  SYSINFO, CHANGES
2
2
 
3
3
 
4
+ #### 0.6.0 (2009-06-09) ###############################
5
+
6
+ * CHANGE: "universal" mapped to "i386". Now: "x86_64"
7
+ * CHANGE: "x86" mapped to "386". Now: "x86"
8
+ * CHANGE: /i\d86/ mapped to "386". Now: "x86"
9
+
10
+
4
11
  #### 0.5.1 (2009-05-07) ###############################
5
12
 
6
13
  * CHANGE: Hella cleanup in preparation for future expansion.
data/README.rdoc CHANGED
@@ -1,7 +1,66 @@
1
- = SysInfo - v0.5
1
+ = SysInfo - v0.6
2
2
 
3
3
  All your system-independent infoz in one handy class.
4
4
 
5
+ SysInfo does a takes a very quick glance at the system it's running on and exposes the results as YAML, JSON, CSV, or TSV. It also determines a platform identifier for the system that takes the form: VM-OS-IMPLEMENTATION-ARCHITECTURE.
6
+
7
+ === Platform Identifier Examples
8
+
9
+ ruby-unix-osx-i386
10
+ ruby-unix-osx-powerpc
11
+ ruby-unix-linux-x86_64
12
+ java-win32-windows-i386
13
+ java-win32-mingw-i386
14
+
15
+ For the complete list of operating systems, implementations and architectures that SysInfo is aware of, see:
16
+
17
+ * <tt>$ sysinfo os</tt>
18
+ * <tt>$ sysinfo impl</tt>
19
+ * <tt>$ sysinfo arch</tt>
20
+
21
+ == Usage -- Library
22
+
23
+ sysinfo = SysInfo.new
24
+ p sysinfo.vm # => ruby
25
+ p sysinfo.os # => unix
26
+ p sysinfo.impl # => osx
27
+ p sysinfo.arch # => i386
28
+ p sysinfo.platform # => ruby-unix
29
+ p sysinfo.to_s # => ruby-unix-osx-i386
30
+
31
+ p sysinfo.user # => delano
32
+ p sysinfo.home # => /Users/delano
33
+ p sysinfo.uptime # => 290.429 (hours)
34
+ p sysinfo.shell # => /bin/bash
35
+ p sysinfo.paths # => [/sbin, /bin, /usr/bin, ...]
36
+
37
+ p sysinfo.hostname # => walter
38
+ p sysinfo.ipaddress_internal # => 10.0.1.2
39
+ p sysinfo.uptime # => 290.573655656974
40
+ p sysinfo.ruby # => [1,9,1]
41
+
42
+ == Usage -- Executable
43
+
44
+ $ sysinfo
45
+ ruby-unix-osx-i386
46
+
47
+ $ /usr/jruby/bin/sysinfo
48
+ java-unix-osx-x86_64
49
+
50
+ $ sysinfo -f yaml
51
+ :vm: :ruby
52
+ :os: :unix
53
+ :impl: :osx
54
+ ...
55
+ :shell: :"/bin/bash"
56
+ :user: delano
57
+
58
+ $ sysinfo -f json
59
+ {"vm":"ruby","os":"unix","impl":"osx", ..., "shell":"\/bin\/bash","user":"delano"}
60
+
61
+ $ sysinfo -f csv
62
+ ruby,unix,osx, ... /bin/bash,delano
63
+
5
64
  == Installation
6
65
 
7
66
  Via Rubygems, one of:
@@ -12,7 +71,7 @@ Via Rubygems, one of:
12
71
  or via download:
13
72
  * sysinfo-latest.tar.gz[http://github.com/delano/sysinfo/tarball/latest]
14
73
  * sysinfo-latest.zip[http://github.com/delano/sysinfo/zipball/latest]
15
-
74
+
16
75
  == Prerequisites
17
76
 
18
77
  * Ruby 1.8, Ruby 1.9, or JRuby 1.2
data/Rakefile CHANGED
@@ -74,7 +74,7 @@ Rake::RDocTask.new do |t|
74
74
  t.rdoc_files.include(LICENSE)
75
75
  t.rdoc_files.include(README)
76
76
  t.rdoc_files.include(CHANGES)
77
- #t.rdoc_files.include('bin/*')
77
+ t.rdoc_files.include('bin/*')
78
78
  t.rdoc_files.include('lib/**/*.rb')
79
79
  end
80
80
 
data/bin/sysinfo CHANGED
@@ -14,7 +14,7 @@ require 'rubygems'
14
14
  require 'drydock'
15
15
  require 'sysinfo'
16
16
 
17
- module SysInfoCLI
17
+ module SysInfoCLI #:nodoc:
18
18
  extend Drydock
19
19
 
20
20
  debug :off
@@ -27,6 +27,7 @@ module SysInfoCLI
27
27
  exit 0
28
28
  end
29
29
 
30
+ about "Display system information"
30
31
  command :info do |obj|
31
32
  format = obj.global.format || :string
32
33
  format = :yaml if obj.global.verbose == true
@@ -34,4 +35,43 @@ module SysInfoCLI
34
35
  puts si.dump(format)
35
36
  end
36
37
 
37
- end
38
+ about "Display list of known architectures"
39
+ command :arch do |obj|
40
+ arch = SysInfo::ARCHITECTURES.collect { |arch|
41
+ next if arch[0].nil?
42
+ obj.global.verbose == true ? "%-15s -> %s" % [arch[1], arch[0].source] : arch[1]
43
+ }
44
+ puts arch.compact
45
+ end
46
+ command_alias :arch, :architectures
47
+
48
+ about "Display list of known OS implementations"
49
+ command :impl do |obj|
50
+ reorg = {}
51
+ SysInfo::IMPLEMENTATIONS.each do |arch|
52
+ next if arch[0].nil?
53
+ reorg.store(arch[2].to_s, arch[0])
54
+ end
55
+ impl = reorg.keys.sort.collect do |key|
56
+ obj.global.verbose == true ? "%-15s -> %s" % [key, reorg[key].source] : key
57
+ end
58
+ puts impl.compact.uniq
59
+ end
60
+ command_alias :impl, :implementations
61
+
62
+ about "Display list of known operating systems (OS)"
63
+ command :os do |obj|
64
+ reorg = {}
65
+ SysInfo::IMPLEMENTATIONS.each do |arch|
66
+ next if arch[0].nil?
67
+ reorg.store(arch[1].to_s, arch[0])
68
+ end
69
+ impl = reorg.keys.sort.collect do |key|
70
+ obj.global.verbose == true ? "%-15s -> %s" % [key, reorg[key].source] : key
71
+ end
72
+ puts impl.compact.uniq
73
+ end
74
+
75
+ end
76
+
77
+
data/sysinfo.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "sysinfo"
3
3
  s.rubyforge_project = "sysinfo"
4
- s.version = "0.5.1"
4
+ s.version = "0.6.0"
5
5
  s.summary = "SysInfo: All your system-independent infoz in one handy class. "
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
@@ -17,6 +17,7 @@
17
17
  # = DEPENDENCIES =
18
18
  # Add all gem dependencies
19
19
  s.add_dependency 'storable', '>= 0.5.1'
20
+ s.add_dependency 'drydock', '>= 0.6.3'
20
21
 
21
22
  # = MANIFEST =
22
23
  # The complete list of files to be included in the release. When GitHub packages your gem,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delano-sysinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 -07:00
12
+ date: 2009-05-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,6 +22,16 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.5.1
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: drydock
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.3
34
+ version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: RedCloth
27
37
  type: :runtime