do_hsqldb 0.10.0-java
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.
- data/HISTORY.markdown +6 -0
- data/LICENSE +19 -0
- data/Manifest.txt +21 -0
- data/README.markdown +4 -0
- data/Rakefile +15 -0
- data/lib/do_hsqldb.rb +32 -0
- data/lib/do_hsqldb/version.rb +5 -0
- data/spec/command_spec.rb +9 -0
- data/spec/connection_spec.rb +19 -0
- data/spec/encoding_spec.rb +8 -0
- data/spec/lib/rspec_immediate_feedback_formatter.rb +3 -0
- data/spec/reader_spec.rb +8 -0
- data/spec/result_spec.rb +16 -0
- data/spec/spec_helper.rb +180 -0
- data/spec/typecast/array_spec.rb +8 -0
- data/spec/typecast/bigdecimal_spec.rb +9 -0
- data/spec/typecast/boolean_spec.rb +9 -0
- data/spec/typecast/byte_array_spec.rb +9 -0
- data/spec/typecast/class_spec.rb +8 -0
- data/spec/typecast/date_spec.rb +9 -0
- data/spec/typecast/datetime_spec.rb +9 -0
- data/spec/typecast/float_spec.rb +9 -0
- data/spec/typecast/integer_spec.rb +8 -0
- data/spec/typecast/nil_spec.rb +10 -0
- data/spec/typecast/range_spec.rb +8 -0
- data/spec/typecast/string_spec.rb +8 -0
- data/spec/typecast/time_spec.rb +8 -0
- data/tasks/gem.rake +8 -0
- data/tasks/install.rake +15 -0
- data/tasks/native.rake +4 -0
- data/tasks/release.rake +75 -0
- data/tasks/spec.rake +19 -0
- metadata +145 -0
data/HISTORY.markdown
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2008-2009 Alex Coles, Ikonoklastik Productions
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
data/Manifest.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
HISTORY.markdown
|
|
2
|
+
LICENSE
|
|
3
|
+
Manifest.txt
|
|
4
|
+
README.markdown
|
|
5
|
+
Rakefile
|
|
6
|
+
buildfile
|
|
7
|
+
ext-java/src/main/java/DoHsqldbExtService.java
|
|
8
|
+
ext-java/src/main/java/do_hsqldb/HsqldbDriverDefinition.java
|
|
9
|
+
lib/do_hsqldb.rb
|
|
10
|
+
lib/do_hsqldb/version.rb
|
|
11
|
+
lib/do_hsqldb_ext.jar
|
|
12
|
+
spec/integration/do_hsqldb_spec.rb
|
|
13
|
+
spec/integration/logging_spec.rb
|
|
14
|
+
spec/spec.opts
|
|
15
|
+
spec/spec_helper.rb
|
|
16
|
+
spec/unit/command_spec.rb
|
|
17
|
+
spec/unit/connection_spec.rb
|
|
18
|
+
spec/unit/do_hsqldb_spec.rb
|
|
19
|
+
spec/unit/reader_spec.rb
|
|
20
|
+
spec/unit/result_spec.rb
|
|
21
|
+
spec/unit/transaction_spec.rb
|
data/README.markdown
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
require 'rake/clean'
|
|
4
|
+
|
|
5
|
+
require 'pathname'
|
|
6
|
+
require 'lib/do_hsqldb/version'
|
|
7
|
+
|
|
8
|
+
ROOT = Pathname(__FILE__).dirname.expand_path
|
|
9
|
+
JRUBY = RUBY_PLATFORM =~ /java/
|
|
10
|
+
WINDOWS = Gem.win_platform?
|
|
11
|
+
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
|
|
12
|
+
|
|
13
|
+
Dir['tasks/*.rake'].sort.each { |f| import f }
|
|
14
|
+
|
|
15
|
+
CLEAN.include(%w[ {tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext-java/target ])
|
data/lib/do_hsqldb.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'data_objects'
|
|
2
|
+
|
|
3
|
+
if RUBY_PLATFORM =~ /java/
|
|
4
|
+
require 'do_jdbc'
|
|
5
|
+
require 'java'
|
|
6
|
+
|
|
7
|
+
driver = 'org.hsqldb.jdbcDriver'
|
|
8
|
+
begin
|
|
9
|
+
java.lang.Thread.currentThread.getContextClassLoader().loadClass(driver, true)
|
|
10
|
+
rescue
|
|
11
|
+
require 'jdbc/hsqldb' # the JDBC driver, packaged as a gem
|
|
12
|
+
end
|
|
13
|
+
require 'do_hsqldb_ext' # the Java extension for this DO driver
|
|
14
|
+
|
|
15
|
+
# Another way of loading the JDBC Class. This seems to be more reliable
|
|
16
|
+
# than Class.forName() within the data_objects.Connection Java class,
|
|
17
|
+
# which is currently not working as expected.
|
|
18
|
+
java_import driver
|
|
19
|
+
|
|
20
|
+
module DataObjects
|
|
21
|
+
module Hsqldb
|
|
22
|
+
class Connection
|
|
23
|
+
def self.pool_size
|
|
24
|
+
20
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
else
|
|
31
|
+
warn "do_hsqldb is only for use with JRuby"
|
|
32
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/command_spec'
|
|
5
|
+
|
|
6
|
+
describe DataObjects::Hsqldb::Command do
|
|
7
|
+
it_should_behave_like 'a Command'
|
|
8
|
+
# it_should_behave_like 'a Command with async'
|
|
9
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/connection_spec'
|
|
5
|
+
|
|
6
|
+
describe DataObjects::Hsqldb::Connection do
|
|
7
|
+
|
|
8
|
+
before :all do
|
|
9
|
+
@driver = 'hsqldb'
|
|
10
|
+
@user = ''
|
|
11
|
+
@password = ''
|
|
12
|
+
@host = ''
|
|
13
|
+
@port = ''
|
|
14
|
+
@database = "#{File.expand_path(File.dirname(__FILE__))}/test.db"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it_should_behave_like 'a Connection'
|
|
18
|
+
#it_should_behave_like 'a Connection with authentication support'
|
|
19
|
+
end
|
data/spec/reader_spec.rb
ADDED
data/spec/result_spec.rb
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/result_spec'
|
|
5
|
+
|
|
6
|
+
# splitting the descibe into two separate declaration avoids
|
|
7
|
+
# concurrent execution of the "it_should_behave_like ....."
|
|
8
|
+
# needed by some databases (sqlite3)
|
|
9
|
+
|
|
10
|
+
describe DataObjects::Hsqldb::Result do
|
|
11
|
+
it_should_behave_like 'a Result'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe DataObjects::Hsqldb::Result do
|
|
15
|
+
it_should_behave_like 'a Result which returns inserted keys'
|
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
$TESTING=true
|
|
2
|
+
JRUBY = true
|
|
3
|
+
|
|
4
|
+
require 'rubygems'
|
|
5
|
+
|
|
6
|
+
gem 'rspec', '>1.1.12'
|
|
7
|
+
require 'spec'
|
|
8
|
+
|
|
9
|
+
require 'date'
|
|
10
|
+
require 'ostruct'
|
|
11
|
+
require 'pathname'
|
|
12
|
+
require 'fileutils'
|
|
13
|
+
|
|
14
|
+
dir = File.dirname(__FILE__)
|
|
15
|
+
lib_path = File.expand_path("#{dir}/../lib")
|
|
16
|
+
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
|
|
17
|
+
# put data_objects from repository in the load path
|
|
18
|
+
# DO NOT USE installed gem of data_objects!
|
|
19
|
+
do_lib_path = File.expand_path("#{dir}/../../data_objects/lib")
|
|
20
|
+
$LOAD_PATH.unshift do_lib_path unless $LOAD_PATH.include?(do_lib_path)
|
|
21
|
+
|
|
22
|
+
if JRUBY
|
|
23
|
+
jdbc_lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'do_jdbc', 'lib'))
|
|
24
|
+
$LOAD_PATH.unshift jdbc_lib_path unless $LOAD_PATH.include?(jdbc_lib_path)
|
|
25
|
+
require 'do_jdbc'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
require 'data_objects'
|
|
29
|
+
|
|
30
|
+
DATAOBJECTS_SPEC_ROOT = Pathname(__FILE__).dirname.parent.parent + 'data_objects' + 'spec'
|
|
31
|
+
Pathname.glob((DATAOBJECTS_SPEC_ROOT + 'lib/**/*.rb').to_s).each { |f| require f }
|
|
32
|
+
|
|
33
|
+
require 'do_hsqldb'
|
|
34
|
+
|
|
35
|
+
log_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'log', 'do.log'))
|
|
36
|
+
FileUtils.mkdir_p(File.dirname(log_path))
|
|
37
|
+
|
|
38
|
+
DataObjects::Hsqldb.logger = DataObjects::Logger.new(log_path, :debug)
|
|
39
|
+
|
|
40
|
+
at_exit { DataObjects.logger.flush }
|
|
41
|
+
|
|
42
|
+
Spec::Runner.configure do |config|
|
|
43
|
+
config.include(DataObjects::Spec::PendingHelpers)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
CONFIG = OpenStruct.new
|
|
47
|
+
# CONFIG.scheme = 'hsqldb'
|
|
48
|
+
# CONFIG.user = ENV['DO_HSQLDB_USER'] || 'hsqldb'
|
|
49
|
+
# CONFIG.pass = ENV['DO_HSQLDB_PASS'] || ''
|
|
50
|
+
# CONFIG.host = ENV['DO_HSQLDB_HOST'] || ''
|
|
51
|
+
# CONFIG.port = ENV['DO_HSQLDB_PORT'] || ''
|
|
52
|
+
# CONFIG.database = ENV['DO_HSQLDB_DATABASE'] || "#{File.expand_path(File.dirname(__FILE__))}/testdb"
|
|
53
|
+
|
|
54
|
+
CONFIG.uri = ENV["DO_HSQLDB_SPEC_URI"] || "jdbc:hsqldb:mem:test"
|
|
55
|
+
|
|
56
|
+
module DataObjectsSpecHelpers
|
|
57
|
+
|
|
58
|
+
def setup_test_environment
|
|
59
|
+
conn = DataObjects::Connection.new(CONFIG.uri)
|
|
60
|
+
|
|
61
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
62
|
+
DROP TABLE IF EXISTS invoices
|
|
63
|
+
EOF
|
|
64
|
+
|
|
65
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
66
|
+
DROP TABLE IF EXISTS users
|
|
67
|
+
EOF
|
|
68
|
+
|
|
69
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
70
|
+
DROP TABLE IF EXISTS widgets
|
|
71
|
+
EOF
|
|
72
|
+
|
|
73
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
74
|
+
CREATE TABLE users (
|
|
75
|
+
id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1),
|
|
76
|
+
name VARCHAR(200) default 'Billy' NULL,
|
|
77
|
+
fired_at TIMESTAMP
|
|
78
|
+
)
|
|
79
|
+
EOF
|
|
80
|
+
|
|
81
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
82
|
+
CREATE TABLE invoices (
|
|
83
|
+
id INTEGER IDENTITY,
|
|
84
|
+
invoice_number VARCHAR(50) NOT NULL
|
|
85
|
+
)
|
|
86
|
+
EOF
|
|
87
|
+
|
|
88
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
89
|
+
CREATE TABLE widgets (
|
|
90
|
+
id INTEGER IDENTITY,
|
|
91
|
+
code CHAR(8) DEFAULT 'A14' NULL,
|
|
92
|
+
name VARCHAR(200) DEFAULT 'Super Widget' NULL,
|
|
93
|
+
shelf_location VARCHAR NULL,
|
|
94
|
+
description LONGVARCHAR NULL,
|
|
95
|
+
image_data VARBINARY NULL,
|
|
96
|
+
ad_description LONGVARCHAR NULL,
|
|
97
|
+
ad_image VARBINARY NULL,
|
|
98
|
+
whitepaper_text LONGVARCHAR NULL,
|
|
99
|
+
cad_drawing LONGVARBINARY NULL,
|
|
100
|
+
flags BOOLEAN DEFAULT 0,
|
|
101
|
+
number_in_stock SMALLINT DEFAULT 500,
|
|
102
|
+
number_sold INTEGER DEFAULT 0,
|
|
103
|
+
super_number BIGINT DEFAULT 9223372036854775807,
|
|
104
|
+
weight FLOAT DEFAULT 1.23,
|
|
105
|
+
cost1 REAL DEFAULT 10.23,
|
|
106
|
+
cost2 DECIMAL DEFAULT 50.23,
|
|
107
|
+
release_date DATE DEFAULT '2008-02-14',
|
|
108
|
+
release_datetime DATETIME DEFAULT '2008-02-14 00:31:12',
|
|
109
|
+
release_timestamp TIMESTAMP DEFAULT '2008-02-14 00:31:31'
|
|
110
|
+
)
|
|
111
|
+
EOF
|
|
112
|
+
# XXX: HSQLDB has no ENUM
|
|
113
|
+
# status` enum('active','out of stock') NOT NULL default 'active'
|
|
114
|
+
|
|
115
|
+
1.upto(16) do |n|
|
|
116
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
117
|
+
INSERT INTO widgets(
|
|
118
|
+
code,
|
|
119
|
+
name,
|
|
120
|
+
shelf_location,
|
|
121
|
+
description,
|
|
122
|
+
image_data,
|
|
123
|
+
ad_description,
|
|
124
|
+
ad_image,
|
|
125
|
+
whitepaper_text,
|
|
126
|
+
cad_drawing,
|
|
127
|
+
super_number,
|
|
128
|
+
weight)
|
|
129
|
+
VALUES (
|
|
130
|
+
'W#{n.to_s.rjust(7,"0")}',
|
|
131
|
+
'Widget #{n}',
|
|
132
|
+
'A14',
|
|
133
|
+
'This is a description',
|
|
134
|
+
'4f3d4331434343434331',
|
|
135
|
+
'Buy this product now!',
|
|
136
|
+
'4f3d4331434343434331',
|
|
137
|
+
'String',
|
|
138
|
+
'4f3d4331434343434331',
|
|
139
|
+
1234,
|
|
140
|
+
13.4);
|
|
141
|
+
EOF
|
|
142
|
+
|
|
143
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
144
|
+
update widgets set flags = true where id = 2
|
|
145
|
+
EOF
|
|
146
|
+
|
|
147
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
148
|
+
update widgets set ad_description = NULL where id = 3
|
|
149
|
+
EOF
|
|
150
|
+
|
|
151
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
152
|
+
update widgets set flags = NULL where id = 4
|
|
153
|
+
EOF
|
|
154
|
+
|
|
155
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
156
|
+
update widgets set cost1 = NULL where id = 5
|
|
157
|
+
EOF
|
|
158
|
+
|
|
159
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
160
|
+
update widgets set cost2 = NULL where id = 6
|
|
161
|
+
EOF
|
|
162
|
+
|
|
163
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
164
|
+
update widgets set release_date = NULL where id = 7
|
|
165
|
+
EOF
|
|
166
|
+
|
|
167
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
168
|
+
update widgets set release_datetime = NULL where id = 8
|
|
169
|
+
EOF
|
|
170
|
+
|
|
171
|
+
conn.create_command(<<-EOF).execute_non_query
|
|
172
|
+
update widgets set release_timestamp = NULL where id = 9
|
|
173
|
+
EOF
|
|
174
|
+
|
|
175
|
+
## TODO: change the hexadecimal examples
|
|
176
|
+
conn.close
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/bigdecimal_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with BigDecimal' do
|
|
7
|
+
it_should_behave_like 'supporting BigDecimal'
|
|
8
|
+
it_should_behave_like 'supporting BigDecimal autocasting'
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/boolean_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with Boolean' do
|
|
7
|
+
it_should_behave_like 'supporting Boolean'
|
|
8
|
+
it_should_behave_like 'supporting Boolean autocasting'
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/byte_array_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with ByteArray' do
|
|
7
|
+
# We need to switch to using parameter binding for this to work with Hsqldb
|
|
8
|
+
# it_should_behave_like 'supporting ByteArray'
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/date_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with Date' do
|
|
7
|
+
it_should_behave_like 'supporting Date'
|
|
8
|
+
it_should_behave_like 'supporting Date autocasting'
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/datetime_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with DateTime' do
|
|
7
|
+
it_should_behave_like 'supporting DateTime'
|
|
8
|
+
it_should_behave_like 'supporting DateTime autocasting'
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/float_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with Float' do
|
|
7
|
+
it_should_behave_like 'supporting Float'
|
|
8
|
+
it_should_behave_like 'supporting Float autocasting'
|
|
9
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
|
+
require 'data_objects/spec/typecast/nil_spec'
|
|
5
|
+
|
|
6
|
+
describe 'DataObjects::Hsqldb with Nil' do
|
|
7
|
+
it_should_behave_like 'supporting Nil'
|
|
8
|
+
it_should_behave_like 'supporting writing an Nil'
|
|
9
|
+
it_should_behave_like 'supporting Nil autocasting'
|
|
10
|
+
end
|
data/tasks/gem.rake
ADDED
data/tasks/install.rake
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
def sudo_gem(cmd)
|
|
2
|
+
sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
desc "Install #{GEM_SPEC.name} #{GEM_SPEC.version}"
|
|
8
|
+
task :install => [ :package ] do
|
|
9
|
+
sudo_gem "install pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version} --no-update-sources"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
desc "Uninstall #{GEM_SPEC.name} #{GEM_SPEC.version}"
|
|
13
|
+
task :uninstall => [ :clean ] do
|
|
14
|
+
sudo_gem "uninstall #{GEM_SPEC.name} -v#{GEM_SPEC.version} -I -x"
|
|
15
|
+
end
|
data/tasks/native.rake
ADDED
data/tasks/release.rake
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
begin
|
|
2
|
+
gem 'rubyforge', '~> 1.0.1'
|
|
3
|
+
require 'rubyforge'
|
|
4
|
+
rescue Exception
|
|
5
|
+
nil
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
if defined?(RubyForge) then
|
|
9
|
+
if defined?(GEM_SPEC) then
|
|
10
|
+
desc 'Package and upload to RubyForge'
|
|
11
|
+
task :release do |t|
|
|
12
|
+
ver = ENV['VERSION'] or fail "Must supply VERSION (rake release VERSION=x.y.z)."
|
|
13
|
+
|
|
14
|
+
# compare versions to avoid mistakes
|
|
15
|
+
unless ver == GEM_SPEC.version.to_s then
|
|
16
|
+
fail "Version mismatch (supplied and specification versions differ)."
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# no rubyforge project? no release for you!
|
|
20
|
+
if GEM_SPEC.rubyforge_project == 'TODO' or GEM_SPEC.rubyforge_project.nil? then
|
|
21
|
+
fail "Must define rubyforge_project in your gem specification."
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# instantiate a RubyForge object
|
|
25
|
+
rf = RubyForge.new
|
|
26
|
+
|
|
27
|
+
# read project info and overview
|
|
28
|
+
notes = begin
|
|
29
|
+
r = File.read("README.markdown")
|
|
30
|
+
r.split(/^(.*\n\-+)/)[1..4].join.strip
|
|
31
|
+
rescue
|
|
32
|
+
warn "Missing README.markdown"
|
|
33
|
+
''
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# read changes
|
|
37
|
+
changes = begin
|
|
38
|
+
h = File.read("HISTORY.markdown")
|
|
39
|
+
h.split(/^(##+ .*)/)[1..2].join.strip
|
|
40
|
+
rescue
|
|
41
|
+
warn "Missing HISTORY.markdown"
|
|
42
|
+
''
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# build the configuration for the release
|
|
46
|
+
config = Hash.new
|
|
47
|
+
config["release_notes"] = notes
|
|
48
|
+
config["release_changes"] = changes
|
|
49
|
+
config["preformatted"] = true
|
|
50
|
+
|
|
51
|
+
# prepare configuration
|
|
52
|
+
rf.configure config
|
|
53
|
+
|
|
54
|
+
files = FileList["pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version}*.*"].to_a
|
|
55
|
+
fail "No files found for the release." if files.empty?
|
|
56
|
+
|
|
57
|
+
puts "Logging in RubyForge..."
|
|
58
|
+
rf.login
|
|
59
|
+
|
|
60
|
+
puts "Files to upload:"
|
|
61
|
+
files.each do |f|
|
|
62
|
+
puts " * #{f}"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
puts "Releasing #{GEM_SPEC.name} version #{GEM_SPEC.version}..."
|
|
66
|
+
rf.add_release GEM_SPEC.rubyforge_project, GEM_SPEC.name, GEM_SPEC.version, *files
|
|
67
|
+
puts "Done."
|
|
68
|
+
end
|
|
69
|
+
#Rake::Task['release'].prerequisites.unshift('clean', 'cross', 'native')
|
|
70
|
+
else
|
|
71
|
+
warn "no GEM_SPEC is found or defined. 'release' task cannot work without it."
|
|
72
|
+
end
|
|
73
|
+
else
|
|
74
|
+
warn "rubyforge gem is required to generate releases, please install it (gem install rubyforge)."
|
|
75
|
+
end
|
data/tasks/spec.rake
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Specs
|
|
2
|
+
require 'spec/rake/spectask'
|
|
3
|
+
|
|
4
|
+
desc 'Run specifications'
|
|
5
|
+
Spec::Rake::SpecTask.new(:spec => [ :clean, :compile ]) do |t|
|
|
6
|
+
t.spec_opts << '--options' << ROOT + 'spec/spec.opts'
|
|
7
|
+
t.spec_files = Pathname.glob(ENV['FILES'] || 'spec/**/*_spec.rb').map { |f| f.to_s }
|
|
8
|
+
t.libs << 'lib'
|
|
9
|
+
|
|
10
|
+
begin
|
|
11
|
+
# RCov is run by default, except on the JRuby platform
|
|
12
|
+
t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
|
|
13
|
+
t.rcov_opts << '--exclude' << 'spec'
|
|
14
|
+
t.rcov_opts << '--text-summary'
|
|
15
|
+
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
|
16
|
+
rescue Exception
|
|
17
|
+
# rcov not installed
|
|
18
|
+
end
|
|
19
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
extensions: []
|
|
3
|
+
|
|
4
|
+
homepage: http://github.com/datamapper/do
|
|
5
|
+
executables: []
|
|
6
|
+
|
|
7
|
+
version: !ruby/object:Gem::Version
|
|
8
|
+
version: 0.10.0
|
|
9
|
+
post_install_message:
|
|
10
|
+
date: 2009-09-16 00:00:00 Z
|
|
11
|
+
files:
|
|
12
|
+
- lib/do_hsqldb.rb
|
|
13
|
+
- lib/do_hsqldb/version.rb
|
|
14
|
+
- spec/command_spec.rb
|
|
15
|
+
- spec/connection_spec.rb
|
|
16
|
+
- spec/encoding_spec.rb
|
|
17
|
+
- spec/reader_spec.rb
|
|
18
|
+
- spec/result_spec.rb
|
|
19
|
+
- spec/spec_helper.rb
|
|
20
|
+
- spec/lib/rspec_immediate_feedback_formatter.rb
|
|
21
|
+
- spec/typecast/array_spec.rb
|
|
22
|
+
- spec/typecast/bigdecimal_spec.rb
|
|
23
|
+
- spec/typecast/boolean_spec.rb
|
|
24
|
+
- spec/typecast/byte_array_spec.rb
|
|
25
|
+
- spec/typecast/class_spec.rb
|
|
26
|
+
- spec/typecast/date_spec.rb
|
|
27
|
+
- spec/typecast/datetime_spec.rb
|
|
28
|
+
- spec/typecast/float_spec.rb
|
|
29
|
+
- spec/typecast/integer_spec.rb
|
|
30
|
+
- spec/typecast/nil_spec.rb
|
|
31
|
+
- spec/typecast/range_spec.rb
|
|
32
|
+
- spec/typecast/string_spec.rb
|
|
33
|
+
- spec/typecast/time_spec.rb
|
|
34
|
+
- tasks/gem.rake
|
|
35
|
+
- tasks/install.rake
|
|
36
|
+
- tasks/native.rake
|
|
37
|
+
- tasks/release.rake
|
|
38
|
+
- tasks/spec.rake
|
|
39
|
+
- LICENSE
|
|
40
|
+
- Rakefile
|
|
41
|
+
- HISTORY.markdown
|
|
42
|
+
- README.markdown
|
|
43
|
+
- Manifest.txt
|
|
44
|
+
rubygems_version: 1.3.4
|
|
45
|
+
rdoc_options: []
|
|
46
|
+
|
|
47
|
+
signing_key:
|
|
48
|
+
cert_chain: []
|
|
49
|
+
|
|
50
|
+
name: do_hsqldb
|
|
51
|
+
has_rdoc: false
|
|
52
|
+
platform: java
|
|
53
|
+
summary: DataObjects Hsqldb Driver
|
|
54
|
+
default_executable:
|
|
55
|
+
bindir: bin
|
|
56
|
+
licenses: []
|
|
57
|
+
|
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
|
+
version:
|
|
60
|
+
requirements:
|
|
61
|
+
- - '>='
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: "0"
|
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
|
+
version:
|
|
66
|
+
requirements:
|
|
67
|
+
- - '>='
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: "0"
|
|
70
|
+
require_paths:
|
|
71
|
+
- lib
|
|
72
|
+
specification_version: 3
|
|
73
|
+
test_files: []
|
|
74
|
+
|
|
75
|
+
dependencies:
|
|
76
|
+
- !ruby/object:Gem::Dependency
|
|
77
|
+
type: :runtime
|
|
78
|
+
name: addressable
|
|
79
|
+
version_requirement:
|
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
81
|
+
version:
|
|
82
|
+
requirements:
|
|
83
|
+
- - ~>
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: "2.0"
|
|
86
|
+
- !ruby/object:Gem::Dependency
|
|
87
|
+
type: :runtime
|
|
88
|
+
name: extlib
|
|
89
|
+
version_requirement:
|
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
91
|
+
version:
|
|
92
|
+
requirements:
|
|
93
|
+
- - ~>
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: 0.9.12
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
type: :runtime
|
|
98
|
+
name: data_objects
|
|
99
|
+
version_requirement:
|
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
101
|
+
version:
|
|
102
|
+
requirements:
|
|
103
|
+
- - "="
|
|
104
|
+
- !ruby/object:Gem::Version
|
|
105
|
+
version: 0.10.0
|
|
106
|
+
- !ruby/object:Gem::Dependency
|
|
107
|
+
type: :runtime
|
|
108
|
+
name: jdbc-hsqldb
|
|
109
|
+
version_requirement:
|
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
111
|
+
version:
|
|
112
|
+
requirements:
|
|
113
|
+
- - ~>
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: 1.8.0
|
|
116
|
+
- !ruby/object:Gem::Dependency
|
|
117
|
+
type: :runtime
|
|
118
|
+
name: do_jdbc
|
|
119
|
+
version_requirement:
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
version:
|
|
122
|
+
requirements:
|
|
123
|
+
- - "="
|
|
124
|
+
- !ruby/object:Gem::Version
|
|
125
|
+
version: 0.10.0
|
|
126
|
+
- !ruby/object:Gem::Dependency
|
|
127
|
+
type: :development
|
|
128
|
+
name: rspec
|
|
129
|
+
version_requirement:
|
|
130
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
131
|
+
version:
|
|
132
|
+
requirements:
|
|
133
|
+
- - ~>
|
|
134
|
+
- !ruby/object:Gem::Version
|
|
135
|
+
version: 1.2.0
|
|
136
|
+
description: Implements the DataObjects API for Hsqldb
|
|
137
|
+
email: alex@alexcolesportfolio.com
|
|
138
|
+
authors:
|
|
139
|
+
- Alex Coles
|
|
140
|
+
extra_rdoc_files: []
|
|
141
|
+
|
|
142
|
+
requirements: []
|
|
143
|
+
|
|
144
|
+
rubyforge_project: dorb
|
|
145
|
+
autorequire:
|