Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jruby support #68

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rvm:
- 2.1
- 2.2
- 2.3.1
- jruby
addons:
code_climate:
repo_token: 05e3e31164d59aa626b730b92eb9b7418326dbf23420a4b87eab2555840b39ef
8 changes: 7 additions & 1 deletion example/rails_app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ source 'https://rubygems.org'

gem 'rails', '3.2.22.4'

gem 'sqlite3'
# for CRuby, Rubinius, including Windows and RubyInstaller
gem "sqlite3", :platform => [:ruby, :mswin, :mingw]

# for JRuby
# gem "jdbc-sqlite3", :platform => :jruby, :require => 'jdbc/sqlite3'
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby

gem 'suture', :path => '../..'

Expand All @@ -12,4 +17,5 @@ gem 'minitest', :group => :test
gem 'rake', '~> 10.0'
gem 'i18n', '~> 0.6.0'
gem 'rack-cache', '~> 1.2.0'
gem 'pry'

31 changes: 28 additions & 3 deletions example/rails_app/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PATH
remote: ../..
specs:
suture (1.0.0)
suture (1.1.1)
activerecord-jdbcsqlite3-adapter
backports
bar-of-progress (>= 0.1.3)
sqlite3

GEM
remote: https://rubygems.org/
Expand All @@ -30,6 +30,11 @@ GEM
activesupport (= 3.2.22.4)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activerecord-jdbc-adapter (1.3.21)
activerecord (>= 2.2)
activerecord-jdbcsqlite3-adapter (1.3.21)
activerecord-jdbc-adapter (~> 1.3.21)
jdbc-sqlite3 (>= 3.7.2, < 3.9)
activeresource (3.2.22.4)
activemodel (= 3.2.22.4)
activesupport (= 3.2.22.4)
Expand All @@ -40,18 +45,32 @@ GEM
backports (3.6.8)
bar-of-progress (0.1.3)
builder (3.0.4)
coderay (1.1.1)
erubis (2.7.0)
ffi (1.9.14-java)
hike (1.2.3)
i18n (0.6.11)
jdbc-sqlite3 (3.8.11.2)
journey (1.0.4)
json (1.8.3)
json (1.8.3-java)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.2)
mime-types (1.25.1)
minitest (5.9.0)
multi_json (1.12.1)
polyglot (0.3.5)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry (0.10.4-java)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
spoon (~> 0.0)
rack (1.4.7)
rack-cache (1.2)
rack (>= 0.4)
Expand All @@ -77,6 +96,9 @@ GEM
rake (10.5.0)
rdoc (3.12.2)
json (~> 1.4)
slop (3.6.0)
spoon (0.0.6)
ffi
sprockets (2.2.3)
hike (~> 1.2)
multi_json (~> 1.0)
Expand All @@ -91,16 +113,19 @@ GEM
tzinfo (0.3.51)

PLATFORMS
java
ruby

DEPENDENCIES
activerecord-jdbcsqlite3-adapter
i18n (~> 0.6.0)
minitest
pry
rack-cache (~> 1.2.0)
rails (= 3.2.22.4)
rake (~> 10.0)
sqlite3
suture!

BUNDLED WITH
1.12.5
1.13.1
7 changes: 6 additions & 1 deletion lib/suture/wrap/sqlite.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require "fileutils"
require "sqlite3"
if defined?(JRUBY_VERSION)
require "jdbc/sqlite3"
Jdbc::SQLite3.load_driver
else
require "sqlite3"
end
require "suture/error/schema_version"

module Suture::Wrap
Expand Down
8 changes: 7 additions & 1 deletion suture.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "sqlite3"
sqlite3 = if defined?(JRUBY_VERSION)
# "jdbc-sqlite3"
"activerecord-jdbcsqlite3-adapter"
else
"sqlite3"
end
spec.add_dependency sqlite3
spec.add_dependency "backports"
spec.add_dependency "bar-of-progress", ">= 0.1.3"

Expand Down