nuodb 1.0.0.rc.1 → 1.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/spec/rcov.opts ADDED
@@ -0,0 +1,2 @@
1
+ --exclude
2
+ spec,bin,/Library/Ruby
data/spec/spec.opts ADDED
@@ -0,0 +1,3 @@
1
+ -c
2
+ -b
3
+ -fs
@@ -0,0 +1,18 @@
1
+ $:.unshift File.expand_path("../..", __FILE__)
2
+
3
+ require 'rubygems'
4
+ require 'rspec/mocks'
5
+
6
+ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
7
+ $:.unshift(File.expand_path("../lib", __FILE__))
8
+ $:.unshift(File.dirname(__FILE__))
9
+
10
+ require 'nuodb'
11
+ #require 'simplecov'
12
+ #
13
+ #SimpleCov.start do
14
+ # add_group 'Libraries', 'lib'
15
+ #end
16
+
17
+ require 'support/config'
18
+ require 'support/connection'
@@ -0,0 +1,42 @@
1
+ require 'yaml'
2
+ require 'erubis'
3
+ require 'fileutils'
4
+ require 'pathname'
5
+
6
+ SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
7
+
8
+ class Hash
9
+ def symbolize_keys!
10
+ keys.each do |key|
11
+ self[(key.to_sym rescue key) || key] = delete(key)
12
+ end
13
+ self
14
+ end
15
+ end
16
+
17
+ module BaseTest
18
+ class << self
19
+ def config
20
+ @config ||= read_config
21
+ end
22
+
23
+ private
24
+
25
+ def config_file
26
+ Pathname.new(ENV['NUODB_CONFIG'] || File.join(SPEC_ROOT, 'config.yml'))
27
+ end
28
+
29
+ def read_config
30
+ unless config_file.exist?
31
+ FileUtils.cp(File.join(SPEC_ROOT, 'config.example.yml'), config_file)
32
+ end
33
+
34
+ erb = Erubis::Eruby.new(config_file.read)
35
+ expand_config(YAML.parse(erb.result(binding)).transform)
36
+ end
37
+
38
+ def expand_config(config)
39
+ config
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,10 @@
1
+ default_connection: development
2
+
3
+ connections:
4
+ development:
5
+ database: 'test'
6
+ username: 'cloud'
7
+ password: 'user'
8
+ schema: 'test'
9
+ #timezone: 'UTC'
10
+
@@ -0,0 +1,15 @@
1
+ require 'logger'
2
+
3
+ module BaseTest
4
+ def self.connection_name
5
+ ENV['NUODB_CONN'] || config['default_connection']
6
+ end
7
+
8
+ def self.connection_config
9
+ config['connections'][connection_name].symbolize_keys!
10
+ end
11
+
12
+ def self.connect
13
+ NuoDB::Connection.new connection_config
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ def with_env_tz(new_tz = 'US/Eastern')
2
+ old_tz, ENV['TZ'] = ENV['TZ'], new_tz
3
+ yield
4
+ ensure
5
+ old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ')
6
+ end
7
+
8
+ @default_timezone = :local
9
+
10
+ def with_default_timezone(zone)
11
+ old_zone, @default_timezone = @default_timezone, zone
12
+ yield
13
+ ensure
14
+ @default_timezone = old_zone
15
+ end
16
+
17
+ def quoted_date(value)
18
+ if value.acts_like?(:time)
19
+ zone_conversion_method = @default_timezone == :utc ? :getutc : :getlocal
20
+ if value.respond_to?(zone_conversion_method)
21
+ value = value.send(zone_conversion_method)
22
+ end
23
+ end
24
+ value.to_s(:db)
25
+ end
File without changes
data/tasks/rdoc.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'rdoc/task'
2
+
3
+ RDOC_FILES = FileList['README.rdoc', 'LICENSE', 'ext/nuodb/nuodb.cpp', 'lib/**/*.rb']
4
+
5
+ require 'rdoc/task'
6
+ Rake::RDocTask.new do |rdoc|
7
+ rdoc.title = "#{name} #{version}"
8
+ rdoc.main = 'README.rdoc'
9
+ rdoc.rdoc_dir = 'doc/site/api'
10
+ rdoc.options << "-a" << "-U" << "-D" << "-v" << '-f' << 'hanna'
11
+ rdoc.rdoc_files.include(RDOC_FILES)
12
+ end
13
+
14
+ Rake::RDocTask.new(:ri) do |rdoc|
15
+ rdoc.main = "README.rdoc"
16
+ rdoc.rdoc_dir = "doc/ri"
17
+ rdoc.options << "--ri-system"
18
+ rdoc.rdoc_files.include(RDOC_FILES)
19
+ end
data/tasks/rspec.rb ADDED
@@ -0,0 +1,56 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ GEM_ROOT ||= File.expand_path(File.join(File.dirname(__FILE__), ".."))
5
+
6
+ begin
7
+
8
+ require 'rspec/core/rake_task'
9
+
10
+ task :default => :spec
11
+
12
+ desc "Run all specs in spec directory"
13
+ RSpec::Core::RakeTask.new(:spec) do |t|
14
+ t.rspec_opts = ['--options', "\"#{GEM_ROOT}/.rspec\""]
15
+ t.pattern = FileList['spec/**/*_spec.rb']
16
+ end
17
+
18
+ desc "Run all rspec functional tests (in functional/ directory)"
19
+ RSpec::Core::RakeTask.new(:functional) do |t|
20
+ t.rspec_opts = ['--options', "\"#{GEM_ROOT}/spec/spec.opts\""]
21
+ t.pattern = FileList['spec/functional/**/*_spec.rb']
22
+ end
23
+
24
+ desc "Run all rspec unit tests (in unit/ directory)"
25
+ RSpec::Core::RakeTask.new(:spec_unit) do |t|
26
+ t.rspec_opts = ['--options', "\"#{GEM_ROOT}/.rspec\""]
27
+ t.pattern = FileList['spec/unit/**/*_spec.rb']
28
+ end
29
+
30
+ namespace :spec do
31
+ desc "Run all specs in spec directory with RCov"
32
+ RSpec::Core::RakeTask.new(:cov) do |t|
33
+ require 'simplecov'
34
+ SimpleCov.start do
35
+ add_group 'Libraries', 'lib'
36
+ end
37
+ end
38
+
39
+ desc "Print Specdoc for all specs"
40
+ RSpec::Core::RakeTask.new(:doc) do |t|
41
+ t.rspec_opts = %w(--format specdoc --dry-run)
42
+ t.pattern = FileList['spec/**/*_spec.rb']
43
+ end
44
+
45
+ [:unit].each do |sub|
46
+ desc "Run the specs under spec/#{sub}"
47
+ RSpec::Core::RakeTask.new(sub) do |t|
48
+ t.rspec_opts = ['--options', "\"#{GEM_ROOT}/spec/spec.opts\""]
49
+ t.pattern = FileList["spec/#{sub}/**/*_spec.rb"]
50
+ end
51
+ end
52
+ end
53
+
54
+ rescue LoadError
55
+ STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
56
+ end
data/tasks/stats.rb ADDED
@@ -0,0 +1,24 @@
1
+ desc "Prints lines of code metrics"
2
+ task :stats do
3
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
4
+
5
+ FileList["lib/nuodb/**/*.rb", "ext/nuodb/*.cpp"].each { |file_name|
6
+ next if file_name =~ /vendor/
7
+ f = File.open(file_name)
8
+
9
+ while (line = f.gets)
10
+ lines += 1
11
+ next if line =~ /^\s*$/
12
+ next if line =~ /^\s*#/
13
+ codelines += 1
14
+ end
15
+ puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
16
+
17
+ total_lines += lines
18
+ total_codelines += codelines
19
+
20
+ lines, codelines = 0, 0
21
+ }
22
+
23
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
24
+ end
metadata CHANGED
@@ -1,17 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuodb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.1
4
+ version: 1.0.0.rc.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
- - ! '''Robert'
9
- - Buck'
8
+ - Robert Buck
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-11-13 00:00:00.000000000 Z
12
+ date: 2012-12-14 00:00:00.000000000 Z
14
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: erubis
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.7.0
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.7.0
15
30
  - !ruby/object:Gem::Dependency
16
31
  name: rake
17
32
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +59,198 @@ dependencies:
44
59
  - - ~>
45
60
  - !ruby/object:Gem::Version
46
61
  version: '3.10'
62
+ - !ruby/object:Gem::Dependency
63
+ name: hanna-nouveau
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.2.4
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.2.4
78
+ - !ruby/object:Gem::Dependency
79
+ name: rake
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rdoc
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: simplecov
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: hanna-nouveau
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rubydoc
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: sdoc
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: ruby-prof
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: rspec
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ~>
196
+ - !ruby/object:Gem::Version
197
+ version: 2.11.0
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ~>
204
+ - !ruby/object:Gem::Version
205
+ version: 2.11.0
206
+ - !ruby/object:Gem::Dependency
207
+ name: rspec-core
208
+ requirement: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ~>
212
+ - !ruby/object:Gem::Version
213
+ version: 2.11.0
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ~>
220
+ - !ruby/object:Gem::Version
221
+ version: 2.11.0
222
+ - !ruby/object:Gem::Dependency
223
+ name: rspec-expectations
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: 2.11.0
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ~>
236
+ - !ruby/object:Gem::Version
237
+ version: 2.11.0
238
+ - !ruby/object:Gem::Dependency
239
+ name: rspec-mocks
240
+ requirement: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ~>
244
+ - !ruby/object:Gem::Version
245
+ version: 2.11.0
246
+ type: :development
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ~>
252
+ - !ruby/object:Gem::Version
253
+ version: 2.11.0
47
254
  description: An easy to use database API for the NuoDB distributed database.
48
255
  email:
49
256
  - support@nuodb.com
@@ -51,24 +258,47 @@ executables: []
51
258
  extensions:
52
259
  - ext/nuodb/extconf.rb
53
260
  extra_rdoc_files:
261
+ - AUTHORS
54
262
  - README.rdoc
263
+ - LICENSE
55
264
  files:
56
265
  - .gitignore
266
+ - .rspec
57
267
  - AUTHORS
58
- - COPYING
59
268
  - Gemfile
60
269
  - History.txt
61
270
  - LICENSE
62
271
  - Manifest.txt
63
272
  - README.rdoc
64
273
  - Rakefile
274
+ - ext/nuodb/atomic.c
275
+ - ext/nuodb/atomic.h
65
276
  - ext/nuodb/extconf.rb
66
277
  - ext/nuodb/nuodb.cpp
67
278
  - lib/nuodb.rb
279
+ - lib/nuodb/column.rb
68
280
  - lib/nuodb/error.rb
69
281
  - lib/nuodb/version.rb
70
282
  - nuodb.gemspec
71
- - test/test_nuodb.rb
283
+ - spec/data/.gitignore
284
+ - spec/functional/column_spec.rb
285
+ - spec/functional/connection_spec.rb
286
+ - spec/functional/datatypes_spec.rb
287
+ - spec/functional/generated_keys_spec.rb
288
+ - spec/functional/prepared_statement_spec.rb
289
+ - spec/functional/statement_spec.rb
290
+ - spec/functional/transaction_spec.rb
291
+ - spec/rcov.opts
292
+ - spec/spec.opts
293
+ - spec/spec_helper.rb
294
+ - spec/support/config.rb
295
+ - spec/support/config.yml
296
+ - spec/support/connection.rb
297
+ - spec/support/datetime.rb
298
+ - spec/unit/.gitignore
299
+ - tasks/rdoc.rb
300
+ - tasks/rspec.rb
301
+ - tasks/stats.rb
72
302
  homepage: http://nuodb.github.com/ruby-nuodb/
73
303
  licenses:
74
304
  - BSD
@@ -92,9 +322,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
322
  version: 1.3.1
93
323
  requirements: []
94
324
  rubyforge_project:
95
- rubygems_version: 1.8.24
325
+ rubygems_version: 1.8.23
96
326
  signing_key:
97
327
  specification_version: 3
98
328
  summary: Native Ruby driver for NuoDB.
99
329
  test_files:
100
- - test/test_nuodb.rb
330
+ - spec/data/.gitignore
331
+ - spec/functional/column_spec.rb
332
+ - spec/functional/connection_spec.rb
333
+ - spec/functional/datatypes_spec.rb
334
+ - spec/functional/generated_keys_spec.rb
335
+ - spec/functional/prepared_statement_spec.rb
336
+ - spec/functional/statement_spec.rb
337
+ - spec/functional/transaction_spec.rb
338
+ - spec/rcov.opts
339
+ - spec/spec.opts
340
+ - spec/spec_helper.rb
341
+ - spec/support/config.rb
342
+ - spec/support/config.yml
343
+ - spec/support/connection.rb
344
+ - spec/support/datetime.rb
345
+ - spec/unit/.gitignore