Permalink
Browse files

Adding JRuby support to FactoryGirl

  JRuby are affected by inconsistent behavior of overriding
  #respond_to? that is causing an unconditional call to
  #respond_to_missing.

  Current change does not affect MRI users in any way,
  JRuby-specific things are wrapped into the RUBY_PLATFORM
  check.

  Adding docs, modifying gemspec and travis.yml to make factory_girl to pass on Travis.

  Wire up tests
  • Loading branch information...
1 parent e038bf8 commit d48b7601c26af5919c3477449bd65dcc2989aec4 @ifesdjeen ifesdjeen committed with joshuaclayton Jul 6, 2012
Showing with 38 additions and 1 deletion.
  1. +3 −0 .travis.yml
  2. +7 −0 GETTING_STARTED.md
  3. +5 −0 Gemfile.lock
  4. +8 −1 factory_girl.gemspec
  5. +5 −0 gemfiles/3.0.gemfile.lock
  6. +5 −0 gemfiles/3.1.gemfile.lock
  7. +5 −0 gemfiles/3.2.gemfile.lock
View
@@ -1,9 +1,12 @@
rvm:
- 1.9.2
- 1.9.3
+ - jruby-19mode
before_install:
- gem update --system
script: "bundle exec rake spec:unit spec:acceptance features"
+jdk:
+ - openjdk6
gemfile:
- gemfiles/3.0.gemfile
- gemfiles/3.1.gemfile
View
@@ -16,6 +16,13 @@ If you're *not* using Rails, you'll just have to change the required version of
gem "factory_girl", "~> 3.0"
```
+JRuby users: FactoryGirl works with JRuby starting with 1.6.7.2 (latest stable, as per July 2012).
+JRuby has to be used in 1.9 mode, for that, use JRUBY_OPTS environment variable:
+
+```
+export JRUBY_OPTS=--1.9
+```
+
Once your Gemfile is updated, you'll want to update your bundle.
Using Without Bundler
View
@@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
+ ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
+ gherkin (2.9.3-java)
+ json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
+ json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
+ java
ruby
DEPENDENCIES
@@ -31,7 +31,14 @@ Gem::Specification.new do |s|
s.add_development_dependency("mocha")
s.add_development_dependency("bourne")
s.add_development_dependency("appraisal", "~> 0.4")
- s.add_development_dependency("sqlite3-ruby")
+
+ if RUBY_PLATFORM == "java"
+ s.add_development_dependency("activerecord-jdbcsqlite3-adapter")
+ s.add_development_dependency("jdbc-sqlite3")
+ else
+ s.add_development_dependency("sqlite3-ruby")
+ end
+
s.add_development_dependency("yard")
end
@@ -39,10 +39,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
+ ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
+ gherkin (2.9.3-java)
+ json (>= 1.4.6)
i18n (0.5.0)
json (1.7.0)
+ json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@@ -69,6 +73,7 @@ GEM
yard (0.8.1)
PLATFORMS
+ java
ruby
DEPENDENCIES
@@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
+ ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
+ gherkin (2.9.3-java)
+ json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
+ json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
+ java
ruby
DEPENDENCIES
@@ -40,10 +40,14 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
ffi (1.0.11)
+ ffi (1.0.11-java)
gherkin (2.9.3)
json (>= 1.4.6)
+ gherkin (2.9.3-java)
+ json (>= 1.4.6)
i18n (0.6.0)
json (1.7.0)
+ json (1.7.0-java)
metaclass (0.0.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
@@ -70,6 +74,7 @@ GEM
yard (0.8.1)
PLATFORMS
+ java
ruby
DEPENDENCIES

0 comments on commit d48b760

Please sign in to comment.