assistly 0.2.1 → 0.2.2

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.
@@ -1,3 +1,12 @@
1
+ 0.2.2 - April 18, 2011
2
+ ------------------
3
+ Added deep_merge! support so that we keep any custom email headers when creating outbound interactions.
4
+ Required pony in the gem so you don't have to include it in your app.
5
+
6
+ 0.2.1 - April 18, 2011
7
+ ------------------
8
+ Stopped returning only the 'results' array when listing things, because this would cause us to not have access to page numbers, total counts, etc.
9
+
1
10
  0.2.0 - April 16, 2011
2
11
  -------------------------
3
12
  * Support for Topics, Articles, and Macros added
data/README.mkd CHANGED
@@ -6,6 +6,15 @@ Installation
6
6
  ------------
7
7
  gem install assistly
8
8
 
9
+ What's new in 0.2.2?
10
+ ------------------
11
+ Added deep_merge! support so that we keep any custom email headers when creating outbound interactions.
12
+ Required pony in the gem so you don't have to include it in your app.
13
+
14
+ What's new in 0.2.1?
15
+ ------------------
16
+ Stopped returning only the 'results' array when listing things, because this would cause us to not have access to page numbers, total counts, etc.
17
+
9
18
  What's new in 0.2.0?
10
19
  ------------------
11
20
  Added support for Topics, Articles, and Macros, which is currently all that is available in the Assistly API.
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency('rash', '~> 0.3.0')
22
22
  s.add_runtime_dependency('simple_oauth', '~> 0.1.4')
23
23
  s.add_runtime_dependency('pony', '~> 1.1')
24
+ s.add_runtime_dependency('deep_merge', '~> 0.1.0')
24
25
  s.authors = ["Chris Warren"]
25
26
  s.description = %q{A Ruby wrapper for the Assistly REST API}
26
27
  s.post_install_message =<<eos
@@ -2,7 +2,8 @@ require 'assistly/error'
2
2
  require 'assistly/configuration'
3
3
  require 'assistly/api'
4
4
  require 'assistly/client'
5
- # require 'assistly/search'
5
+ require 'pony'
6
+ require 'deep_merge'
6
7
 
7
8
  module Assistly
8
9
  extend Configuration
@@ -20,7 +20,6 @@ module Assistly
20
20
 
21
21
  def create_interaction(*args)
22
22
  options = args.last.is_a?(Hash) ? args.pop : {}
23
- direction =
24
23
  if options[:direction].to_s == "outbound"
25
24
  options.delete(:direction)
26
25
  to = options.delete(:customer_email)
@@ -64,7 +63,7 @@ module Assistly
64
63
  raise Assistly::SupportEmailNotSet if support_email.blank?
65
64
  options = args.last.is_a?(Hash) ? args.pop : {}
66
65
  options.merge!(:to => to, :subject => subject, :body => body, :from => support_email, :bcc => support_email)
67
- options.merge!(:headers => { "x-assistly-customer-email" => to,
66
+ options.deep_merge!(:headers => { "x-assistly-customer-email" => to,
68
67
  "x-assistly-interaction-direction" => "out",
69
68
  "x-assistly-case-status" => options[:status]||"open"})
70
69
  Pony.mail(options)
@@ -1,4 +1,4 @@
1
1
  module Assistly
2
2
  # The version of the gem
3
- VERSION = '0.2.1'.freeze unless defined?(::Assistly::VERSION)
3
+ VERSION = '0.2.2'.freeze unless defined?(::Assistly::VERSION)
4
4
  end
@@ -146,6 +146,20 @@ describe Assistly::Client do
146
146
  end
147
147
 
148
148
  end
149
+
150
+ context "with customer headers set" do
151
+ before do
152
+ @custom_email = @client.create_outbound_interaction("customer@example.com", "Need help?", "Sorry we missed you in chat today.", :headers => { "x-assistly-interaction-user-agent" => "12345"})
153
+ end
154
+
155
+ it "should merge the custom headers" do
156
+ @custom_email.last.should have_header("x-assistly-interaction-user-agent","12345")
157
+ end
158
+
159
+ it "should preserve the existing headers" do
160
+ @custom_email.last.should have_header("x-assistly-customer-email","customer@example.com")
161
+ end
162
+ end
149
163
  end
150
164
 
151
165
  describe ".interactions" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assistly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Warren
@@ -295,6 +295,22 @@ dependencies:
295
295
  version: "1.1"
296
296
  type: :runtime
297
297
  version_requirements: *id018
298
+ - !ruby/object:Gem::Dependency
299
+ name: deep_merge
300
+ prerelease: false
301
+ requirement: &id019 !ruby/object:Gem::Requirement
302
+ none: false
303
+ requirements:
304
+ - - ~>
305
+ - !ruby/object:Gem::Version
306
+ hash: 27
307
+ segments:
308
+ - 0
309
+ - 1
310
+ - 0
311
+ version: 0.1.0
312
+ type: :runtime
313
+ version_requirements: *id019
298
314
  description: A Ruby wrapper for the Assistly REST API
299
315
  email:
300
316
  - chris@zencoder.com