Hello community, here is the log from the commit of package rubygem-pg for openSUSE:Factory checked in at 2015-09-08 17:42:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-pg (Old) and /work/SRC/openSUSE:Factory/.rubygem-pg.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-pg" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-pg/rubygem-pg.changes 2015-05-16 07:14:20.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-pg.new/rubygem-pg.changes 2015-09-08 17:47:24.000000000 +0200 @@ -1,0 +2,137 @@ +Fri Sep 4 04:32:03 UTC 2015 - [email protected] + +- updated to version 0.18.3 + see installed ChangeLog + + 2015-09-03 Michael Granger <[email protected]> + + * History.rdoc: + Added recent fix to the History file + [f12dc2f1ce14] [tip] + + 2015-09-01 Lars Kanis <[email protected]> + + * lib/pg/text_decoder.rb: + Add missing require + [d0ba6a2cb10f] + + * Merge pull request #9 from ramfjord/date-decoder-return-dates + + Date decoder to return real Dates + [676def89b826] + + 2015-06-21 Thomas Ramfjord <[email protected]> + + * lib/pg/text_decoder.rb, spec/pg/basic_type_mapping_spec.rb: + modified TextDecoder::Date to return an actual ruby Date instead of + a Time + [c50593d12ba2] + + 2015-08-20 Lars Kanis <[email protected]> + + * Rakefile: + Add include for Hoe::MercurialHelpers as a temporary solution for + the error: + + Packaging tasks require the hoe-mercurial plugin (gem install hoe- + mercurial) + [a84f83ff5b31] + + * History.rdoc: + Update History.rdoc + [cadfac537e73] + + * Merge branch 'master' of github.com:larskanis/ruby-pg + [d27d6d5a6545] + + * README.rdoc: + Add Appveyor status badge to the README. + [c9637c6efcfb] + + * appveyor.yml: + Use 9.3 because 9.0, 9.1 and 9.2 segfault in PG.init_openssl + [158f6649b7b8] + + * spec/pg/connection_spec.rb: + Skip conn#host test on Windows-x64, because it segfaults, currently. + [04110aad7fc6] + + * spec/pg/connection_spec.rb: + libpq on Windows doesn't respect the PGPORT env variable, so we + accept both. + [b4b666011f3f] + + * spec/helpers.rb: + Older versions of PostgreSQL don't have a pid column, so this could + raise an exception: TypeError: can't convert nil into Integer + [48f1145fa631] + + * Rakefile.cross: + Update OpenSSL version for Windows cross build. + [be6b75fef0ff] + + * appveyor.yml: + Add CI-tests on appveyor. + [c2dc9e491853] + + 2015-06-29 Lars Kanis <[email protected]> + + * History.rdoc: + Merge branch 'master' of https://github.com/larskanis/ruby-pg + + Conflicts: History.rdoc + [affb47533d82] + + * History.rdoc, ext/util.c, spec/pg/type_spec.rb: + Fix data type resulting in wrong base64 encoding. + [5fb9170f6a7d] + + 2015-06-17 Lars Kanis <[email protected]> + + * Gemfile, Rakefile, Rakefile.cross: + Update versions of rake-compiler-dock, OpenSSL and PostgreSQL. + [10c6b496314c] + + 2015-06-12 Lars Kanis <[email protected]> + + * Rakefile.cross: + Update OpenSSL and PostgreSQL versions for cross build. + [02094cca1cf8] + + 2015-06-11 Lars Kanis <[email protected]> + + * History.rdoc, README-Windows.rdoc: + Update README-Windows in regards to rake-compiler-dock. + [4d9fd821ec1e] + + 2015-06-09 Lars Kanis <[email protected]> + + * Rakefile.cross: + Cross build: Ensure ChangeLog file is built on the host side before + entering the docker container. + [d32412acff38] + + * Rakefile.cross: + Cross build: Add workaround for missing symlink support on Windows. + [52bb3eef00f0] + + * Rakefile.cross: + Explicitly set the gcc-toolchain, instead of deriving from the rake- + compiler config. + + Now, that we use the libpq.dll (instead of static linking), we can + mix the gcc-toolchains. So we better build the dll with the newer + mingw-w64 toolchain (instead of the old mingw32) and build only the + extension for ruby-1.9 with the old mingw32-gcc. + [b3d169fa189b] + + * Merge https://github.com/ged/ruby-pg + [5aeb99dda0ca] + + 2015-05-25 Michael Granger <[email protected]> + + * lib/pg/basic_type_mapping.rb: + Whitespace fixes + [57cfbc230597] + +------------------------------------------------------------------- Old: ---- pg-0.18.2.gem New: ---- pg-0.18.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-pg.spec ++++++ --- /var/tmp/diff_new_pack.xWi1wc/_old 2015-09-08 17:47:25.000000000 +0200 +++ /var/tmp/diff_new_pack.xWi1wc/_new 2015-09-08 17:47:25.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-pg -Version: 0.18.2 +Version: 0.18.3 Release: 0 %define mod_name pg %define mod_full_name %{mod_name}-%{version} ++++++ pg-0.18.2.gem -> pg-0.18.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ChangeLog new/ChangeLog --- old/ChangeLog 2015-05-14 20:50:00.000000000 +0200 +++ new/ChangeLog 2015-09-03 23:03:40.000000000 +0200 @@ -1,8 +1,267 @@ +2015-09-03 Michael Granger <[email protected]> + + * History.rdoc: + Added recent fix to the History file + [f12dc2f1ce14] [tip] + +2015-09-01 Lars Kanis <[email protected]> + + * lib/pg/text_decoder.rb: + Add missing require + [d0ba6a2cb10f] + + * Merge pull request #9 from ramfjord/date-decoder-return-dates + + Date decoder to return real Dates + [676def89b826] + +2015-06-21 Thomas Ramfjord <[email protected]> + + * lib/pg/text_decoder.rb, spec/pg/basic_type_mapping_spec.rb: + modified TextDecoder::Date to return an actual ruby Date instead of + a Time + [c50593d12ba2] + +2015-08-20 Lars Kanis <[email protected]> + + * Rakefile: + Add include for Hoe::MercurialHelpers as a temporary solution for + the error: + + Packaging tasks require the hoe-mercurial plugin (gem install hoe- + mercurial) + [a84f83ff5b31] + + * History.rdoc: + Update History.rdoc + [cadfac537e73] + + * Merge branch 'master' of github.com:larskanis/ruby-pg + [d27d6d5a6545] + + * README.rdoc: + Add Appveyor status badge to the README. + [c9637c6efcfb] + + * appveyor.yml: + Use 9.3 because 9.0, 9.1 and 9.2 segfault in PG.init_openssl + [158f6649b7b8] + + * spec/pg/connection_spec.rb: + Skip conn#host test on Windows-x64, because it segfaults, currently. + [04110aad7fc6] + + * spec/pg/connection_spec.rb: + libpq on Windows doesn't respect the PGPORT env variable, so we + accept both. + [b4b666011f3f] + + * spec/helpers.rb: + Older versions of PostgreSQL don't have a pid column, so this could + raise an exception: TypeError: can't convert nil into Integer + [48f1145fa631] + + * Rakefile.cross: + Update OpenSSL version for Windows cross build. + [be6b75fef0ff] + + * appveyor.yml: + Add CI-tests on appveyor. + [c2dc9e491853] + +2015-06-29 Lars Kanis <[email protected]> + + * History.rdoc: + Merge branch 'master' of https://github.com/larskanis/ruby-pg + + Conflicts: History.rdoc + [affb47533d82] + + * History.rdoc, ext/util.c, spec/pg/type_spec.rb: + Fix data type resulting in wrong base64 encoding. + [5fb9170f6a7d] + +2015-06-17 Lars Kanis <[email protected]> + + * Gemfile, Rakefile, Rakefile.cross: + Update versions of rake-compiler-dock, OpenSSL and PostgreSQL. + [10c6b496314c] + +2015-06-12 Lars Kanis <[email protected]> + + * Rakefile.cross: + Update OpenSSL and PostgreSQL versions for cross build. + [02094cca1cf8] + +2015-06-11 Lars Kanis <[email protected]> + + * History.rdoc, README-Windows.rdoc: + Update README-Windows in regards to rake-compiler-dock. + [4d9fd821ec1e] + +2015-06-09 Lars Kanis <[email protected]> + + * Rakefile.cross: + Cross build: Ensure ChangeLog file is built on the host side before + entering the docker container. + [d32412acff38] + + * Rakefile.cross: + Cross build: Add workaround for missing symlink support on Windows. + [52bb3eef00f0] + + * Rakefile.cross: + Explicitly set the gcc-toolchain, instead of deriving from the rake- + compiler config. + + Now, that we use the libpq.dll (instead of static linking), we can + mix the gcc-toolchains. So we better build the dll with the newer + mingw-w64 toolchain (instead of the old mingw32) and build only the + extension for ruby-1.9 with the old mingw32-gcc. + [b3d169fa189b] + + * Merge https://github.com/ged/ruby-pg + [5aeb99dda0ca] + +2015-05-25 Michael Granger <[email protected]> + + * lib/pg/basic_type_mapping.rb: + Whitespace fixes + [57cfbc230597] + +2015-05-14 Michael Granger <[email protected]> + + * .hgtags: + Added tag v0.18.2 for changeset 22a361201fd1 + [00d6997551e6] + + * .hgsigs: + Added signature for changeset 7d31b04e7913 + [d77ab8ab870e] + + * History.rdoc, lib/pg.rb: + Bump patch version, update History + [fa56690fe72d] + + * Merged with git branch. + [9b2c80df821d] + +2015-06-09 Lars Kanis <[email protected]> + + * Rakefile.cross: + Cross build: Copy gem signing key and certs to be accessable from + the docker container + [c5382a785f4d] + +2015-06-08 Lars Kanis <[email protected]> + + * Merged + [3d56a65c78c5] + + * Gemfile, Rakefile, Rakefile.cross: + Add rake task 'gem:windows' which makes use of the new rake- + compiler-dock. + + Also update the Gemfile per 'rake bundler:gemfile' . + [fafadd62cc6d] + + * Rakefile.cross: + Cross build: Work around missing dependency to libcommon in + PostgreSQL-9.4.0 + [630a22437026] + +2015-05-25 Michael Granger <[email protected]> + + * ext/pg_connection.c: + Change instance_of checks to kind_of for subclassing [#220] + [eb4d3c003bd6] [github/kind-of-fix] + + * lib/pg/basic_type_mapping.rb: + Whitespace fixes + [4a4368e30bcf] [github/master] + +2015-05-14 Michael Granger <[email protected]> + + * .hgtags: + Added tag v0.18.2 for changeset 22a361201fd1 + [94e26b472c78] + + * .hgsigs: + Added signature for changeset 7d31b04e7913 + [22a361201fd1] [v0.18.2] + + * History.rdoc, lib/pg.rb: + Bump patch version, update History + [7d31b04e7913] + + * Merged with git branch. + [45a1753da19a] + + * .rvm.gems: + Bump the rvm gemset gem versions + [8050020330d8] + +2015-03-13 Lars Kanis <[email protected]> + + * ext/pg_text_encoder.c, ext/util.c, ext/util.h: + Avoid possible symbol name clash when linking againt static libpq. + + This should fix issue #209 . + [2334a1bc38e6] + +2015-02-11 Lars Kanis <[email protected]> + + * ext/pg.c, spec/pg/connection_spec.rb: + Merge from git branch. + [a7261eb6796f] + + * ext/pg.h, ext/pg_text_decoder.c: + Merge branch 'non-c99-compiler' + [7e8f1e4da59d] + +2015-02-06 Lars Kanis <[email protected]> + + * ext/extconf.rb, ext/pg.h, ext/pg_result.c, ext/pg_text_decoder.c, + ext/pg_type_map_by_mri_type.c: + Use fixed size arrays in case the compiler doesn't support C99 + variable length arrays. + + This is notably the MSVC compiler. + + Note: The MSVC build environment is currently not tested on a + regular base, so is not fully supported. + [a08290a78221] + +2015-02-11 Lars Kanis <[email protected]> + + * ext/pg_connection.c: + Replace quote_ident implementation with that of + PG::TextEncoder::Identifier . + + This allowes quoation of array of strings in addition to plain + strings and removes duplicated code. + + It also removes the 63 byte limitation and therefore obsolets pull + request #21 https://bitbucket.org/ged/ruby-pg/pull-request/21 + [b8ac29b020ee] + + * ext/pg.c, ext/pg.h, ext/pg_text_decoder.c, ext/pg_text_encoder.c, + spec/pg/connection_spec.rb, spec/pg/type_spec.rb: + Derive PG::TextDecoder::Identifier from PG::SimpleDecoder instead of + CompositeDecoder + + .. and equally for Encoder. + + Identifiers are strings, so there is no good reason to compose it + from other element types. This change allows a faster quoting + implementation. + [55ec58cabad4] + 2015-05-14 Michael Granger <[email protected]> * .rvmrc: Bump default rvm Ruby to 2.2 - [128b075d5800] [tip] + [128b075d5800] 2015-03-13 Lars Kanis <[email protected]> @@ -64,7 +323,7 @@ * README.rdoc, ext/pg.c: Update copyright notices - [447962e0dcba] [github/master] + [447962e0dcba] * spec/pg/connection_spec.rb: Whitespace fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.rdoc new/History.rdoc --- old/History.rdoc 2015-05-14 20:50:00.000000000 +0200 +++ new/History.rdoc 2015-09-03 23:03:40.000000000 +0200 @@ -1,3 +1,16 @@ +== v0.18.3 [2015-09-03] Michael Granger <[email protected]> + +Enhancements: +- Use rake-compiler-dock to build windows gems easily. +- Add CI-tests on appveyor and fix test cases accordingly. + +Bugfixes: +- Fix data type resulting in wrong base64 encoding. +- Change instance_of checks to kind_of for subclassing. #220 +- TextDecoder::Date returns an actual Ruby Date instead of a Time + (thanks to Thomas Ramfjord) + + == v0.18.2 [2015-05-14] Michael Granger <[email protected]> Enhancements: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README-Windows.rdoc new/README-Windows.rdoc --- old/README-Windows.rdoc 2015-05-14 20:50:00.000000000 +0200 +++ new/README-Windows.rdoc 2015-09-03 23:03:40.000000000 +0200 @@ -2,9 +2,9 @@ In order to build this extension on MS Windows you will need a couple things. -First, a compiler. For the one click installer this means you should either -use VC++ 6.0 or the compiler that comes with cygwin or mingw if you're -building on that platform. +First, a compiler. For the one click installer this means you should use +the DevKit or the compiler that comes with cygwin if you're building on that +platform. If you've built Ruby yourself, you should use the same compiler to build this library that you used to build Ruby. @@ -29,34 +29,23 @@ try to use a path with spaces in it, the nmake.exe program will choke. -== Cross compiling for mswin32 +== Building binary 'pg' gems for MS Windows -Using rake-compiler a cross compiled pg gem can be build on a Linux or MacOS X -host for the win32 platform. The generated gem is statically linked against -libpq and libssl. OpenSSL and PostgreSQL are downloaded and compiled from the -sources. There are no runtime dependencies to any but the standard Windows -DLLs. +Binary gems for windows can be built on Linux, OS-X and even on Windows +with the help of docker. This is how regular windows gems are built for +rubygems.org . -Install mingw32 using the instructions in rake-compiler's README. -For Debian/Ubuntu it is <tt>apt-get install gcc-mingw32</tt> . -Use ruby-1.8.7 for the following commands. +To do this, install boot2docker [on Windows](https://github.com/boot2docker/windows-installer/releases) +or [on OS X](https://github.com/boot2docker/osx-installer/releases) and make +sure it is started. A native Docker installation is best on Linux. -Download and cross compile ruby 1.8 and 1.9 for win32 with: +Then run: - rake-compiler cross-ruby VERSION=1.8.7-p352 - rake-compiler cross-ruby VERSION=1.9.2-p290 + rake gem:windows -Download and cross compile pg for win32: - - rake cross native gem - -or with custom versions: - - rake cross native gem RUBY_CC_VERSION=1.8.7:1.9.2 \ - OPENSSL_VERSION=1.0.0e POSTGRESQL_VERSION=9.1.1 - -If everything works, there should be pg-VERSION-x86-mingw32.gem in the pkg -directory. +This will download a docker image suited for building windows gems, and it +will download and build OpenSSL and PostgreSQL. Finally the gem is built +containing binaries for all supported ruby versions. == Reporting Problems diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.rdoc new/README.rdoc --- old/README.rdoc 2015-05-14 20:50:00.000000000 +0200 +++ new/README.rdoc 2015-09-03 23:03:40.000000000 +0200 @@ -29,7 +29,8 @@ == Build Status -{<img src="https://travis-ci.org/ged/ruby-pg.png?branch=master" alt="Build Status" />}[https://travis-ci.org/ged/ruby-pg] +{<img src="https://travis-ci.org/ged/ruby-pg.png?branch=master" alt="Build Status Travis-CI" />}[https://travis-ci.org/ged/ruby-pg] +{<img src="https://ci.appveyor.com/api/projects/status/at4g4swb2cd4xji7/branch/master?svg=true" alt="Build Status Appveyor" />}[https://ci.appveyor.com/api/projects/status/at4g4swb2cd4xji7/branch/master] == Requirements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2015-05-14 20:50:00.000000000 +0200 +++ new/Rakefile 2015-09-03 23:03:40.000000000 +0200 @@ -61,6 +61,7 @@ self.developer 'Lars Kanis', '[email protected]' self.dependency 'rake-compiler', '~> 0.9', :developer + self.dependency 'rake-compiler-dock', '~> 0.3', :developer self.dependency 'hoe', '~> 3.12', :developer self.dependency 'hoe-deveiate', '~> 0.6', :developer self.dependency 'hoe-bundler', '~> 1.0', :developer @@ -150,6 +151,7 @@ if File.exist?('.hg/branch') $stderr.puts "Updating the changelog..." begin + include Hoe::MercurialHelpers content = make_changelog() rescue NameError abort "Packaging tasks require the hoe-mercurial plugin (gem install hoe-mercurial)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile.cross new/Rakefile.cross --- old/Rakefile.cross 2015-05-14 20:50:00.000000000 +0200 +++ new/Rakefile.cross 2015-09-03 23:03:40.000000000 +0200 @@ -21,17 +21,28 @@ class CrossLibrary < OpenStruct include Rake::DSL - def initialize(for_platform, openssl_config) + def initialize(for_platform, openssl_config, toolchain) super() self.for_platform = for_platform self.openssl_config = openssl_config + self.host_platform = toolchain # Cross-compilation constants - self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.1i' - self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.3.5' + self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.2d' + self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.4.4' - self.compile_home = Pathname( "./build" ).expand_path + # Check if symlinks work in the current working directory. + # This fails, if rake-compiler-dock is running on a Windows box. + begin + FileUtils.rm_f '.test_symlink' + FileUtils.ln_s '/', '.test_symlink' + rescue SystemCallError + # Symlinks don't work -> use home directory instead + self.compile_home = Pathname( "~/.ruby-pg-build" ).expand_path + else + self.compile_home = Pathname( "./build" ).expand_path + end self.static_sourcesdir = compile_home + 'sources' self.static_builddir = compile_home + 'builds' + for_platform @@ -67,17 +78,6 @@ self.postgresql_lib = static_postgresql_libdir + 'libpq.dll' self.postgresql_patches = Rake::FileList[ (MISCDIR + "postgresql-#{postgresql_version}.*.patch").to_s ] - # Use rake-compilers config.yml to determine the toolchain that was used - # to build Ruby for this platform. - self.host_platform = begin - config_file = YAML.load_file(File.expand_path("~/.rake-compiler/config.yml")) - _, rbfile = config_file.find{|key, fname| key.start_with?("rbconfig-#{for_platform}-") } - IO.read(rbfile).match(/CONFIG\["CC"\] = "(.*)"/)[1].sub(/\-gcc/, '') - rescue - nil - end - - # clean intermediate files and folders CLEAN.include( static_builddir.to_s ) @@ -217,6 +217,11 @@ # make libpq.dll task postgresql_lib => [ postgresql_global_makefile ] do |t| + # Work around missing dependency to libcommon in PostgreSQL-9.4.0 + chdir( static_postgresql_srcdir + "common" ) do + sh 'make', "-j#{NUM_CPUS}" + end + chdir( postgresql_lib.dirname ) do sh 'make', "-j#{NUM_CPUS}", @@ -246,10 +251,10 @@ if File.exist?(File.expand_path("~/.rake-compiler/config.yml")) CrossLibraries = [ - ['i386-mingw32', 'mingw'], - ['x64-mingw32', 'mingw64'], - ].map do |platform, openssl_config| - CrossLibrary.new platform, openssl_config + ['i386-mingw32', 'mingw', 'i686-w64-mingw32'], + ['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'], + ].map do |platform, openssl_config, toolchain| + CrossLibrary.new platform, openssl_config, toolchain end else $stderr.puts "Cross-compilation disabled -- rake-compiler not properly installed" @@ -278,3 +283,19 @@ sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pg_ext.so" end end + +desc "Build the windows binary gems" +task 'gem:windows' => ['ChangeLog'] do + require 'rake_compiler_dock' + + # Copy gem signing key and certs to be accessable from the docker container + mkdir_p 'build/gem' + sh "cp ~/.gem/gem-*.pem build/gem/" + + RakeCompilerDock.sh <<-EOT + mkdir ~/.gem && + cp build/gem/gem-*.pem ~/.gem/ && + bundle install && + rake cross native gem RUBYOPT=--disable-rubygems RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2 + EOT +end Files old/checksums.yaml.gz and new/checksums.yaml.gz differ Files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ Files old/data.tar.gz.sig and new/data.tar.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/pg_connection.c new/ext/pg_connection.c --- old/ext/pg_connection.c 2015-05-14 20:50:00.000000000 +0200 +++ new/ext/pg_connection.c 2015-09-03 23:03:40.000000000 +0200 @@ -1,6 +1,6 @@ /* * pg_connection.c - PG::Connection class extension - * $Id: pg_connection.c,v 714601d05fba 2015/02/11 20:45:04 lars $ + * $Id: pg_connection.c,v eb4d3c003bd6 2015/05/25 20:04:04 ged $ * */ @@ -1534,7 +1534,7 @@ Check_Type(string, T_STRING); escaped = ALLOC_N(char, RSTRING_LEN(string) * 2 + 1); - if(rb_obj_class(self) == rb_cPGconn) { + if( rb_obj_is_kind_of(self, rb_cPGconn) ) { size = PQescapeStringConn(pg_get_pgconn(self), escaped, RSTRING_PTR(string), RSTRING_LEN(string), &error); if(error) { @@ -1547,7 +1547,7 @@ result = rb_str_new(escaped, size); xfree(escaped); OBJ_INFECT(result, string); - PG_ENCODING_SET_NOCHECK(result, ENCODING_GET( rb_obj_class(self) == rb_cPGconn ? self : string )); + PG_ENCODING_SET_NOCHECK(result, ENCODING_GET( rb_obj_is_kind_of(self, rb_cPGconn) ? self : string )); return result; } @@ -1587,7 +1587,7 @@ from = (unsigned char*)RSTRING_PTR(str); from_len = RSTRING_LEN(str); - if(rb_obj_class(self) == rb_cPGconn) { + if ( rb_obj_is_kind_of(self, rb_cPGconn) ) { to = PQescapeByteaConn(pg_get_pgconn(self), from, from_len, &to_len); } else { to = PQescapeBytea( from, from_len, &to_len); @@ -3031,7 +3031,7 @@ pg_text_enc_identifier(NULL, in_str, NULL, &ret); OBJ_INFECT(ret, in_str); - PG_ENCODING_SET_NOCHECK(ret, ENCODING_GET( rb_obj_class(self) == rb_cPGconn ? self : in_str )); + PG_ENCODING_SET_NOCHECK(ret, ENCODING_GET( rb_obj_is_kind_of(self, rb_cPGconn) ? self : in_str )); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/util.c new/ext/util.c --- old/ext/util.c 2015-05-14 20:50:00.000000000 +0200 +++ new/ext/util.c 2015-09-03 23:03:40.000000000 +0200 @@ -1,6 +1,6 @@ /* * util.c - Utils for ruby-pg - * $Id: util.c,v b859963462b2 2015/03/13 17:39:35 lars $ + * $Id: util.c,v 5fb9170f6a7d 2015/06/29 11:15:12 kanis $ * */ @@ -17,7 +17,7 @@ void base64_encode( char *out, char *in, int len) { - char *in_ptr = in + len; + unsigned char *in_ptr = (unsigned char *)in + len; char *out_ptr = out + BASE64_ENCODED_SIZE(len); int part_len = len % 3; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pg/basic_type_mapping.rb new/lib/pg/basic_type_mapping.rb --- old/lib/pg/basic_type_mapping.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/lib/pg/basic_type_mapping.rb 2015-09-03 23:03:40.000000000 +0200 @@ -25,9 +25,9 @@ # populate the enum types _enums, leaves = leaves.partition { |row| row['typinput'] == 'enum_in' } - # enums.each do |row| - # coder_map[row['oid'].to_i] = OID::Enum.new - # end + # enums.each do |row| + # coder_map[row['oid'].to_i] = OID::Enum.new + # end # populate the base types leaves.find_all { |row| coders_by_name.key?(row['typname']) }.each do |row| @@ -41,9 +41,9 @@ _records_by_oid = result.group_by { |row| row['oid'] } # populate composite types - # nodes.each do |row| - # add_oid row, records_by_oid, coder_map - # end + # nodes.each do |row| + # add_oid row, records_by_oid, coder_map + # end if arraycoder # populate array types @@ -62,11 +62,11 @@ end # populate range types - # ranges.find_all { |row| coder_map.key? row['rngsubtype'].to_i }.each do |row| - # subcoder = coder_map[row['rngsubtype'].to_i] - # range = OID::Range.new subcoder - # coder_map[row['oid'].to_i] = range - # end + # ranges.find_all { |row| coder_map.key? row['rngsubtype'].to_i }.each do |row| + # subcoder = coder_map[row['rngsubtype'].to_i] + # range = OID::Range.new subcoder + # coder_map[row['oid'].to_i] = range + # end @coders = coder_map.values @coders_by_name = @coders.inject({}){|h, t| h[t.name] = t; h } @@ -154,46 +154,46 @@ alias_type 0, 'int8', 'int2' alias_type 0, 'oid', 'int2' -# register_type 0, 'numeric', OID::Decimal.new + # register_type 0, 'numeric', OID::Decimal.new register_type 0, 'text', PG::TextEncoder::String, PG::TextDecoder::String alias_type 0, 'varchar', 'text' alias_type 0, 'char', 'text' alias_type 0, 'bpchar', 'text' alias_type 0, 'xml', 'text' -# # FIXME: why are we keeping these types as strings? -# alias_type 'tsvector', 'text' -# alias_type 'interval', 'text' -# alias_type 'macaddr', 'text' -# alias_type 'uuid', 'text' -# -# register_type 'money', OID::Money.new + # FIXME: why are we keeping these types as strings? + # alias_type 'tsvector', 'text' + # alias_type 'interval', 'text' + # alias_type 'macaddr', 'text' + # alias_type 'uuid', 'text' + # + # register_type 'money', OID::Money.new # There is no PG::TextEncoder::Bytea, because it's simple and more efficient to send bytea-data # in binary format, either with PG::BinaryEncoder::Bytea or in Hash param format. register_type 0, 'bytea', nil, PG::TextDecoder::Bytea register_type 0, 'bool', PG::TextEncoder::Boolean, PG::TextDecoder::Boolean -# register_type 'bit', OID::Bit.new -# register_type 'varbit', OID::Bit.new -# + # register_type 'bit', OID::Bit.new + # register_type 'varbit', OID::Bit.new + register_type 0, 'float4', PG::TextEncoder::Float, PG::TextDecoder::Float alias_type 0, 'float8', 'float4' register_type 0, 'timestamp', PG::TextEncoder::TimestampWithoutTimeZone, PG::TextDecoder::TimestampWithoutTimeZone register_type 0, 'timestamptz', PG::TextEncoder::TimestampWithTimeZone, PG::TextDecoder::TimestampWithTimeZone register_type 0, 'date', PG::TextEncoder::Date, PG::TextDecoder::Date -# register_type 'time', OID::Time.new -# -# register_type 'path', OID::Text.new -# register_type 'point', OID::Point.new -# register_type 'polygon', OID::Text.new -# register_type 'circle', OID::Text.new -# register_type 'hstore', OID::Hstore.new -# register_type 'json', OID::Json.new -# register_type 'citext', OID::Text.new -# register_type 'ltree', OID::Text.new -# -# register_type 'cidr', OID::Cidr.new -# alias_type 'inet', 'cidr' + # register_type 'time', OID::Time.new + # + # register_type 'path', OID::Text.new + # register_type 'point', OID::Point.new + # register_type 'polygon', OID::Text.new + # register_type 'circle', OID::Text.new + # register_type 'hstore', OID::Hstore.new + # register_type 'json', OID::Json.new + # register_type 'citext', OID::Text.new + # register_type 'ltree', OID::Text.new + # + # register_type 'cidr', OID::Cidr.new + # alias_type 'inet', 'cidr' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pg/text_decoder.rb new/lib/pg/text_decoder.rb --- old/lib/pg/text_decoder.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/lib/pg/text_decoder.rb 2015-09-03 23:03:40.000000000 +0200 @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +require 'date' + module PG module TextDecoder class Date < SimpleDecoder @@ -7,7 +9,7 @@ def decode(string, tuple=nil, field=nil) if string =~ ISO_DATE - Time.new $1.to_i, $2.to_i, $3.to_i + ::Date.new $1.to_i, $2.to_i, $3.to_i else string end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/pg.rb new/lib/pg.rb --- old/lib/pg.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/lib/pg.rb 2015-09-03 23:03:40.000000000 +0200 @@ -24,10 +24,10 @@ module PG # Library version - VERSION = '0.18.2' + VERSION = '0.18.3' # VCS revision - REVISION = %q$Revision: 7d31b04e7913 $ + REVISION = %q$Revision: 3b49541c9f12 $ class NotAllCopyDataRetrieved < PG::Error end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-05-14 20:50:00.000000000 +0200 +++ new/metadata 2015-09-03 23:03:40.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: pg version: !ruby/object:Gem::Version - version: 0.18.2 + version: 0.18.3 platform: ruby authors: - Michael Granger @@ -31,7 +31,7 @@ G8LHR7EjtPPmqCCunfyecJ6MmCNaiJCBxq2NYzyNmluPyHT8+0fuB5kccUVZm6CD xn3DzOkDE6NYbk8gC9rTsA== -----END CERTIFICATE----- -date: 2015-05-14 00:00:00.000000000 Z +date: 2015-09-03 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: hoe-mercurial @@ -53,14 +53,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: '0.6' + version: '0.7' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '0.6' + version: '0.7' - !ruby/object:Gem::Dependency name: hoe-highline requirement: !ruby/object:Gem::Requirement @@ -104,6 +104,20 @@ - !ruby/object:Gem::Version version: '0.9' - !ruby/object:Gem::Dependency + name: rake-compiler-dock + requirement: !ruby/object:Gem::Requirement + requirements: + - - "~>" + - !ruby/object:Gem::Version + version: '0.3' + type: :development + prerelease: false + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - "~>" + - !ruby/object:Gem::Version + version: '0.3' +- !ruby/object:Gem::Dependency name: hoe requirement: !ruby/object:Gem::Requirement requirements: @@ -315,7 +329,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.4.6 +rubygems_version: 2.4.7 signing_key: specification_version: 4 summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/] Files old/metadata.gz.sig and new/metadata.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/helpers.rb new/spec/helpers.rb --- old/spec/helpers.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/spec/helpers.rb 2015-09-03 23:03:40.000000000 +0200 @@ -255,7 +255,7 @@ unless conns.empty? puts "Lingering connections remain:" conns.each do |row| - puts " [%d] {%s} %s -- %s" % row.values_at( 'pid', 'state', 'application_name', 'query' ) + puts " [%s] {%s} %s -- %s" % row.values_at( 'pid', 'state', 'application_name', 'query' ) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/pg/basic_type_mapping_spec.rb new/spec/pg/basic_type_mapping_spec.rb --- old/spec/pg/basic_type_mapping_spec.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/spec/pg/basic_type_mapping_spec.rb 2015-09-03 23:03:40.000000000 +0200 @@ -58,8 +58,8 @@ it "should do OID based type conversions", :ruby_19 do res = @conn.exec( "SELECT 1, 'a', 2.0::FLOAT, TRUE, '2013-06-30'::DATE, generate_series(4,5)" ) expect( res.map_types!(basic_type_mapping).values ).to eq( [ - [ 1, 'a', 2.0, true, Time.new(2013,6,30), 4 ], - [ 1, 'a', 2.0, true, Time.new(2013,6,30), 5 ], + [ 1, 'a', 2.0, true, Date.new(2013,6,30), 4 ], + [ 1, 'a', 2.0, true, Date.new(2013,6,30), 5 ], ] ) end @@ -159,8 +159,8 @@ CAST('1913-12-31' AS DATE), CAST('infinity' AS DATE), CAST('-infinity' AS DATE)", [], format ) - expect( res.getvalue(0,0) ).to eq( Time.new(2113, 12, 31) ) - expect( res.getvalue(0,1) ).to eq( Time.new(1913, 12, 31) ) + expect( res.getvalue(0,0) ).to eq( Date.new(2113, 12, 31) ) + expect( res.getvalue(0,1) ).to eq( Date.new(1913, 12, 31) ) expect( res.getvalue(0,2) ).to eq( 'infinity' ) expect( res.getvalue(0,3) ).to eq( '-infinity' ) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/pg/connection_spec.rb new/spec/pg/connection_spec.rb --- old/spec/pg/connection_spec.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/spec/pg/connection_spec.rb 2015-09-03 23:03:40.000000000 +0200 @@ -228,11 +228,14 @@ expect( @conn.db ).to eq( "test" ) expect( @conn.user ).to be_a_kind_of( String ) expect( @conn.pass ).to eq( "" ) - expect( @conn.host ).to eq( "localhost" ) expect( @conn.port ).to eq( 54321 ) expect( @conn.tty ).to eq( "" ) expect( @conn.options ).to eq( "" ) end + it "can retrieve it's connection parameters for the established connection", + skip: RUBY_PLATFORM=~/x64-mingw/ ? "host segfaults on Windows-x64" : false do + expect( @conn.host ).to eq( "localhost" ) + end EXPECTED_TRACE_OUTPUT = %{ To backend> Msg Q @@ -705,7 +708,7 @@ it "can return the default connection options as a Hash" do expect( described_class.conndefaults_hash ).to be_a( Hash ) expect( described_class.conndefaults_hash ).to include( :user, :password, :dbname, :host, :port ) - expect( described_class.conndefaults_hash[:port] ).to eq( '54321' ) + expect( ['5432', '54321'] ).to include( described_class.conndefaults_hash[:port] ) expect( @conn.conndefaults_hash ).to eq( described_class.conndefaults_hash ) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/pg/type_spec.rb new/spec/pg/type_spec.rb --- old/spec/pg/type_spec.rb 2015-05-14 20:50:00.000000000 +0200 +++ new/spec/pg/type_spec.rb 2015-09-03 23:03:40.000000000 +0200 @@ -512,6 +512,7 @@ expect( e.encode("xxxx") ).to eq("eHh4eA==") expect( e.encode("xxxxx") ).to eq("eHh4eHg=") expect( e.encode("\0\n\t") ).to eq("AAoJ") + expect( e.encode("(\xFBm") ).to eq("KPtt") end it "should encode Strings as base64 in BinaryDecoder" do @@ -540,6 +541,7 @@ expect( e.decode("eHh4eA==") ).to eq("xxxx") expect( e.decode("eHh4eHg=") ).to eq("xxxxx") expect( e.decode("AAoJ") ).to eq("\0\n\t") + expect( e.decode("KPtt") ).to eq("(\xFBm") end it "should decode base64 in BinaryEncoder" do
