do_derby 0.10.0-java → 0.10.1-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/ChangeLog.markdown +15 -0
- data/LICENSE +1 -1
- data/README.markdown +79 -3
- data/Rakefile +46 -7
- data/lib/do_derby.rb +1 -11
- data/lib/do_derby/do_derby.jar +0 -0
- data/lib/do_derby/version.rb +1 -1
- data/spec/command_spec.rb +2 -2
- data/spec/connection_spec.rb +9 -7
- data/spec/encoding_spec.rb +1 -1
- data/spec/reader_spec.rb +1 -1
- data/spec/result_spec.rb +3 -3
- data/spec/spec_helper.rb +14 -30
- data/spec/typecast/array_spec.rb +1 -1
- data/spec/typecast/bigdecimal_spec.rb +2 -2
- data/spec/typecast/boolean_spec.rb +2 -2
- data/spec/typecast/byte_array_spec.rb +1 -1
- data/spec/typecast/class_spec.rb +1 -1
- data/spec/typecast/date_spec.rb +2 -2
- data/spec/typecast/datetime_spec.rb +2 -2
- data/spec/typecast/float_spec.rb +2 -2
- data/spec/typecast/integer_spec.rb +1 -1
- data/spec/typecast/nil_spec.rb +3 -3
- data/spec/typecast/other_spec.rb +8 -0
- data/spec/typecast/range_spec.rb +1 -1
- data/spec/typecast/string_spec.rb +1 -1
- data/spec/typecast/time_spec.rb +1 -1
- data/tasks/compile.rake +29 -0
- data/tasks/release.rake +10 -71
- data/tasks/spec.rake +19 -15
- metadata +108 -99
- data/HISTORY.markdown +0 -6
- data/Manifest.txt +0 -16
- data/spec/lib/rspec_immediate_feedback_formatter.rb +0 -3
- data/tasks/gem.rake +0 -8
- data/tasks/install.rake +0 -15
- data/tasks/native.rake +0 -4
data/ChangeLog.markdown
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
## 0.10.1 (unreleased, in git)
|
2
|
+
|
3
|
+
* Switch to Jeweler for Gem building tasks (this change may be temporary).
|
4
|
+
* Switch to using Bacon for running specs: This should make specs friendlier to
|
5
|
+
new Ruby implementations that are not yet 100% MRI-compatible, and in turn,
|
6
|
+
prepared the road for our own IronRuby and MacRuby support.
|
7
|
+
* Switch to the newly added rake-compiler `JavaExtensionTask` for compiling
|
8
|
+
JRuby extensions, instead of our (broken) home-grown solution.
|
9
|
+
|
10
|
+
## 0.10.0 2009-09-15
|
11
|
+
|
12
|
+
Initial release of Derby driver (using *do_jdbc*).
|
13
|
+
|
14
|
+
* Known Issues
|
15
|
+
* JRuby-only
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2008-
|
1
|
+
Copyright (c) 2008 - 2010 Alex Coles, Ikonoklastik Productions
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.markdown
CHANGED
@@ -1,4 +1,80 @@
|
|
1
|
-
do_derby
|
2
|
-
========
|
1
|
+
# do_derby
|
3
2
|
|
4
|
-
|
3
|
+
* <http://dataobjects.info>
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
A Derby driver for DataObjects.
|
8
|
+
|
9
|
+
## Features/Problems
|
10
|
+
|
11
|
+
This driver implements the DataObjects API for the Derby relational database.
|
12
|
+
This driver is currently provided only for JRuby.
|
13
|
+
|
14
|
+
## Synopsis
|
15
|
+
|
16
|
+
An example of usage:
|
17
|
+
|
18
|
+
@connection = DataObjects::Connection.new("derby://employees")
|
19
|
+
@reader = @connection.create_command('SELECT * FROM users').execute_reader
|
20
|
+
@reader.next!
|
21
|
+
|
22
|
+
The `Connection` constructor should be passed either a DataObjects-style URL or
|
23
|
+
JDBC-style URL:
|
24
|
+
|
25
|
+
derby://employees
|
26
|
+
jdbc:derby:employees;create=true
|
27
|
+
|
28
|
+
## Requirements
|
29
|
+
|
30
|
+
* JRuby 1.3.1 + (1.4+ recommended)
|
31
|
+
* `data_objects` gem
|
32
|
+
* `do_jdbc` gem (shared library)
|
33
|
+
|
34
|
+
## Install
|
35
|
+
|
36
|
+
To install the gem:
|
37
|
+
|
38
|
+
jruby -S gem install do_derby
|
39
|
+
|
40
|
+
To compile and install from source:
|
41
|
+
|
42
|
+
* Install the Java Development Kit (provided if you are on a recent version of
|
43
|
+
Mac OS X) from <http://java.sun.com>
|
44
|
+
* Install a recent version of JRuby. Ensure `jruby` is in your `PATH` and/or
|
45
|
+
you have configured the `JRUBY_HOME` environment variable to point to your
|
46
|
+
JRuby installation.
|
47
|
+
* Install `data_objects` and `do_jdbc` with `jruby -S rake install`.
|
48
|
+
* Install this driver with `jruby -S rake install`.
|
49
|
+
|
50
|
+
For more information, see the Derby driver wiki page:
|
51
|
+
<http://wiki.github.com/datamapper/do/derby>.
|
52
|
+
|
53
|
+
## Developers
|
54
|
+
|
55
|
+
Follow the above installation instructions. Additionally, you'll need:
|
56
|
+
* `bacon` gem for running specs.
|
57
|
+
* `YARD` gem for generating documentation.
|
58
|
+
|
59
|
+
See the DataObjects wiki for more comprehensive information:
|
60
|
+
<http://wiki.github.com/datamapper/do/jruby>.
|
61
|
+
|
62
|
+
To run specs:
|
63
|
+
|
64
|
+
jruby -S rake spec
|
65
|
+
|
66
|
+
To run specs without compiling extensions first:
|
67
|
+
|
68
|
+
jruby -S rake spec_no_compile
|
69
|
+
|
70
|
+
To run individual specs:
|
71
|
+
|
72
|
+
jruby -S rake spec TEST=spec/connection_spec.rb
|
73
|
+
|
74
|
+
(Note that the `rake` task uses a `TEST` parameter, not `SPEC`. This is because
|
75
|
+
the `Rake::TestTask` is used for executing the Bacon specs).
|
76
|
+
|
77
|
+
## License
|
78
|
+
|
79
|
+
This code is licensed under an **MIT (X11) License**. Please see the
|
80
|
+
accompanying `LICENSE` file.
|
data/Rakefile
CHANGED
@@ -1,15 +1,54 @@
|
|
1
|
+
require 'pathname'
|
1
2
|
require 'rubygems'
|
2
3
|
require 'rake'
|
3
4
|
require 'rake/clean'
|
4
5
|
|
5
|
-
|
6
|
-
require 'lib/do_derby/version'
|
6
|
+
ROOT = Pathname(__FILE__).dirname.expand_path
|
7
7
|
|
8
|
-
ROOT
|
9
|
-
JRUBY = RUBY_PLATFORM =~ /java/
|
10
|
-
WINDOWS = Gem.win_platform?
|
11
|
-
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
|
8
|
+
require ROOT + 'lib/do_derby/version'
|
12
9
|
|
13
|
-
|
10
|
+
JRUBY = RUBY_PLATFORM =~ /java/
|
11
|
+
IRONRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby'
|
12
|
+
WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
|
13
|
+
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
|
14
14
|
|
15
15
|
CLEAN.include(%w[ {tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext-java/target ])
|
16
|
+
|
17
|
+
begin
|
18
|
+
gem 'jeweler', '~> 1.4'
|
19
|
+
require 'jeweler'
|
20
|
+
|
21
|
+
Jeweler::Tasks.new do |gem|
|
22
|
+
gem.name = 'do_derby'
|
23
|
+
gem.version = DataObjects::Derby::VERSION
|
24
|
+
gem.summary = 'DataObjects Derby Driver'
|
25
|
+
gem.description = 'Implements the DataObjects API for Derby'
|
26
|
+
gem.platform = 'java'
|
27
|
+
gem.files = FileList['lib/**/*.rb', 'spec/**/*.rb', 'tasks/**/*.rake',
|
28
|
+
'LICENSE', 'Rakefile', '*.{markdown,rdoc,txt,yml}',
|
29
|
+
'lib/*.jar']
|
30
|
+
gem.extra_rdoc_files = FileList['README*', 'ChangeLog*', 'LICENSE']
|
31
|
+
gem.test_files = FileList['spec/**/*.rb']
|
32
|
+
|
33
|
+
gem.add_dependency 'data_objects', DataObjects::Derby::VERSION
|
34
|
+
gem.add_dependency 'do_jdbc', DataObjects::Derby::VERSION
|
35
|
+
gem.add_dependency 'jdbc-derby', '~>10.4.2.0'
|
36
|
+
|
37
|
+
gem.add_development_dependency 'bacon', '~>1.1'
|
38
|
+
gem.add_development_dependency 'rake-compiler', '~>0.7'
|
39
|
+
|
40
|
+
gem.has_rdoc = false
|
41
|
+
gem.rubyforge_project = 'dorb'
|
42
|
+
gem.authors = [ 'Alex Coles' ]
|
43
|
+
gem.email = 'alex@alexcolesportfolio.com'
|
44
|
+
end
|
45
|
+
|
46
|
+
Rake::Task['build'].clear_actions if Rake::Task.task_defined?('build')
|
47
|
+
task :build => [ :java, :gem ]
|
48
|
+
|
49
|
+
Jeweler::GemcutterTasks.new
|
50
|
+
|
51
|
+
FileList['tasks/**/*.rake'].each { |task| import task }
|
52
|
+
rescue LoadError
|
53
|
+
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
|
54
|
+
end
|
data/lib/do_derby.rb
CHANGED
@@ -11,23 +11,13 @@ if RUBY_PLATFORM =~ /java/
|
|
11
11
|
require 'jdbc/derby' # the JDBC driver, packaged as a gem
|
12
12
|
end
|
13
13
|
|
14
|
-
require '
|
14
|
+
require 'do_derby/do_derby' # the Java extension for this DO driver
|
15
15
|
|
16
16
|
# Another way of loading the JDBC Class. This seems to be more reliable
|
17
17
|
# than Class.forName() within the data_objects.Connection Java class,
|
18
18
|
# which is currently not working as expected.
|
19
19
|
java_import driver
|
20
20
|
|
21
|
-
module DataObjects
|
22
|
-
module Derby
|
23
|
-
class Connection
|
24
|
-
def self.pool_size
|
25
|
-
20
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
21
|
else
|
32
22
|
warn "do_derby is only for use with JRuby"
|
33
23
|
end
|
Binary file
|
data/lib/do_derby/version.rb
CHANGED
data/spec/command_spec.rb
CHANGED
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/command_spec'
|
5
5
|
|
6
6
|
describe DataObjects::Derby::Command do
|
7
|
-
|
8
|
-
#
|
7
|
+
behaves_like 'a Command'
|
8
|
+
# behaves_like 'a Command with async'
|
9
9
|
end
|
data/spec/connection_spec.rb
CHANGED
@@ -5,15 +5,17 @@ require 'data_objects/spec/connection_spec'
|
|
5
5
|
|
6
6
|
describe DataObjects::Derby::Connection do
|
7
7
|
|
8
|
-
before
|
9
|
-
@driver
|
10
|
-
@user
|
8
|
+
before do
|
9
|
+
@driver = 'derby'
|
10
|
+
@user = ''
|
11
11
|
@password = ''
|
12
|
-
@host
|
13
|
-
@port
|
12
|
+
@host = ''
|
13
|
+
@port = ''
|
14
14
|
@database = "#{File.expand_path(File.dirname(__FILE__))}/test.db;create=true"
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
#
|
17
|
+
behaves_like 'a Connection'
|
18
|
+
#behaves_like 'a Connection with authentication support'
|
19
|
+
behaves_like 'a Connection with JDBC URL support'
|
20
|
+
behaves_like 'a Connection via JDNI'
|
19
21
|
end
|
data/spec/encoding_spec.rb
CHANGED
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/encoding_spec'
|
5
5
|
|
6
6
|
describe DataObjects::Derby::Connection do
|
7
|
-
#
|
7
|
+
# behaves_like 'a driver supporting different encodings'
|
8
8
|
end
|
data/spec/reader_spec.rb
CHANGED
data/spec/result_spec.rb
CHANGED
@@ -4,13 +4,13 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/result_spec'
|
5
5
|
|
6
6
|
# splitting the descibe into two separate declaration avoids
|
7
|
-
# concurrent execution of the "
|
7
|
+
# concurrent execution of the "behaves_like ....."
|
8
8
|
# needed by some databases (sqlite3)
|
9
9
|
|
10
10
|
describe DataObjects::Derby::Result do
|
11
|
-
|
11
|
+
behaves_like 'a Result'
|
12
12
|
end
|
13
13
|
|
14
14
|
describe DataObjects::Derby::Result do
|
15
|
-
|
15
|
+
behaves_like 'a Result which returns inserted keys'
|
16
16
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,47 +2,28 @@ $TESTING=true
|
|
2
2
|
JRUBY = true
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
|
-
|
6
|
-
gem 'rspec', '>1.1.12'
|
7
|
-
require 'spec'
|
8
|
-
|
9
5
|
require 'date'
|
10
6
|
require 'ostruct'
|
11
|
-
require 'pathname'
|
12
7
|
require 'fileutils'
|
13
8
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
# DO NOT USE installed
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
if
|
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'
|
9
|
+
driver_lib = File.expand_path('../../lib', __FILE__)
|
10
|
+
$LOAD_PATH.unshift(driver_lib) unless $LOAD_PATH.include?(driver_lib)
|
11
|
+
|
12
|
+
# Prepend data_objects/do_jdbc in the repository to the load path.
|
13
|
+
# DO NOT USE installed gems, except when running the specs from gem.
|
14
|
+
repo_root = File.expand_path('../../..', __FILE__)
|
15
|
+
['data_objects', 'do_jdbc'].each do |lib|
|
16
|
+
lib_path = "#{repo_root}/#{lib}/lib"
|
17
|
+
$LOAD_PATH.unshift(lib_path) if File.directory?(lib_path) && !$LOAD_PATH.include?(lib_path)
|
26
18
|
end
|
27
19
|
|
28
20
|
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
|
-
|
21
|
+
require 'data_objects/spec/bacon'
|
33
22
|
require 'do_derby'
|
34
23
|
|
35
|
-
|
36
|
-
FileUtils.mkdir_p(File.dirname(log_path))
|
37
|
-
|
38
|
-
DataObjects::Derby.logger = DataObjects::Logger.new(log_path, :debug)
|
39
|
-
|
24
|
+
DataObjects::Derby.logger = DataObjects::Logger.new(STDOUT, :off)
|
40
25
|
at_exit { DataObjects.logger.flush }
|
41
26
|
|
42
|
-
Spec::Runner.configure do |config|
|
43
|
-
config.include(DataObjects::Spec::PendingHelpers)
|
44
|
-
end
|
45
|
-
|
46
27
|
CONFIG = OpenStruct.new
|
47
28
|
# CONFIG.scheme = 'derby'
|
48
29
|
# CONFIG.user = ENV['DO_DERBY_USER'] || 'derby'
|
@@ -52,6 +33,7 @@ CONFIG = OpenStruct.new
|
|
52
33
|
# CONFIG.database = ENV['DO_DERBY_DATABASE'] || "#{File.expand_path(File.dirname(__FILE__))}/testdb"
|
53
34
|
|
54
35
|
CONFIG.uri = ENV["DO_DERBY_SPEC_URI"] || "jdbc:derby:testdb;create=true"
|
36
|
+
CONFIG.testsql = "SELECT 1 FROM SYSIBM.SYSDUMMY1"
|
55
37
|
|
56
38
|
module DataObjectsSpecHelpers
|
57
39
|
|
@@ -199,3 +181,5 @@ module DataObjectsSpecHelpers
|
|
199
181
|
|
200
182
|
end
|
201
183
|
end
|
184
|
+
|
185
|
+
include DataObjectsSpecHelpers
|
data/spec/typecast/array_spec.rb
CHANGED
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/bigdecimal_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with BigDecimal' do
|
7
|
-
|
8
|
-
|
7
|
+
behaves_like 'supporting BigDecimal'
|
8
|
+
behaves_like 'supporting BigDecimal autocasting'
|
9
9
|
end
|
@@ -4,7 +4,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/boolean_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with Boolean' do
|
7
|
-
|
7
|
+
behaves_like 'supporting Boolean'
|
8
8
|
# TODO should we map smallint to boolean for derby ??
|
9
|
-
#
|
9
|
+
# behaves_like 'supporting Boolean autocasting'
|
10
10
|
end
|
@@ -5,5 +5,5 @@ require 'data_objects/spec/typecast/byte_array_spec'
|
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with ByteArray' do
|
7
7
|
# We need to switch to using parameter binding for this to work with Derby
|
8
|
-
#
|
8
|
+
# behaves_like 'supporting ByteArray'
|
9
9
|
end
|
data/spec/typecast/class_spec.rb
CHANGED
data/spec/typecast/date_spec.rb
CHANGED
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/date_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with Date' do
|
7
|
-
|
8
|
-
|
7
|
+
behaves_like 'supporting Date'
|
8
|
+
behaves_like 'supporting Date autocasting'
|
9
9
|
end
|
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/datetime_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with DateTime' do
|
7
|
-
|
8
|
-
|
7
|
+
behaves_like 'supporting DateTime'
|
8
|
+
behaves_like 'supporting DateTime autocasting'
|
9
9
|
end
|
data/spec/typecast/float_spec.rb
CHANGED
@@ -4,6 +4,6 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/float_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with Float' do
|
7
|
-
|
8
|
-
|
7
|
+
behaves_like 'supporting Float'
|
8
|
+
behaves_like 'supporting Float autocasting'
|
9
9
|
end
|
data/spec/typecast/nil_spec.rb
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
|
4
4
|
require 'data_objects/spec/typecast/nil_spec'
|
5
5
|
|
6
6
|
describe 'DataObjects::Derby with Nil' do
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
behaves_like 'supporting Nil'
|
8
|
+
behaves_like 'supporting writing an Nil'
|
9
|
+
behaves_like 'supporting Nil autocasting'
|
10
10
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
4
|
+
require 'data_objects/spec/typecast/other_spec'
|
5
|
+
|
6
|
+
describe 'DataObjects::H2 with other (unknown) type' do
|
7
|
+
behaves_like 'supporting other (unknown) type'
|
8
|
+
end
|
data/spec/typecast/range_spec.rb
CHANGED
data/spec/typecast/time_spec.rb
CHANGED
data/tasks/compile.rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
begin
|
2
|
+
gem 'rake-compiler', '~>0.7'
|
3
|
+
require 'rake/javaextensiontask'
|
4
|
+
|
5
|
+
# Hack to avoid "allocator undefined for Proc" issue when unpacking Gems:
|
6
|
+
# gemspec provided by Jeweler uses Rake::FileList for files, test_files and
|
7
|
+
# extra_rdoc_files, and procs cannot be marshalled.
|
8
|
+
def gemspec
|
9
|
+
@clean_gemspec ||= eval("#{Rake.application.jeweler.gemspec.to_ruby}") # $SAFE = 3\n
|
10
|
+
end
|
11
|
+
|
12
|
+
Rake::JavaExtensionTask.new('do_derby', gemspec) do |ext|
|
13
|
+
ext.ext_dir = 'ext-java/src/main/java'
|
14
|
+
ext.lib_dir = 'lib/do_derby'
|
15
|
+
ext.debug = ENV.has_key?('DO_JAVA_DEBUG') && ENV['DO_JAVA_DEBUG']
|
16
|
+
ext.classpath = '../do_jdbc/lib/do_jdbc_internal.jar'
|
17
|
+
end
|
18
|
+
|
19
|
+
# do_derby is only available for JRuby: the normal behaviour of rake-compiler
|
20
|
+
# is to only chain 'compile:PLATFORM' tasks to 'compile' where PLATFORM is the
|
21
|
+
# platform of the current interpreter (i.e. 'compile:java' to 'compile' only
|
22
|
+
# if running on JRuby). However, we always want to compile for Java, even if
|
23
|
+
# running from MRI.
|
24
|
+
task 'compile:do_derby' => ['compile:do_derby:java']
|
25
|
+
task 'compile' => ['compile:java']
|
26
|
+
|
27
|
+
rescue LoadError
|
28
|
+
warn "To compile, install rake-compiler (gem install rake-compiler)"
|
29
|
+
end
|
data/tasks/release.rake
CHANGED
@@ -1,75 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
nil
|
1
|
+
desc 'Builds all gems (native, binaries for JRuby and Windows)'
|
2
|
+
task :build_all do
|
3
|
+
`rake clean`
|
4
|
+
`rake java gem`
|
6
5
|
end
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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."
|
7
|
+
desc 'Release all gems (native, binaries for JRuby and Windows)'
|
8
|
+
task :release_all => :build_all do
|
9
|
+
Dir["pkg/do_derby-#{DataObjects::Derby::VERSION}*.gem"].each do |gem_path|
|
10
|
+
command = "gem push #{gem_path}"
|
11
|
+
puts "Executing #{command.inspect}:"
|
12
|
+
sh command
|
72
13
|
end
|
73
|
-
else
|
74
|
-
warn "rubyforge gem is required to generate releases, please install it (gem install rubyforge)."
|
75
14
|
end
|
data/tasks/spec.rake
CHANGED
@@ -1,19 +1,23 @@
|
|
1
|
-
|
2
|
-
require 'spec/rake/spectask'
|
1
|
+
require 'rake/testtask'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
spec_defaults = lambda do |spec|
|
4
|
+
spec.libs << 'lib' << 'spec'
|
5
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
6
|
+
spec.verbose = true
|
7
|
+
end
|
8
|
+
|
9
|
+
Rake::TestTask.new(:spec => [ :clean, :compile ], &spec_defaults)
|
10
|
+
Rake::TestTask.new(:spec_no_compile, &spec_defaults)
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
begin
|
13
|
+
require 'rcov/rcovtask'
|
14
|
+
Rcov::RcovTask.new do |spec|
|
15
|
+
spec.libs << 'spec'
|
16
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
17
|
+
spec.verbose = true
|
18
|
+
end
|
19
|
+
rescue LoadError
|
20
|
+
task :rcov do
|
21
|
+
abort 'RCov is not available. In order to run rcov, you must: gem install rcov'
|
18
22
|
end
|
19
23
|
end
|
metadata
CHANGED
@@ -1,145 +1,154 @@
|
|
1
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_derby.rb
|
13
|
-
- lib/do_derby/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
2
|
name: do_derby
|
51
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.1
|
52
5
|
platform: java
|
53
|
-
|
54
|
-
|
6
|
+
authors:
|
7
|
+
- Alex Coles
|
8
|
+
autorequire:
|
55
9
|
bindir: bin
|
56
|
-
|
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: []
|
10
|
+
cert_chain: []
|
74
11
|
|
12
|
+
date: 2010-01-09 00:00:00 +01:00
|
13
|
+
default_executable:
|
75
14
|
dependencies:
|
76
15
|
- !ruby/object:Gem::Dependency
|
16
|
+
name: data_objects
|
77
17
|
type: :runtime
|
78
|
-
name: addressable
|
79
18
|
version_requirement:
|
80
19
|
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
version:
|
82
20
|
requirements:
|
83
|
-
- -
|
21
|
+
- - "="
|
84
22
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
type: :runtime
|
88
|
-
name: extlib
|
89
|
-
version_requirement:
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
version: 0.10.1
|
91
24
|
version:
|
92
|
-
requirements:
|
93
|
-
- - ~>
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 0.9.12
|
96
25
|
- !ruby/object:Gem::Dependency
|
26
|
+
name: do_jdbc
|
97
27
|
type: :runtime
|
98
|
-
name: data_objects
|
99
28
|
version_requirement:
|
100
29
|
version_requirements: !ruby/object:Gem::Requirement
|
101
|
-
version:
|
102
30
|
requirements:
|
103
31
|
- - "="
|
104
32
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.10.
|
33
|
+
version: 0.10.1
|
34
|
+
version:
|
106
35
|
- !ruby/object:Gem::Dependency
|
107
|
-
type: :runtime
|
108
36
|
name: jdbc-derby
|
37
|
+
type: :runtime
|
109
38
|
version_requirement:
|
110
39
|
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
version:
|
112
40
|
requirements:
|
113
41
|
- - ~>
|
114
42
|
- !ruby/object:Gem::Version
|
115
43
|
version: 10.4.2.0
|
44
|
+
version:
|
116
45
|
- !ruby/object:Gem::Dependency
|
117
|
-
|
118
|
-
|
46
|
+
name: bacon
|
47
|
+
type: :development
|
119
48
|
version_requirement:
|
120
49
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
version:
|
122
50
|
requirements:
|
123
|
-
- -
|
51
|
+
- - ~>
|
124
52
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
53
|
+
version: "1.1"
|
54
|
+
version:
|
126
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake-compiler
|
127
57
|
type: :development
|
128
|
-
name: rspec
|
129
58
|
version_requirement:
|
130
59
|
version_requirements: !ruby/object:Gem::Requirement
|
131
|
-
version:
|
132
60
|
requirements:
|
133
61
|
- - ~>
|
134
62
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
63
|
+
version: "0.7"
|
64
|
+
version:
|
136
65
|
description: Implements the DataObjects API for Derby
|
137
66
|
email: alex@alexcolesportfolio.com
|
138
|
-
|
139
|
-
- Alex Coles
|
140
|
-
extra_rdoc_files: []
|
67
|
+
executables: []
|
141
68
|
|
69
|
+
extensions: []
|
70
|
+
|
71
|
+
extra_rdoc_files:
|
72
|
+
- README.markdown
|
73
|
+
- ChangeLog.markdown
|
74
|
+
- LICENSE
|
75
|
+
files:
|
76
|
+
- lib/do_derby/version.rb
|
77
|
+
- lib/do_derby.rb
|
78
|
+
- spec/command_spec.rb
|
79
|
+
- spec/connection_spec.rb
|
80
|
+
- spec/encoding_spec.rb
|
81
|
+
- spec/reader_spec.rb
|
82
|
+
- spec/result_spec.rb
|
83
|
+
- spec/spec_helper.rb
|
84
|
+
- spec/typecast/array_spec.rb
|
85
|
+
- spec/typecast/bigdecimal_spec.rb
|
86
|
+
- spec/typecast/boolean_spec.rb
|
87
|
+
- spec/typecast/byte_array_spec.rb
|
88
|
+
- spec/typecast/class_spec.rb
|
89
|
+
- spec/typecast/date_spec.rb
|
90
|
+
- spec/typecast/datetime_spec.rb
|
91
|
+
- spec/typecast/float_spec.rb
|
92
|
+
- spec/typecast/integer_spec.rb
|
93
|
+
- spec/typecast/nil_spec.rb
|
94
|
+
- spec/typecast/other_spec.rb
|
95
|
+
- spec/typecast/range_spec.rb
|
96
|
+
- spec/typecast/string_spec.rb
|
97
|
+
- spec/typecast/time_spec.rb
|
98
|
+
- tasks/compile.rake
|
99
|
+
- tasks/release.rake
|
100
|
+
- tasks/spec.rake
|
101
|
+
- LICENSE
|
102
|
+
- Rakefile
|
103
|
+
- ChangeLog.markdown
|
104
|
+
- README.markdown
|
105
|
+
- lib/do_derby/do_derby.jar
|
106
|
+
has_rdoc: false
|
107
|
+
homepage:
|
108
|
+
licenses: []
|
109
|
+
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options:
|
112
|
+
- --charset=UTF-8
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: "0"
|
120
|
+
version:
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: "0"
|
126
|
+
version:
|
142
127
|
requirements: []
|
143
128
|
|
144
129
|
rubyforge_project: dorb
|
145
|
-
|
130
|
+
rubygems_version: 1.3.5
|
131
|
+
signing_key:
|
132
|
+
specification_version: 3
|
133
|
+
summary: DataObjects Derby Driver
|
134
|
+
test_files:
|
135
|
+
- spec/command_spec.rb
|
136
|
+
- spec/connection_spec.rb
|
137
|
+
- spec/encoding_spec.rb
|
138
|
+
- spec/reader_spec.rb
|
139
|
+
- spec/result_spec.rb
|
140
|
+
- spec/spec_helper.rb
|
141
|
+
- spec/typecast/array_spec.rb
|
142
|
+
- spec/typecast/bigdecimal_spec.rb
|
143
|
+
- spec/typecast/boolean_spec.rb
|
144
|
+
- spec/typecast/byte_array_spec.rb
|
145
|
+
- spec/typecast/class_spec.rb
|
146
|
+
- spec/typecast/date_spec.rb
|
147
|
+
- spec/typecast/datetime_spec.rb
|
148
|
+
- spec/typecast/float_spec.rb
|
149
|
+
- spec/typecast/integer_spec.rb
|
150
|
+
- spec/typecast/nil_spec.rb
|
151
|
+
- spec/typecast/other_spec.rb
|
152
|
+
- spec/typecast/range_spec.rb
|
153
|
+
- spec/typecast/string_spec.rb
|
154
|
+
- spec/typecast/time_spec.rb
|
data/HISTORY.markdown
DELETED
data/Manifest.txt
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
HISTORY.markdown
|
2
|
-
LICENSE
|
3
|
-
Manifest.txt
|
4
|
-
README.markdown
|
5
|
-
Rakefile
|
6
|
-
buildfile
|
7
|
-
ext-java/src/main/java/DoDerbyExtService.java
|
8
|
-
ext-java/src/main/java/do_derby/DerbyDriverDefinition.java
|
9
|
-
lib/do_derby.rb
|
10
|
-
lib/do_derby/version.rb
|
11
|
-
lib/do_derby_ext.jar
|
12
|
-
spec/integration/do_derby_spec.rb
|
13
|
-
spec/integration/logging_spec.rb
|
14
|
-
spec/spec.opts
|
15
|
-
spec/spec_helper.rb
|
16
|
-
spec/unit/do_derby_spec.rb
|
data/tasks/gem.rake
DELETED
data/tasks/install.rake
DELETED
@@ -1,15 +0,0 @@
|
|
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
DELETED