tiny_tds 0.6.2-x86-mingw32 → 0.6.3.rc2-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +0 -1
- data/CHANGELOG +22 -5
- data/CODE_OF_CONDUCT.md +31 -0
- data/Gemfile +0 -1
- data/README.md +29 -31
- data/Rakefile +52 -62
- data/appveyor.yml +48 -0
- data/ext/tiny_tds/client.c +11 -11
- data/ext/tiny_tds/extconf.rb +203 -6
- data/ext/tiny_tds/result.c +3 -35
- data/lib/tiny_tds.rb +25 -6
- data/lib/tiny_tds/client.rb +15 -17
- data/lib/tiny_tds/version.rb +2 -2
- data/test/client_test.rb +23 -23
- data/test/result_test.rb +80 -84
- data/test/schema/sqlserver_2014.sql +138 -0
- data/test/schema_test.rb +58 -59
- data/test/test_helper.rb +55 -46
- data/test/thread_test.rb +4 -4
- metadata +48 -42
- data/compile/rake-compiler-dev-box.patch +0 -31
- data/ext/patch/Makefile.in.diff +0 -29
- data/ext/patch/dblib-30-char-username.diff +0 -11
- data/ext/patch/sspi_w_kerberos.diff +0 -42
- data/tasks/ports.rake +0 -79
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YWJjYjc0YjI5MTVmYjVmYTI5NzAxODIwMWUzNmM0OTZiOTk1MTJhOA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0dd04f4683a2f898bb98e96dd11a79080a790abb
|
4
|
+
data.tar.gz: ceadb1c7789b7e6c25d681fa9ce1e72d17b12d58
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDk5ZGIyNTY3NTEyZjFmY2VjNmExN2ZhOGI1ODRkZjdlODUwMDIxNDRkZWFl
|
11
|
-
OWY1OWVjMDMwOGUzNzU1OTM1OTM4MWY2NDU0YTM3MTk2OTM0Y2Q=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NTA0ZjJmMGVhNDI2ZTkyNjc2ZTJhNjhiZGVkZTZhZDUwZTI0ODEwNjIzOTky
|
14
|
-
YmJlZGI0NjNlZTRkOWYwZTllZDBhNjEwNTNjOWI1NTYxNjUzZDMxZGMyMjZh
|
15
|
-
NDg0NTI1NzRjYjFjNjQ4YTA0Y2YxZWEwOWU5NjJhMDY0ZTlmNjE=
|
6
|
+
metadata.gz: f9caa34500b0947a8b03661cff574aa7505cca048d729df19c9be828af6b763d494358bcf00239e012922b0df09006074c770dfdc5ebba793d5eb742d6e52343
|
7
|
+
data.tar.gz: 55014eddd3f06ba0845cde578541423a41fac276403c77aedfbfd34be4b2e18c38289b285056965715d710548d0727a81c96403062b6656e1dc3a7be28252fbc
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
|
2
|
+
* 0.6.3.rc1 *
|
3
|
+
|
4
|
+
* Ensure zero terminated strings, where C-str pointers are expected. Use StringValueCStr() Fixes #208.
|
5
|
+
|
6
|
+
* Revert 999fa571 so timeouts do not kill the client. Fixes #179.
|
7
|
+
|
8
|
+
* Remove `sspi_w_kerberos.diff` patch. Not needed anymore.
|
9
|
+
|
10
|
+
* Tested again on Azure. Added notes to README on recommended settings.
|
11
|
+
|
12
|
+
* Replace `rb_thread_blocking_region` (removed in Ruby 2.2.0) w/`rb_thread_call_without_gvl`. Fixes #182.
|
13
|
+
|
14
|
+
* Remove 30 char password warning. Fixes #172.
|
15
|
+
|
16
|
+
* Remove Ruby 1.8.6 support. We always use Time vs edge case DateTime.
|
17
|
+
|
18
|
+
|
2
19
|
* 0.6.2 *
|
3
20
|
|
4
21
|
* Support an optional environment variable to find FreeTDS. Fixes #128.
|
@@ -58,7 +75,7 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
|
|
58
75
|
|
59
76
|
* Add CFLAGS='-fPIC' for libtool. Fix TDS version configs in our ports file. Document. Fixes #45
|
60
77
|
|
61
|
-
* Update our TDS version constants to reflect changed 8.0/9.0 to 7.1/7.2 DBLIB versions in FreeTDS
|
78
|
+
* Update our TDS version constants to reflect changed 8.0/9.0 to 7.1/7.2 DBLIB versions in FreeTDS
|
62
79
|
while making it backward compatible, again like FreeTDS. Even tho you can not configure FreeTDS with
|
63
80
|
TDS version 7.2 or technically even use it, I added tests to prove that we correctly handle both
|
64
81
|
varchar(max) and nvarchar(max) with large amounts of data.
|
@@ -101,7 +118,7 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
|
|
101
118
|
|
102
119
|
* 0.4.2 *
|
103
120
|
|
104
|
-
* Iconv is a dep only when compiling locally. However, left in the ability to configure
|
121
|
+
* Iconv is a dep only when compiling locally. However, left in the ability to configure
|
105
122
|
it for native gem installation but you must use
|
106
123
|
--enable-iconv before using --with-iconv-dir=/some/dir
|
107
124
|
|
@@ -121,8 +138,8 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
|
|
121
138
|
|
122
139
|
* Allow Result#fields to be called before iterating over the results.
|
123
140
|
|
124
|
-
* Two new client helper methods, #sqlsent? and #canceled?. Possible to use these to determine current
|
125
|
-
state of the client and the need to use Result#cancel to stop processing active results. It is also
|
141
|
+
* Two new client helper methods, #sqlsent? and #canceled?. Possible to use these to determine current
|
142
|
+
state of the client and the need to use Result#cancel to stop processing active results. It is also
|
126
143
|
safe to call Result#cancel over and over again.
|
127
144
|
|
128
145
|
* Look for the syb headers only.
|
@@ -154,7 +171,7 @@ Use both dbsetversion() vs. dbsetlversion. Partially reverts #62.
|
|
154
171
|
|
155
172
|
* 0.2.2 *
|
156
173
|
|
157
|
-
* Fixed failing test in Ruby 1.8.6. DateTime doesn't support fractional seconds greater than 59.
|
174
|
+
* Fixed failing test in Ruby 1.8.6. DateTime doesn't support fractional seconds greater than 59.
|
158
175
|
See: http://redmine.ruby-lang.org/issues/show/1490 [Erik Bryn]
|
159
176
|
|
160
177
|
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all
|
4
|
+
people who contribute through reporting issues, posting feature requests,
|
5
|
+
updating documentation, submitting pull requests or patches, and other
|
6
|
+
activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, or religion.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include the use of sexual
|
14
|
+
language or imagery, derogatory comments or personal attacks, trolling, public
|
15
|
+
or private harassment, insults, or other unprofessional conduct.
|
16
|
+
|
17
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
18
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
19
|
+
that are not aligned to this Code of Conduct. Project maintainers who do not
|
20
|
+
follow the Code of Conduct may be removed from the project team.
|
21
|
+
|
22
|
+
This code of conduct applies both within project spaces and in public spaces
|
23
|
+
when an individual is representing the project or its community.
|
24
|
+
|
25
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
26
|
+
reported by opening an issue or contacting one or more of the project
|
27
|
+
maintainers.
|
28
|
+
|
29
|
+
This Code of Conduct is adapted from the Contributor Covenant
|
30
|
+
(http://contributor-covenant.org), version 1.1.0, available at
|
31
|
+
http://contributor-covenant.org/version/1/1/0/
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Although we search for FreeTDS's libraries and headers, you may have to specify
|
|
24
24
|
|
25
25
|
## FreeTDS Compatibility & Configuration
|
26
26
|
|
27
|
-
TinyTDS is developed against FreeTDS 0.82 & 0.91, and 0.92 currents, the latest is recommended. It is tested with SQL Server 2000, 2005, 2008 and Azure. Below are a few QA style notes about installing FreeTDS.
|
27
|
+
TinyTDS is developed against FreeTDS 0.82 & 0.91, and 0.92 currents, the latest is recommended. It is tested with SQL Server 2000, 2005, 2008, 2014, and Azure. Below are a few QA style notes about installing FreeTDS.
|
28
28
|
|
29
29
|
* **Do I need to install FreeTDS?** Yes! Somehow, someway, you are going to need FreeTDS for TinyTDS to compile against. You can avoid installing FreeTDS on your system by using our projects usage of rake-compiler and mini_portile to compile and package a native gem just for you. See the "Using MiniPortile" section below.
|
30
30
|
|
@@ -41,7 +41,7 @@ TinyTDS is developed against FreeTDS 0.82 & 0.91, and 0.92 currents, the latest
|
|
41
41
|
|
42
42
|
Our goal is to support every SQL Server data type and covert it to a logical ruby object. When dates or times are returned, they are instantiated to either `:utc` or `:local` time depending on the query options. Under ruby 1.9, all strings are encoded to the connection's encoding and all binary data types are associated to ruby's `ASCII-8BIT/BINARY` encoding.
|
43
43
|
|
44
|
-
Below is a list of the data types we plan to support using future versions of FreeTDS. They are associated with SQL Server 2008. All unsupported data types are returned as properly encoded strings.
|
44
|
+
Below is a list of the data types we plan to support using future versions of FreeTDS. They are associated with SQL Server 2008 and up. All unsupported data types are returned as properly encoded strings.
|
45
45
|
|
46
46
|
* [date]
|
47
47
|
* [datetime2]
|
@@ -54,7 +54,7 @@ Below is a list of the data types we plan to support using future versions of Fr
|
|
54
54
|
Connect to a database.
|
55
55
|
|
56
56
|
```ruby
|
57
|
-
client = TinyTds::Client.new
|
57
|
+
client = TinyTds::Client.new username: 'sa', password: 'secret', host: 'mydb.host.net'
|
58
58
|
```
|
59
59
|
|
60
60
|
Creating a new client takes a hash of options. For valid iconv encoding options, see the output of `iconv -l`. Only a few have been tested and highly recommended to leave blank for the UTF-8 default.
|
@@ -267,9 +267,23 @@ As of version 2.3.11 & 3.0.3 of the adapter, you can specify a `:dblib` mode in
|
|
267
267
|
|
268
268
|
## Using TinyTDS with Azure
|
269
269
|
|
270
|
-
TinyTDS is fully tested with the Azure platform. You must set the
|
270
|
+
TinyTDS is fully tested with the Azure platform. You must set the `azure: true` connection option when connecting. This is needed to specify the default database name in the login packet since Azure has no notion of `USE [database]`. You must use the latest FreeTDS 0.91. FreeTDS must be compiled with OpenSSL too.
|
271
271
|
|
272
|
-
IMPORTANT
|
272
|
+
**IMPORTANT**: Do not use `username@server.database.windows.net` for the username connection option! You must use the shorter `username@server` instead!
|
273
|
+
|
274
|
+
We recommend the following settings when using TinyTDS with Azure. These are the same settings used in the ActiveRecord SQL Server adapter.
|
275
|
+
|
276
|
+
```sql
|
277
|
+
SET ANSI_NULLS ON
|
278
|
+
SET CURSOR_CLOSE_ON_COMMIT OFF
|
279
|
+
SET ANSI_NULL_DFLT_ON ON
|
280
|
+
SET IMPLICIT_TRANSACTIONS OFF
|
281
|
+
SET ANSI_PADDING ON
|
282
|
+
SET QUOTED_IDENTIFIER ON
|
283
|
+
SET ANSI_WARNINGS ON
|
284
|
+
```
|
285
|
+
|
286
|
+
Also, please read the [Azure SQL Database General Guidelines and Limitations](https://msdn.microsoft.com/en-us/library/ee336245.aspx) MSDN article to understand the differences. Specifically, the connection constraints section!
|
273
287
|
|
274
288
|
|
275
289
|
## Using MiniPortile
|
@@ -304,34 +318,24 @@ To find out more about the FreeTDS release system [visit this thread](http://lis
|
|
304
318
|
|
305
319
|
## Compiling Gems for Windows
|
306
320
|
|
307
|
-
For the convenience of Windows users, TinyTDS ships pre-compiled for Ruby 1.9.3, 2.0 and 2.
|
308
|
-
|
309
|
-
There are a handful of rake tasks that are part of TinyTDS that make cross-compiling simple. Ensure that you have VirtualBox, Vagrant and git installed, and then run the following to download the box and perform initial setup:
|
310
|
-
|
311
|
-
```
|
312
|
-
$ rake cross-compile:setup
|
313
|
-
```
|
321
|
+
For the convenience of Windows users, TinyTDS ships pre-compiled for Ruby 1.9.3, 2.0, 2.1 and 2.2 on Windows. In order to generate these gems, [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) is used. This project provides a [Docker image](https://registry.hub.docker.com/u/larskanis/rake-compiler-dock/) with rvm, cross-compilers and a number of different target versions of ruby.
|
314
322
|
|
315
|
-
|
323
|
+
Run the following rake task to compile the gem for Windows. This will check the availability of [Docker](https://www.docker.com/) (and boot2docker on Windows or OS-X) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
|
316
324
|
|
317
325
|
```
|
318
|
-
$ rake
|
326
|
+
$ rake gem:windows
|
319
327
|
```
|
320
328
|
|
321
|
-
The compiled gems will exist in `./
|
322
|
-
|
323
|
-
If you want to clean up the dependent ports, temp files and resulting gems, run:
|
324
|
-
|
325
|
-
```
|
326
|
-
$ rake cross-compile:clean
|
327
|
-
```
|
329
|
+
The compiled gems will exist in `./pkg/`.
|
328
330
|
|
329
331
|
|
330
332
|
## Development & Testing
|
331
333
|
|
332
|
-
We use bundler for development. Simply run `bundle install` then `rake` to build the gem and run the unit tests. The tests assume you have created a database named `tinytdstest` accessible by a database owner named `tinytds`. Before running the test rake task, you may need to define a pair of environment variables that help the client connect to your specific FreeTDS database server name and which schema (2000, 2005, 2008, Azure or Sybase ASE) to use. For example:
|
334
|
+
We use bundler for development. Simply run `bundle install` then `rake` to build the gem and run the unit tests. The tests assume you have created a database named `tinytdstest` accessible by a database owner named `tinytds`. Before running the test rake task, you may need to define a pair of environment variables that help the client connect to your specific FreeTDS database server name and which schema (2000, 2005, 2008, 2014, Azure or Sybase ASE) to use. For example:
|
333
335
|
|
334
336
|
```
|
337
|
+
$ rake TINYTDS_UNIT_DATASERVER=mydbserver
|
338
|
+
or
|
335
339
|
$ rake TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2008
|
336
340
|
or
|
337
341
|
$ rake TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
|
@@ -342,7 +346,7 @@ $ rake TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_UNIT_PORT=5000 TINYTDS_SCHEMA=syb
|
|
342
346
|
If you do not want to use MiniPortile to compile a local project version of FreeTDS and instead use your local system version, use the `TINYTDS_SKIP_PORTS` environment variable. This will ignore any port tasks and will instead build and link to your system's FreeTDS installation as a normal gem install would.
|
343
347
|
|
344
348
|
```
|
345
|
-
$ rake TINYTDS_SKIP_PORTS=
|
349
|
+
$ rake TINYTDS_SKIP_PORTS=1
|
346
350
|
```
|
347
351
|
|
348
352
|
|
@@ -356,14 +360,13 @@ $ rake TINYTDS_SKIP_PORTS=true
|
|
356
360
|
|
357
361
|
## TODO List
|
358
362
|
|
359
|
-
* Include OpenSSL with Windows binaries for SQL Azure.
|
360
363
|
* Install an interrupt handler.
|
361
364
|
* Allow #escape to accept all ruby primitives.
|
362
365
|
|
363
366
|
|
364
367
|
## About Me
|
365
368
|
|
366
|
-
My name is Ken Collins and I currently maintain the SQL Server adapter for ActiveRecord and wrote this library as my first cut into learning ruby C extensions. Hopefully it will help promote the power of ruby and the Rails framework to those that have not yet discovered it. My blog is http://metaskills.net and I can be found on twitter as @metaskills. Enjoy!
|
369
|
+
My name is Ken Collins and I currently maintain the SQL Server adapter for ActiveRecord and wrote this library as my first cut into learning ruby C extensions. Hopefully it will help promote the power of ruby and the Rails framework to those that have not yet discovered it. My blog is [metaskills.net](http://metaskills.net/) and I can be found on twitter as @metaskills. Enjoy!
|
367
370
|
|
368
371
|
|
369
372
|
## Special Thanks
|
@@ -374,12 +377,7 @@ My name is Ken Collins and I currently maintain the SQL Server adapter for Activ
|
|
374
377
|
* Josh Clayton of Thoughtbot for writing about ruby C extensions. - http://robots.thoughtbot.com/post/1037240922/get-your-c-on
|
375
378
|
|
376
379
|
|
377
|
-
## Donators
|
378
|
-
|
379
|
-
I am trying to save up for a Happy Hacking pro keyboard. Help me out via GitTip! https://www.gittip.com/metaskills/
|
380
|
-
|
381
|
-
|
382
380
|
## License
|
383
381
|
|
384
|
-
TinyTDS is Copyright (c) 2010-
|
382
|
+
TinyTDS is Copyright (c) 2010-2015 Ken Collins, <ken@metaskills.net> and Will Bond (Veracross LLC) <wbond@breuer.com>. It is distributed under the MIT license. Windows binaries contain precompiled versions of FreeTDS <http://www.freetds.org/> which is licensed under the GNU LGPL license at <http://www.gnu.org/licenses/lgpl-2.0.html>
|
385
383
|
|
data/Rakefile
CHANGED
@@ -11,9 +11,27 @@ def test_libs
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_files
|
14
|
-
|
14
|
+
if ENV['TEST_FILES']
|
15
|
+
ENV['TEST_FILES'].split(',').map{ |f| f.strip }.sort
|
16
|
+
else
|
17
|
+
Dir.glob("test/**/*_test.rb").sort
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_file_to_gem(spec, relative_path)
|
22
|
+
target_path = File.join gem_build_path(spec), relative_path
|
23
|
+
target_dir = File.dirname(target_path)
|
24
|
+
mkdir_p target_dir
|
25
|
+
rm_f target_path
|
26
|
+
safe_ln relative_path, target_path
|
27
|
+
spec.files += [relative_path]
|
15
28
|
end
|
16
29
|
|
30
|
+
def gem_build_path(spec)
|
31
|
+
File.join 'pkg', spec.full_name
|
32
|
+
end
|
33
|
+
|
34
|
+
|
17
35
|
gemspec = Gem::Specification::load(File.expand_path('../tiny_tds.gemspec', __FILE__))
|
18
36
|
|
19
37
|
Rake::TestTask.new do |t|
|
@@ -27,7 +45,7 @@ Gem::PackageTask.new(gemspec) do |pkg|
|
|
27
45
|
pkg.need_zip = false
|
28
46
|
end
|
29
47
|
|
30
|
-
task :compile
|
48
|
+
task :compile
|
31
49
|
|
32
50
|
task :build => [:clean, :compile]
|
33
51
|
|
@@ -37,78 +55,50 @@ Dir["tasks/*.rake"].sort.each { |f| load f }
|
|
37
55
|
|
38
56
|
Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
|
39
57
|
ext.lib_dir = 'lib/tiny_tds'
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
ext.lib_dir = "lib/tiny_tds/#{$1}"
|
44
|
-
else
|
45
|
-
ext.cross_compile = true
|
46
|
-
ext.cross_platform = []
|
47
|
-
ext.cross_config_options << "--disable-lookup"
|
48
|
-
config_opts = {}
|
58
|
+
ext.cross_compile = true
|
59
|
+
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
|
60
|
+
ext.cross_config_options += %w[ --disable-lookup --enable-cross-build ]
|
49
61
|
|
62
|
+
# Add dependent DLLs to the cross gems
|
63
|
+
ext.cross_compiling do |spec|
|
50
64
|
platform_host_map = {
|
51
|
-
'x86-mingw32' => '
|
65
|
+
'x86-mingw32' => 'i686-w64-mingw32',
|
52
66
|
'x64-mingw32' => 'x86_64-w64-mingw32'
|
53
67
|
}
|
54
68
|
|
55
|
-
|
56
|
-
|
57
|
-
# extconf.rb in such a way that library detection works.
|
58
|
-
platform_host_map.each do |plat, host|
|
59
|
-
ext.cross_platform << plat
|
60
|
-
|
61
|
-
libiconv = define_libiconv_recipe(plat, host)
|
62
|
-
freetds = define_freetds_recipe(plat, host, libiconv)
|
63
|
-
task "native:#{plat}" => ["ports:freetds:#{plat}"] unless ENV['TINYTDS_SKIP_PORTS']
|
64
|
-
|
65
|
-
# For some reason --with-freetds-dir and --with-iconv-dir would not work.
|
66
|
-
# It seems the default params that extconf.rb constructs include
|
67
|
-
# --without-freetds-include, --without-freetds-lib, --without-iconv-lib
|
68
|
-
# and --without-iconv-include. Thus we must explicitly override them.
|
69
|
-
config_opts[plat] = " --with-freetds-include=#{freetds.path}/include"
|
70
|
-
config_opts[plat] += " --with-freetds-lib=#{freetds.path}/lib"
|
71
|
-
config_opts[plat] += " --with-iconv-include=#{libiconv.path}/include"
|
72
|
-
config_opts[plat] += " --with-iconv-lib=#{libiconv.path}/lib"
|
73
|
-
end
|
69
|
+
gemplat = spec.platform.to_s
|
70
|
+
host = platform_host_map[gemplat]
|
74
71
|
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
dlls = [
|
73
|
+
"libeay32-1.0.2d-#{host}.dll",
|
74
|
+
"ssleay32-1.0.2d-#{host}.dll",
|
75
|
+
"libiconv-2.dll",
|
76
|
+
"libsybdb-5.dll",
|
77
|
+
]
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
sh 'git', '--version'
|
83
|
-
sh 'vagrant', '-v'
|
79
|
+
# We don't need the sources in a fat binary gem
|
80
|
+
spec.files = spec.files.reject{|f| f=~/^ports\/archives/ }
|
81
|
+
spec.files += dlls.map{|dll| "ports/#{host}/bin/#{File.basename(dll)}" }
|
84
82
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
sh 'patch -p1 < ../compile/rake-compiler-dev-box.patch'
|
83
|
+
dlls.each do |dll|
|
84
|
+
file "ports/#{host}/bin/#{dll}" do |t|
|
85
|
+
sh "x86_64-w64-mingw32-strip", t.name
|
86
|
+
end
|
87
|
+
end
|
91
88
|
end
|
92
89
|
|
93
|
-
sh 'vagrant', 'up'
|
94
90
|
end
|
95
91
|
|
96
|
-
|
97
|
-
task
|
98
|
-
|
99
|
-
if not Dir.exists?(build_dir)
|
100
|
-
Dir.mkdir build_dir
|
101
|
-
end
|
102
|
-
# Copy the current version of tiny_tds into the box directory
|
103
|
-
Dir.entries('./').each do |entry|
|
104
|
-
next if ['.', '..', 'rake-compiler-dev-box'].include?(entry)
|
105
|
-
cp_r entry, build_dir, :remove_destination => true
|
106
|
-
end
|
107
|
-
Dir.chdir './rake-compiler-dev-box'
|
108
|
-
sh 'vagrant ssh -c "package_win32_fat_binary tiny_tds"'
|
92
|
+
# Bundle the freetds sources to avoid download while gem install
|
93
|
+
task gem_build_path(gemspec) do
|
94
|
+
add_file_to_gem(gemspec, "ports/archives/freetds-0.91.112.tar.gz")
|
109
95
|
end
|
110
96
|
|
111
|
-
desc "
|
112
|
-
task '
|
113
|
-
|
97
|
+
desc "Build the windows binary gems per rake-compiler-dock"
|
98
|
+
task 'gem:windows' do
|
99
|
+
require 'rake_compiler_dock'
|
100
|
+
RakeCompilerDock.sh <<-EOT
|
101
|
+
# bundle install &&
|
102
|
+
rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2
|
103
|
+
EOT
|
114
104
|
end
|
data/appveyor.yml
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
services:
|
2
|
+
- mssql2014
|
3
|
+
|
4
|
+
install:
|
5
|
+
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
6
|
+
- SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
|
7
|
+
- SET RAKEOPT=-rdevkit
|
8
|
+
- SET TINYTDS_UNIT_DATASERVER=localhost\SQL2014
|
9
|
+
- SET TINYTDS_UNIT_DATABASE=master
|
10
|
+
- SET TINYTDS_UNIT_USER=sa
|
11
|
+
- SET TINYTDS_UNIT_PASS=Password12!
|
12
|
+
- ruby --version
|
13
|
+
- gem --version
|
14
|
+
- bundle install
|
15
|
+
- ps: |
|
16
|
+
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
|
17
|
+
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
|
18
|
+
|
19
|
+
$serverName = $env:COMPUTERNAME
|
20
|
+
$instanceName = 'SQL2014'
|
21
|
+
$smo = 'Microsoft.SqlServer.Management.Smo.'
|
22
|
+
$wmi = new-object ($smo + 'Wmi.ManagedComputer')
|
23
|
+
|
24
|
+
# Enable TCP/IP
|
25
|
+
$uri = "ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"
|
26
|
+
$Tcp = $wmi.GetSmoObject($uri)
|
27
|
+
$Tcp.IsEnabled = $true
|
28
|
+
$TCP.alter()
|
29
|
+
|
30
|
+
# Start services
|
31
|
+
Set-Service SQLBrowser -StartupType Manual
|
32
|
+
Start-Service SQLBrowser
|
33
|
+
Start-Service "MSSQL`$$instanceName"
|
34
|
+
|
35
|
+
build: off
|
36
|
+
|
37
|
+
test_script:
|
38
|
+
- bundle exec rake
|
39
|
+
|
40
|
+
environment:
|
41
|
+
matrix:
|
42
|
+
- ruby_version: "193"
|
43
|
+
#- ruby_version: "200"
|
44
|
+
#- ruby_version: "200-x64"
|
45
|
+
#- ruby_version: "21"
|
46
|
+
#- ruby_version: "21-x64"
|
47
|
+
#- ruby_version: "22"
|
48
|
+
- ruby_version: "22-x64"
|