activerecord-nuodb-adapter 1.0.1 → 1.0.2

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: 5dc9e5f9a4b2c788d6edc4827f2acf2eed90c1a3
4
- data.tar.gz: 936c6fe1f003e90aea1d2a2a19a9597e912be953
3
+ metadata.gz: dceb4c4edff859d8247cce658377dfcf6b0827a0
4
+ data.tar.gz: f87ceee850943be68e849ab746f67622cde524db
5
5
  SHA512:
6
- metadata.gz: 54151b9b46c73960f51398a54f766362b6d02d8695a99dc3c3c9b3977c0c413952ef6f550e51219239f2769351330bb30ffb1c663c02b96cf183f4929e6f4ab2
7
- data.tar.gz: 698fa5ee9edef596ef016e77bdd987e03a85d55b95aad1ab38be47e9f859013078163bfeb3f86471ac34593df97be16285ecb42d18327206ceb111e5f9585a2b
6
+ metadata.gz: c26ebe7068c17f61ae3340b286816e242360e4e90a756ebf7e44b73256099c5a55892bdfe6da5dd7070f5672651209f042b2ce62faa858e32bed65137f0d5f95
7
+ data.tar.gz: e80c91cd528092e7ca348edbf006d8c330ac3ea493180ff4ab171aec96b45fe4795669a214f4e78fcb95c6258c9a5b790e1be4af683e66f79931058f28aa1942
data/.travis.yml CHANGED
@@ -4,7 +4,8 @@ rvm:
4
4
  - 1.9.3
5
5
 
6
6
  env:
7
- - NUODB_ROOT=/opt/nuodb
7
+ - NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.0.2
8
+ - NUODB_ROOT=/opt/nuodb NUODB_VERSION=1.0.1
8
9
 
9
10
  notifications:
10
11
  recipients:
@@ -13,7 +14,7 @@ notifications:
13
14
  - lbayas@nuodb.com
14
15
 
15
16
  before_install:
16
- - wget http://www.nuodb.com/latest/nuodb-1.0.2.linux.x64.deb --output-document=/var/tmp/nuodb.deb
17
+ - wget http://www.nuodb.com/latest/releases/nuodb-${NUODB_VERSION}.linux.x64.deb --output-document=/var/tmp/nuodb.deb
17
18
  - sudo dpkg -i /var/tmp/nuodb.deb
18
19
  - sleep 2
19
20
 
data/CONTRIBUTION.rdoc CHANGED
@@ -12,7 +12,7 @@ To compile and test run this command:
12
12
 
13
13
  Or from the source tree:
14
14
 
15
- gem install pkg/activerecord-nuodb-adapter-1.0.1.gem
15
+ gem install pkg/activerecord-nuodb-adapter-1.0.2.gem
16
16
 
17
17
  Or you can do this using Rake:
18
18
 
@@ -41,26 +41,26 @@ Run the tests:
41
41
 
42
42
  Tag the product using tags per the SemVer specification; our tags have a v-prefix:
43
43
 
44
- git tag -a v1.0.1 -m "SemVer Version: v1.0.1"
44
+ git tag -a v1.0.2 -m "SemVer Version: v1.0.2"
45
45
  git push --tags
46
46
 
47
47
  If you make a mistake, take it back quickly:
48
48
 
49
- git tag -d v1.0.1
50
- git push origin :refs/tags/v1.0.1
49
+ git tag -d v1.0.2
50
+ git push origin :refs/tags/v1.0.2
51
51
 
52
52
  ===PUBLISHING
53
53
 
54
54
  Here are the commands used to publish:
55
55
 
56
- gem push pkg/activerecord-nuodb-adapter-1.0.1.gem
56
+ gem push pkg/activerecord-nuodb-adapter-1.0.2.gem
57
57
 
58
58
  == INSPECTING THE GEM
59
59
 
60
60
  It is often useful to inspect the contents of a Gem before distribution.
