This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'abevoelker-add-openedge-adapter'
Conflicts: data_objects/lib/data_objects/spec/shared/connection_spec.rb
- Loading branch information
Showing
41 changed files
with
1,284 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
--format documentation | |||
--colour |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
source :rubygems | |||
|
|||
path '../' | |||
|
|||
gemspec | |||
|
|||
platforms :jruby do | |||
gem 'jdbc-openedge' | |||
gem 'do_jdbc' | |||
end | |||
|
|||
group :development do # Development dependencies (as in the gemspec) | |||
gem 'rake', '~> 0.8.7' | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
Copyright (c) 2012 Abe Voelker, other DataObjects contributors | |||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||
of this software and associated documentation files (the "Software"), to deal | |||
in the Software without restriction, including without limitation the rights | |||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
copies of the Software, and to permit persons to whom the Software is | |||
furnished to do so, subject to the following conditions: | |||
|
|||
The above copyright notice and this permission notice shall be included in | |||
all copies or substantial portions of the Software. | |||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,107 @@ | |||
# do_openedge | |||
|
|||
* <http://dataobjects.info> | |||
|
|||
## Description | |||
|
|||
An OpenEdge driver for DataObjects. | |||
|
|||
## Features/Problems | |||
|
|||
This driver implements the DataObjects API for the Progress OpenEdge relational database. | |||
This driver is currently provided only for JRuby. | |||
|
|||
### Known Issues | |||
|
|||
* `BLOB`/`CLOB` fields cannot be used as predicates or arithmetic/comparison | |||
operators. In other words, you cannot query rows based on their value. You | |||
will have to query the rows using a different column value (there is no | |||
issue doing reads or writes with `BLOB`/`CLOB` fields). See [ProKB P91964][0] | |||
for more info. | |||
* The 10.2B JDBC driver causes `DECIMAL`/`NUMERIC` SQL types to round up to the | |||
nearest integer and then truncate all digits after the decimal point. According | |||
to [ProKB P187898][1], it appears to be a regression bug in the JDBC driver. | |||
|
|||
## Synopsis | |||
|
|||
An example of usage: | |||
|
|||
@connection = DataObjects::Connection.new("openedge://localhost:4000/sports2000") | |||
@reader = @connection.create_command('SELECT * FROM State').execute_reader | |||
@reader.next! | |||
|
|||
The `Connection` constructor should be passed either a DataObjects-style URI or | |||
JDBC-style URI: | |||
|
|||
openedge://user:password@host:port/database?option1=value1&option2=value2 | |||
jdbc:datadirect:openedge://host:port/database?user=<value>&password=<value> | |||
|
|||
Note that the DataDirect proprietary-style JDBC URI tokenized with `;`s: | |||
|
|||
jdbc:datadirect:openedge://host:port;databaseName=database;user=<value>;password=<value> | |||
|
|||
is **not** supported. | |||
|
|||
## Requirements | |||
|
|||
* JRuby 1.3.1 + (1.4+ recommended) | |||
* `data_objects` gem | |||
* `do_jdbc` gem (shared library) | |||
|
|||
## Install | |||
|
|||
To install the gem: | |||
|
|||
jruby -S gem install do_openedge | |||
|
|||
To compile and install from source: | |||
|
|||
* Install the Java Development Kit (provided if you are on a recent version of | |||
Mac OS X) from <http://java.sun.com> | |||
* Install a recent version of JRuby. Ensure `jruby` is in your `PATH` and/or | |||
you have configured the `JRUBY_HOME` environment variable to point to your | |||
JRuby installation. | |||
* Install `data_objects` and `do_jdbc` with `jruby -S rake install`. | |||
* Install this driver with `jruby -S rake install`. | |||
|
|||
## Developers | |||
|
|||
Follow the above installation instructions. Additionally, you'll need: | |||
* `rspec` gem for running specs. | |||
* `YARD` gem for generating documentation. | |||
|
|||
See the DataObjects wiki for more comprehensive information: | |||
<http://wiki.github.com/datamapper/do/jruby>. | |||
|
|||
To run specs: | |||
|
|||
jruby -S rake spec | |||
|
|||
To run specs without compiling extensions first: | |||
|
|||
jruby -S rake spec_no_compile | |||
|
|||
To run individual specs: | |||
|
|||
jruby -S rake spec SPEC=spec/connection_spec.rb | |||
|
|||
### Spec data setup | |||
|
|||
The specs require an empty database to use for running tests against | |||
(the database will be written/read from by the tests). Here are | |||
some commands to be ran from `proenv` to create an empty | |||
database that can be used for testing (note the use of UTF-8, | |||
which is required for proper multibyte string support): | |||
|
|||
prodb test empty | |||
proutil test -C convchar convert utf-8 | |||
sql_env | |||
proserve test -S 4000 | |||
|
|||
## License | |||
|
|||
This code is licensed under an **MIT License**. Please see the | |||
accompanying `LICENSE` file. | |||
|
|||
[0]: http://knowledgebase.progress.com/articles/Article/P91964 | |||
[1]: http://knowledgebase.progress.com/articles/Article/P187898 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
require 'pathname' | |||
require 'rubygems' | |||
require 'bundler' | |||
require 'rubygems/package_task' | |||
Bundler::GemHelper.install_tasks | |||
|
|||
require 'rake' | |||
require 'rake/clean' | |||
|
|||
ROOT = Pathname(__FILE__).dirname.expand_path | |||
|
|||
require ROOT + 'lib/do_openedge/version' | |||
|
|||
JRUBY = RUBY_PLATFORM =~ /java/ | |||
IRONRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby' | |||
WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i) | |||
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS']) | |||
|
|||
CLEAN.include(%w[ {tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext-java/target ]) | |||
|
|||
|
|||
Rake::Task['build'].clear_actions if Rake::Task.task_defined?('build') | |||
task :build => [ :java, :gem ] | |||
|
|||
FileList['tasks/**/*.rake'].each { |task| import task } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
# Apache Buildr buildfile for do_openedge | |||
# see http://incubator.apache.org/buildr/ for more information on Apache Buildr | |||
require 'buildr' | |||
require 'pathname' | |||
|
|||
VERSION_NUMBER = '1.0' | |||
JDBC_SUPPORT = ['data_objects:jdbc:jar:1.0'] | |||
TARGET_DIR = 'pkg/classes' | |||
repositories.remote << 'http://www.ibiblio.org/maven2/' | |||
|
|||
define 'do_openedge' do | |||
project.version = VERSION_NUMBER | |||
project.group = 'data_objects.rb' | |||
|
|||
manifest['Copyright'] = 'Abe Voelker (C) 2012' | |||
|
|||
compile.using :target => '1.5', :lint => 'all', :deprecation => 'true' | |||
|
|||
define 'ext-java' do | |||
package(:jar).clean.include(TARGET_DIR) | |||
|
|||
jdbc_support_jar = file('../../do_jdbc/lib/do_jdbc_internal.jar') | |||
jdbc_support = artifact('data_objects:jdbc:jar:1.0').from(jdbc_support_jar) | |||
|
|||
compile.into(TARGET_DIR).with(JDBC_SUPPORT) | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,96 @@ | |||
# -*- encoding: utf-8 -*- | |||
|
|||
Gem::Specification.new do |s| | |||
s.name = %q{do_openedge} | |||
s.version = "0.10.8" | |||
s.platform = %q{java} | |||
|
|||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | |||
s.authors = ["Abe Voelker"] | |||
s.date = %q{2012-06-05} | |||
s.description = %q{Implements the DataObjects API for OpenEdge} | |||
s.email = %q{abe@abevoelker.com} | |||
s.extra_rdoc_files = [ | |||
"ChangeLog.markdown", | |||
"LICENSE", | |||
"README.markdown" | |||
] | |||
s.files = [ | |||
"ChangeLog.markdown", | |||
"LICENSE", | |||
"README.markdown", | |||
"Rakefile", | |||
"lib/do_openedge.rb", | |||
"lib/do_openedge/version.rb", | |||
"spec/command_spec.rb", | |||
"spec/connection_spec.rb", | |||
"spec/encoding_spec.rb", | |||
"spec/reader_spec.rb", | |||
"spec/result_spec.rb", | |||
"spec/spec_helper.rb", | |||
"spec/typecast/array_spec.rb", | |||
"spec/typecast/bigdecimal_spec.rb", | |||
"spec/typecast/boolean_spec.rb", | |||
"spec/typecast/byte_array_spec.rb", | |||
"spec/typecast/class_spec.rb", | |||
"spec/typecast/date_spec.rb", | |||
"spec/typecast/datetime_spec.rb", | |||
"spec/typecast/float_spec.rb", | |||
"spec/typecast/integer_spec.rb", | |||
"spec/typecast/nil_spec.rb", | |||
"spec/typecast/other_spec.rb", | |||
"spec/typecast/range_spec.rb", | |||
"spec/typecast/string_spec.rb", | |||
"spec/typecast/time_spec.rb", | |||
"tasks/compile.rake", | |||
"tasks/release.rake", | |||
"tasks/spec.rake" | |||
] | |||
s.require_paths = ["lib"] | |||
s.rubyforge_project = %q{dorb} | |||
s.rubygems_version = %q{1.6.2} | |||
s.summary = %q{DataObjects OpenEdge Driver} | |||
s.test_files = [ | |||
"spec/command_spec.rb", | |||
"spec/connection_spec.rb", | |||
"spec/encoding_spec.rb", | |||
"spec/reader_spec.rb", | |||
"spec/result_spec.rb", | |||
"spec/spec_helper.rb", | |||
"spec/typecast/array_spec.rb", | |||
"spec/typecast/bigdecimal_spec.rb", | |||
"spec/typecast/boolean_spec.rb", | |||
"spec/typecast/byte_array_spec.rb", | |||
"spec/typecast/class_spec.rb", | |||
"spec/typecast/date_spec.rb", | |||
"spec/typecast/datetime_spec.rb", | |||
"spec/typecast/float_spec.rb", | |||
"spec/typecast/integer_spec.rb", | |||
"spec/typecast/nil_spec.rb", | |||
"spec/typecast/other_spec.rb", | |||
"spec/typecast/range_spec.rb", | |||
"spec/typecast/string_spec.rb", | |||
"spec/typecast/time_spec.rb" | |||
] | |||
|
|||
if s.respond_to? :specification_version then | |||
s.specification_version = 3 | |||
|
|||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then | |||
s.add_runtime_dependency(%q<data_objects>, ["= 0.10.8"]) | |||
s.add_runtime_dependency(%q<do_jdbc>, ["= 0.10.8"]) | |||
s.add_development_dependency(%q<rspec>, ["~> 2.5"]) | |||
s.add_development_dependency(%q<rake-compiler>, ["~> 0.7"]) | |||
else | |||
s.add_dependency(%q<data_objects>, ["= 0.10.8"]) | |||
s.add_dependency(%q<do_jdbc>, ["= 0.10.8"]) | |||
s.add_dependency(%q<rspec>, ["~> 2.5"]) | |||
s.add_dependency(%q<rake-compiler>, ["~> 0.7"]) | |||
end | |||
else | |||
s.add_dependency(%q<data_objects>, ["= 0.10.8"]) | |||
s.add_dependency(%q<do_jdbc>, ["= 0.10.8"]) | |||
s.add_dependency(%q<rspec>, ["~> 2.5"]) | |||
s.add_dependency(%q<rake-compiler>, ["~> 0.7"]) | |||
end | |||
end |
Oops, something went wrong.