capybara-email 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/capybara/email/driver.rb +0 -1
- data/lib/capybara/email/version.rb +1 -1
- data/lib/capybara/node/email.rb +22 -3
- metadata +6 -6
data/README.md
CHANGED
@@ -132,7 +132,7 @@ end
|
|
132
132
|
|
133
133
|
[Brian Cardarella](http://twitter.com/bcardarella)
|
134
134
|
|
135
|
-
[We are very thankful for the many contributors](https://github.com/dockyard/
|
135
|
+
[We are very thankful for the many contributors](https://github.com/dockyard/capybara-email/graphs/contributors)
|
136
136
|
|
137
137
|
## Versioning ##
|
138
138
|
|
data/lib/capybara/node/email.rb
CHANGED
@@ -28,9 +28,28 @@ class Capybara::Node::Email < Capybara::Node::Document
|
|
28
28
|
base.from
|
29
29
|
end
|
30
30
|
|
31
|
-
#
|
32
|
-
|
33
|
-
|
31
|
+
# Save a snapshot of the page.
|
32
|
+
#
|
33
|
+
# @param [String] path The path to where it should be saved [optional]
|
34
|
+
#
|
35
|
+
def save_page(path = nil)
|
36
|
+
path ||= "capybara-email-#{Time.new.strftime("%Y%m%d%H%M%S")}#{rand(10**10)}.html"
|
37
|
+
path = File.expand_path(path, Capybara.save_and_open_page_path) if Capybara.save_and_open_page_path
|
38
|
+
|
39
|
+
FileUtils.mkdir_p(File.dirname(path))
|
40
|
+
|
41
|
+
File.open(path,'w') { |f| f.write(body) }
|
42
|
+
path
|
34
43
|
end
|
35
44
|
|
45
|
+
# Save a snapshot of the page and open it in a browser for inspection
|
46
|
+
#
|
47
|
+
# @param [String] path The path to where it should be saved [optional]
|
48
|
+
#
|
49
|
+
def save_and_open(file_name = nil)
|
50
|
+
require 'launchy'
|
51
|
+
Launchy.open(save_page(file_name))
|
52
|
+
rescue LoadError
|
53
|
+
warn 'Please install the launchy gem to open page with save_and_open_page'
|
54
|
+
end
|
36
55
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mail
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
53
|
+
version: '3.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '3.0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: bourne
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
segments:
|
140
140
|
- 0
|
141
|
-
hash:
|
141
|
+
hash: 1988258438555355399
|
142
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
143
|
none: false
|
144
144
|
requirements:
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
segments:
|
149
149
|
- 0
|
150
|
-
hash:
|
150
|
+
hash: 1988258438555355399
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
153
|
rubygems_version: 1.8.23
|