monetdb 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a5ec545e31663df97597447cdbd33b25e2d88c86
4
- data.tar.gz: f3bc08654b1fac1b7cc99988e269aa8d3707c412
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjA0NTQ0M2UwZDAxMjUxNjFiZTFkMjc5MjUzYmY2MWIyNWY2MTc1ZQ==
5
+ data.tar.gz: !binary |-
6
+ NjM3MWRlZGQ4MmI5YjIwZTdkYjM0MmEzNzQ3M2Y4NDJjZmRjZjUwZA==
5
7
  SHA512:
6
- metadata.gz: ab6e208b3f0c3a93de085f7ee71d15277b1615e7cd3b77f722d7cf35f96abb9fcf463083cffa724ec691497cfaf6dd7f91a3553b74bbe3260ca848e876e62781
7
- data.tar.gz: e10a8e18b1a99d5fdaff880af3ab7b358a4962a6ffdbc9a179c454901f5b6df9f77cb4327db2756e1daa9cee3848d2fa9e3918f6e9e41085d373ce8ce360acd4
8
+ metadata.gz: !binary |-
9
+ Mjc4ZGU5NzJkYWUzZGQ3ZDIzODVkN2UyZGMzMzUyZmFiNWYyNTZiY2YxMzU5
10
+ MmE4OWRhMWE5Mjk2Yjc4YjE2M2VkYTQ2ZTU2ZjQ5ODY3NDAzNzg1YTJhOGIz
11
+ ZWM1ODdmOTg1MjhjZTljNDg3NmU1OWFhZjEyYWQyZDhmOWEyYjM=
12
+ data.tar.gz: !binary |-
13
+ ZjkxYWY4ZTQwYWU5MWZiNzk0MmE2NzJkZTYzYzRiZjFlMTE4NDA1NmY4YWU5
14
+ N2Y5Y2UyYTVjYmEzMmFhMDE3ZDU3YjE0YzA3ODVjYjg3YWVlZGZkMmUzMmRm
15
+ MzI2ZmViNGQxNjcwOTA4Mjc2MTc1MmQ4ZGE2NmQ5NTRiZmY4YzE=
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,11 @@
1
1
  = MonetDB CHANGELOG
2
2
 
3
+ == Version 0.2.2 (October 13, 2014)
4
+
5
+ * Added MonetDB::Connection#select_values
6
+ * Added MonetDB::Connection#select_value
7
+ * Changed license to MIT License
8
+
3
9
  == Version 0.2.1 (October 13, 2014)
4
10
 
5
11
  * Extracted IO related methods to MonetDB::Connection::IO
@@ -8,6 +14,7 @@
8
14
  == Version 0.2.0 (October 13, 2014)
9
15
 
10
16
  * Complete rewrite of the gem (only focussed on querying data using SQL)
17
+ * Fixed major bug when fetching large result sets (rows were missing)
11
18
 
12
19
  == Version 0.1.3 (October 8, 2014)
13
20
 
@@ -23,4 +30,4 @@
23
30
 
24
31
  == Version 0.1.0 (August 28, 2014)
25
32
 
26
- * Initial release
33
+ * Initial release
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Paul Engel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -16,7 +16,7 @@ Run the following in your console to install with Bundler:
16
16
 
17
17
  === License
18
18
 
19
- Copyright (c) 2014 Paul Engel, released under the MonetDB Public License v1.1
19
+ Copyright (c) 2014 Paul Engel, released under the MIT License
20
20
 
21
21
  http://gettopup.com – http://github.com/archan937 – http://twitter.com/archan937 – {pm_engel@icloud.com}[mailto:pm_engel@icloud.com]
22
22
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -24,6 +24,15 @@ module MonetDB
24
24
 
25
25
  alias :select_rows :query
26
26
 
27
+ def select_values(query)
28
+ select_rows(query).collect{|x| x[0]}
29
+ end
30
+
31
+ def select_value(query)
32
+ row = select_rows(query)[0]
33
+ row[0] if row
34
+ end
35
+
27
36
  private
28
37
 
29
38
  def extract_headers!(response)
@@ -1,7 +1,7 @@
1
1
  module MonetDB
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- TINY = 1
4
+ TINY = 2
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -75,7 +75,7 @@ module Unit
75
75
  end
76
76
  end
77
77
 
78
- describe "when doing another query" do
78
+ describe "when doing any another type of query" do
79
79
  it "returns true" do
80
80
  query = "UPDATE foo_bars SET updated_at = NOW()"
81
81
 
@@ -88,6 +88,42 @@ module Unit
88
88
  end
89
89
  end
90
90
 
91
+ describe "#select_values" do
92
+ before do
93
+ @query = "SELECT id FROM relations ORDER BY id LIMIT 4"
94
+ end
95
+ describe "when empty result set" do
96
+ it "returns an empty array" do
97
+ @connection.expects(:select_rows).with(@query).returns([])
98
+ assert_equal [], @connection.select_values(@query)
99
+ end
100
+ end
101
+ describe "when getting data" do
102
+ it "returns every first value of every row" do
103
+ @connection.expects(:select_rows).with(@query).returns([[1934], [1947], [1980], [1982]])
104
+ assert_equal [1934, 1947, 1980, 1982], @connection.select_values(@query)
105
+ end
106
+ end
107
+ end
108
+
109
+ describe "#select_value" do
110
+ before do
111
+ @query = "SELECT id FROM relations ORDER BY id LIMIT 1"
112
+ end
113
+ describe "when empty result set" do
114
+ it "returns nil" do
115
+ @connection.expects(:select_rows).with(@query).returns([])
116
+ assert_nil @connection.select_value(@query)
117
+ end
118
+ end
119
+ describe "when getting data" do
120
+ it "returns the first value of the first row" do
121
+ @connection.expects(:select_rows).with(@query).returns([[1982]])
122
+ assert_equal 1982, @connection.select_value(@query)
123
+ end
124
+ end
125
+ end
126
+
91
127
  describe "#extract_headers!" do
92
128
  it "returns an array with delegated return values" do
93
129
  response, foo, bar = mock, mock, mock
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monetdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Engel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-12 00:00:00.000000000 Z
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: yard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mocha
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: A pure Ruby database driver for MonetDB (monetdb5-sql)
@@ -115,11 +115,11 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".gitignore"
119
- - ".travis.yml"
118
+ - .gitignore
119
+ - .travis.yml
120
120
  - CHANGELOG.rdoc
121
121
  - Gemfile
122
- - LICENSE
122
+ - MIT-LICENSE
123
123
  - README.rdoc
124
124
  - Rakefile
125
125
  - VERSION
@@ -152,17 +152,17 @@ require_paths:
152
152
  - lib
153
153
  required_ruby_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ">="
155
+ - - ! '>='
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - ">="
160
+ - - ! '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.2.2
165
+ rubygems_version: 2.1.11
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: A pure Ruby database driver for MonetDB (monetdb5-sql)
data/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- The contents of this repository are subject to the MonetDB Public License
2
- Version 1.1 (the "License"); you may not use this file except in
3
- compliance with the License. You may obtain a copy of the License at
4
- https://www.monetdb.org/Legal/MonetDBLicense
5
-
6
- Software distributed under the License is distributed on an "AS IS"
7
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
8
- License for the specific language governing rights and limitations
9
- under the License.
10
-
11
- The Original Code is the MonetDB Database System.
12
-
13
- The Initial Developer of the Original Code is CWI.
14
- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
15
-
16
- Copyright August 2008-2011 MonetDB B.V.
17
- All Rights Reserved.
18
-
19
- Copyright (c) 2014 Paul Engel, released under the MonetDB Public License v1.1