Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for starting limewire via script/server

  • Loading branch information...
commit 79f9ea44ef89701ade2f0c9469e5edd5b593e2f0 1 parent edf1652
@mnutt authored
View
1  .gitignore
@@ -5,3 +5,4 @@ bin/*
.DS_Store
.#*
test/fixtures/*
+vendor/limewire/*
View
41 lib/start_core.rb
@@ -0,0 +1,41 @@
+include Java
+
+if File.exist?(File.join(RAILS_ROOT, "vendor", "limewire", "LimeWire.jar"))
+ require 'vendor/limewire/LimeWire.jar'
+else
+ puts "Place the LimeWire.jar file in the vendor/limewire directory and restart."
+end
+
+Guice = com.google.inject.Guice
+GuiceUtils = org.limewire.inject.GuiceUtils
+Stage = com.google.inject.Stage
+OSUtils = org.limewire.util.OSUtils
+AbstractModule = com.google.inject.AbstractModule
+LimeCoreGlue = com.limegroup.gnutella.LimeCoreGlue
+CommonUtils = org.limewire.util.CommonUtils
+LimeWireUtils = com.limegroup.gnutella.util.LimeWireUtils
+SystemUtils = org.limewire.util.SystemUtils
+LimeWireModule = org.limewire.ui.swing.LimeWireModule
+LimeWireCoreModule = com.limegroup.gnutella.LimeWireCoreModule
+CoreGlueModule = org.limewire.core.impl.CoreGlueModule
+System = java.lang.System
+
+CommonUtils.setUserSettingsDir LimeWireUtils.getRequestedUserSettingsLocation
+
+class RailsModule < AbstractModule
+ include com.google.inject.Module
+
+ def configure
+ install LimeWireCoreModule.new
+ install CoreGlueModule.new
+ end
+end
+
+if org.limewire.util.OSUtils.isMacOSX
+ SystemUtils.set_open_file_limit(1024)
+ System.setProperty("apple.awt.UIElement", "true")
+end
+# raise RailsModule.new.methods.to_yaml
+rails_module = RailsModule.new
+$injector = Guice.createInjector(Stage::DEVELOPMENT, [rails_module])
+GuiceUtils.loadEagerSingletons($injector)
View
1  script/server
@@ -1,3 +1,4 @@
#!/usr/bin/env jruby
require File.dirname(__FILE__) + '/../config/boot'
+require 'lib/start_core'
require 'commands/server'
View
0  vendor/limewire/.gitignore
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.