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 support to jruby #10

Open
wants to merge 1 commit into
base: master
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ language: ruby
rvm:
- 1.9.3
- ruby-head
- jruby-1.7
- jruby-9.0.4.0
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
source "http://rubygems.org"

gem 'pg', '>= 0.0.1'
gem 'activerecord', '>= 4.0.0'
gem 'pg', '>= 0.0.1', platform: :ruby
# Use jdbcpostgresql as the database for Active Record in jruby
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby

gem 'activesupport'
gem 'activerecord'
gem 'logger'
gem 'rake'

group :test, :development do
Expand Down
62 changes: 38 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
GEM
remote: http://rubygems.org/
specs:
activemodel (4.2.0)
activesupport (= 4.2.0)
activemodel (4.2.5.1)
activesupport (= 4.2.5.1)
builder (~> 3.1)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
activerecord (4.2.5.1)
activemodel (= 4.2.5.1)
activesupport (= 4.2.5.1)
arel (~> 6.0)
activesupport (4.2.0)
activerecord-jdbc-adapter (1.3.19)
activerecord (>= 2.2)
activerecord-jdbcpostgresql-adapter (1.3.19)
activerecord-jdbc-adapter (~> 1.3.19)
jdbc-postgres (>= 9.1)
activesupport (4.2.5.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.0)
arel (6.0.3)
builder (3.2.2)
diff-lcs (1.2.5)
i18n (0.7.0)
json (1.8.2)
minitest (5.5.1)
pg (0.18.1)
rake (10.4.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
jdbc-postgres (9.4.1206)
json (1.8.3)
json (1.8.3-java)
logger (1.2.8)
minitest (5.8.4)
pg (0.18.4)
rake (10.5.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.2)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
thread_safe (0.3.4)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
thread_safe (0.3.5)
thread_safe (0.3.5-java)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
java
ruby

DEPENDENCIES
activerecord (>= 4.0.0)
activerecord
activerecord-jdbcpostgresql-adapter
activesupport
logger
pg (>= 0.0.1)
rake
rspec
2 changes: 1 addition & 1 deletion lib/multilang-hstore/translation_keeper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def actual_locale
end

def flush!
@model.send("#{@attribute}_will_change!")
@model[@attribute] = @translations
@model.send("#{@attribute}_will_change!")
end

end
Expand Down
7 changes: 6 additions & 1 deletion multilang-hstore.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ Gem::Specification.new do |s|
"spec/schema.rb",
"spec/spec_helper.rb"
]
s.add_dependency 'pg', '~> 0.0'
s.add_dependency 'activerecord', '~> 4.0'
if (RUBY_PLATFORM == 'java')
s.add_dependency 'activerecord-jdbcpostgresql-adapter'
else
s.add_dependency 'pg', '~> 0.0'
end

end