vmail 2.7.6 → 2.7.7
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/README.markdown +1 -1
- data/lib/vmail.rb +10 -6
- data/lib/vmail/message_formatter.rb +2 -2
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -15,7 +15,7 @@ than in any web browser or GUI program.
|
|
15
15
|
* a relatively recent version of Vim (Vmail is developed against Vim 7.3)
|
16
16
|
* Ruby 1.9.0 or higher with SSL support compiled in (Vmail is developed using Ruby 1.9.2)
|
17
17
|
* `libsqlite3-dev` and `sqlite3` (try installing with `apt-get`, `brew`, `yum`, `emerge`, etc.)
|
18
|
-
*
|
18
|
+
* text-only-mode web browser (w3m, elinks, or lynx) should be available to view HTML mail parts in Vmail
|
19
19
|
|
20
20
|
To install Ruby 1.9.2, I recommend using the [RVM Version Manager][rvm].
|
21
21
|
|
data/lib/vmail.rb
CHANGED
@@ -32,7 +32,7 @@ module Vmail
|
|
32
32
|
end
|
33
33
|
|
34
34
|
puts "Setting VMAIL_BROWSER to '#{ENV['VMAIL_BROWSER']}'"
|
35
|
-
|
35
|
+
check_html_reader
|
36
36
|
|
37
37
|
working_dir = ENV['VMAIL_HOME'] || "#{ENV['HOME']}/.vmail/default"
|
38
38
|
`mkdir -p #{working_dir}`
|
@@ -70,7 +70,7 @@ module Vmail
|
|
70
70
|
puts "INBOX polling disabled."
|
71
71
|
end
|
72
72
|
|
73
|
-
puts "
|
73
|
+
puts "Working directory: #{Dir.pwd}"
|
74
74
|
|
75
75
|
# require after the working dir is set
|
76
76
|
require 'vmail/imap_client'
|
@@ -126,11 +126,15 @@ module Vmail
|
|
126
126
|
|
127
127
|
private
|
128
128
|
|
129
|
-
def
|
129
|
+
def check_html_reader
|
130
130
|
# TODO check for elinks, or firefox (how do we parse VMAIL_HTML_PART_REDAER to determine?)
|
131
|
-
|
132
|
-
|
133
|
-
|
131
|
+
html_reader = %w( w3m elinks lynx ).detect {|x| `which #{x}` != ''}
|
132
|
+
if html_reader
|
133
|
+
cmd = ['w3m -dump -T text/html', 'lynx -stdin -dump', 'elinks -dump'].detect {|s| s.index(html_reader)}
|
134
|
+
STDERR.puts "Setting VMAIL_HTML_PART_READER to '#{cmd}'"
|
135
|
+
ENV['VMAIL_HTML_PART_READER'] = cmd
|
136
|
+
else
|
137
|
+
abort "You need to install w3m, elinks, or lynx on your system in order to see html-only messages"
|
134
138
|
end
|
135
139
|
end
|
136
140
|
|
@@ -70,10 +70,10 @@ module Vmail
|
|
70
70
|
part.body.decoded.gsub("\r", '')
|
71
71
|
end
|
72
72
|
|
73
|
-
# depend on
|
73
|
+
# depend on VMAIL_HTML_PART_READER
|
74
74
|
# variable
|
75
75
|
def format_html_body(part)
|
76
|
-
html_tool = ENV['VMAIL_HTML_PART_READER']
|
76
|
+
html_tool = ENV['VMAIL_HTML_PART_READER']
|
77
77
|
html = part.body.decoded.gsub("\r", '')
|
78
78
|
stdin, stdout, stderr = Open3.popen3(html_tool)
|
79
79
|
stdin.puts html
|
data/lib/vmail/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.7
|
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: 2012-12-
|
12
|
+
date: 2012-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mail
|