Skip to content

Instantly share code, notes, and snippets.

@dnagir
dnagir / shell.sh
Created December 14, 2011 08:01
neo4j one spec is failing (locally only)
> bundle exec rake
/Users/dnagir/.rvm/rubies/jruby-1.6.5/bin/jruby -S bundle exec rcov -Ispec:lib --rails --include views -Ispec --exclude gems\/,spec\/,features\/,seeds\/ ./spec/event_handler_spec.rb ./spec/identity_map_spec.rb ./spec/load_spec.rb ./spec/neo4j_spec.rb ./spec/node_spec.rb ./spec/paginate_spec.rb ./spec/relationship_set_spec.rb ./spec/relationship_spec.rb ./spec/transaction_spec.rb ./spec/algo/graph_algo_spec.rb ./spec/batch/indexer_spec.rb ./spec/batch/inserter_spec.rb ./spec/batch/lucene_inserter_spec.rb ./spec/batch/rule_inserter_spec.rb ./spec/cypher/cypher_spec.rb ./spec/has_list/timeline_spec.rb ./spec/has_n/has_n_spec.rb ./spec/has_n/has_one_spec.rb ./spec/index/index_spec.rb ./spec/index/shared_index_spec.rb ./spec/migrations/global_migration_spec.rb ./spec/migrations/lazy_node_mixin_spec.rb ./spec/migrations/node_mixin_spec.rb ./spec/node_mixin/node_mixin_find_spec.rb ./spec/node_mixin/node_mixin_spec.rb ./spec/orm_adapter/adapters/neo4j_spec.rb ./spec/property/property_spec.rb ./spec
@dnagir
dnagir / document.rb
Created December 12, 2011 05:25
Integrating neo4j with Dragonfly in Rails
class Document < Neo4j::Model
property :file_uid, :type => String
property :file_name, :type => String
file_accessor :file
end
@dnagir
dnagir / Gemfile
Created December 9, 2011 09:11
devise-neo4j
source 'http://rubygems.org'
gem "neo4j", "~> 1.3.0"
gem "devise-neo4j"
@dnagir
dnagir / shell.sh
Created December 8, 2011 01:37
JRuby can't run on thin and can't install unicorn
RAILS_ENV=production thin start
The signal QUIT is in use by the JVM and will not work correctly on this platform
>> Using rack adapter
JopensslService.java:66 warning: already initialized constant PKCS1_PADDING
JopensslService.java:66 warning: already initialized constant SSLV23_PADDING
JopensslService.java:66 warning: already initialized constant NO_PADDING
JopensslService.java:66 warning: already initialized constant PKCS1_OAEP_PADDING
JopensslService.java:66 warning: already initialized constant UNIVERSAL_TAG_NAME
JopensslService.java:66 warning: already initialized constant EOC
JopensslService.java:66 warning: already initialized constant BOOLEAN
@dnagir
dnagir / jruby-trinidad-non-threaded.sh
Created December 8, 2011 01:31
JRyby, MRI 1.9.3 and Rails 3.1 Benchmarks
FIRST REQUEST
Concurrency Level: 1
Time taken for tests: 0.670 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Total transferred: 2956 bytes
HTML transferred: 2348 bytes
Requests per second: 1.49 [#/sec] (mean)
Time per request: 670.401 [ms] (mean)
@dnagir
dnagir / environment.sh
Created December 7, 2011 03:05
JRuby no stacktrace repro
> rvm info
jruby-1.6.5:
system:
uname: "Darwin dima-mac.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
rvm:
@dnagir
dnagir / terminal.sh
Created December 7, 2011 02:03
No Stacktrace in JRuby
> rvm use jruby
Using /Users/dnagir/.rvm/gems/jruby-1.6.5
> bundle exec rspec spec/models/user_spec.rb --backtrace
NameError: uninitialized constant ActiveRecord
> rvm use 1.9.3
Using /Users/dnagir/.rvm/gems/ruby-1.9.3-p0
@dnagir
dnagir / specs-run.sh
Created December 2, 2011 13:44
JRuby vs Ruby 1.9.3
# | wall time | specs |
# JRuby | 69s | 34s |
# Ruby 1.9.3 | 28s | 16s |
# x faster | x2.5 | 2.1 |
> ruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
> time bundle exec rspec spec
Finished in 33.8 seconds
@dnagir
dnagir / spec-results
Created November 30, 2011 00:26
architect4r failing specs
......................***......FFFFFFFF.FFF.....F...*..............FFFFFFFFFF*.F...............**........F..FFFF.FF.....FFF.FFFFF...F.......F**
Pending:
Architect4r::Server execute_cypher should return an array of nodes
# No reason given
# ./spec/core/cypher_methods_spec.rb:9
Architect4r::Server execute_cypher should return an array of relationships
# No reason given
# ./spec/core/cypher_methods_spec.rb:15
Architect4r::Server execute_cypher should the data unprocessed
@dnagir
dnagir / sample_spec.rb
Created November 29, 2011 00:21
jRuby and RSpec shared examples issue
shared_examples_for "weird" do |options={}|
# Uncomment to make it work in jruby
#options = {} unless options.respond_to? :to_hash
it "should be a hash" do
options.should be_a Hash
end
end