tappy 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tappy +3 -1
- data/lib/tappy/tappy_base.rb +2 -2
- data/lib/tappy.rb +1 -1
- metadata +2 -2
data/bin/tappy
CHANGED
@@ -7,13 +7,15 @@ host = ARGV[0] || "localhost"
|
|
7
7
|
port = ARGV[1].to_i
|
8
8
|
port = 9090 if port == 0
|
9
9
|
@@filter_option = ARGV[2] || "foursquare"
|
10
|
+
@@filter_class = ARGV[3] || "Tappy::AgentFilter"
|
10
11
|
|
11
12
|
module Tappy
|
12
13
|
class MyTappy < TappyBase
|
14
|
+
set :filter_class, @@filter_class
|
13
15
|
set :filter_options, @@filter_option
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
|
-
puts "Start Tappy server on #{host}:#{port}, options: #{@@filter_option}"
|
19
|
+
puts "Start Tappy server on #{host}:#{port}, options: #{@@filter_option}, filter: #{@@filter_class}"
|
18
20
|
|
19
21
|
Tappy::MyTappy.run! :host => host, :port => port
|
data/lib/tappy/tappy_base.rb
CHANGED
@@ -6,8 +6,8 @@ require 'json'
|
|
6
6
|
module Tappy
|
7
7
|
class TappyBase < Sinatra::Base
|
8
8
|
set :twitter_host, "http://api.twitter.com"
|
9
|
-
set :filter, "Tappy::AgentFilter"
|
10
|
-
set :filter_options, ENV["
|
9
|
+
set :filter, ENV["TAPPY_FILTER_CLASS"] || "Tappy::AgentFilter"
|
10
|
+
set :filter_options, ENV["TAPPY_FILTER_OPTIONS"] || "foursquare"
|
11
11
|
|
12
12
|
helpers do
|
13
13
|
def handle_request(url, request_params={}, params={})
|
data/lib/tappy.rb
CHANGED