vmail 2.6.7 → 2.6.9

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.
@@ -71,21 +71,10 @@ The `.vmailrc` file should look something like this. Substitute your own values.
71
71
  username: dhchoi@gmail.com
72
72
  password: password
73
73
  name: Daniel Choi
74
- date_format: wordy
75
74
  signature: |
76
75
  --
77
76
  Sent from Vmail. http://danielchoi.com/software/vmail.html
78
77
 
79
-
80
- ### Configuration file - optional parameters
81
- `date_format: wordy | numerical`
82
-
83
- `wordy`: The email arrival date is shown as for example 'Dec 15 11:59pm' or 'Dec 15 2008'.
84
- This is the default value of the date_format parameter.
85
-
86
- `numerical`: The email arrival date is shown as for example '15.12 23:59' or '15.12 2008'.
87
- It saves two characters - useful on devices with really small displays.
88
-
89
78
  This file should be formatted in [YAML syntax][1].
90
79
 
91
80
  [1]:http://www.yaml.org/spec/1.2/spec.html
@@ -104,7 +93,6 @@ If you want to use a shell script to print the signature, use the
104
93
  username: dhchoi@gmail.com
105
94
  password: password
106
95
  name: Daniel Choi
107
- date_format: wordy
108
96
  signature_script: /home/choi/bin/vmail_signature.sh
109
97
 
110
98
  You can add a `vim_opts:` key-value pair to run arbitrary Vim commands when Vmail starts up.
@@ -121,6 +109,12 @@ configuration options][firewall] that you can use.
121
109
 
122
110
  [firewall]:https://github.com/danchoi/vmail/wiki/How-to-use-vmail-behind-a-firewall-that-blocks-IMAP
123
111
 
112
+ Another optional parameter is `date_format`, which controls the appearance of
113
+ the dates in the message list. Here you can use a strptime-compatible date
114
+ format string. Make sure you enclose these in quotes:
115
+
116
+ date_format_: '%b %d %I:%M%P'
117
+ date_format_previous_years: '%b %d %Y'
124
118
 
125
119
  ## Contacts autocompletion
126
120
 
@@ -46,20 +46,17 @@ module Vmail
46
46
  @smtp_domain = config['smtp_domain'] || 'gmail.com'
47
47
  @authentication = config['authentication'] || 'plain'
48
48
  @width = 100
49
- @date_format = config['date_format'] || 'wordy'
50
- if @date_format == 'numerical'
51
- @date_formatter_this_year = '%d.%m %H:%M'
52
- @date_formatter_prev_years = '%d.%m %Y'
53
- @formatted_date_with = 11
54
- else
55
- if @date_format != 'wordy'
56
- @logger.warn "Unknown date_format: #{@date_format}; Using default value: wordy"
57
- @date_format = 'wordy'
58
- end
59
- @date_formatter_this_year = '%b %d %I:%M%P'
60
- @date_formatter_prev_years = '%b %d %Y'
61
- @formatted_date_with = 14
49
+
50
+ if config['date_format'] =~ /numerical/
51
+ config['date_format'] = '%d.%m %H:%M'
52
+ config['date_format_prev_years'] = '%d.%m %Y'
53
+ elsif config['date_format'] =~ /wordy/
54
+ config['date_format'] = '%b %d %I:%M%P'
55
+ config['date_format_prev_years'] = '%b %d %Y'
62
56
  end
57
+ @date_formatter_this_year = config['date_format'] || '%b %d %I:%M%P'
58
+ @date_formatter_prev_years = config['date_format_previous_years'] || '%b %d %Y'
59
+ @date_width = DateTime.parse("12/12/2012 12:12:12").strftime(@date_formatter_this_year).length
63
60
  current_message = nil
64
61
  end
65
62
 
@@ -92,7 +92,7 @@ module Vmail
92
92
  address_col_width = (mid_width * 0.3).ceil
93
93
  subject_col_width = (mid_width * 0.7).floor
94
94
  row_text = [ format_flags(message.flags).col(2),
95
- (formatted_date || '').col(@formatted_date_with),
95
+ (formatted_date || '').col(@date_width),
96
96
  address.col(address_col_width),
97
97
  message.subject.col(subject_col_width),
98
98
  number_to_human_size(message.size).rcol(7),
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = '2.6.7'
2
+ VERSION = '2.6.9'
3
3
  end
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.6.7
4
+ version: 2.6.9
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-17 00:00:00.000000000 Z
12
+ date: 2012-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail