chocolate_rain 0.0.3 → 0.0.4
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/lib/chocolate_rain.rb +12 -5
- data/lib/chocolate_rain/ftp.rb +4 -9
- data/lib/chocolate_rain/ftp_worker.rb +1 -1
- data/lib/chocolate_rain/inbox.rb +7 -10
- data/lib/chocolate_rain/version.rb +1 -1
- metadata +3 -3
data/lib/chocolate_rain.rb
CHANGED
@@ -9,10 +9,17 @@ require 'logger'
|
|
9
9
|
ftp_worker
|
10
10
|
).each{|m| require File.dirname(__FILE__) + '/chocolate_rain/' + m }
|
11
11
|
|
12
|
+
|
12
13
|
module ChocolateRain
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
class Loader
|
15
|
+
|
16
|
+
def self.do
|
17
|
+
puts "Starting MailFetcher"
|
18
|
+
ChocolateRain::MailFetcher.start
|
19
|
+
puts "Starting FtpMachine"
|
20
|
+
ChocolateRain::FtpMachine.start
|
21
|
+
puts "All started"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
18
25
|
end
|
data/lib/chocolate_rain/ftp.rb
CHANGED
@@ -3,15 +3,10 @@ require 'fileutils'
|
|
3
3
|
include Daemon
|
4
4
|
include ChocolateRain
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
module ChocolateRain
|
7
|
+
class FtpMachine
|
8
|
+
def self.start
|
9
9
|
ChocolateRain::FtpWorker.do_work
|
10
|
-
sleep(30)
|
11
10
|
end
|
12
11
|
end
|
13
|
-
|
14
|
-
def self.stop
|
15
|
-
put "Stopping FtpMachine"
|
16
|
-
end
|
17
|
-
end
|
12
|
+
end
|
data/lib/chocolate_rain/inbox.rb
CHANGED
@@ -1,26 +1,23 @@
|
|
1
1
|
require 'net/pop'
|
2
2
|
require 'mail'
|
3
|
-
include Daemon
|
4
3
|
include ChocolateRain
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
module ChocolateRain
|
6
|
+
class MailFetcher
|
7
|
+
def self.start
|
8
|
+
puts "in start"
|
9
9
|
pop = Net::POP3.new('mail.hasflavor.com')
|
10
10
|
pop.start("app@hasflavor.com", "oi890po")
|
11
11
|
|
12
12
|
if !pop.mails.empty?
|
13
13
|
pop.each_mail do |m|
|
14
|
+
puts "new mail"
|
14
15
|
ChocolateRain::MailHandler.receive(m.pop)
|
15
|
-
|
16
|
+
m.delete
|
16
17
|
end
|
17
18
|
end
|
19
|
+
puts 'done poppin'
|
18
20
|
pop.finish
|
19
|
-
sleep(30)
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
|
-
def self.stop
|
24
|
-
puts "Stopping Mail Fetcher Daemon"
|
25
|
-
end
|
26
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chocolate_rain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-23 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: youtube_it
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153952420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153952420
|
25
25
|
description: Monitor E-Mail and FTP for videos to upload to YouTube
|
26
26
|
email:
|
27
27
|
- kevin@wearefound.com
|