scoobydoo 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/scoobydoo.rb +21 -0
  3. metadata +45 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ae5a44b2fcb58015c64b5ae631a49343a463859
4
+ data.tar.gz: e542146b178fee79e4404cbaf6e46c787ebc0b94
5
+ SHA512:
6
+ metadata.gz: ed07a04c983495c6848d0d43bef8ccf7e4f1c17e84b59406c5a9397609e0145d04afafa839b6075ee55ae263067057b3d1b83de1627f8dad18a6e6b43d21174f
7
+ data.tar.gz: ded16793ba8b7534d1cf82ebea1e966156c633ae0398a96921d92c1fcecbed7a765accff0d27bc5c90c103ddb911b212fb7345e0ff41f52b65cdbcdc3489929c
@@ -0,0 +1,21 @@
1
+ require "pathname"
2
+
3
+ class ScoobyDoo
4
+ def self.where_are_you(cmd)
5
+ if (cmd.include?(File::PATH_SEPARATOR))
6
+ exe = Pathname.new(cmd).expand_path
7
+ return (exe.executable? && !exe.directory?) ? exe : nil
8
+ end
9
+
10
+ exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
11
+ ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
12
+ exts.each do |ext|
13
+ exe = File.join(path, "#{cmd}#{ext}")
14
+ if (File.executable?(exe) && !File.directory?(exe))
15
+ return exe
16
+ end
17
+ end
18
+ end
19
+ return nil
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scoobydoo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Miles Whittaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Cross-platform which for ruby.
14
+ email: mjwhitta@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/scoobydoo.rb
20
+ homepage: http://mjwhitta.github.io/scoobydoo
21
+ licenses:
22
+ - GPL-3.0
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.8
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Cross-platform which for ruby
44
+ test_files: []
45
+ has_rdoc: