jmcarbo-imapstore 0.4.9 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,21 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
3
3
 
4
4
  require 'rubygems'
5
5
  require 'imapstore'
6
+ require 'rdoc/ri/ri_paths'
6
7
  require 'getoptions'
7
8
  #old versions of ruby require this
8
- require 'rdoc/ri/ri_paths'
9
+
10
+ def print_help
11
+ puts "Usage: imapstore -c <#{COMMAND_LIST.join(', ')}> -s <subject> -d <folder> -f <file list or glob> "
12
+ puts " -i <imapstore> -x --recursive --versioned --all -t <text of message> -p password"
13
+ puts " imapstore -h"
14
+ end
9
15
 
10
16
  COMMAND_LIST = ['ls', 'rm', 'put', 'get', 'rmdir', 'mkdir', 'quota', 'setup', 'snipplet' ]
11
17
  opt = GetOptions.new(%w( help password=s subject=s command=s dir=s files=@s recursive! versioned! all! imapstore:s x! text=s ))
12
18
 
13
19
  if opt['help']
14
- puts "Usage: imapstore -c <#{COMMAND_LIST.join(', ')}> -s <subject> -d <folder> -f <file list or glob> "
15
- puts " -i <imapstore> -x --recursive --versioned --all -t <text of message>"
16
- puts " imapstore -h"
20
+ print_help
17
21
  exit 0
18
22
  end
19
23
 
@@ -116,4 +120,5 @@ end
116
120
 
117
121
  rescue
118
122
  puts "An error has occured #{$!}"
123
+ print_help
119
124
  end
@@ -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.9'
7
+ VERSION = '0.5.1'
8
8
 
9
9
  end
@@ -86,6 +86,7 @@ END
86
86
  end
87
87
 
88
88
  def connect()
89
+ raise "No password given" if @password == nil
89
90
  if !@imap && @email && @password && @imap_server && @imap_port
90
91
  if(@ssl == true)
91
92
  @imap = Net::IMAP.new(@imap_server, @imap_port, true)
@@ -219,9 +220,9 @@ END
219
220
 
220
221
  end
221
222
 
222
- def store_file( file, folder = "INBOX", subject = "")
223
+ def store_file( file, folder = "INBOX", subject = "")
223
224
 
224
- @imap.create(folder) if !@imap.list("", folder)
225
+ @imap.create(folder) if !@imap.list("", folder)
225
226
 
226
227
  size = File.size(file)
227
228
  if(size > MAX_FILE_SIZE)
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.9
4
+ version: 0.5.1
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-17 00:00:00 -08:00
12
+ date: 2009-01-19 00:00:00 -08:00
13
13
  default_executable: imapstore
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency