[Feature:trunk] improvement of sample in lib/imap.rb: --starttls option

[email protected]$G$9!#e(B

lib/net/imap.rbe$B$rD>@<B9T$9$k$H;H$($k4J0We(BIMAPe$B%/%i%$%"%s%H$r!"e(B
starttlse$B$KBP1~$5$;$F$_$^$7$?!#e(B

Index: lib/net/imap.rb

— lib/net/imap.rb (revision 28780)
+++ lib/net/imap.rb (working copy)
@@ -3472,7 +3472,8 @@ if FILE == $0
$auth = “login”
$ssl = false

  • $starttls = false

    def usage

  • $stderr.print <<EOF
  • <<EOF
    usage: #{$0} [options]

@@ -3481,4 +3482,5 @@ usage: #{$0} [options]
–user=USER specifies user
–auth=AUTH specifies auth type

  • –starttls use starttls
    –ssl use ssl
    EOF
    @@ -3511,4 +3513,5 @@ EOF
    [’–user’, GetoptLong::REQUIRED_ARGUMENT],
    [’–auth’, GetoptLong::REQUIRED_ARGUMENT],
  •                 ['--starttls', GetoptLong::NO_ARGUMENT],
                    ['--ssl', GetoptLong::NO_ARGUMENT])
    
    begin
    @@ -3523,20 +3526,20 @@ EOF
    when “–ssl”
    $ssl = true
  •  when "--starttls"
    
  •    $starttls = true
     when "--debug"
       Net::IMAP.debug = true
     when "--help"
       usage
    
  •    exit(1)
    
  •    exit
     end
    
    end
    rescue
  • usage
  • exit(1)
  • abort usage
    end

$host = ARGV.shift
unless $host

  • usage
  • exit(1)
  • abort usage
    end

@@ -3543,4 +3546,5 @@
imap = Net::IMAP.new($host, :port => $port, :ssl => $ssl)
begin

  • imap.starttls if $starttls
    password = get_password
    imap.authenticate($auth, $user, password)

e$BA0ED$G$9!#e(B

2010e$BG/e(B7e$B7ne(B29e$BF|e(B12:16 Nobuyoshi N.
[email protected]:

lib/net/imap.rbe$B$rD>@<B9T$9$k$H;H$($k4J0We(BIMAPe$B%/%i%$%"%s%H$r!"e(B
starttlse$B$KBP1~$5$;$F$_$^$7$?!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!#$3$A$i$be([email protected]$1$^$9$+e(B?

e$B%A%1%C%He(B #3625 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r28797.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


http://redmine.ruby-lang.org/issues/show/3625

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs