do_h2 0.10.0-java → 0.10.1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 H2 driver (using *do_jdbc*).
13
+
14
+ * Known Issues
15
+ * JRuby-only
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2009 Alex Coles, Ikonoklastik Productions
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
@@ -1,4 +1,80 @@
1
- do_h2
2
- =====
1
+ # do_h2
3
2
 
4
- An H2 driver for DataObjects
3
+ * <http://dataobjects.info>
4
+
5
+ ## Description
6
+
7
+ An H2 driver for DataObjects.
8
+
9
+ ## Features/Problems
10
+
11
+ This driver implements the DataObjects API for the H2 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("h2://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
+ h2://employees
26
+ jdbc:h2:mem
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_h2
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 H2 driver wiki page:
51
+ <http://wiki.github.com/datamapper/do/h2>.
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
- require 'pathname'
6
- require 'lib/do_h2/version'
6
+ ROOT = Pathname(__FILE__).dirname.expand_path
7
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'])
8
+ require ROOT + 'lib/do_h2/version'
12
9
 
13
- Dir['tasks/*.rake'].sort.each { |f| import f }
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_h2'
23
+ gem.version = DataObjects::H2::VERSION
24
+ gem.summary = 'DataObjects H2 Driver'
25
+ gem.description = 'Implements the DataObjects API for H2'
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::H2::VERSION
34
+ gem.add_dependency 'do_jdbc', DataObjects::H2::VERSION
35
+ gem.add_dependency 'jdbc-h2', '~>1.1.107'
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
@@ -12,23 +12,13 @@ if RUBY_PLATFORM =~ /java/
12
12
  require 'jdbc/h2' # the JDBC driver, packaged as a gem
13
13
  end
14
14
 
15
- require 'do_h2_ext' # the Java extension for this DO driver
15
+ require 'do_h2/do_h2' # the Java extension for this DO driver
16
16
 
17
17
  # Another way of loading the JDBC Class. This seems to be more reliable
18
18
  # than Class.forName() within the data_objects.Connection Java class,
19
19
  # which is currently not working as expected.
20
20
  java_import driver
21
21
 
22
- module DataObjects
23
- module H2
24
- class Connection
25
- def self.pool_size
26
- 20
27
- end
28
- end
29
- end
30
- end
31
-
32
22
  else
33
23
  warn "do_h2 is only for use with JRuby"
34
24
  end
Binary file
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module H2
3
- VERSION = "0.10.0"
3
+ VERSION = '0.10.1'.freeze
4
4
  end
5
5
  end
@@ -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::H2::Command do
7
- it_should_behave_like 'a Command'
8
- # it_should_behave_like 'a Command with async'
7
+ behaves_like 'a Command'
8
+ # behaves_like 'a Command with async'
9
9
  end
@@ -5,15 +5,17 @@ require 'data_objects/spec/connection_spec'
5
5
 
6
6
  describe DataObjects::H2::Connection do
7
7
 
8
- before :all do
9
- @driver = 'h2'
10
- @user = ''
8
+ before do
9
+ @driver = 'h2'
10
+ @user = ''
11
11
  @password = ''
12
- @host = ''
13
- @port = ''
12
+ @host = ''
13
+ @port = ''
14
14
  @database = "#{File.expand_path(File.dirname(__FILE__))}/test.db"
15
15
  end
16
16
 
17
- it_should_behave_like 'a Connection'
18
- #it_should_behave_like 'a Connection with authentication support'
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
@@ -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::H2::Connection do
7
- #it_should_behave_like 'a driver supporting encodings'
7
+ #behaves_like 'a driver supporting different encodings'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
4
4
  require 'data_objects/spec/reader_spec'
5
5
 
6
6
  describe DataObjects::H2::Reader do
7
- it_should_behave_like 'a Reader'
7
+ behaves_like 'a Reader'
8
8
  end
@@ -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 "it_should_behave_like ....."
7
+ # concurrent execution of the "behaves_like ....."
8
8
  # needed by some databases (sqlite3)
9
9
 
10
10
  describe DataObjects::H2::Result do
11
- it_should_behave_like 'a Result'
11
+ behaves_like 'a Result'
12
12
  end
13
13
 
14
14
  describe DataObjects::H2::Result do
15
- it_should_behave_like 'a Result which returns inserted keys'
15
+ behaves_like 'a Result which returns inserted keys'
16
16
  end
@@ -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
- 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'
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_h2'
34
23
 
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::H2.logger = DataObjects::Logger.new(log_path, :debug)
39
-
24
+ DataObjects::H2.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 = 'h2'
48
29
  # CONFIG.user = ENV['DO_H2_USER'] || 'h2'
@@ -179,3 +160,5 @@ module DataObjectsSpecHelpers
179
160
 
180
161
  end
181
162
  end
163
+
164
+ include DataObjectsSpecHelpers
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/array_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Array' do
7
- it_should_behave_like 'supporting Array'
7
+ behaves_like 'supporting Array'
8
8
  end
@@ -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::H2 with BigDecimal' do
7
- it_should_behave_like 'supporting BigDecimal'
8
- it_should_behave_like 'supporting BigDecimal autocasting'
7
+ behaves_like 'supporting BigDecimal'
8
+ behaves_like 'supporting BigDecimal 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/boolean_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Boolean' do
7
- it_should_behave_like 'supporting Boolean'
8
- it_should_behave_like 'supporting Boolean autocasting'
7
+ behaves_like 'supporting Boolean'
8
+ behaves_like 'supporting Boolean autocasting'
9
9
  end
@@ -5,5 +5,5 @@ require 'data_objects/spec/typecast/byte_array_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with ByteArray' do
7
7
  # We need to switch to using parameter binding for this to work with H2
8
- # it_should_behave_like 'supporting ByteArray'
8
+ # behaves_like 'supporting ByteArray'
9
9
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/class_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Class' do
7
- it_should_behave_like 'supporting Class'
7
+ behaves_like 'supporting Class'
8
8
  end
@@ -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::H2 with Date' do
7
- it_should_behave_like 'supporting Date'
8
- it_should_behave_like 'supporting Date autocasting'
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::H2 with DateTime' do
7
- it_should_behave_like 'supporting DateTime'
8
- it_should_behave_like 'supporting DateTime autocasting'
7
+ behaves_like 'supporting DateTime'
8
+ behaves_like 'supporting DateTime 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/float_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Float' do
7
- it_should_behave_like 'supporting Float'
8
- it_should_behave_like 'supporting Float autocasting'
7
+ behaves_like 'supporting Float'
8
+ behaves_like 'supporting Float autocasting'
9
9
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/integer_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Integer' do
7
- it_should_behave_like 'supporting Integer'
7
+ behaves_like 'supporting Integer'
8
8
  end
@@ -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::H2 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'
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
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/range_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Range' do
7
- it_should_behave_like 'supporting Range'
7
+ behaves_like 'supporting Range'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/string_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with String' do
7
- it_should_behave_like 'supporting String'
7
+ behaves_like 'supporting String'
8
8
  end
@@ -4,5 +4,5 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
4
4
  require 'data_objects/spec/typecast/time_spec'
5
5
 
6
6
  describe 'DataObjects::H2 with Time' do
7
- it_should_behave_like 'supporting Time'
7
+ behaves_like 'supporting Time'
8
8
  end
@@ -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_h2', gemspec) do |ext|
13
+ ext.ext_dir = 'ext-java/src/main/java'
14
+ ext.lib_dir = 'lib/do_h2'
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_h2 is only available for JRuby: the normal behaviour of rake-compiler
20
+ # is to only chain 'compile:PLATFORM' tasks to 'compile' where PLATFORM is
21
+ # the platform of the current interpreter (i.e. 'compile:java' to 'compile'
22
+ # only if running on JRuby). However, we always want to compile for Java,
23
+ # even if running from MRI.
24
+ task 'compile:do_h2' => ['compile:do_h2:java']
25
+ task 'compile' => ['compile:java']
26
+
27
+ rescue LoadError
28
+ warn "To compile, install rake-compiler (gem install rake-compiler)"
29
+ end
@@ -1,75 +1,14 @@
1
- begin
2
- gem 'rubyforge', '~> 1.0.1'
3
- require 'rubyforge'
4
- rescue Exception
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
- 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."
7
+ desc 'Release all gems (native, binaries for JRuby and Windows)'
8
+ task :release_all => :build_all do
9
+ Dir["pkg/do_h2-#{DataObjects::H2::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
@@ -1,19 +1,23 @@
1
- # Specs
2
- require 'spec/rake/spectask'
1
+ require 'rake/testtask'
3
2
 
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'
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
- 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
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_h2.rb
13
- - lib/do_h2/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_h2
51
- has_rdoc: false
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.10.1
52
5
  platform: java
53
- summary: DataObjects H2 Driver
54
- default_executable:
6
+ authors:
7
+ - Alex Coles
8
+ autorequire:
55
9
  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: []
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: "2.0"
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.0
33
+ version: 0.10.1
34
+ version:
106
35
  - !ruby/object:Gem::Dependency
107
- type: :runtime
108
36
  name: jdbc-h2
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: 1.1.107
44
+ version:
116
45
  - !ruby/object:Gem::Dependency
117
- type: :runtime
118
- name: do_jdbc
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: 0.10.0
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: 1.2.0
63
+ version: "0.7"
64
+ version:
136
65
  description: Implements the DataObjects API for H2
137
66
  email: alex@alexcolesportfolio.com
138
- authors:
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_h2/version.rb
77
+ - lib/do_h2.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_h2/do_h2.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
- autorequire:
130
+ rubygems_version: 1.3.5
131
+ signing_key:
132
+ specification_version: 3
133
+ summary: DataObjects H2 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
@@ -1,6 +0,0 @@
1
- ## 0.10.0 2009-10-15
2
-
3
- Initial release of H2 driver (using *do_jdbc*).
4
-
5
- * Known Issues
6
- * JRuby-only
@@ -1,21 +0,0 @@
1
- HISTORY.markdown
2
- LICENSE
3
- Manifest.txt
4
- README.markdown
5
- Rakefile
6
- buildfile
7
- ext-java/src/main/java/DoH2ExtService.java
8
- ext-java/src/main/java/do_h2/H2DriverDefinition.java
9
- lib/do_h2.rb
10
- lib/do_h2/version.rb
11
- lib/do_h2_ext.jar
12
- spec/integration/do_h2_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_h2_spec.rb
19
- spec/unit/reader_spec.rb
20
- spec/unit/result_spec.rb
21
- spec/unit/transaction_spec.rb
@@ -1,3 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'data_objects', 'spec', 'lib', 'rspec_immediate_feedback_formatter'))
@@ -1,8 +0,0 @@
1
- require 'rubygems/package_task'
2
-
3
- GEM_SPEC = eval(File.read('do_h2.gemspec'))
4
-
5
- gem_package = Gem::PackageTask.new(GEM_SPEC) do |pkg|
6
- pkg.need_tar = false
7
- pkg.need_zip = false
8
- end
@@ -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
@@ -1,4 +0,0 @@
1
- if (tasks_dir = ROOT.parent + 'tasks').directory?
2
- require tasks_dir + 'ext_helper_java'
3
- setup_java_extension("#{GEM_SPEC.name}_ext", GEM_SPEC)
4
- end