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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc69b9477f5dd9407b74c29aee3e7c064b24eb85
4
- data.tar.gz: 4b05a5d4159f38ada22ad28af67df2f68ea04f2c
3
+ metadata.gz: 45f84e5b337db84fb1de32c459cf3909a0ff6334
4
+ data.tar.gz: 036aa4f75afe3a7c75491c7ec4a5e2c00e437942
5
5
  SHA512:
6
- metadata.gz: 3dfc4f0b91ca7ddf829500452cd4d9fe9ec75c040e8834dda55e3bbb27fc75962c50f0d7558bc78f8fc38074f828782369000a3c89e903cc853c6b4e18bb6a74
7
- data.tar.gz: 61190c1b86d312d7968b9c8ef2bdebd2b99b7950e036083dcdd8ab552d23cf929eb7d771cf91b1e6e5f232e04f93927cc75428f78cbc5c7a0a054db171e93000
6
+ metadata.gz: a5f62e018d7839721caf97bcedb299639fa0cb85a7448cf50f9616e60517184d5d8dce3ca285aaa1c18db66d5275e10ca076d11f437dffbea70e0bd9d886d970
7
+ data.tar.gz: 4657cd2f26f7525faaab333b754842ffc463e86a1cf851d677ff89def476164d4f885c693e5b3602e799d3b12e291085c309d9ddeeff1855bea8b4cedd5de155
@@ -1,5 +1,5 @@
1
1
  # File: taupe.rb
2
- # Time-stamp: <2014-12-10 15:59:00 pierre>
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, 3].join('.')
16
+ VERSION = [0, 6, 4].join('.')
17
17
 
18
18
  # Require a gem
19
19
  # @param gem_name [String] the gem name
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # File: table.rb
4
- # Time-stamp: <2014-12-10 15:58:00 pierre>
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]
@@ -1,5 +1,5 @@
1
1
  # File: model_spec.rb
2
- # Time-stamp: <2014-09-11 16:03:43 pierre>
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
@@ -1,5 +1,5 @@
1
1
  # File: taupe_spec.rb
2
- # Time-stamp: <2014-12-10 15:59:17 pierre>
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.3' do
11
- expect(Taupe::VERSION).to eql '0.6.3'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taupe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Lecocq