fibber_mailman 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +3 -0
- data/MIT-LICENSE.txt +20 -0
- data/README.rdoc +58 -0
- data/Rakefile +17 -14
- data/doc/classes/FibberMailman.html +246 -0
- data/doc/classes/FibberPop.html +196 -0
- data/doc/created.rid +1 -0
- data/doc/files/README_rdoc.html +187 -0
- data/doc/files/lib/fibber_mailman_rb.html +108 -0
- data/doc/fr_class_index.html +28 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +32 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/fibber_mailman.gemspec +17 -29
- data/lib/fibber_mailman.rb +20 -1
- data/lib/fibber_mailman/version.rb +3 -0
- metadata +34 -28
- data/Manifest +0 -7
- data/README.md +0 -41
data/fibber_mailman.gemspec
CHANGED
@@ -1,34 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path( "#{__FILE__}/../lib" )
|
3
|
+
require "fibber_mailman/version"
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
4
|
-
s.name
|
5
|
-
s.version
|
6
|
+
s.name = "fibber_mailman"
|
7
|
+
s.version = FibberMailman::VERSION
|
8
|
+
s.authors = ["Fernando Guillen"]
|
9
|
+
s.email = ["fguillen.mail@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/fguillen/FibberMailman"
|
11
|
+
s.summary = "FibberMailman lie to you when you ask for a Net::POP3.start call."
|
12
|
+
s.description = "FibberMailman lie to you when you ask for a Net::POP3.start call."
|
6
13
|
|
7
|
-
s.
|
8
|
-
|
9
|
-
s.
|
10
|
-
s.description = %q{FibberMailman lie to you when you ask for a Net::POP3.start call.}
|
11
|
-
s.email = %q{fguillen.mail@gmail.com}
|
12
|
-
s.extra_rdoc_files = ["README.md", "lib/fibber_mailman.rb"]
|
13
|
-
s.files = ["README.md", "Rakefile", "lib/fibber_mailman.rb", "test/fibber_mailman_test.rb", "test/fixtures/mail1.raw_mail", "test/fixtures/mail2.raw_mail", "Manifest", "fibber_mailman.gemspec"]
|
14
|
-
s.homepage = %q{http://github.com/fguillen/FibberMailman}
|
15
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Fibber_mailman", "--main", "README.md"]
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
s.rubyforge_project = %q{fibber_mailman}
|
18
|
-
s.rubygems_version = %q{1.3.7}
|
19
|
-
s.summary = %q{FibberMailman lie to you when you ask for a Net::POP3.start call.}
|
20
|
-
s.test_files = ["test/fibber_mailman_test.rb"]
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version = 3
|
14
|
+
s.rubyforge_project = "FibberMailman"
|
15
|
+
|
16
|
+
s.add_dependency "tmail"
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
else
|
32
|
-
s.add_dependency(%q<tmail>, [">= 0"])
|
33
|
-
end
|
34
|
-
end
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
end
|
data/lib/fibber_mailman.rb
CHANGED
@@ -14,7 +14,26 @@ class FibberPop
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
#
|
18
|
+
# Example of use:
|
19
|
+
# raw_mails = [
|
20
|
+
# File.read( "/fixtures/mail1.raw_mail" ) ),
|
21
|
+
# File.read( "/fixtures/mail2.raw_mail" ) ),
|
22
|
+
# ]
|
23
|
+
#
|
24
|
+
# FibberMailman.lie_to_me( raw_mails ) do
|
25
|
+
# <your code that uses the Net::POP3.start on any point>
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# Not any real POP call will be done.
|
29
|
+
#
|
30
|
+
# The mock will simulate that the mails received was the fake **raw_mails**.
|
31
|
+
#
|
17
32
|
class FibberMailman
|
33
|
+
def self.raw_mails
|
34
|
+
@@raw_mails
|
35
|
+
end
|
36
|
+
|
18
37
|
def self.lie_to_me( raw_mails )
|
19
38
|
@@raw_mails = raw_mails
|
20
39
|
|
@@ -27,7 +46,7 @@ class FibberMailman
|
|
27
46
|
|
28
47
|
alias_method :orig_mails, :mails
|
29
48
|
def mails
|
30
|
-
pop_mails =
|
49
|
+
pop_mails = FibberMailman.raw_mails.map { |raw_mail| FibberPop.new( raw_mail ) }
|
31
50
|
return pop_mails
|
32
51
|
end
|
33
52
|
end
|
metadata
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fibber_mailman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 25
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
|
-
-
|
12
|
+
- Fernando Guillen
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2011-10-23 00:00:00 +02:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,42 +25,50 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
33
|
-
type: :
|
31
|
+
type: :runtime
|
34
32
|
version_requirements: *id001
|
35
33
|
description: FibberMailman lie to you when you ask for a Net::POP3.start call.
|
36
|
-
email:
|
34
|
+
email:
|
35
|
+
- fguillen.mail@gmail.com
|
37
36
|
executables: []
|
38
37
|
|
39
38
|
extensions: []
|
40
39
|
|
41
|
-
extra_rdoc_files:
|
42
|
-
|
43
|
-
- lib/fibber_mailman.rb
|
40
|
+
extra_rdoc_files: []
|
41
|
+
|
44
42
|
files:
|
45
|
-
-
|
43
|
+
- .gitignore
|
44
|
+
- .rvmrc
|
45
|
+
- Gemfile
|
46
|
+
- MIT-LICENSE.txt
|
47
|
+
- README.rdoc
|
46
48
|
- Rakefile
|
49
|
+
- doc/classes/FibberMailman.html
|
50
|
+
- doc/classes/FibberPop.html
|
51
|
+
- doc/created.rid
|
52
|
+
- doc/files/README_rdoc.html
|
53
|
+
- doc/files/lib/fibber_mailman_rb.html
|
54
|
+
- doc/fr_class_index.html
|
55
|
+
- doc/fr_file_index.html
|
56
|
+
- doc/fr_method_index.html
|
57
|
+
- doc/index.html
|
58
|
+
- doc/rdoc-style.css
|
59
|
+
- fibber_mailman.gemspec
|
47
60
|
- lib/fibber_mailman.rb
|
61
|
+
- lib/fibber_mailman/version.rb
|
48
62
|
- test/fibber_mailman_test.rb
|
49
63
|
- test/fixtures/mail1.raw_mail
|
50
64
|
- test/fixtures/mail2.raw_mail
|
51
|
-
- Manifest
|
52
|
-
- fibber_mailman.gemspec
|
53
65
|
has_rdoc: true
|
54
|
-
homepage:
|
66
|
+
homepage: https://github.com/fguillen/FibberMailman
|
55
67
|
licenses: []
|
56
68
|
|
57
69
|
post_install_message:
|
58
|
-
rdoc_options:
|
59
|
-
|
60
|
-
- --inline-source
|
61
|
-
- --title
|
62
|
-
- Fibber_mailman
|
63
|
-
- --main
|
64
|
-
- README.md
|
70
|
+
rdoc_options: []
|
71
|
+
|
65
72
|
require_paths:
|
66
73
|
- lib
|
67
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -69,7 +76,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
76
|
requirements:
|
70
77
|
- - ">="
|
71
78
|
- !ruby/object:Gem::Version
|
72
|
-
hash: 3
|
73
79
|
segments:
|
74
80
|
- 0
|
75
81
|
version: "0"
|
@@ -78,17 +84,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
84
|
requirements:
|
79
85
|
- - ">="
|
80
86
|
- !ruby/object:Gem::Version
|
81
|
-
hash: 11
|
82
87
|
segments:
|
83
|
-
-
|
84
|
-
|
85
|
-
version: "1.2"
|
88
|
+
- 0
|
89
|
+
version: "0"
|
86
90
|
requirements: []
|
87
91
|
|
88
|
-
rubyforge_project:
|
92
|
+
rubyforge_project: FibberMailman
|
89
93
|
rubygems_version: 1.3.7
|
90
94
|
signing_key:
|
91
95
|
specification_version: 3
|
92
96
|
summary: FibberMailman lie to you when you ask for a Net::POP3.start call.
|
93
97
|
test_files:
|
94
98
|
- test/fibber_mailman_test.rb
|
99
|
+
- test/fixtures/mail1.raw_mail
|
100
|
+
- test/fixtures/mail2.raw_mail
|
data/Manifest
DELETED
data/README.md
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# FibberMailman
|
2
|
-
|
3
|
-
**Hey Mailmal.. lie to me!**
|
4
|
-
|
5
|
-
Very simple library for mocking a
|
6
|
-
|
7
|
-
Net::POP3.start( ... ) do |pop|
|
8
|
-
<any code here>
|
9
|
-
end
|
10
|
-
|
11
|
-
call
|
12
|
-
|
13
|
-
## Usage
|
14
|
-
raw_mails = [
|
15
|
-
File.read( "/fixtures/mail1.raw_mail" ) ),
|
16
|
-
File.read( "/fixtures/mail2.raw_mail" ) ),
|
17
|
-
]
|
18
|
-
|
19
|
-
FibberMailman.lie_to_me( raw_mails ) do
|
20
|
-
<your code that uses the Net::POP3.start on any point>
|
21
|
-
end
|
22
|
-
|
23
|
-
Not any real POP call will be done.
|
24
|
-
|
25
|
-
The mock will simulate that the mails received was the fake **raw_mails**.
|
26
|
-
|
27
|
-
See the **test** folder.
|
28
|
-
|
29
|
-
## TODO
|
30
|
-
|
31
|
-
Only
|
32
|
-
pop.each_mail do |m|
|
33
|
-
<code here>
|
34
|
-
end
|
35
|
-
|
36
|
-
is supported.
|
37
|
-
|
38
|
-
## Special Thanks
|
39
|
-
|
40
|
-
* To the people on this (Ruby Forum Thread)[http://www.ruby-forum.com/topic/214129]
|
41
|
-
|