adacosta-labilerecord 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/History.txt +5 -2
  2. data/README.rdoc +1 -1
  3. data/lib/labilerecord.rb +13 -3
  4. metadata +1 -1
@@ -1,4 +1,4 @@
1
- == 0.0.8 2009-05-07
1
+ == 0.0.9 2009-05-07
2
2
 
3
3
  * 1 major enhancement:
4
4
  * Initial release
@@ -16,4 +16,7 @@
16
16
  * Increment revision; minor bug fix
17
17
  * 8 :
18
18
  * Added Query.to_insert_sql to transform dataset into
19
- an insert statement ... handy for data copies.
19
+ an insert statement ... handy for data copies.
20
+ * 9 :
21
+ * Attempt to load alternate postgresql adapter
22
+ * Fix readme example typo
@@ -35,7 +35,7 @@
35
35
  puts databases.fields.inspect
36
36
  # inspect specific row and column of data set
37
37
  # datname - being a column returned by the query
38
- puts datases[0].datname
38
+ puts databases[0].datname
39
39
 
40
40
  == REQUIREMENTS:
41
41
 
@@ -2,8 +2,18 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module LabileRecord
5
- VERSION = '0.0.8'
6
- require 'pg'
5
+ VERSION = '0.0.9'
6
+ # TODO: refactor into a clean method
7
+ # try to load a postgres adapter
8
+ begin
9
+ require 'pg'
10
+ rescue LoadError
11
+ begin
12
+ require 'postgres'
13
+ rescue LoadError
14
+ raise LoadError, 'no postgres adapters available to load; ensure rubygems or a postgres connection adapter path is required'
15
+ end
16
+ end
7
17
 
8
18
  class Base
9
19
  class << self
@@ -63,7 +73,7 @@ module LabileRecord
63
73
  end
64
74
 
65
75
  def to_insert_sql(table_name=nil)
66
- # return: [INSERT INTO table_name] (column_list) gVALUES(value_list);
76
+ # return: [INSERT INTO table_name] (column_list) VALUES(value_list);
67
77
  sql = ""
68
78
  each do |row|
69
79
  non_nil_column_names = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adacosta-labilerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Da Costa