messed 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +8 -0
- data/README.rdoc +22 -0
- data/Rakefile +76 -0
- data/VERSION +1 -0
- data/application_spec/Rakefile +12 -0
- data/application_spec/app/runner.rb +3 -0
- data/application_spec/bin/runner +18 -0
- data/application_spec/bin/status +36 -0
- data/application_spec/bin/web +29 -0
- data/application_spec/config/environment.rb +8 -0
- data/application_spec/config/environments/development.rb +0 -0
- data/application_spec/log/development.log +6 -0
- data/application_spec/spec/application_spec.rb +12 -0
- data/application_spec/spec/spec.opts +7 -0
- data/application_spec/spec/spec_helper.rb +42 -0
- data/bin/messed +9 -0
- data/lib/messed/booter.rb +114 -0
- data/lib/messed/configuration.rb +94 -0
- data/lib/messed/controller/helper.rb +8 -0
- data/lib/messed/controller/processing.rb +22 -0
- data/lib/messed/controller/respond.rb +48 -0
- data/lib/messed/controller.rb +17 -0
- data/lib/messed/em_runner.rb +50 -0
- data/lib/messed/interface/adapter/sms.rb +4 -0
- data/lib/messed/interface/adapter/twitter_consumer.rb +35 -0
- data/lib/messed/interface/adapter/twitter_search.rb +111 -0
- data/lib/messed/interface/adapter/twitter_sender.rb +44 -0
- data/lib/messed/interface/adapter/twitter_streaming.rb +50 -0
- data/lib/messed/interface/adapter.rb +68 -0
- data/lib/messed/interface/runner.rb +20 -0
- data/lib/messed/interface.rb +74 -0
- data/lib/messed/logger.rb +50 -0
- data/lib/messed/matcher.rb +50 -0
- data/lib/messed/message/twitter.rb +23 -0
- data/lib/messed/message.rb +35 -0
- data/lib/messed/queue/beanstalk.rb +56 -0
- data/lib/messed/queue.rb +17 -0
- data/lib/messed/session/memcache.rb +40 -0
- data/lib/messed/session.rb +7 -0
- data/lib/messed/tasks/console.rb +70 -0
- data/lib/messed/tasks/generation.rb +12 -0
- data/lib/messed/tasks/runner.rb +50 -0
- data/lib/messed/tasks/status.rb +37 -0
- data/lib/messed/tasks.rb +9 -0
- data/lib/messed/util/remote_status.rb +45 -0
- data/lib/messed.rb +235 -0
- data/patterns/messed/Pattern +24 -0
- data/patterns/messed/Rakefile +12 -0
- data/patterns/messed/app/runner.rb +5 -0
- data/patterns/messed/bin/console +3 -0
- data/patterns/messed/bin/runner +3 -0
- data/patterns/messed/bin/status +3 -0
- data/patterns/messed/bin/web +13 -0
- data/patterns/messed/config/environment.rb +15 -0
- data/patterns/messed/config/environments/development.rb +2 -0
- data/patterns/messed/config/environments/production.rb +0 -0
- data/patterns/messed/config/environments/test.rb +0 -0
- data/patterns/messed/spec/application_spec.rb +12 -0
- data/patterns/messed/spec/spec.opts +7 -0
- data/patterns/messed/spec/spec_helper.rb +44 -0
- data/spec/adapter/applications/twitter_search/app/application.rb +3 -0
- data/spec/adapter/applications/twitter_search/app/runner.rb +7 -0
- data/spec/adapter/applications/twitter_search/bin/incoming +89 -0
- data/spec/adapter/applications/twitter_search/bin/runner +21 -0
- data/spec/adapter/applications/twitter_search/bin/status +36 -0
- data/spec/adapter/applications/twitter_search/config/environment.rb +11 -0
- data/spec/adapter/applications/twitter_search/config/environments/development.rb +0 -0
- data/spec/adapter/applications/twitter_search/log/development.log +1006 -0
- data/spec/adapter/applications/twitter_sender/app/application.rb +0 -0
- data/spec/adapter/applications/twitter_sender/app/runner.rb +0 -0
- data/spec/adapter/applications/twitter_sender/bin/incoming +89 -0
- data/spec/adapter/applications/twitter_sender/bin/runner +21 -0
- data/spec/adapter/applications/twitter_sender/bin/status +36 -0
- data/spec/adapter/applications/twitter_sender/config/environment.rb +11 -0
- data/spec/adapter/applications/twitter_sender/config/environments/development.rb +0 -0
- data/spec/adapter/applications/twitter_sender/log/development.log +146 -0
- data/spec/adapter/http/direct_message +0 -0
- data/spec/adapter/http/twitter_search +20 -0
- data/spec/adapter/http/update +0 -0
- data/spec/adapter/twitter_search_spec.rb +36 -0
- data/spec/adapter/twitter_sender_spec.rb +64 -0
- data/spec/booter_spec.rb +7 -0
- data/spec/fixtures/booter/app/application.rb +3 -0
- data/spec/fixtures/booter/app/runner.rb +7 -0
- data/spec/fixtures/booter/bin/incoming +89 -0
- data/spec/fixtures/booter/bin/runner +21 -0
- data/spec/fixtures/booter/bin/status +36 -0
- data/spec/fixtures/booter/config/environment.rb +15 -0
- data/spec/fixtures/booter/config/environments/development.rb +0 -0
- data/spec/fixtures/booter/log/development.log +11 -0
- data/spec/message_spec.rb +52 -0
- data/spec/session_spec.rb +34 -0
- data/spec/spec.opts +7 -0
- data/spec/spec_helper.rb +8 -0
- data/test/app/runner.rb +5 -0
- data/test/config/environment.rb +15 -0
- data/test/config/environments/development.rb +2 -0
- data/test/config/environments/production.rb +0 -0
- data/test/config/environments/test.rb +0 -0
- data/test/spec/application_spec.rb +12 -0
- data/test/spec/spec_helper.rb +44 -0
- metadata +291 -0
@@ -0,0 +1,89 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
begin
|
5
|
+
require 'messed'
|
6
|
+
rescue LoadError
|
7
|
+
if ENV['MESSED_HOME']
|
8
|
+
require File.join(ENV['MESSED_HOME'], 'lib', 'messed')
|
9
|
+
else
|
10
|
+
raise("no messed!")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'thor'
|
15
|
+
|
16
|
+
class IncomingRunnerTask < Thor
|
17
|
+
|
18
|
+
method_options :detach => false
|
19
|
+
method_options :environment => "development"
|
20
|
+
desc "start [NAME]", "start an incoming instance"
|
21
|
+
def start(name = nil)
|
22
|
+
application = Messed::Booter.new(File.expand_path(File.join(File.dirname(__FILE__), '..')), options.environment)
|
23
|
+
incoming = if name.nil? and application.incoming_map.size == 1
|
24
|
+
application.incoming_map.values.first
|
25
|
+
elsif application.incoming_map.key?(name)
|
26
|
+
application.incoming_map[name]
|
27
|
+
else
|
28
|
+
raise(name ? "unable to find incoming with name #{name}" : "You have no incoming setup.")
|
29
|
+
end
|
30
|
+
|
31
|
+
Messed::Interface::Runner.new(incoming).start
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
IncomingRunnerTask.start
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
begin
|
5
|
+
require 'messed'
|
6
|
+
rescue LoadError
|
7
|
+
if ENV['MESSED_HOME']
|
8
|
+
require File.join(ENV['MESSED_HOME'], 'lib', 'messed')
|
9
|
+
else
|
10
|
+
raise("no messed!")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'thor'
|
15
|
+
|
16
|
+
$root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
17
|
+
|
18
|
+
Messed::Tasks::Runner.start
|
19
|
+
|
20
|
+
RunnerTask.start
|
21
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
begin
|
5
|
+
require 'messed'
|
6
|
+
rescue LoadError
|
7
|
+
if ENV['MESSED_HOME']
|
8
|
+
require File.join(ENV['MESSED_HOME'], 'lib', 'messed')
|
9
|
+
else
|
10
|
+
raise("no messed!")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'thor'
|
15
|
+
|
16
|
+
class IncomingRunnerTask < Thor
|
17
|
+
|
18
|
+
method_options :detach => false
|
19
|
+
method_options :environment => "development"
|
20
|
+
desc "start [NAME]", "start an incoming instance"
|
21
|
+
def start(name = nil)
|
22
|
+
application = Messed::Booter.new(File.expand_path(File.join(File.dirname(__FILE__), '..')), options.environment)
|
23
|
+
incoming = if name.nil? and application.incoming_map.size == 1
|
24
|
+
application.incoming_map.values.first
|
25
|
+
elsif application.incoming_map.key?(name)
|
26
|
+
application.incoming_map[name]
|
27
|
+
else
|
28
|
+
raise(name ? "unable to find incoming with name #{name}" : "You have no incoming setup.")
|
29
|
+
end
|
30
|
+
|
31
|
+
IncomingRunner.new(incoming)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
IncomingRunnerTask.start
|
@@ -0,0 +1,11 @@
|
|
1
|
+
queues.incoming.host = '127.0.0.1'
|
2
|
+
queues.incoming.port = 11300
|
3
|
+
queues.incoming.tube = 'incoming-tube'
|
4
|
+
|
5
|
+
queues.outgoing.host = '127.0.0.1'
|
6
|
+
queues.outgoing.port = 11300
|
7
|
+
queues.outgoing.tube = 'outgoing-tube'
|
8
|
+
|
9
|
+
interfaces.search.adapter = :twitter_search
|
10
|
+
interfaces.search.options[:fetch] = {:query => {'q' => 'love'}, :host => 'search.twitter.com', :path => 'search.json'}
|
11
|
+
interfaces.search.options[:interval] = 30
|
File without changes
|