sys-uname 1.0.4 → 1.2.2

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.
@@ -2,24 +2,26 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-uname'
5
- spec.version = '1.0.4'
5
+ spec.version = '1.2.2'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.email = 'djberg96@gmail.com'
8
8
  spec.homepage = 'http://github.com/djberg96/sys-uname'
9
9
  spec.summary = 'An interface for returning uname (platform) information'
10
- spec.license = 'Artistic-2.0'
10
+ spec.license = 'Apache-2.0'
11
11
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
12
- spec.test_files = Dir['test/test*.rb']
12
+ spec.test_files = Dir['spec/*_spec.rb']
13
13
  spec.cert_chain = ['certs/djberg96_pub.pem']
14
14
 
15
- spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST', 'doc/uname.txt']
15
+ spec.extra_rdoc_files = Dir['doc/*.rdoc']
16
16
 
17
- spec.add_dependency('ffi', '>= 1.0.0')
17
+ spec.add_dependency('ffi', '~> 1.1')
18
+ spec.add_development_dependency('rspec', '~> 3.9')
19
+ spec.add_development_dependency('rake')
18
20
 
19
21
  spec.metadata = {
20
22
  'homepage_uri' => 'https://github.com/djberg96/sys-uname',
21
23
  'bug_tracker_uri' => 'https://github.com/djberg96/sys-uname/issues',
22
- 'changelog_uri' => 'https://github.com/djberg96/sys-uname/blob/ffi/CHANGES',
24
+ 'changelog_uri' => 'https://github.com/djberg96/sys-uname/blob/ffi/CHANGES.md',
23
25
  'documentation_uri' => 'https://github.com/djberg96/sys-uname/wiki',
24
26
  'source_code_uri' => 'https://github.com/djberg96/sys-uname',
25
27
  'wiki_uri' => 'https://github.com/djberg96/sys-uname/wiki'
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-uname
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -35,22 +35,50 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2018-11-04 00:00:00.000000000 Z
38
+ date: 2020-10-30 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.0
46
+ version: '1.1'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.1'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rspec
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.9'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.9'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rake
70
+ requirement: !ruby/object:Gem::Requirement
50
71
  requirements:
51
72
  - - ">="
52
73
  - !ruby/object:Gem::Version
53
- version: 1.0.0
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
54
82
  description: |2
55
83
  The sys-uname library provides an interface for gathering information
56
84
  about your current platform. The library is named after the Unix 'uname'
@@ -61,45 +89,36 @@ email: djberg96@gmail.com
61
89
  executables: []
62
90
  extensions: []
63
91
  extra_rdoc_files:
64
- - CHANGES
65
- - README
66
- - MANIFEST
67
- - doc/uname.txt
92
+ - doc/uname.rdoc
68
93
  files:
69
- - CHANGES
70
- - test
71
- - test/test_sys_uname.rb
72
- - test/test_sys_platform.rb
73
- - examples
74
- - examples/uname_test.rb
75
- - doc
76
- - doc/uname.txt
77
- - sys-uname.gemspec
78
- - README
94
+ - CHANGES.md
95
+ - Gemfile
96
+ - LICENSE
97
+ - MANIFEST.md
98
+ - README.md
79
99
  - Rakefile
80
- - MANIFEST
81
- - lib
100
+ - certs/djberg96_pub.pem
101
+ - doc/uname.rdoc
102
+ - examples/uname_test.rb
82
103
  - lib/sys-uname.rb
83
- - lib/sys
84
104
  - lib/sys/platform.rb
85
- - lib/sys/windows
86
- - lib/sys/windows/uname.rb
87
105
  - lib/sys/uname.rb
88
- - lib/sys/unix
89
106
  - lib/sys/unix/uname.rb
90
- - certs
91
- - certs/djberg96_pub.pem
107
+ - lib/sys/windows/uname.rb
108
+ - spec/sys_platform_spec.rb
109
+ - spec/sys_uname_spec.rb
110
+ - sys-uname.gemspec
92
111
  homepage: http://github.com/djberg96/sys-uname
93
112
  licenses:
94
- - Artistic-2.0
113
+ - Apache-2.0
95
114
  metadata:
96
115
  homepage_uri: https://github.com/djberg96/sys-uname
97
116
  bug_tracker_uri: https://github.com/djberg96/sys-uname/issues
98
- changelog_uri: https://github.com/djberg96/sys-uname/blob/ffi/CHANGES
117
+ changelog_uri: https://github.com/djberg96/sys-uname/blob/ffi/CHANGES.md
99
118
  documentation_uri: https://github.com/djberg96/sys-uname/wiki
100
119
  source_code_uri: https://github.com/djberg96/sys-uname
101
120
  wiki_uri: https://github.com/djberg96/sys-uname/wiki
102
- post_install_message:
121
+ post_install_message:
103
122
  rdoc_options: []
104
123
  require_paths:
105
124
  - lib
@@ -114,11 +133,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
133
  - !ruby/object:Gem::Version
115
134
  version: '0'
116
135
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.7.6
119
- signing_key:
136
+ rubygems_version: 3.1.4
137
+ signing_key:
120
138
  specification_version: 4
121
139
  summary: An interface for returning uname (platform) information
122
140
  test_files:
123
- - test/test_sys_uname.rb
124
- - test/test_sys_platform.rb
141
+ - spec/sys_uname_spec.rb
142
+ - spec/sys_platform_spec.rb
metadata.gz.sig CHANGED
Binary file
data/MANIFEST DELETED
@@ -1,12 +0,0 @@
1
- * MANIFEST
2
- * CHANGES
3
- * README
4
- * Rakefile
5
- * sys-uname.gemspec
6
- * certs/djberg96_pub.pem
7
- * doc/uname.txt
8
- * examples/uname_test.rb
9
- * ext/extconf.rb
10
- * ext/uname.c
11
- * lib/sys/uname.rb
12
- * test/tc_uname.rb
data/README DELETED
@@ -1,51 +0,0 @@
1
- = Description
2
- A Ruby interface for getting operating system information. The name comes
3
- from the Unix 'uname' command, but this library works on MS Windows as well.
4
-
5
- = Prerequisites
6
- ffi 1.0 or later
7
-
8
- = Installation
9
- gem install sys-uname
10
-
11
- = Synopsis
12
- require 'sys/uname' # require 'sys-uname' works, too
13
-
14
- # You now have Sys::Uname and Sys::Platform classes available.
15
-
16
- # Get full information about your system
17
- p Sys::Uname.uname
18
-
19
- # Check individual platform details about your system
20
- p Sys::Platform.linux? # => true
21
- p Sys::Platform::ARCH # => :x86_64
22
-
23
- = Solaris Notes
24
- Users on SunOS get several extra methods: architecture, platform,
25
- hw_serial, hw_provider, srpc_domain, isa_list, and dhcp_cache.
26
-
27
- = BSD flavors, including OS X
28
- Users on BSD platforms get the extra Uname.model method.
29
-
30
- = HP-UX Notes
31
- HP-UX users get the extra Uname.id_number method. This is actually a
32
- String, not a Fixnum, because that's how it's defined in the utsname
33
- struct.
34
-
35
- = MS Windows Notes
36
- The C version for Windows has been completely scrapped in favor of an OLE
37
- plus WMI approach. It is pure Ruby. Please see the MSDN documentation for
38
- the Win32_OperatingSystem class for a complete list of what each of the
39
- UnameStruct members mean.
40
-
41
- = The Platform Class
42
- This was added both as a nicer way to check simple information about your
43
- system, and as a replacement for the old 'Platform' gem which is no longer
44
- maintained.
45
-
46
- = Future Plans
47
- I may dump the "Uname" portion of this library, and rename the project
48
- to just sys-platform.
49
-
50
- = Documentation
51
- For more details, see the 'uname.txt' file under the 'doc' directory.
@@ -1,127 +0,0 @@
1
- == Description
2
- A Ruby interface for getting operating system information. The name comes
3
- from the Unix 'uname' command, but this library works on Windows as well.
4
-
5
- == Synopsis
6
- require 'sys/uname'
7
- include Sys
8
-
9
- # Unix
10
- puts Uname.nodename => my_host
11
- puts Uname.version => #1 Fri Oct 24 22:43:28 MDT 2003
12
- puts Uname.sysname => Linux
13
- puts Uname.machine => i686
14
- puts Uname.release => 2.4.22-21mdk
15
-
16
- p Uname.uname => Show all UnameStruct members
17
-
18
- # Windows
19
- u = Uname.uname
20
- puts u.caption => 'Microsoft Windows XP Home Edition
21
- puts u.csd_version => 'Service Pack 2'
22
-
23
- == Constants
24
- VERSION
25
- The current version number of the sys-uname library. This is a String.
26
-
27
- == Class Methods
28
- Uname.sysname
29
- Returns the operating system name. e.g. "SunOS"
30
-
31
- Uname.nodename
32
- Returns the nodename. This is usually, but not necessarily, the
33
- same as the system's hostname.
34
-
35
- You cannot currently set the nodename (root or otherwise). This may
36
- be added in a future release.
37
-
38
- Uname.machine
39
- Returns the machine hardware type. e.g. "i686"
40
-
41
- Uname.version
42
- Returns the operating system version. e.g. "5.8". In the case of MS
43
- Windows, it returns the version plus patch information, separated by
44
- a hyphen, e.g. "2915-Service Pack 2".
45
-
46
- Uname.release
47
- Returns the operating system release. e.g. "2.2.16-3"
48
-
49
- Uname.uname
50
- Returns a struct of type UnameStruct that contains sysname, nodename,
51
- machine, version, and release. On Solaris, it will also include
52
- architecture and platform. On HP-UX, it will also include id_number.
53
-
54
- MS Windows - there are many more, and different, fields in the struct.
55
- Please see the MSDN documenation on the Win32_OperatingSystem WMI class
56
- for a complete explanation of what each of these members mean.
57
-
58
- == Solaris Only
59
- Uname.architecture
60
- Returns the instruction set architecture. e.g. "sparc"
61
-
62
- Uname.platform
63
- Returns the platform identifier. e.g. "SUNW,Sun-Blade-100"
64
-
65
- Uname.isa_list
66
- Returns a space separated string containing a list of all variant
67
- instruction set architectures executable on the current system.
68
-
69
- They are listed in order of performance, from best to worst.
70
-
71
- Uname.hw_provider
72
- Returns the name of the hardware manufacturer.
73
-
74
- Uname.hw_serial_number
75
- Returns the ASCII representation of the hardware-specific serial number
76
- of the machine that executes the function.
77
-
78
- Uname.srpc_domain
79
- Returns the name of the Secure Remote Procedure Call domain, if any.
80
-
81
- Uname.dhcp_cache
82
- Returns a hexidecimal encoding, in String form, of the name of the
83
- interface configured by boot(1M) followed by the DHCPACK reply from
84
- the server.
85
-
86
- == BSD Platforms Only (including OS X)
87
- Uname.model
88
- Returns the model type, e.g. "PowerBook5,1"
89
-
90
- == HP-UX Only
91
- Uname.id
92
- Returns the id number, e.g. 234233587. This is a String, not a Fixnum.
93
-
94
- == Notes
95
- Not all of the information that you might be used to seeing with
96
- a 'uname -a' is available. This may be added in future releases,
97
- but since different implementations provide different information
98
- (via different header files) it will be a bit of a pain.
99
-
100
- Windows users - please see the MSDN documentation for the
101
- Win32_OperatingSystem class for a complete list of what each of the
102
- UnameStruct members mean.
103
-
104
- == Known Bugs
105
- None that I'm aware of. Please log any bugs on the project page at
106
- http://www.rubyforge.org/projects/sysutils.
107
-
108
- == Future Plans
109
- Add additional info for Linux, Solaris, BSD.
110
-
111
- == License
112
- Artistic 2.0
113
-
114
- == Copyright
115
- (C) 2002-2013 Daniel J. Berger
116
- All Rights Reserved
117
-
118
- == Warranty
119
- This package is provided "as is" and without any express or
120
- implied warranties, including, without limitation, the implied
121
- warranties of merchantability and fitness for a particular purpose.
122
-
123
- == Author
124
- Daniel Berger
125
-
126
- == See Also
127
- uname(1) for unix, or WMI for MS Windows.
@@ -1,79 +0,0 @@
1
- ##############################################################################
2
- # test_sys_platform.rb
3
- #
4
- # Test suite for the Sys::Platform class.
5
- ##############################################################################
6
- require 'test-unit'
7
- require 'sys/uname'
8
- require 'rbconfig'
9
-
10
- class TC_Sys_Platform < Test::Unit::TestCase
11
- def self.startup
12
- @@host_os = RbConfig::CONFIG['host_os']
13
- @@windows = @@host_os =~ /mingw|mswin|windows/i ? true : false
14
- end
15
-
16
- test "the VERSION constant is set to the expected value" do
17
- assert_equal('1.0.4', Sys::Platform::VERSION)
18
- end
19
-
20
- test "the ARCH constant is defined" do
21
- assert_kind_of(Symbol, Sys::Platform::ARCH)
22
- end
23
-
24
- test "the OS constant is defined" do
25
- assert_kind_of(Symbol, Sys::Platform::OS)
26
- end
27
-
28
- test "the IMPL constant is defined" do
29
- assert_kind_of(Symbol, Sys::Platform::IMPL)
30
- end
31
-
32
- test "the IMPL returns an expected value" do
33
- omit_unless(@@windows)
34
- assert_true([:mingw, :mswin].include?(Sys::Platform::IMPL))
35
- end
36
-
37
- test "the mac? method is defined and returns a boolean" do
38
- assert_respond_to(Sys::Platform, :mac?)
39
- assert_boolean(Sys::Platform.mac?)
40
- end
41
-
42
- test "the windows? method is defined and returns a boolean" do
43
- assert_respond_to(Sys::Platform, :windows?)
44
- assert_boolean(Sys::Platform.windows?)
45
- end
46
-
47
- test "the windows? method returns the expected value" do
48
- assert_equal(Sys::Platform.windows?, @@windows)
49
- end
50
-
51
- test "the unix? method is defined and returns a boolean" do
52
- assert_respond_to(Sys::Platform, :unix?)
53
- assert_boolean(Sys::Platform.unix?)
54
- end
55
-
56
- test "the unix? method returns the expected value" do
57
- assert_equal(Sys::Platform.unix?, !@@windows)
58
- end
59
-
60
- test "the solaris? method is defined and returns a boolean" do
61
- assert_respond_to(Sys::Platform, :solaris?)
62
- assert_boolean(Sys::Platform.solaris?)
63
- end
64
-
65
- test "the linux? method is defined and returns a boolean" do
66
- assert_respond_to(Sys::Platform, :linux?)
67
- assert_boolean(Sys::Platform.linux?)
68
- end
69
-
70
- test "the bsd? method is defined and returns a boolean" do
71
- assert_respond_to(Sys::Platform, :bsd?)
72
- assert_boolean(Sys::Platform.bsd?)
73
- end
74
-
75
- def self.shutdown
76
- @@host_os = nil
77
- @@windows = nil
78
- end
79
- end