61
61
  To do this you dump the contents of a gem thus:
62
62
 
63
- gem unpack pkg/activerecord-nuodb-adapter-1.0.1.gem
63
+ gem unpack pkg/activerecord-nuodb-adapter-1.0.2.gem
64
64
 
65
65
  == RUNNING ACTIVE RECORD COMPLIANCE TEST SUITES
66
66
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.rdoc_options = %w(--charset=UTF-8)
15
15
  gem.extra_rdoc_files = %w[README.rdoc]
16
16
 
17
- gem.add_dependency('activerecord', '~> 3.2.8')
17
+ gem.add_dependency('activerecord', '~> 3.2.11')
18
18
  gem.add_development_dependency('rake', '~> 10.0.3')
19
19
  gem.add_development_dependency('rdoc', '~> 3.10')
20
20
  gem.add_dependency('nuodb', '~> 1.0.2')
@@ -29,7 +29,7 @@
29
29
  module ActiveRecord
30
30
  module ConnectionAdapters
31
31
  module NuoDB
32
- VERSION = '1.0.1'
32
+ VERSION = '1.0.2'
33
33
  end
34
34
  end
35
35
  end
@@ -281,7 +281,60 @@ module ActiveRecord
281
281
  end
282
282
 
283
283
  def supports_explain?
284
- false
284
+ true
285
+ end
286
+
287
+ def explain(arel, binds = [])
288
+ sql = "EXPLAIN #{to_sql(arel, binds.dup)}"
289
+ start = Time.now
290
+ result = exec_query(sql, 'EXPLAIN', binds)
291
+ elapsed = Time.now - start
292
+
293
+ ExplainPrettyPrinter.new.pp(result, elapsed)
294
+ end
295
+
296
+ class ExplainPrettyPrinter # :nodoc:
297
+
298
+ def pp(result, elapsed)
299
+ widths = compute_column_widths(result)
300
+
301
+ pp = []
302
+
303
+ pp << build_cells(result.columns, widths)
304
+
305
+ result.rows.each do |row|
306
+ pp << build_cells(row, widths)
307
+ end
308
+
309
+ pp << build_footer(result.rows.length, elapsed)
310
+
311
+ pp.join("\n") + "\n"
312
+ end
313
+
314
+ private
315
+
316
+ def compute_column_widths(result)
317
+ [].tap do |widths|
318
+ result.columns.each_with_index do |column, i|
319
+ cells_in_column = [column] + result.rows.map {|r| r[i].nil? ? 'NULL' : r[i].to_s}
320
+ widths << cells_in_column.map(&:length).max
321
+ end
322
+ end
323
+ end
324
+
325
+ def build_cells(items, widths)
326
+ cells = []
327
+ items.each_with_index do |item, i|
328
+ item = 'NULL' if item.nil?
329
+ justifier = item.is_a?(Numeric) ? 'rjust' : 'ljust'
330
+ cells << item.to_s.send(justifier, widths[i])
331
+ end
332
+ end
333
+
334
+ def build_footer(nrows, elapsed)
335
+ rows_label = nrows == 1 ? 'row' : 'rows'
336
+ "#{nrows} #{rows_label} in set (%.2f sec)" % elapsed
337
+ end
285
338
  end
286
339
 
287
340
  # CONNECTION MANAGEMENT ==================================
@@ -684,9 +737,9 @@ module ActiveRecord
684
737
  exec_query(sql, name).rows
685
738
  end
686
739
 
687
- def select_values(sql, name = nil)
688
- exec_query(sql, name).values
689
- end
740
+ # def select_values(sql, name = nil)
741
+ # exec_query(sql, name).values
742
+ # end
690
743
 
691
744
  def outside_transaction?
692
745
  nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-nuodb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Buck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-29 00:00:00.000000000 Z
11
+ date: 2013-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.8
19
+ version: 3.2.11
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
- version: 3.2.8
26
+ version: 3.2.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement