[DRE-commits] [ruby-sequel-pg] 01/03: Imported Upstream version 1.6.10

Dmitry Borodaenko angdraug at moszumanska.debian.org
Sat Aug 23 22:01:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

angdraug pushed a commit to branch master
in repository ruby-sequel-pg.

commit 311191fa5037d835a8e34934c080b000111b14bc
Author: Dmitry Borodaenko <angdraug at gmail.com>
Date:   Sat Aug 23 14:54:52 2014 -0700

    Imported Upstream version 1.6.10
---
 CHANGELOG                 |  4 ++++
 README.rdoc               |  5 +++++
 ext/sequel_pg/sequel_pg.c | 18 +++++++++++-------
 sequel_pg.gemspec         |  2 +-
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 316edef..7bf6f74 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+=== 1.6.10 (2014-07-11)
+
+* Work correctly when the database timezone is not a named timezone but the application timezone is (jeremyevans)
+
 === 1.6.9 (2014-03-05)
 
 * When using the streaming extension, automatically use streaming to implement paging in Dataset#paged_each (jeremyevans)
diff --git a/README.rdoc b/README.rdoc
index c9043d4..bcf3027 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -107,6 +107,11 @@ you should modify the maximum supported number of columns via:
 
    gem install sequel_pg -- --with-cflags=\"-DSPG_MAX_FIELDS=512\"
 
+Make sure the pg_config binary is in your PATH so the installation
+can find the PostgreSQL shared library and header files.  Alternatively,
+you can use the POSTGRES_LIB and POSTGRES_INCLUDE environment
+variables to specify the shared library and header directories.
+
 == Running the specs
 
 sequel_pg doesn't ship with it's own specs.  It's designed to
diff --git a/ext/sequel_pg/sequel_pg.c b/ext/sequel_pg/sequel_pg.c
index 1a422e2..bdc10fc 100644
--- a/ext/sequel_pg/sequel_pg.c
+++ b/ext/sequel_pg/sequel_pg.c
@@ -309,6 +309,17 @@ static VALUE spg_timestamp(const char *s, VALUE self) {
     }
   }
 
+  rtz = rb_funcall(spg_Sequel, spg_id_application_timezone, 0);
+  if (rtz != Qnil) {
+    if (rtz == spg_sym_local) {
+      tz += SPG_APP_LOCAL;
+    } else if (rtz == spg_sym_utc) {
+      tz += SPG_APP_UTC;
+    } else {
+      return rb_funcall(db, spg_id_to_application_timestamp, 1, rb_str_new2(s)); 
+    }
+  }
+
   if (0 != strchr(s, '.')) {
     tokens = sscanf(s, "%d-%2d-%2d %2d:%2d:%2d.%n%d%n%c%02d:%02d", 
 	&year, &month, &day, &hour, &min, &sec,
@@ -337,14 +348,7 @@ static VALUE spg_timestamp(const char *s, VALUE self) {
     offset_minute *= -1;
   }
 
-  /* Get values of datetime_class, database_timezone, and application_timezone */
   dtc = rb_funcall(spg_Sequel, spg_id_datetime_class, 0);
-  rtz = rb_funcall(spg_Sequel, spg_id_application_timezone, 0);
-  if (rtz == spg_sym_local) {
-    tz += SPG_APP_LOCAL;
-  } else if (rtz == spg_sym_utc) {
-    tz += SPG_APP_UTC;
-  }
 
   if (dtc == rb_cTime) {
     if (offset_sign) {
diff --git a/sequel_pg.gemspec b/sequel_pg.gemspec
index 1bf3ad9..5d6d16b 100644
--- a/sequel_pg.gemspec
+++ b/sequel_pg.gemspec
@@ -1,6 +1,6 @@
 SEQUEL_PG_GEMSPEC = Gem::Specification.new do |s|
   s.name = 'sequel_pg'
-  s.version = '1.6.9'
+  s.version = '1.6.10'
   s.platform = Gem::Platform::RUBY
   s.has_rdoc = false
   s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "MIT-LICENSE"]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-sequel-pg.git



More information about the Pkg-ruby-extras-commits mailing list