tiny_tds 0.9.5.beta.8 → 0.9.5.beta.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/defncopy +1 -4
  4. data/bin/tsql +1 -4
  5. data/lib/tiny_tds/bin.rb +24 -3
  6. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d48f1c36aa12557e50fbbc8c25bdb51d61e137e2
4
- data.tar.gz: 71f40eda2997b98146c4bf0fb5e522b60df96e3f
3
+ metadata.gz: 7ebb84f30b5cbf5d6ceac3f3bbb5804a56a4b40d
4
+ data.tar.gz: 8c01d7757a794cc320eb94a421bbcc293d15d583
5
5
  SHA512:
6
- metadata.gz: 69ffac95ce98bc4fdb6c06e140514225c89a8a503ba057a13b6628d98c99d8745094bc4999ca91798c02343c44cc2a284de8ba58bbe6ea0360f580f1dc23c432
7
- data.tar.gz: e6873d272426b78d5aa9169800a6be66d2e25898b55d719b429b724eb00af30b4b98c352b81d91ab8a9af37efb39b496824501d4ec540e7f995349003fef4549
6
+ metadata.gz: 2ec05f153a1b5f4a64b3113dfafbc7f8a445a91da1f3ebe5f2244e6839245de783878a2e480b5316fc8b23e1eec62a9fb12801098ba2d7e9f0c913425e98839c
7
+ data.tar.gz: 64eddfff3082ad2917deca6ed98f3ecc1e562ba0e70c44c8c13c204a2c2b00122939cd21d2941c8ed2823980666cf272339b39529ee1488f52a4b04b0e8a6165
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5.beta.8
1
+ 0.9.5.beta.9
data/bin/defncopy CHANGED
@@ -1,6 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require_relative '../lib/tiny_tds/bin'
4
-
5
- bin = TinyTds::Bin.new 'defncopy'
6
- Kernel.system bin.path, *ARGV
3
+ TinyTds::Bin.exe 'defncopy', *ARGV
data/bin/tsql CHANGED
@@ -1,6 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require_relative '../lib/tiny_tds/bin'
4
-
5
- bin = TinyTds::Bin.new 'tsql'
6
- Kernel.system bin.path, *ARGV
3
+ TinyTds::Bin.exe 'tsql', *ARGV
data/lib/tiny_tds/bin.rb CHANGED
@@ -9,11 +9,20 @@ module TinyTds
9
9
 
10
10
  attr_reader :name
11
11
 
12
+ class << self
13
+
14
+ def exe(name, *args)
15
+ bin = new(name)
16
+ puts bin.info
17
+ Kernel.system bin.path, *args if bin.path
18
+ end
19
+
20
+ end
21
+
12
22
  def initialize(name, options = {})
13
23
  @name = name
14
- @binstub = File.join ROOT, 'bin', @name
15
- @exefile = File.join ROOT, 'exe', @name
16
- puts info unless options[:silent]
24
+ @binstub = find_bin
25
+ @exefile = find_exe
17
26
  end
18
27
 
19
28
  def path
@@ -28,6 +37,18 @@ module TinyTds
28
37
 
29
38
  private
30
39
 
40
+ def find_bin
41
+ File.join ROOT, 'bin', @name
42
+ end
43
+
44
+ def find_exe
45
+ EXTS.each do |ext|
46
+ f = File.join ROOT, 'exe', "#{@name}#{ext}"
47
+ return f if File.exists?(f)
48
+ end
49
+ nil
50
+ end
51
+
31
52
  def which
32
53
  PATHS.each do |path|
33
54
  EXTS.each do |ext|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5.beta.8
4
+ version: 0.9.5.beta.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins