groovehq 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5297d2c40416cd886269a0843c1fb532d23c25c6
4
- data.tar.gz: bec7bed50a2eb6e43dd9186de38757bee6a23dce
3
+ metadata.gz: 43f043143339184bc705dda2e5fa561531a5c010
4
+ data.tar.gz: d0a3a58f8a05e824e43b49a0c2614d085814ef5f
5
5
  SHA512:
6
- metadata.gz: 951ce20a379d848d1cfffbfd32d1585e7ee4d74f9693de5b04b3389f411c35ccf37c37af71822805c0a52a48034344ea4e55a7ec0d47c328ccfce6e67e89206a
7
- data.tar.gz: c0aea7da762427a4f8851e7a2904f03ba8c38a4087b7972574ac9eee1f6e06a81d6ddb357e63d1a9e2231c82bdf8a0d1eeeae135e6faf07efbaaeffbae653772
6
+ metadata.gz: c049b74da9379131aa2e86f4a40c30096a29ee2492e73bb0b09330b10b226df377fbcd0b27e8629ad402854fbe511fc6ceda7408e724c6665aa1486baf754321
7
+ data.tar.gz: 796ae8ac97aebf7902d6750577e34dc96426278131fce0790d1b75ab3d4d945e2077466308ed798784d9a662bd87dc955a30c0562bf70edbdf4396aec2fa6e8f
data/README.md CHANGED
@@ -1,3 +1,55 @@
1
1
  ### GrooveHQ ruby client library
2
2
 
3
3
  [![Build Status](https://travis-ci.org/Fodoj/groovehq.svg)](https://travis-ci.org/Fodoj/groovehq)
4
+
5
+ Client library for talking to [GrooveHQ API](https://www.groovehq.com/docs). Supports all endpoints, as well as chaining API requests for hypermedia links.
6
+
7
+ #### Usage
8
+
9
+ First of all, initialize client:
10
+
11
+ ```ruby
12
+ client = GrooveHQ::Client.new("MY_API_TOKEN")
13
+ ```
14
+
15
+ And then talk to API:
16
+
17
+ ```ruby
18
+ client.tickets(page: 2).first.number
19
+ ```
20
+
21
+ #### Hypermedia support
22
+
23
+ Gem supports hypermedia links and allows to chain unlimited amount of requests like this:
24
+
25
+ ```ruby
26
+ client.tickets(page: 2).rels[:next].get.first.rels[:customer].get.email
27
+ ```
28
+
29
+ #### List of all methods
30
+
31
+ Client methods really just map 1 to 1 to API, see all of them beyond. Check API docs for list of available `options`.
32
+
33
+ ```ruby
34
+ agent(email)
35
+ agents(options = {})
36
+ update_customer(options = {})
37
+ customer(email)
38
+ customers(options = {})
39
+ folders(options = {})
40
+ groups(options = {})
41
+ mailboxes(options = {})
42
+ create_message(options)
43
+ message(message_id)
44
+ messages(ticket_number, options = {})
45
+ tickets_count(options = {})
46
+ create_ticket(options)
47
+ ticket(ticket_number)
48
+ tickets(options = {})
49
+ ticket_state(ticket_number)
50
+ update_ticket_state(ticket_number, state)
51
+ ticket_assignee(ticket_number)
52
+ update_ticket_assignee(ticket_number, assignee)
53
+ update_ticket_priority(ticket_number, priority)
54
+ update_ticket_assigned_group(ticket_number, assigned_group)
55
+ ```
data/groovehq.gemspec CHANGED
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'groovehq/version'
@@ -17,6 +16,7 @@ Gem::Specification.new do |spec|
17
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
18
  spec.require_paths = ["lib"]
19
+ spec.required_ruby_version = '>= 2.0'
20
20
 
21
21
  spec.add_dependency "httparty"
22
22
  spec.add_dependency "activesupport"
@@ -3,7 +3,6 @@ module GrooveHQ
3
3
 
4
4
  module Folders
5
5
 
6
- # Doesn't work, waiting for GrooveHQ team to clarify
7
6
  def folders(options = {})
8
7
  get("/folders", options)
9
8
  end
@@ -3,7 +3,6 @@ module GrooveHQ
3
3
 
4
4
  module Tickets
5
5
 
6
- # FIXME Doesn't work yet, shows only one random folder at the moment
7
6
  def tickets_count(options = {})
8
7
  get("/tickets/count", options)
9
8
  end
@@ -7,6 +7,8 @@ module GrooveHQ
7
7
  data = {} unless data.is_a?(Hash)
8
8
  data = data.with_indifferent_access
9
9
 
10
+ @client = client
11
+
10
12
  meta_data = data.delete(:meta) { Hash.new }
11
13
 
12
14
  collection = Array(data.values.first).map do |item|
@@ -18,10 +20,10 @@ module GrooveHQ
18
20
  if meta_data.has_key?("pagination")
19
21
  links = {
20
22
  next: {
21
- href: meta_data["pagination"]["next_page"]
23
+ "href" => meta_data["pagination"]["next_page"]
22
24
  },
23
25
  prev: {
24
- href: meta_data["pagination"]["prev_page"]
26
+ "href" => meta_data["pagination"]["prev_page"]
25
27
  }
26
28
  }
27
29
  end
@@ -1,3 +1,3 @@
1
1
  module GrooveHQ
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groovehq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Shirinkin
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: '0'
114
+ version: '2.0'
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="