uname 1.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/Gemfile +2 -0
  2. data/Manifest +4 -0
  3. data/Rakefile +34 -0
  4. data/lib/uname.rb +34 -0
  5. data/uname.gemspec +29 -0
  6. metadata +61 -0
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gem "echoe"
@@ -0,0 +1,4 @@
1
+ Gemfile
2
+ Rakefile
3
+ lib/uname.rb
4
+ Manifest
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+ require 'fileutils'
5
+
6
+ name = 'uname'
7
+ version = '1.0'
8
+ Echoe.new(name, version) do |p|
9
+ p.description = "Ruby interface to `uname` command."
10
+ p.url = "http://github.com/stpettersens/Uname"
11
+ p.email = "s.stpettersen@gmail.com"
12
+ p.ignore_pattern = []
13
+ p.development_dependencies = []
14
+ p.runtime_dependencies = []
15
+ end
16
+
17
+ task :makegem => [:build_gemspec] do
18
+ puts "Building gem..."
19
+ system("gem build #{name}.gemspec")
20
+ end
21
+
22
+ task :instgem do
23
+ puts "Installing gem..."
24
+ system("gem install #{name}-#{version}")
25
+ end
26
+
27
+ task :all => [:makegem, :instgem, :cleanup] do
28
+ end
29
+
30
+ task :cleanup => [:clobber] do
31
+ puts "Removing everything, including .gemspec"
32
+ FileUtils.rm("Manifest")
33
+ FileUtils.rm("#{name}.gemspec")
34
+ end
@@ -0,0 +1,34 @@
1
+ #
2
+ # Uname module
3
+ # Interface to `uname` [or `ver` on Windows].
4
+ # Copyright (c) 2011 Sam Saint-Pettersen.
5
+ #
6
+ # Released under the MIT/X11 License.
7
+ #
8
+ module Uname
9
+
10
+ # Equivalent to Uname.short, for compatibility with `sys/uname`,
11
+ # which this module was written to replace for compatibility
12
+ # with IronRuby - no C code here ;).
13
+ def self.sysname()
14
+ self.short
15
+ end
16
+
17
+ def self.short()
18
+ self.invokeUname("-s")
19
+ end
20
+ private
21
+ def self.invokeUname(params)
22
+ output = nil
23
+ begin
24
+ output = IO.popen("uname #{params}")
25
+ output = output.readlines
26
+ output = output[0].chomp
27
+ rescue
28
+ output = IO.popen("ver")
29
+ output = output.readlines
30
+ output = output[0].chomp
31
+ end
32
+ return output
33
+ end
34
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{uname}
5
+ s.version = "1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = [%q{}]
9
+ s.date = %q{2011-07-23}
10
+ s.description = %q{Ruby interface to `uname` command.}
11
+ s.email = %q{s.stpettersen@gmail.com}
12
+ s.extra_rdoc_files = [%q{lib/uname.rb}]
13
+ s.files = [%q{Gemfile}, %q{Rakefile}, %q{lib/uname.rb}, %q{Manifest}, %q{uname.gemspec}]
14
+ s.homepage = %q{http://github.com/stpettersens/Uname}
15
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Uname}]
16
+ s.require_paths = [%q{lib}]
17
+ s.rubyforge_project = %q{uname}
18
+ s.rubygems_version = %q{1.8.5}
19
+ s.summary = %q{Ruby interface to `uname` command.}
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ else
26
+ end
27
+ else
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uname
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: "1.0"
6
+ platform: ruby
7
+ authors:
8
+ - ""
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-07-23 00:00:00 Z
14
+ dependencies: []
15
+
16
+ description: Ruby interface to `uname` command.
17
+ email: s.stpettersen@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - lib/uname.rb
24
+ files:
25
+ - Gemfile
26
+ - Rakefile
27
+ - lib/uname.rb
28
+ - Manifest
29
+ - uname.gemspec
30
+ homepage: http://github.com/stpettersens/Uname
31
+ licenses: []
32
+
33
+ post_install_message:
34
+ rdoc_options:
35
+ - --line-numbers
36
+ - --inline-source
37
+ - --title
38
+ - Uname
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "1.2"
53
+ requirements: []
54
+
55
+ rubyforge_project: uname
56
+ rubygems_version: 1.8.5
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Ruby interface to `uname` command.
60
+ test_files: []
61
+