simonreed-lyrebird 0.1 → 0.1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -6,7 +6,21 @@ Twitter Gateway, allows your app to respond to natural language questions from T
6
6
 
7
7
  * HTTParty http://github.com/jnunemaker/httparty/ - For accessing the Twitter web service.
8
8
 
9
+ = SYNOPSIS
10
+ require 'rubygems'
11
+ require 'lyre_bird'
12
+
13
+ routes = [
14
+ { 'str' => "Do you have a :item for me" }
15
+ ]
16
+
17
+ lyre = LyreBird.new(:username => 'username', :password => 'password', :routes => routes)
18
+ lyre.check() # Check for new messages.
19
+
9
20
  == Install
10
21
 
11
- * sudo gem sources -a http://gems.github.com
12
- * sudo gem install simonreed-lyrebird
22
+ sudo gem sources -a http://gems.github.com
23
+
24
+ sudo gem install simonreed-lyrebird
25
+
26
+ require ''
data/lib/lyre_bird.rb CHANGED
@@ -1,15 +1,13 @@
1
- CONSOLE = false
2
- DEBUG = false
3
-
4
1
  class LyreBird
5
2
 
6
3
  attr_accessor :username
7
- attr_accessor :password
4
+ attr_accessor :password
8
5
 
9
6
  def initialize(options={})
10
7
  $responses = {}
11
8
  self.username = options[:username] || 'username'
12
9
  self.password = options[:password] || 'password'
10
+ $lyrebird_routes = options[:routes] || []
13
11
  end
14
12
 
15
13
  def listen(options={})
@@ -1,5 +1,3 @@
1
- ROUTES = YAML.load_file("#{RAILS_ROOT}/config/lyre_routes.yml")
2
-
3
1
  class LyreBird::Route
4
2
  def initialize(options={})
5
3
 
@@ -9,7 +7,7 @@ class LyreBird::Route
9
7
 
10
8
  successes = []
11
9
  puts "Parsing '#{str}'" if DEBUG
12
- ::ROUTES.each do | r |
10
+ $lyrebird_routes.each do | r |
13
11
  route = r['str']
14
12
  clear = r['clear']
15
13
  puts "- Trying '#{route}'" if DEBUG
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simonreed-lyrebird
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.1"
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Reed