Skip to content

Commit

Permalink
Renaming to siriproxy-lag
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgco committed Dec 2, 2011
1 parent 2b5f104 commit b78be5e
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
70 changes: 70 additions & 0 deletions lib/siriproxy-lag.rb
@@ -0,0 +1,70 @@
require 'cora'
require 'siri_objects'

#######
#
# Remember to add other plugins to the "config.yml" file if you create them!
######

class SiriProxy::Plugin::Lag < SiriProxy::Plugin
def initialize(config)
#if you have custom configuration options, process them here!
end

listen_for /why am i lagging|lacking/i do
say "Why not!" #say something to the user!

request_completed #always complete your request! Otherwise the phone will "spin" at the user!
end

#demonstrate state change
#listen_for /siri proxy test state/i do
#set_state :some_state #set a state... this is useful when you want to change how you respond after certain conditions are met!
#say "I set the state, try saying 'confirm state change'"

#request_completed #always complete your request! Otherwise the phone will "spin" at the user!
#end

#listen_for /confirm state change/i, within_state: :some_state do #this only gets processed if you're within the :some_state state!
#say "State change works fine!"
#set_state nil #clear out the state!

#request_completed #always complete your request! Otherwise the phone will "spin" at the user!
#end

#demonstrate asking a question
#listen_for /siri proxy test question/i do
#response = ask "Is this thing working?" #ask the user for something

#if(response =~ /yes/i) #process their response
#say "Great!"
#else
#say "You could have just said 'yes'!"
#end

#request_completed #always complete your request! Otherwise the phone will "spin" at the user!
#end

##demonstrate capturing data from the user (e.x. "Siri proxy number 15")
#listen_for /siri proxy number ([0-9,]*[0-9])/i do |number|
#say "Detected number: #{number}"

#request_completed #always complete your request! Otherwise the phone will "spin" at the user!
#end

##demonstrate injection of more complex objects without shortcut methods.
#listen_for /test map/i do
#add_views = SiriAddViews.new
#add_views.make_root(last_ref_id)
#map_snippet = SiriMapItemSnippet.new
#map_snippet.items << SiriMapItem.new
#utterance = SiriAssistantUtteranceView.new("Testing map injection!")
#add_views.views << utterance
#add_views.views << map_snippet

##you can also do "send_object object, target: :guzzoni" in order to send an object to guzzoni
#send_object add_views #send_object takes a hash or a SiriObject object

#request_completed #always complete your request! Otherwise the phone will "spin" at the user!
#end
end
23 changes: 23 additions & 0 deletions siriproxy-lag.gemspec
@@ -0,0 +1,23 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
s.name = "siriproxy-lag"
s.version = "0.0.2"
s.authors = ["tomgallacher"]
s.email = [""]
s.homepage = ""
s.summary = %q{A Siri Proxy Plugin for 56 to see what the state of Lag is}
s.description = %q{This is a plugin which shows the lag being experienced at 56}

s.rubyforge_project = "siriproxy-lag"

s.files = `git ls-files 2> /dev/null`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n")
s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

# specify any dependencies here; for example:
# s.add_development_dependency "rspec"
# s.add_runtime_dependency "rest-client"
end

0 comments on commit b78be5e

Please sign in to comment.