whereis 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +24 -0
  3. data/Manifest +5 -0
  4. data/Rakefile +35 -0
  5. data/lib/whereis.rb +31 -0
  6. data/whereis.gemspec +32 -0
  7. metadata +72 -0
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+ gem "sys-uname"
3
+ gem "echoe"
@@ -0,0 +1,24 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ allison (2.0.3)
5
+ echoe (4.6.1)
6
+ allison (>= 2.0.3)
7
+ gemcutter (>= 0.7.0)
8
+ rake (>= 0.9.2)
9
+ rdoc (>= 3.6.1)
10
+ rubyforge (>= 2.0.4)
11
+ gemcutter (0.7.0)
12
+ json_pure (1.5.3)
13
+ rake (0.9.2)
14
+ rdoc (3.8)
15
+ rubyforge (2.0.4)
16
+ json_pure (>= 1.1.7)
17
+ sys-uname (0.8.5)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ echoe
24
+ sys-uname
@@ -0,0 +1,5 @@
1
+ Gemfile
2
+ Gemfile.lock
3
+ Rakefile
4
+ lib/whereis.rb
5
+ Manifest
@@ -0,0 +1,35 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+ require 'fileutils'
5
+
6
+ name = 'whereis'
7
+ version = '1.0'
8
+ Echoe.new(name, version) do |p|
9
+ p.description = "Ruby interface to `whereis` command."
10
+ p.url = "http://github.com/stpettersens/Whereis"
11
+ p.email = "s.stpettersen@gmail.com"
12
+ p.ignore_pattern = []
13
+ p.development_dependencies = []
14
+ p.runtime_dependencies = ["sys-uname"]
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}-#{version}.gem")
34
+ FileUtils.rm("#{name}.gemspec")
35
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # An interface to `whereis` [or `where` on Windows].
3
+ # Copyright (c) 2011 Sam Saint-Pettersen.
4
+ #
5
+ # Released under the MIT/X11 License.
6
+ #
7
+ require 'sys/uname'
8
+ include Sys
9
+
10
+ module Whereis
11
+ def self.whereis(executable)
12
+ whereis = nil
13
+ if Uname.uname['sysname'].match(/.*n[i|u]x/)
14
+ whereis = 'whereis'
15
+ else
16
+ whereis = 'where'
17
+ end
18
+ output = IO.popen("#{whereis} #{executable}")
19
+ output = output.readlines()
20
+ output = output[0].chomp
21
+ return output
22
+ end
23
+ def self.boolean(executable)
24
+ output = self.whereis(executable)
25
+ if output.match(/[\|\/]+/)
26
+ return true
27
+ else
28
+ return false
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{whereis}
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-16}
10
+ s.description = %q{Ruby interface to `whereis` command.}
11
+ s.email = %q{s.stpettersen@gmail.com}
12
+ s.extra_rdoc_files = [%q{lib/whereis.rb}]
13
+ s.files = [%q{Gemfile}, %q{Gemfile.lock}, %q{Rakefile}, %q{lib/whereis.rb}, %q{Manifest}, %q{whereis.gemspec}]
14
+ s.homepage = %q{http://github.com/stpettersens/Whereis}
15
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Whereis}]
16
+ s.require_paths = [%q{lib}]
17
+ s.rubyforge_project = %q{whereis}
18
+ s.rubygems_version = %q{1.8.5}
19
+ s.summary = %q{Ruby interface to `whereis` 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
+ s.add_runtime_dependency(%q<sys-uname>, [">= 0"])
26
+ else
27
+ s.add_dependency(%q<sys-uname>, [">= 0"])
28
+ end
29
+ else
30
+ s.add_dependency(%q<sys-uname>, [">= 0"])
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: whereis
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-16 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sys-uname
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ description: Ruby interface to `whereis` command.
27
+ email: s.stpettersen@gmail.com
28
+ executables: []
29
+
30
+ extensions: []
31
+
32
+ extra_rdoc_files:
33
+ - lib/whereis.rb
34
+ files:
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - Rakefile
38
+ - lib/whereis.rb
39
+ - Manifest
40
+ - whereis.gemspec
41
+ homepage: http://github.com/stpettersens/Whereis
42
+ licenses: []
43
+
44
+ post_install_message:
45
+ rdoc_options:
46
+ - --line-numbers
47
+ - --inline-source
48
+ - --title
49
+ - Whereis
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "1.2"
64
+ requirements: []
65
+
66
+ rubyforge_project: whereis
67
+ rubygems_version: 1.8.5
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: Ruby interface to `whereis` command.
71
+ test_files: []
72
+