Permalink
Browse files

rename to desk

  • Loading branch information...
1 parent 12a02ec commit e04541aa102219c21a6a3f51873bf43e43958227 Christopher Warren committed Jul 15, 2012
Showing with 395 additions and 472 deletions.
  1. +6 −1 HISTORY.mkd
  2. +66 −61 README.mkd
  3. +9 −10 assistly.gemspec → desk.gemspec
  4. +0 −31 lib/assistly/client.rb
  5. +0 −83 lib/assistly/client/utils.rb
  6. +0 −4 lib/assistly/version.rb
  7. +9 −9 lib/{assistly.rb → desk.rb}
  8. +7 −7 lib/{assistly → desk}/api.rb
  9. +1 −1 lib/{assistly → desk}/authentication.rb
  10. +28 −0 lib/desk/client.rb
  11. +13 −13 lib/{assistly → desk}/client/article.rb
  12. +10 −10 lib/{assistly → desk}/client/case.rb
  13. +18 −18 lib/{assistly → desk}/client/customer.rb
  14. +13 −13 lib/{assistly → desk}/client/interaction.rb
  15. +23 −23 lib/{assistly → desk}/client/macro.rb
  16. +14 −14 lib/{assistly → desk}/client/topic.rb
  17. +3 −3 lib/{assistly → desk}/client/user.rb
  18. +5 −5 lib/{assistly → desk}/configuration.rb
  19. +1 −1 lib/{assistly → desk}/connection.rb
  20. +15 −15 lib/{assistly → desk}/error.rb
  21. +1 −1 lib/{assistly → desk}/request.rb
  22. +4 −0 lib/desk/version.rb
  23. +6 −6 lib/faraday/response/raise_http_4xx.rb
  24. +4 −4 lib/faraday/response/raise_http_5xx.rb
  25. +7 −7 spec/{assistly → desk}/api_spec.rb
  26. +9 −9 spec/{assistly → desk}/client/article_spec.rb
  27. +7 −7 spec/{assistly → desk}/client/case_spec.rb
  28. +7 −7 spec/{assistly → desk}/client/customer_spec.rb
  29. +16 −16 spec/{assistly → desk}/client/interaction_spec.rb
  30. +6 −6 spec/{assistly → desk}/client/macro_spec.rb
  31. +3 −3 spec/{assistly → desk}/client/topic_spec.rb
  32. +3 −3 spec/{assistly → desk}/client/user_spec.rb
  33. +2 −2 spec/{assistly → desk}/client_spec.rb
  34. +37 −37 spec/{assistly_spec.rb → desk_spec.rb}
  35. +11 −11 spec/faraday/response_spec.rb
  36. +3 −3 spec/fixtures/case.json
  37. +3 −3 spec/fixtures/case_update.json
  38. +3 −3 spec/fixtures/customer_update.json
  39. +12 −12 spec/fixtures/interactions.json
  40. +10 −10 spec/helper.rb
View
@@ -1,3 +1,8 @@
+0.3.0 July 15, 2012
+------------------
+Renamed from Assistly to Desk
+Updated Faraday and Hashie versions
+
0.2.6 October 3, 2011
------------------
Newer Faraday and multixml versions
@@ -12,7 +17,7 @@ Removed deep_merge because it conflicts with rails. Handling the merge inside th
0.2.2 - April 18, 2011
------------------
-Added deep_merge! support so that we keep any custom email headers when creating outbound interactions.
+Added deep_merge! support so that we keep any custom email headers when creating outbound interactions.
Required pony in the gem so you don't have to include it in your app.
0.2.1 - April 18, 2011
View
@@ -1,10 +1,15 @@
-The Assistly Ruby Gem
+The Desk Ruby Gem
====================
-A Ruby wrapper for the [Assistly API](http://dev.desk.com/)
+A Ruby wrapper for the [Desk.com API](http://dev.desk.com/)
Installation
------------
- gem install assistly
+ gem install desk
+
+What's new in 0.3.0?
+------------------
+Renamed to Desk
+Newer faraday, faraday_middleware and hashie
What's new in 0.2.6?
------------------
@@ -53,13 +58,13 @@ You'll need to explicitly require a JSON library. We recommend [yajl-ruby](http:
Usage Examples
--------------
require "rubygems"
- require "assistly"
+ require "desk"
- # All methods require authentication. To get your Assistly OAuth credentials,
- # register an app in the Assistly admin for your account at http://your-domain.desk.com/admin
- Assistly.configure do |config|
+ # All methods require authentication. To get your Desk OAuth credentials,
+ # register an app in the Desk.com admin for your account at http://your-domain.desk.com/admin
+ Desk.configure do |config|
config.support_email = "help@example.com"
- config.subdomain = YOUR_ASSISTLY_SUBDOMAIN
+ config.subdomain = YOUR_DESK_SUBDOMAIN
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
@@ -71,150 +76,150 @@ Usage Examples
######
# List cases
- Assistly.cases
- Assistly.cases(:since_id => 12345)
+ Desk.cases
+ Desk.cases(:since_id => 12345)
# Get a specific case
- Assistly.case(12345)
+ Desk.case(12345)
# Update a specific case
- Assistly.update_case(12345, :subject => "Something Else")
+ Desk.update_case(12345, :subject => "Something Else")
# Get a case url
- Assistly.case_url(12345)
+ Desk.case_url(12345)
######
# Customers
######
# List customers
- Assistly.customers
- Assistly.customers(:since_id => 12345, :count => 5)
+ Desk.customers
+ Desk.customers(:since_id => 12345, :count => 5)
# Get a specific customer
- Assistly.customer(12345)
+ Desk.customer(12345)
# Create a customer
- Assistly.create_customer(:name => "Chris Warren", :twitter => "cdwarren")
+ Desk.create_customer(:name => "Chris Warren", :twitter => "cdwarren")
# Update a customer
- Assistly.update_customer(12345, :name => "Christopher Warren")
+ Desk.update_customer(12345, :name => "Christopher Warren")
# Add a customer email
- Assistly.create_customer_email(12345, "foo@example.com")
- Assistly.create_customer_email(12345, "foo@example.com", :customer_contact_type => "work")
+ Desk.create_customer_email(12345, "foo@example.com")
+ Desk.create_customer_email(12345, "foo@example.com", :customer_contact_type => "work")
# Update a customer email
- Assistly.update_customer_email(12345, 54321, :email => "foo@example.com")
- Assistly.update_customer_email(12345, 54321, :customer_contact_type => "work")
-
+ Desk.update_customer_email(12345, 54321, :email => "foo@example.com")
+ Desk.update_customer_email(12345, 54321, :customer_contact_type => "work")
+
# Add a customer phone number
- Assistly.create_customer_phone(12345, "555-368-7147")
- Assistly.create_customer_phone(12345, "555-368-7147", :customer_contact_type => "work")
+ Desk.create_customer_phone(12345, "555-368-7147")
+ Desk.create_customer_phone(12345, "555-368-7147", :customer_contact_type => "work")
# Update a customer phone number
- Assistly.update_customer_phone(12345, 54321, :phone => "555-368-7147")
- Assistly.update_customer_phone(12345, 54321, :customer_contact_type => "work")
+ Desk.update_customer_phone(12345, 54321, :phone => "555-368-7147")
+ Desk.update_customer_phone(12345, 54321, :customer_contact_type => "work")
######
# Interactions
######
# List interactions
- Assistly.interactions
- Assistly.interactions(:since_id => 12345)
- Assistly.interactions(:since_id => 12345, :count => 5)
+ Desk.interactions
+ Desk.interactions(:since_id => 12345)
+ Desk.interactions(:since_id => 12345, :count => 5)
# Create an inbound interaction
- Assistly.create_interaction(:interaction_subject => "help me", :customer_email => "foo@example.com", :interaction_body => "You're my only hope.")
- Assistly.create_inbound_interaction(:interaction_subject => "help me", :customer_email => "foo@example.com", :interaction_body => "You're my only hope.")
+ Desk.create_interaction(:interaction_subject => "help me", :customer_email => "foo@example.com", :interaction_body => "You're my only hope.")
+ Desk.create_inbound_interaction(:interaction_subject => "help me", :customer_email => "foo@example.com", :interaction_body => "You're my only hope.")
# Create an outbound interaction
- # Assistly's API doesn't support creating outbound communications, so we do this over email with a BCC back to Assistly and customer headers.
- # Assistly.support_email must be set to your Assistly email address so that the email can be sent to the account and give the customer someone to respond to.
+ # Desk.com's API doesn't support creating outbound communications, so we do this over email with a BCC back to Desk and customer headers.
+ # Desk.support_email must be set to your Desk.com email address so that the email can be sent to the account and give the customer someone to respond to.
#
# Read more at http://support.desk.com/customer/portal/articles/4180
# Additional headers can be passed as well http://support.desk.com/customer/portal/articles/6728
#
# Email is sent using Pony https://github.com/benprew/pony
- Assistly.create_interaction(:interaction_subject => "Missed Your Call", :customer_email => "foo@example.com", :interaction_body => "Sorry we missed yoru call. What's up?", :direction => "outbound")
- Assistly.create_outbound_interaction("foo@example.com", "Missed Your Call", "Sorry we missed yoru call. What's up?")
+ Desk.create_interaction(:interaction_subject => "Missed Your Call", :customer_email => "foo@example.com", :interaction_body => "Sorry we missed yoru call. What's up?", :direction => "outbound")
+ Desk.create_outbound_interaction("foo@example.com", "Missed Your Call", "Sorry we missed yoru call. What's up?")
######
# Users
######
# List users
- Assistly.users
+ Desk.users
# Get a specific user
- Assistly.user(12345)
+ Desk.user(12345)
######
# Topics
######
# List Topics
- Assistly.topics
+ Desk.topics
# Get a specific topic
- Assistly.topic(12345)
+ Desk.topic(12345)
# Create a new topic
- Assistly.create_topic("name", :description => "description")
+ Desk.create_topic("name", :description => "description")
# Update a topic
- Assistly.update_topic(12345, :subject => "Updated")
+ Desk.update_topic(12345, :subject => "Updated")
# Delete a topic
- Assistly.delete_topic(12345)
+ Desk.delete_topic(12345)
######
# Articles
######
# List articles for a topic
- Assistly.articles(1)
+ Desk.articles(1)
# Get a specific article
- Assistly.article(12345)
+ Desk.article(12345)
# Create a new article within a topic
- Assistly.create_article(1, :subject => "API Tips", :main_content => "Tips on using our API")
+ Desk.create_article(1, :subject => "API Tips", :main_content => "Tips on using our API")
# Update an article
- Assistly.update_article(12345, :subject => "Updated API Tips")
+ Desk.update_article(12345, :subject => "Updated API Tips")
# Delete an article
- Assistly.delete_article(12345)
+ Desk.delete_article(12345)
######
# Macros
######
# List Macros
- Assistly.macros
+ Desk.macros
# Get a specific macro
- Assistly.macro(12345)
+ Desk.macro(12345)
# Create a new macro
- Assistly.create_macro("name", :labels => "escalated")
+ Desk.create_macro("name", :labels => "escalated")
# Update a macro
- Assistly.update_macro(12345, :name => "Updated Name")
+ Desk.update_macro(12345, :name => "Updated Name")
# Delete a macro
- Assistly.delete_macro(12345)
+ Desk.delete_macro(12345)
# Macro Actions
- Assistly.macro_actions(12345)
+ Desk.macro_actions(12345)
# Macro Action
- Assistly.macro_action(12345, "set-case-description")
+ Desk.macro_action(12345, "set-case-description")
# Update Macro Action
- Assistly.update_macro_action(12345, "set-case-description", :value => "New Subject")
+ Desk.update_macro_action(12345, "set-case-description", :value => "New Subject")
Contributing
------------
@@ -229,15 +234,15 @@ Here are some ways *you* can contribute:
* by writing specifications
* by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
* by refactoring code
-* by closing [issues](http://github.com/zencoder/assistly/issues)
+* by closing [issues](http://github.com/zencoder/desk/issues)
* by reviewing patches
-All contributors will be added to the [HISTORY](https://github.com/zencoder/assistly/blob/master/HISTORY.mkd)
+All contributors will be added to the [HISTORY](https://github.com/zencoder/desk/blob/master/HISTORY.mkd)
file and will receive the respect and gratitude of the community.
Submitting an Issue
-------------------
-We use the [GitHub issue tracker](http://github.com/zencoder/assistly/issues) to track bugs and
+We use the [GitHub issue tracker](http://github.com/zencoder/desk/issues) to track bugs and
features. Before submitting a bug report or feature request, check to make sure it hasn't already
been submitted. You can indicate support for an existing issuse by voting it up. When submitting a
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
@@ -258,5 +263,5 @@ Submitting a Pull Request
Copyright
---------
-Copyright (c) 2011 Chris Warren/[Zencoder](http://zencoder.com)
-See [LICENSE](https://github.com/zencoder/assistly/blob/master/LICENSE.mkd) for details.
+Copyright (c) 2012 Chris Warren/[Zencoder](http://zencoder.com)
+See [LICENSE](https://github.com/zencoder/desk/blob/master/LICENSE.mkd) for details.
@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
-require File.expand_path('../lib/assistly/version', __FILE__)
+require File.expand_path('../lib/desk/version', __FILE__)
Gem::Specification.new do |s|
- s.add_development_dependency('json', '~> 1.5')
+ # s.add_development_dependency('json', '~> 1.5')
s.add_development_dependency('nokogiri', '~> 1.4')
s.add_development_dependency('maruku', '~> 0.6')
s.add_development_dependency('rake', '~> 0.8')
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('webmock', '~> 1.6')
s.add_development_dependency('yard', '~> 0.6')
s.add_development_dependency('ZenTest', '~> 4.5')
+ s.add_runtime_dependency('json', '~> 1.7') if RUBY_VERSION < '1.9'
s.add_runtime_dependency('hashie', '~> 1.2.0')
s.add_runtime_dependency('faraday', '~> 0.8.0')
s.add_runtime_dependency('faraday_middleware', '~> 0.8.0')
@@ -22,24 +23,22 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('simple_oauth', '~> 0.1.4')
s.add_runtime_dependency('pony', '~> 1.1')
s.authors = ["Chris Warren"]
- s.description = %q{A Ruby wrapper for the Assistly REST API}
+ s.description = %q{A Ruby wrapper for the Desk.com REST API}
s.post_install_message =<<eos
********************************************************************************
-
-Ruby wrapper for the Assistly API.
-
+Ruby wrapper for the Desk.com API.
********************************************************************************
eos
s.email = ['chris@zencoder.com']
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.files = `git ls-files`.split("\n")
- s.homepage = 'https://github.com/zencoder/assistly'
- s.name = 'assistly'
+ s.homepage = 'https://github.com/zencoder/desk'
+ s.name = 'desk'
s.platform = Gem::Platform::RUBY
s.require_paths = ['lib']
s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
s.rubyforge_project = s.name
- s.summary = %q{Ruby wrapper for the Assistly API, based on the Twitter gem}
+ s.summary = %q{Ruby wrapper for the Desk.com API}
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.version = Assistly::VERSION.dup
+ s.version = Desk::VERSION.dup
end
View
@@ -1,31 +0,0 @@
-module Assistly
- # Wrapper for the Assistly REST API
- #
- # @note All methods have been separated into modules and follow the same grouping used in {http://dev.desk.com/doc the Assistly API Documentation}.
- # @see http://dev.desk.com/pages/every_developer
- class Client < API
- # Require client method modules after initializing the Client class in
- # order to avoid a superclass mismatch error, allowing those modules to be
- # Client-namespaced.
- require 'assistly/client/utils'
- require 'assistly/client/user'
- require 'assistly/client/interaction'
- require 'assistly/client/case'
- require 'assistly/client/customer'
- require 'assistly/client/topic'
- require 'assistly/client/article'
- require 'assistly/client/macro'
-
- alias :api_endpoint :endpoint
-
- include Assistly::Client::Utils
-
- include Assistly::Client::User
- include Assistly::Client::Interaction
- include Assistly::Client::Case
- include Assistly::Client::Customer
- include Assistly::Client::Topic
- include Assistly::Client::Article
- include Assistly::Client::Macro
- end
-end
Oops, something went wrong.

0 comments on commit e04541a

Please sign in to comment.