vmail 1.5.4 → 1.5.5

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/Rakefile CHANGED
@@ -5,6 +5,25 @@ Bundler::GemHelper.install_tasks
5
5
 
6
6
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
7
7
 
8
+ desc "release and build and push new website"
9
+ task :push => [:release, :web]
10
+
11
+ desc "Bumps version number up one and git commits"
12
+ task :bump do
13
+ basefile = "lib/vmail/version.rb"
14
+ file = File.read(basefile)
15
+ oldver = file[/VERSION = '(\d.\d.\d)'/, 1]
16
+ newver_i = oldver.gsub(".", '').to_i + 1
17
+ newver = ("%.3d" % newver_i).split(//).join('.')
18
+ puts oldver
19
+ puts newver
20
+ puts "Bumping version: #{oldver} => #{newver}"
21
+ newfile = file.gsub("VERSION = '#{oldver}'", "VERSION = '#{newver}'")
22
+ File.open(basefile, 'w') {|f| f.write newfile}
23
+ `git commit -am 'Bump'`
24
+ end
25
+
26
+
8
27
  desc "build and push website"
9
28
  task :web do
10
29
  require 'vmail/version'
@@ -634,8 +634,8 @@ function! s:send_message()
634
634
  if match(res, '^Failed') == -1
635
635
  call s:close_and_focus_list_window()
636
636
  endif
637
- redraw
638
637
  echom substitute(res, '[\s\r\n]\+$', '', '')
638
+ redraw
639
639
  endfunction
640
640
 
641
641
  " --------------------------------------------------------------------------------
@@ -20,6 +20,7 @@ module Vmail
20
20
  @username, @password = config['username'], config['password']
21
21
  @name = config['name']
22
22
  @signature = config['signature']
23
+ @always_cc = config['always_cc']
23
24
  @mailbox = nil
24
25
  @logger = Logger.new(config['logfile'] || STDERR)
25
26
  @logger.level = Logger::DEBUG
@@ -612,7 +613,8 @@ EOF
612
613
  def new_message_template(subject = nil, append_signature = true)
613
614
  headers = {'from' => "#{@name} <#{@username}>",
614
615
  'to' => nil,
615
- 'subject' => subject
616
+ 'subject' => subject,
617
+ 'cc' => @always_cc
616
618
  }
617
619
  format_headers(headers) + (append_signature ? ("\n\n" + signature) : "\n\n")
618
620
  end
@@ -635,7 +637,7 @@ EOF
635
637
  return nil
636
638
  end
637
639
  # user reply_template class
638
- reply_headers = Vmail::ReplyTemplate.new(@current_mail, @username, @name, replyall).reply_headers
640
+ reply_headers = Vmail::ReplyTemplate.new(@current_mail, @username, @name, replyall, @always_cc).reply_headers
639
641
  body = reply_headers.delete(:body)
640
642
  format_headers(reply_headers) + "\n\n\n" + body + signature
641
643
  end
@@ -5,8 +5,8 @@ require 'time'
5
5
  module Vmail
6
6
  class ReplyTemplate
7
7
 
8
- def initialize(mail, username, name, replyall)
9
- @username, @name, @replyall = username, name, replyall
8
+ def initialize(mail, username, name, replyall, always_cc=nil)
9
+ @username, @name, @replyall, @always_cc = username, name, replyall, always_cc
10
10
  @mail = Mail.new(mail)
11
11
  end
12
12
 
@@ -34,15 +34,15 @@ module Vmail
34
34
  end
35
35
 
36
36
  def cc
37
- return nil unless @replyall
37
+ return nil unless (@replyall || @always_cc)
38
38
  cc = @mail.header['to'].value.split(/,\s*/)
39
39
  if @mail.header['cc']
40
40
  cc += @mail.header['cc'].value.split(/,\s*/)
41
41
  end
42
42
  cc = cc.flatten.compact.
43
- select {|x|
44
- x.to_s[/<([^>]+)>/, 1] !~ /#{@username}/ && x.to_s[/^[^<]+/, 1] !~ /#{@name}/
45
- }.join(', ')
43
+ select {|x| x.to_s[/<([^>]+)>/, 1] !~ /#{@username}/ && x.to_s[/^[^<]+/, 1] !~ /#{@name}/ }
44
+ cc << @always_cc
45
+ cc.join(', ')
46
46
  end
47
47
 
48
48
  def sender
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "1.5.4"
2
+ VERSION = '1.5.5'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 4
9
- version: 1.5.4
8
+ - 5
9
+ version: 1.5.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi