jmcarbo-imapstore 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/imapstore CHANGED
@@ -8,7 +8,7 @@ require 'getoptions'
8
8
  require 'rdoc/ri/ri_paths'
9
9
 
10
10
  COMMAND_LIST = ['ls', 'rm', 'put', 'get', 'rmdir', 'mkdir', 'quota', 'setup', 'snipplet' ]
11
- opt = GetOptions.new(%w( help subject=s command=s dir=s files=@s recursive! versioned! all! imapstore:s x! text=s))
11
+ opt = GetOptions.new(%w( help password=s subject=s command=s dir=s files=@s recursive! versioned! all! imapstore:s x! text=s ))
12
12
 
13
13
  if opt['help']
14
14
  puts "Usage: imapstore -c <#{COMMAND_LIST.join(', ')}> -s <subject> -d <folder> -f <file list or glob> "
@@ -27,7 +27,7 @@ all = opt['all'] || false
27
27
  versioned = opt['versioned']
28
28
  verbose = opt['x'] || false
29
29
  text = opt['text'] || "no text"
30
-
30
+ password = opt['password']
31
31
 
32
32
 
33
33
 
@@ -40,7 +40,7 @@ if COMMAND_LIST.include? command
40
40
  end
41
41
 
42
42
  puts "Opening mailstore #{imapstore} configured in #{File.expand_path('~/.imapstore/config.yml')}" if verbose
43
- i = IMAPSTORE::Imapstore.new(File.expand_path('~/.imapstore/config.yml'), imapstore)
43
+ i = IMAPSTORE::Imapstore.new(File.expand_path('~/.imapstore/config.yml'), imapstore, password)
44
44
  puts "Mailstore #{imapstore} opened" if verbose
45
45
 
46
46
  i.versioned=versioned if versioned!=nil
@@ -37,11 +37,13 @@ END
37
37
  end
38
38
  end
39
39
 
40
- def initialize(file = File.expand_path('~/.imapstore/config.yml'), imapstore="default")
40
+ def initialize(file = File.expand_path('~/.imapstore/config.yml'), imapstore="default", password=nil)
41
41
  puts "Initializing IMAP" if @verbose
42
42
  @versioned = true
43
43
  @verbose = false
44
-
44
+
45
+ @password = password
46
+
45
47
  puts "Getting configuration file #{file} for account #{imapstore}" if @verbose
46
48
  get_config(file, imapstore)
47
49
  connect
@@ -113,7 +115,7 @@ END
113
115
 
114
116
  #COFIGURATION SECTION
115
117
  @email = aConfig[imapstore]['email']
116
- @password = aConfig[imapstore]['password']
118
+ @password = aConfig[imapstore]['password'] if aConfig[imapstore]['password']
117
119
  @store_tag = aConfig[imapstore]['store_tag'] || "IMAPSTORE"
118
120
  @imap_server = aConfig[imapstore]['imap_server']
119
121
  @imap_port = aConfig[imapstore]['imap_port']
data/lib/imapstore.rb CHANGED
@@ -4,6 +4,6 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'imapstore/imapstore.rb'
5
5
 
6
6
  module IMAPSTORE
7
- VERSION = '0.4.4'
7
+ VERSION = '0.4.6'
8
8
 
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmcarbo-imapstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joan Marc Carbo Arnau
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-11 00:00:00 -08:00
12
+ date: 2009-01-17 00:00:00 -08:00
13
13
  default_executable: imapstore
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency