rgrove-larch 1.0.0.10 → 1.0.0.11

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.
@@ -165,7 +165,7 @@ class Mailbox
165
165
  # Subscribes to this mailbox.
166
166
  def subscribe(force = false)
167
167
  return if subscribed? && !force
168
- @imap.safely { @imap.conn.subscribe(@name) }
168
+ @imap.safely { @imap.conn.subscribe(@name) } unless @imap.options[:dry_run]
169
169
  @mutex.synchronize { @subscribed = true }
170
170
  end
171
171
 
@@ -177,7 +177,7 @@ class Mailbox
177
177
  # Unsubscribes to this mailbox.
178
178
  def unsubscribe(force = false)
179
179
  return unless subscribed? || force
180
- @imap.safely { @imap.conn.unsubscribe(@name) }
180
+ @imap.safely { @imap.conn.unsubscribe(@name) } unless @imap.options[:dry_run]
181
181
  @mutex.synchronize { @subscribed = false }
182
182
  end
183
183
 
data/lib/larch/imap.rb CHANGED
@@ -27,7 +27,7 @@ class IMAP
27
27
  # [:dry_run]
28
28
  # If +true+, read-only operations will be performed as usual and all change
29
29
  # operations will be simulated, but no changes will actually be made. Note
30
- # that it's not actually possible to simulation mailbox creation, so
30
+ # that it's not actually possible to simulate mailbox creation, so
31
31
  # +:dry_run+ mode always behaves as if +:create_mailbox+ is +false+.
32
32
  #
33
33
  # [:fast_scan]
@@ -312,8 +312,8 @@ class IMAP
312
312
  end
313
313
 
314
314
  def update_mailboxes
315
- all = safely { @conn.list('', '*') }
316
- subscribed = safely { @conn.lsub('', '*') }
315
+ all = safely { @conn.list('', '*') } || []
316
+ subscribed = safely { @conn.lsub('', '*') } || []
317
317
 
318
318
  @mutex.synchronize do
319
319
  # Remove cached mailboxes that no longer exist.
data/lib/larch/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Larch
2
2
  APP_NAME = 'Larch'
3
- APP_VERSION = '1.0.0.10'
3
+ APP_VERSION = '1.0.0.11'
4
4
  APP_AUTHOR = 'Ryan Grove'
5
5
  APP_EMAIL = 'ryan@wonko.com'
6
6
  APP_URL = 'http://github.com/rgrove/larch/'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgrove-larch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.10
4
+ version: 1.0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Grove