simple_desk 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e55d130b67924254d3ce35e5304e85c3a24ebfc7
4
- data.tar.gz: 6d5ddf600020468187e31018176219d5515b8a08
3
+ metadata.gz: 09316216a0fd2eb3a1a18d66813cd62d003ab3b9
4
+ data.tar.gz: 15fb10d3b95de88816df195e846cffe2db1cd51d
5
5
  SHA512:
6
- metadata.gz: f371a2f54d8dc74aa58d6e5650d1313a70ffc697927d4be771bc791dd7b1cb9dd948ebd69bbd54241898051c106a584ab1ff0c567778cf896225ea6dc8a4d8d1
7
- data.tar.gz: 44f488cb5fd882c96dc53ed70f7e6f5fa88544f053ac43dd773362c65e209a13da14f33b54933b0934d97445546fbaae3415b7ae700e0e017c9d047c58b120e9
6
+ metadata.gz: faa8d5000a0384bdae9da16642581ee324a31abdb3be8df12095a2d1712712f6da44eafd6e3c293f9a47c5500f7a650b73b1f2d9224e5f437d2358644bd86f28
7
+ data.tar.gz: d12b251db9194dffb7bd8620a2470ed222f073ca82e2063fd3098d1a7b2d22e8197efd5b0bea3ecfed4497f69753559e17eaec3fb5a3d18e7766ebf9cd54b42e
data/README.md CHANGED
@@ -2,13 +2,6 @@
2
2
 
3
3
  [Simple Desk](https://www.getsimpledesk.com) is a skin on top of the twillio API which makes it much easier to use. This simple wrapper is a gem to quickly integrate with Simple Desk in seconds.
4
4
 
5
- ## To Do List
6
-
7
- - Make generator to accept your API key
8
- - Add ability to pass in properties and convert to base 64
9
- - Add auto capitalization for names
10
- - Parse formatting for phone number
11
-
12
5
  ## Installation
13
6
 
14
7
  Add this line to your application's Gemfile:
@@ -24,8 +17,9 @@ Or install it yourself as:
24
17
  $ gem install simple_desk
25
18
 
26
19
  ## Usage
20
+ *As of right now I have my API code hardcoded into the gem, meaning it is useless as of right now for anyone else.*
27
21
 
28
- #Adding Customers
22
+ ###**Adding Customers**
29
23
  To get started and add a new customer, run:
30
24
  SimpleDesk.add_customer({phone_number: "1231231232"})
31
25
 
@@ -41,16 +35,21 @@ Like this:
41
35
  SimpleDesk.add_customer(params)
42
36
 
43
37
 
44
- #Messaging
38
+ ###**Messaging**
45
39
  To message a user the format is similar
46
40
  Note: They do not have to be existing in the system to message. You'll automatically create a new user if you message a new phone number
47
41
 
48
42
  message_and_phone_number = {to: 5551231234, text: "Howdy partner!"}
49
43
  SimpleDesk.message_customer(message_and_phone_number)
50
44
 
45
+ ## To Do List
51
46
 
47
+ Features that still need to be implemented
52
48
 
53
- or you if you want to pass in other details, you can
49
+ - Make generator to accept your API key
50
+ - Add ability to pass in properties and convert to base 64
51
+ - Add auto capitalization for names
52
+ - Parse formatting for phone number
54
53
 
55
54
  ## Contributing
56
55
 
data/RELEASE.md CHANGED
@@ -1,3 +1,7 @@
1
+ v 0.3.0
2
+ -------
3
+ Make dynamic for API token
4
+
1
5
  v 0.2.0
2
6
  -------
3
7
  Add documentation
@@ -1,3 +1,3 @@
1
1
  module SimpleDesk
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/simple_desk.rb CHANGED
@@ -3,10 +3,8 @@ require "net/http"
3
3
  require "uri"
4
4
 
5
5
  module SimpleDesk
6
-
7
6
  BASE_URL = "https://www.getsimpledesk.com"
8
- TOKEN = ENV['SIMPLE_DESK_TOKEN'] || "ucMKQtZ0CQkgfGzTj6lOJe2VRvoRHM8z"
9
-
7
+
10
8
  def self.add_customer(params)
11
9
  uri = URI.parse(post_url("add_customer"))
12
10
  response = Net::HTTP.post_form(uri, params)
@@ -36,13 +34,13 @@ module SimpleDesk
36
34
 
37
35
  def self.post_url(post_type)
38
36
  if post_type == nil
39
- "#{BASE_URL}?token=#{TOKEN}"
37
+ "#{BASE_URL}?token=#{ENV['SIMPLE_DESK_TOKEN']}"
40
38
  else
41
39
  case post_type
42
40
  when "message_customer"
43
- "#{BASE_URL}/api_send_message?token=#{TOKEN}"
41
+ "#{BASE_URL}/api_send_message?token=#{ENV['SIMPLE_DESK_TOKEN']}"
44
42
  when "add_customer" || "update_customer"
45
- "#{BASE_URL}/api_add_customer?token=#{TOKEN}"
43
+ "#{BASE_URL}/api_add_customer?token=#{ENV['SIMPLE_DESK_TOKEN']}"
46
44
  end
47
45
  end
48
46
  end
data/spec/my_spec.rb CHANGED
@@ -5,6 +5,7 @@ describe SimpleDesk do
5
5
  before :each do
6
6
  @phone = {phone_number: "555#{Random.rand(10_000_000 - 1_000_000)}"}
7
7
  @user = {first_name: "Elijah", last_name: "Murray"}.merge!(@phone)
8
+ ENV['SIMPLE_DESK_TOKEN'] = 'ucMKQtZ0CQkgfGzTj6lOJe2VRvoRHM8z'
8
9
  end
9
10
 
10
11
  describe "#build_url" do
@@ -24,7 +25,7 @@ describe SimpleDesk do
24
25
  describe "#message_customer" do
25
26
  it "message customer successfully" do
26
27
  # skip("disabled to not call API")
27
- message = "Hi customer!"
28
+ message = "Wooot"
28
29
  to = {to: @phone[:phone_number]}
29
30
  params = {text: message}.merge!(to)
30
31
  request = SimpleDesk.message_customer(params)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_desk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elijah Murray
@@ -104,10 +104,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.1.9
107
+ rubygems_version: 2.0.14
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Provides a clean and simple gem to connect to Simple Desk
111
111
  test_files:
112
112
  - spec/my_spec.rb
113
113
  - spec/spec_helper.rb
114
+ has_rdoc: