taupe 0.6.3 → 0.6.4
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.
- checksums.yaml +4 -4
- data/lib/taupe.rb +2 -2
- data/lib/taupe/model/table.rb +7 -1
- data/spec/model_spec.rb +12 -1
- data/spec/taupe_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45f84e5b337db84fb1de32c459cf3909a0ff6334
|
4
|
+
data.tar.gz: 036aa4f75afe3a7c75491c7ec4a5e2c00e437942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f62e018d7839721caf97bcedb299639fa0cb85a7448cf50f9616e60517184d5d8dce3ca285aaa1c18db66d5275e10ca076d11f437dffbea70e0bd9d886d970
|
7
|
+
data.tar.gz: 4657cd2f26f7525faaab333b754842ffc463e86a1cf851d677ff89def476164d4f885c693e5b3602e799d3b12e291085c309d9ddeeff1855bea8b4cedd5de155
|
data/lib/taupe.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# File: taupe.rb
|
2
|
-
# Time-stamp: <2014-12-10
|
2
|
+
# Time-stamp: <2014-12-10 16:24:51 pierre>
|
3
3
|
# Copyright (C) 2014 Pierre Lecocq
|
4
4
|
# Description: Taupe library main file
|
5
5
|
|
@@ -13,7 +13,7 @@ require 'taupe/model'
|
|
13
13
|
# Main Taupe module
|
14
14
|
module Taupe
|
15
15
|
# Current version constant in the form major.minor.patch
|
16
|
-
VERSION = [0, 6,
|
16
|
+
VERSION = [0, 6, 4].join('.')
|
17
17
|
|
18
18
|
# Require a gem
|
19
19
|
# @param gem_name [String] the gem name
|
data/lib/taupe/model/table.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
# File: table.rb
|
4
|
-
# Time-stamp: <2014-12-10
|
4
|
+
# Time-stamp: <2014-12-10 16:24:03 pierre>
|
5
5
|
# Copyright (C) 2014 Pierre Lecocq
|
6
6
|
# Description: Taupe library model table class
|
7
7
|
|
@@ -195,6 +195,12 @@ module Taupe
|
|
195
195
|
@_values[key]
|
196
196
|
end
|
197
197
|
|
198
|
+
# Transform to hash
|
199
|
+
# @return [Hash]
|
200
|
+
def to_hash
|
201
|
+
@_values
|
202
|
+
end
|
203
|
+
|
198
204
|
# Execute a single query
|
199
205
|
# @param query [String] The query to execute
|
200
206
|
# @return [Object]
|
data/spec/model_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# File: model_spec.rb
|
2
|
-
# Time-stamp: <2014-
|
2
|
+
# Time-stamp: <2014-12-10 16:27:47 pierre>
|
3
3
|
# Copyright (C) 2014 Pierre Lecocq
|
4
4
|
# Description: Taupe library model tests file
|
5
5
|
|
@@ -53,4 +53,15 @@ describe Taupe::Model do
|
|
53
53
|
expect(results.last.title).to eql 'This is a new article'
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
# Types
|
58
|
+
describe 'types' do
|
59
|
+
it 'should return an object and transform it to an Hash' do
|
60
|
+
query = "SELECT * FROM article WHERE article_id = 1"
|
61
|
+
result = Taupe::Model::Article.fetch(query, true)
|
62
|
+
expect(result).to be_a Taupe::Model::Article
|
63
|
+
hash_result = result.to_hash
|
64
|
+
expect(hash_result).to be_a Hash
|
65
|
+
end
|
66
|
+
end
|
56
67
|
end
|
data/spec/taupe_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# File: taupe_spec.rb
|
2
|
-
# Time-stamp: <2014-12-10
|
2
|
+
# Time-stamp: <2014-12-10 16:28:36 pierre>
|
3
3
|
# Copyright (C) 2014 Pierre Lecocq
|
4
4
|
# Description: Taupe library main tests file
|
5
5
|
|
@@ -7,8 +7,8 @@ require_relative '../lib/taupe'
|
|
7
7
|
|
8
8
|
describe Taupe do
|
9
9
|
describe 'VERSION' do
|
10
|
-
it 'should return 0.6.
|
11
|
-
expect(Taupe::VERSION).to eql '0.6.
|
10
|
+
it 'should return 0.6.4' do
|
11
|
+
expect(Taupe::VERSION).to eql '0.6.4'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|