Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Got it actually working as a standalone gem, though it still throws a…

… bunch of errors
  • Loading branch information...
commit a869d1c7ea64f6804e3df32a53e6c0ab7f5da1fd 1 parent 64dbcc0
@netpro2k netpro2k authored
Showing with 30 additions and 19 deletions.
  1. +1 −3 Gemfile
  2. +0 −14 bin/siriproxy
  3. +29 −2 lib/siriproxy/command_line.rb
View
4 Gemfile
@@ -1,8 +1,6 @@
source :gemcutter
-gem 'CFPropertyList'
-gem 'eventmachine'
-gem 'uuidtools'
+gemspec
# load plugins
require 'yaml'
View
14 bin/siriproxy
@@ -1,20 +1,6 @@
#!/usr/bin/env ruby
-# @todo these 2 lines emulate "bundle exec"
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-#
-
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
-require 'rubygems'
-require 'bundler'
-require 'bundler/setup'
-
-require 'yaml'
-require 'ostruct'
-
-require 'siriproxy'
require 'siriproxy/command_line'
SiriProxy::CommandLine.new
View
31 lib/siriproxy/command_line.rb
@@ -1,4 +1,12 @@
require 'optparse'
+require 'yaml'
+require 'ostruct'
+
+# @todo want to make SiriProxy::Commandline without having to
+# require 'siriproxy'. Im sure theres a better way.
+class SiriProxy
+
+end
class SiriProxy::CommandLine
@@ -10,7 +18,8 @@ class SiriProxy::CommandLine
Usage: siriproxy COMMAND OPTIONS
Commands:
-server (default) Start up the Siri proxy server
+server Start up the Siri proxy server
+bundle Install any dependancies needed by plugins
console Launch the plugin test console
help Show this usage information
@@ -23,9 +32,10 @@ def initialize
subcommand = ARGV.shift
case command
when 'server' then run_server(subcommand)
+ when 'bundle' then run_bundle
when 'console' then run_console
when 'help' then usage
- else run_server()
+ else usage
end
end
@@ -33,6 +43,11 @@ def run_console
puts "Not yet implemented"
end
+ def run_bundle
+ setup_bundler_path
+ puts `bundle -V`
+ end
+
def run_server(subcommand='start')
load_code
start_server
@@ -75,7 +90,19 @@ def parse_options
@option_parser.parse!(ARGV)
end
+ def setup_bundler_path
+ require 'pathname'
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+ end
+
def load_code
+ setup_bundler_path
+
+ require 'bundler'
+ require 'bundler/setup'
+
+ require 'siriproxy'
require 'siriproxy/connection'
require 'siriproxy/connection/iphone'
require 'siriproxy/connection/guzzoni'
Please sign in to comment.
Something went wrong with that request. Please try again.