tiny_tds 1.3.0-x64-mingw32 → 2.0.0.pre1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -5
- data/BACKERS.md +32 -0
- data/Gemfile +4 -1
- data/README.md +23 -32
- data/Rakefile +26 -83
- data/VERSION +1 -1
- data/appveyor.yml +7 -4
- data/circle.yml +2 -4
- data/ext/tiny_tds/extconf.rb +33 -336
- data/lib/tiny_tds.rb +9 -4
- data/lib/tiny_tds/bin.rb +38 -19
- data/lib/tiny_tds/gem.rb +32 -0
- data/{ports/patches → patches}/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +0 -0
- data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
- data/tasks/native_gem.rake +14 -0
- data/tasks/package.rake +8 -0
- data/tasks/ports.rake +84 -0
- data/tasks/ports/freetds.rb +37 -0
- data/tasks/ports/libiconv.rb +43 -0
- data/tasks/ports/openssl.rb +75 -0
- data/tasks/ports/recipe.rb +52 -0
- data/tasks/test.rake +9 -0
- data/test/bin/install-openssl.sh +2 -2
- data/test/bin/setup.sh +1 -1
- data/test/gem_test.rb +179 -0
- data/test/result_test.rb +2 -2
- metadata +47 -12
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'mini_portile2'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'rbconfig'
|
5
|
+
|
6
|
+
module Ports
|
7
|
+
class Recipe < MiniPortile
|
8
|
+
def cook
|
9
|
+
checkpoint = "ports/#{name}-#{version}-#{host}.installed"
|
10
|
+
|
11
|
+
unless File.exist? checkpoint
|
12
|
+
super
|
13
|
+
FileUtils.touch checkpoint
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def configure_defaults
|
20
|
+
[
|
21
|
+
"--host=#{@host}",
|
22
|
+
'--disable-static',
|
23
|
+
'--enable-shared'
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
def windows?
|
28
|
+
host =~ /mswin|mingw32/
|
29
|
+
end
|
30
|
+
|
31
|
+
def system_host
|
32
|
+
RbConfig::CONFIG['host']
|
33
|
+
end
|
34
|
+
|
35
|
+
def cross_build?
|
36
|
+
host != system_host
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_patches(libname, version)
|
40
|
+
patches = []
|
41
|
+
|
42
|
+
patch_path = File.expand_path(
|
43
|
+
File.join('..','..','..','patches',libname,version),
|
44
|
+
__FILE__
|
45
|
+
)
|
46
|
+
|
47
|
+
patches.concat(Dir[File.join(patch_path, '*.patch')].sort)
|
48
|
+
patches.concat(Dir[File.join(patch_path, '*.diff')].sort)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
data/tasks/test.rake
ADDED
data/test/bin/install-openssl.sh
CHANGED
@@ -10,9 +10,9 @@ fi
|
|
10
10
|
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
11
11
|
tar -xzf openssl-$OPENSSL_VERSION.tar.gz
|
12
12
|
cd openssl-$OPENSSL_VERSION
|
13
|
-
./config --prefix=/
|
13
|
+
./config --prefix=/opt/local --openssldir=/opt/local
|
14
14
|
make
|
15
|
-
make
|
15
|
+
make install_sw install_ssldirs
|
16
16
|
cd ..
|
17
17
|
rm -rf openssl-$OPENSSL_VERSION
|
18
18
|
rm openssl-$OPENSSL_VERSION.tar.gz
|
data/test/bin/setup.sh
CHANGED
data/test/gem_test.rb
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'test_helper'
|
3
|
+
require 'tiny_tds/gem'
|
4
|
+
|
5
|
+
class GemTest < MiniTest::Spec
|
6
|
+
gem_root ||= File.expand_path '../..', __FILE__
|
7
|
+
|
8
|
+
describe TinyTds::Gem do
|
9
|
+
|
10
|
+
# We're going to muck with some system globals so lets make sure
|
11
|
+
# they get set back later
|
12
|
+
original_host = RbConfig::CONFIG['host']
|
13
|
+
original_pwd = Dir.pwd
|
14
|
+
|
15
|
+
after do
|
16
|
+
RbConfig::CONFIG['host'] = original_host
|
17
|
+
Dir.chdir original_pwd
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#root_path' do
|
21
|
+
let(:root_path) { TinyTds::Gem.root_path }
|
22
|
+
|
23
|
+
it 'should be the root path' do
|
24
|
+
root_path.must_equal gem_root
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should be the root path no matter the cwd' do
|
28
|
+
Dir.chdir '/'
|
29
|
+
|
30
|
+
root_path.must_equal gem_root
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#ports_root_path' do
|
35
|
+
let(:ports_root_path) { TinyTds::Gem.ports_root_path }
|
36
|
+
|
37
|
+
it 'should be the ports path' do
|
38
|
+
ports_root_path.must_equal File.join(gem_root,'ports')
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should be the ports path no matter the cwd' do
|
42
|
+
Dir.chdir '/'
|
43
|
+
|
44
|
+
ports_root_path.must_equal File.join(gem_root,'ports')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#ports_bin_paths' do
|
49
|
+
let(:ports_bin_paths) { TinyTds::Gem.ports_bin_paths }
|
50
|
+
|
51
|
+
describe 'when the ports directories exist' do
|
52
|
+
let(:fake_bin_paths) do
|
53
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
54
|
+
[
|
55
|
+
File.join('a','bin'),
|
56
|
+
File.join('a','inner','bin'),
|
57
|
+
File.join('b','bin')
|
58
|
+
].map do |p|
|
59
|
+
File.join(ports_host_root, p)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
before do
|
64
|
+
RbConfig::CONFIG['host'] = 'fake-host-with-dirs'
|
65
|
+
fake_bin_paths.each do |path|
|
66
|
+
FileUtils.mkdir_p(path)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
after do
|
71
|
+
FileUtils.remove_entry_secure(
|
72
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should return all the bin directories' do
|
77
|
+
ports_bin_paths.sort.must_equal fake_bin_paths.sort
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'should return all the bin directories regardless of cwd' do
|
81
|
+
Dir.chdir '/'
|
82
|
+
ports_bin_paths.sort.must_equal fake_bin_paths.sort
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'when the ports directories are missing' do
|
87
|
+
before do
|
88
|
+
RbConfig::CONFIG['host'] = 'fake-host-without-dirs'
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should return no directories' do
|
92
|
+
ports_bin_paths.must_be_empty
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should return no directories regardless of cwd' do
|
96
|
+
Dir.chdir '/'
|
97
|
+
ports_bin_paths.must_be_empty
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#ports_lib_paths' do
|
103
|
+
let(:ports_lib_paths) { TinyTds::Gem.ports_lib_paths }
|
104
|
+
|
105
|
+
describe 'when the ports directories exist' do
|
106
|
+
let(:fake_lib_paths) do
|
107
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
108
|
+
[
|
109
|
+
File.join('a','lib'),
|
110
|
+
File.join('a','inner','lib'),
|
111
|
+
File.join('b','lib')
|
112
|
+
].map do |p|
|
113
|
+
File.join(ports_host_root, p)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
before do
|
118
|
+
RbConfig::CONFIG['host'] = 'fake-host-with-dirs'
|
119
|
+
fake_lib_paths.each do |path|
|
120
|
+
FileUtils.mkdir_p(path)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
after do
|
125
|
+
FileUtils.remove_entry_secure(
|
126
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should return all the lib directories' do
|
131
|
+
ports_lib_paths.sort.must_equal fake_lib_paths.sort
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'should return all the lib directories regardless of cwd' do
|
135
|
+
Dir.chdir '/'
|
136
|
+
ports_lib_paths.sort.must_equal fake_lib_paths.sort
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe 'when the ports directories are missing' do
|
141
|
+
before do
|
142
|
+
RbConfig::CONFIG['host'] = 'fake-host-without-dirs'
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
it 'should return no directories' do
|
147
|
+
ports_lib_paths.must_be_empty
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should return no directories regardless of cwd' do
|
151
|
+
Dir.chdir '/'
|
152
|
+
ports_lib_paths.must_be_empty
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe '#ports_host' do
|
158
|
+
{
|
159
|
+
'i686-pc-linux-gnu' => 'i686-pc-linux-gnu',
|
160
|
+
'x86_64-pc-linux-gnu' => 'x86_64-pc-linux-gnu',
|
161
|
+
'i686-w64-mingw32' => 'i686-w64-mingw32',
|
162
|
+
'x86_64-w64-mingw32' => 'x86_64-w64-mingw32',
|
163
|
+
# consolidate this host to our build w64-mingw32 arch
|
164
|
+
'i686-pc-mingw32' => 'i686-w64-mingw32'
|
165
|
+
}.each do |host,expected|
|
166
|
+
describe "on a #{host} architecture" do
|
167
|
+
before do
|
168
|
+
RbConfig::CONFIG['host'] = host
|
169
|
+
end
|
170
|
+
|
171
|
+
it "should return a #{expected} ports host" do
|
172
|
+
TinyTds::Gem.ports_host.must_equal expected
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
data/test/result_test.rb
CHANGED
@@ -135,10 +135,10 @@ class ResultTest < TinyTds::TestCase
|
|
135
135
|
text = 'test affected rows sql'
|
136
136
|
@client.execute("DELETE FROM [datatypes]").do
|
137
137
|
afrows = @client.execute("SELECT @@ROWCOUNT AS AffectedRows").each.first['AffectedRows']
|
138
|
-
|
138
|
+
['Fixnum', 'Integer'].must_include afrows.class.name
|
139
139
|
@client.execute("INSERT INTO [datatypes] ([varchar_50]) VALUES ('#{text}')").do
|
140
140
|
pk1 = @client.execute(@client.identity_sql).each.first['Ident']
|
141
|
-
|
141
|
+
['Fixnum', 'Integer'].must_include pk1.class.name, 'we it be able to CAST to bigint'
|
142
142
|
@client.execute("UPDATE [datatypes] SET [varchar_50] = NULL WHERE [varchar_50] = '#{text}'").do
|
143
143
|
afrows = @client.execute("SELECT @@ROWCOUNT AS AffectedRows").each.first['AffectedRows']
|
144
144
|
assert_equal 1, afrows
|
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:
|
4
|
+
version: 2.0.0.pre1
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-03
|
13
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mini_portile2
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- ".gitignore"
|
113
113
|
- ".rubocop.yml"
|
114
114
|
- ".travis.yml"
|
115
|
+
- BACKERS.md
|
115
116
|
- CHANGELOG
|
116
117
|
- CODE_OF_CONDUCT.md
|
117
118
|
- Gemfile
|
@@ -125,8 +126,6 @@ files:
|
|
125
126
|
- bin/tsql
|
126
127
|
- circle.yml
|
127
128
|
- exe/.keep
|
128
|
-
- exe/defncopy.exe
|
129
|
-
- exe/tsql.exe
|
130
129
|
- ext/tiny_tds/client.c
|
131
130
|
- ext/tiny_tds/client.h
|
132
131
|
- ext/tiny_tds/extconf.rb
|
@@ -144,13 +143,48 @@ files:
|
|
144
143
|
- lib/tiny_tds/bin.rb
|
145
144
|
- lib/tiny_tds/client.rb
|
146
145
|
- lib/tiny_tds/error.rb
|
146
|
+
- lib/tiny_tds/gem.rb
|
147
147
|
- lib/tiny_tds/result.rb
|
148
148
|
- lib/tiny_tds/version.rb
|
149
|
-
-
|
150
|
-
-
|
151
|
-
- ports/x86_64-w64-mingw32/bin/
|
152
|
-
- ports/x86_64-w64-mingw32/
|
153
|
-
- ports/x86_64-w64-mingw32/bin/
|
149
|
+
- patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff
|
150
|
+
- patches/libiconv/1.14/1-avoid-gets-error.patch
|
151
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/bsqldb.exe
|
152
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/datacopy.exe
|
153
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/defncopy.exe
|
154
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/freebcp.exe
|
155
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/libct-4.dll
|
156
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/libsybdb-5.dll
|
157
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/osql
|
158
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/tdspool.exe
|
159
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/bin/tsql.exe
|
160
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/lib/libct.dll.a
|
161
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/lib/libct.la
|
162
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/lib/libsybdb.dll.a
|
163
|
+
- ports/x86_64-w64-mingw32/freetds/1.00.27/lib/libsybdb.la
|
164
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/bin/iconv.exe
|
165
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/bin/libcharset-1.dll
|
166
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/bin/libiconv-2.dll
|
167
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/lib/charset.alias
|
168
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/lib/libcharset.dll.a
|
169
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/lib/libcharset.la
|
170
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/lib/libiconv.dll.a
|
171
|
+
- ports/x86_64-w64-mingw32/libiconv/1.14/lib/libiconv.la
|
172
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/c_rehash
|
173
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/libcrypto-1_1-x64.dll
|
174
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/libssl-1_1-x64.dll
|
175
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/bin/openssl.exe
|
176
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libcrypto.a
|
177
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libcrypto.dll.a
|
178
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libssl.a
|
179
|
+
- ports/x86_64-w64-mingw32/openssl/1.1.0e/lib/libssl.dll.a
|
180
|
+
- tasks/native_gem.rake
|
181
|
+
- tasks/package.rake
|
182
|
+
- tasks/ports.rake
|
183
|
+
- tasks/ports/freetds.rb
|
184
|
+
- tasks/ports/libiconv.rb
|
185
|
+
- tasks/ports/openssl.rb
|
186
|
+
- tasks/ports/recipe.rb
|
187
|
+
- tasks/test.rake
|
154
188
|
- test/appveyor/dbsetup.ps1
|
155
189
|
- test/appveyor/dbsetup.sql
|
156
190
|
- test/benchmark/query.rb
|
@@ -160,6 +194,7 @@ files:
|
|
160
194
|
- test/bin/install-openssl.sh
|
161
195
|
- test/bin/setup.sh
|
162
196
|
- test/client_test.rb
|
197
|
+
- test/gem_test.rb
|
163
198
|
- test/result_test.rb
|
164
199
|
- test/schema/1px.gif
|
165
200
|
- test/schema/sqlserver_2000.sql
|
@@ -189,12 +224,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
224
|
version: 2.0.0
|
190
225
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
226
|
requirements:
|
192
|
-
- - "
|
227
|
+
- - ">"
|
193
228
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
229
|
+
version: 1.3.1
|
195
230
|
requirements: []
|
196
231
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.6.
|
232
|
+
rubygems_version: 2.6.12
|
198
233
|
signing_key:
|
199
234
|
specification_version: 4
|
200
235
|
summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|