hivemeta 0.1.9 → 0.2.0
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.
- data/CHANGELOG +4 -0
- data/lib/hivemeta/record.rb +11 -1
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
* 2011-08-12 - fsf
|
2
|
+
- new: added _count, _size, _length methods for row to read column count
|
3
|
+
- fix: NoMethodError is properly raised if a bogus field is read
|
4
|
+
|
1
5
|
* 2011-07-06 - fsf
|
2
6
|
- new: added introductory jruby/jdbc support
|
3
7
|
- change: HiveMeta::Connection.initialize takes 4 optional arguments now
|
data/lib/hivemeta/record.rb
CHANGED
@@ -12,6 +12,15 @@ module HiveMeta
|
|
12
12
|
@table = table
|
13
13
|
end
|
14
14
|
|
15
|
+
# avoid collisions with column name 'count'
|
16
|
+
# ugly :(
|
17
|
+
def _count
|
18
|
+
@fields.count
|
19
|
+
end
|
20
|
+
|
21
|
+
alias :_size :_count
|
22
|
+
alias :_length :_count
|
23
|
+
|
15
24
|
# allow for column access via column name as an index
|
16
25
|
# example: rec[:col_name]
|
17
26
|
# or: rec['col_name']
|
@@ -25,7 +34,8 @@ module HiveMeta
|
|
25
34
|
# allow for column access via column name as a method
|
26
35
|
# example: rec.col_name
|
27
36
|
def method_missing(id, *args)
|
28
|
-
return @fields[@table.indexes[id]]
|
37
|
+
return @fields[@table.indexes[id]]
|
38
|
+
rescue
|
29
39
|
raise NoMethodError
|
30
40
|
end
|
31
41
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Frank Fejes
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-08-12 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|