stockboy 0.5.6 → 0.5.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0aa712e8eb41ce506b4c5e8f8da10ece8e7e681
4
- data.tar.gz: 81a9530e38ee9b395a1055da7f85f4a13e9ccee0
3
+ metadata.gz: 18c67d713e1473f435d7bcc26378aa766d9f6243
4
+ data.tar.gz: 0d82139b4018daeb8ce12a139e5bc7f8c808d679
5
5
  SHA512:
6
- metadata.gz: 3e02ec395baf5942face9b0a9b09484806d6d64dc76dd9e04b6fb9682f71539e3862efe635c9091df1b3a25cb65cf5fb4245b4cef179c4cff7eb529b8060fcb8
7
- data.tar.gz: c11c6aa079a9bd5fa296c5be307199d9ff84065f70bed54818f80b4a8d2643ff9e91340eebc2203e52204d10d167b0798b48973243c01398741e38d6d28ad7ac
6
+ metadata.gz: f63f685efb55c6eda528d3bd630c481e68d6961a36c83e0b8e5e72ecf09deddd9027e1143ee33ca5ae63094a026c3ea7c1748900b8ea446e308d980c7111c94d
7
+ data.tar.gz: bc63a44fc29399fa614afc15bf3bf282b9587bfc3a552f344411eb262fcd4701d243324d20a7d9d13b71d534baeb531b3cb93358c743a31ece6971717a644bc9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.7 / 2013-12-13
4
+
5
+ * [BUGFIX] Fix IMAP search with missing search defaults
6
+
3
7
  ## 0.5.6 / 2013-12-12
4
8
 
5
9
  * [BUGFIX] Fix requiring of nested module
@@ -19,6 +19,7 @@ module Stockboy::Providers
19
19
  # end
20
20
  #
21
21
  class IMAP < Stockboy::Provider
22
+ require_relative 'imap/search_options'
22
23
 
23
24
  # @!group Options
24
25
 
@@ -128,7 +129,6 @@ module Stockboy::Providers
128
129
  # Initialize a new IMAP reader
129
130
  #
130
131
  def initialize(opts={}, &block)
131
- require 'stockboy/providers/imap/search_options'
132
132
  super(opts, &block)
133
133
  @host = opts[:host]
134
134
  @username = opts[:username]
@@ -229,12 +229,12 @@ module Stockboy::Providers
229
229
  end
230
230
  end
231
231
 
232
- private
233
-
234
232
  def default_search_options
235
- {subject: subject, from: from, since: since}
233
+ {subject: subject, from: from, since: since}.reject { |k,v| v.nil? }
236
234
  end
237
235
 
236
+ private
237
+
238
238
  def fetch_data
239
239
  client do |imap|
240
240
  return false unless matching_message
@@ -1,3 +1,3 @@
1
1
  module Stockboy
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
@@ -137,6 +137,23 @@ module Stockboy
137
137
  end
138
138
  end
139
139
 
140
+ describe "#default_search_options" do
141
+ it "includes configured SUBJECT option" do
142
+ provider.subject = "Life"
143
+ provider.default_search_options.should == {subject: "Life"}
144
+ end
145
+
146
+ it "includes configured SINCE option" do
147
+ provider.since = Date.today
148
+ provider.default_search_options.should == {since: Date.today}
149
+ end
150
+
151
+ it "includes configured FROM option" do
152
+ provider.from = "me@example.com"
153
+ provider.default_search_options.should == {from: "me@example.com"}
154
+ end
155
+ end
156
+
140
157
  def expect_connection(host, user, pass, mailbox)
141
158
  net_imap = double("IMAP")
142
159
  expect(Net::IMAP).to receive(:new).with(host) { net_imap }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stockboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Vit