contextio 1.3.0 → 1.4.0
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 +4 -4
- data/CHANGES.md +9 -0
- data/README.md +3 -0
- data/lib/contextio/body_part.rb +2 -0
- data/lib/contextio/email_address.rb +2 -0
- data/lib/contextio/email_settings.rb +2 -0
- data/lib/contextio/folder.rb +3 -1
- data/lib/contextio/message.rb +4 -2
- data/lib/contextio/source.rb +2 -0
- data/lib/contextio/version.rb +1 -1
- data/spec/integration/folders_messages_spec.rb +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d62101124ebb89c46b9b7c61525f7d8feb9e36
|
4
|
+
data.tar.gz: 99bc1cf63255499a00fe0c960cd2e8d4bce16db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a76056315bfe9234e4a32b5c772e36049736026a34584174f570d423af63e7d16a7e3fe3af30d95a4158e63f380ea187e05fcc16375a6fdeacdf82bbf1c4b9e0
|
7
|
+
data.tar.gz: e60081fa6e7c590fdb79156c6d6bd93afc816bcc211d2e2984000b86cf471596d97c462e07c7fa3070e668ef9784098968f9d089bee92f3b1c955eac590207bd
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 1.4.0
|
4
|
+
|
5
|
+
* Normalize key names from the API to be valid Ruby variable names. - Ben Hamill
|
6
|
+
* Fix how `Folder` objects create their associated `MessageCollection` objects,
|
7
|
+
specifically with respect to passing around the handle to an appropriate
|
8
|
+
`Account` object. - Ben Hamill
|
9
|
+
* Convenience methods: `Message#to`,`#bcc`, `#cc` and `#reply_to`. - Aubrey
|
10
|
+
Holland
|
11
|
+
|
3
12
|
## 1.3.0
|
4
13
|
|
5
14
|
* Add sugar `Message#from` method. - Andrew Harrison
|
data/README.md
CHANGED
@@ -133,6 +133,9 @@ likely to get in (or get in faster) the closer you stick to these steps:
|
|
133
133
|
1. Turn the Issue into a Pull Request. There are several ways to do this, but
|
134
134
|
[hub](https://github.com/defunkt/hub) is probably the easiest.
|
135
135
|
1. Make sure your Pull Request includes tests.
|
136
|
+
1. Bonus points if your Pull Request updates `CHANGES.md` to include a summary
|
137
|
+
of your changes and your name like the other entries. If the last entry is
|
138
|
+
the last release, add a new `## Unreleased` heading.
|
136
139
|
|
137
140
|
If you don't know how to fix something, even just a Pull Request that includes a
|
138
141
|
failing test can be helpful. If in doubt, make an Issue to discuss.
|
data/lib/contextio/body_part.rb
CHANGED
@@ -131,6 +131,8 @@ class ContextIO
|
|
131
131
|
attr_hashes = api.request(:get, resource_url, 'email' => email, 'source_type' => source_type)
|
132
132
|
|
133
133
|
attr_hashes.each do |key, value|
|
134
|
+
key = key.to_s.gsub('-', '_')
|
135
|
+
|
134
136
|
instance_variable_set("@#{key}", value)
|
135
137
|
|
136
138
|
unless respond_to?(key)
|
data/lib/contextio/folder.rb
CHANGED
@@ -25,6 +25,8 @@ class ContextIO
|
|
25
25
|
@source = options.delete(:source) || options.delete('source')
|
26
26
|
|
27
27
|
options.each do |key, value|
|
28
|
+
key = key.to_s.gsub('-', '_')
|
29
|
+
|
28
30
|
instance_variable_set("@#{key}", value)
|
29
31
|
|
30
32
|
unless self.respond_to?(key)
|
@@ -50,7 +52,7 @@ class ContextIO
|
|
50
52
|
def messages
|
51
53
|
association_class = ContextIO::API::AssociationHelpers.class_for_association_name(:messages)
|
52
54
|
|
53
|
-
@messages ||= association_class.new(api, folder: self)
|
55
|
+
@messages ||= association_class.new(api, account: source.account).where(folder: self.name)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
data/lib/contextio/message.rb
CHANGED
data/lib/contextio/source.rb
CHANGED
data/lib/contextio/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'contextio'
|
3
|
+
|
4
|
+
describe "A MessageCollection created from a Folder" do
|
5
|
+
let(:api) { double(:api) }
|
6
|
+
let(:source) { double(:source, account: 'account') }
|
7
|
+
let(:folder) { ContextIO::Folder.new(api, source: source) }
|
8
|
+
let(:message_collection) { folder.messages }
|
9
|
+
|
10
|
+
it "has a handle on the right account" do
|
11
|
+
expect(message_collection.account).to eq('account')
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contextio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Hamill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- lib/contextio/webhook_collection.rb
|
191
191
|
- spec/config.yml.example
|
192
192
|
- spec/integration/accounts_messages_spec.rb
|
193
|
+
- spec/integration/folders_messages_spec.rb
|
193
194
|
- spec/spec_helper.rb
|
194
195
|
- spec/unit/contextio/account_collection_spec.rb
|
195
196
|
- spec/unit/contextio/account_spec.rb
|
@@ -234,6 +235,7 @@ summary: Provides interface to Context.IO
|
|
234
235
|
test_files:
|
235
236
|
- spec/config.yml.example
|
236
237
|
- spec/integration/accounts_messages_spec.rb
|
238
|
+
- spec/integration/folders_messages_spec.rb
|
237
239
|
- spec/spec_helper.rb
|
238
240
|
- spec/unit/contextio/account_collection_spec.rb
|
239
241
|
- spec/unit/contextio/account_spec.rb
|