adacosta-labilerecord 0.0.2 → 0.0.3

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 -1
  2. data/README.rdoc +10 -9
  3. data/lib/labilerecord.rb +3 -3
  4. metadata +1 -1
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- == 0.0.1 2009-04-14
1
+ == 0.0.3 2009-04-14
2
2
 
3
3
  * 1 major enhancement:
4
4
  * Initial release
5
+ * 2 :
6
+ * Bumped version for github
7
+ * 3 :
8
+ * Changed Query.data to Query.rows
data/README.rdoc CHANGED
@@ -15,19 +15,20 @@
15
15
 
16
16
  == SYNOPSIS:
17
17
 
18
- require 'rubygems'
19
18
  require 'labilerecord'
20
19
 
21
20
  LabileRecord::Base.connection = {:dbname => 'postgres', :user => user,
22
21
  :pass => pass, :host => host, :port => port}
23
22
 
24
- q = LabileRecord::Query.new("SELECT * FROM pg_database")
23
+ databases = LabileRecord::Query.new("SELECT * FROM pg_database")
25
24
  # execute the query
26
- q.exec
27
- # inspect data
28
- q.data.inspect
29
- #inspect fields (columns)
30
- q.fields.inspect
25
+ databases.exec!
26
+ # inspect rows
27
+ puts databases.rows.inspect
28
+ # inspect fields (columns)
29
+ puts databases.fields.inspect
30
+ # inspect specific row and column of data set
31
+ puts datases.rows[0].datname
31
32
 
32
33
  == REQUIREMENTS:
33
34
 
@@ -35,8 +36,8 @@
35
36
 
36
37
  == INSTALL:
37
38
 
38
- * gem sources -a http://gems.github.com
39
- * sudo gem install adacosta-labilerecord
39
+ gem sources -a http://gems.github.com
40
+ sudo gem install adacosta-labilerecord
40
41
 
41
42
  == LICENSE:
42
43
 
data/lib/labilerecord.rb CHANGED
@@ -18,7 +18,7 @@ module LabileRecord
18
18
  end
19
19
 
20
20
  class Query < LabileRecord::Base
21
- attr_reader :data
21
+ attr_reader :rows
22
22
  attr_reader :result
23
23
  attr_reader :fields
24
24
  attr_reader :string
@@ -27,7 +27,7 @@ module LabileRecord
27
27
  @string = query_string
28
28
  end
29
29
 
30
- def exec
30
+ def exec!
31
31
  @result = connection.exec(@string)
32
32
  parse_fields
33
33
  parse_result_data
@@ -46,7 +46,7 @@ module LabileRecord
46
46
  end
47
47
  rows << row
48
48
  end
49
- @data = rows
49
+ @rows = rows
50
50
  end
51
51
 
52
52
  def parse_fields
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Da Costa