statuspageio 0.1.2 → 0.1.3

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: 0caf8c784355d8fc2004397fe2139773a2d9aef7
4
- data.tar.gz: 2edf2c57f1ccc345f4aca38b9e2a500ed47efcb2
3
+ metadata.gz: 455366f8c25d2bd8a353e87ab53e901931309885
4
+ data.tar.gz: 07e0b6066a8ae714c53e887ab63c0b69576678e2
5
5
  SHA512:
6
- metadata.gz: c84864826dea97ead1b424a414682ed89aa2afca35bc57f637d6fc0762c21e60a83b1ff6e75171e8dd7e8a5f61e69d2cf7ffc63feb43ad29fd3a4e9fdc01833c
7
- data.tar.gz: dbed2abf04dd767beeed0943b03b63d963e6ecba5b778b184f4263864238de1cca1d2f3c5892ff3728b4448251b599cb0ef2ca29899978d8e093801f5f116a0f
6
+ metadata.gz: 732126728c8c13f95d35b098148aab6d1b4be0c7c7ea5f4f894a434371f1fca10087f4a6a858dced79011ab39fdfc5faffd522d6b99c1af9990217ea35edfcd2
7
+ data.tar.gz: 232322e3ef9c3010277c7df6f69c2545dd2531cb11e19567eaea9e498fb327c9755803b0aa17faeb408a7c0f934cb070bf11ebc097a7b5f565b014eec3fe4937
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Statuspageio
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/statuspageio`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Ruby gem for the [Statuspage REST API](https://developer.statuspage.io).
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,23 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ##### In plain Ruby
24
+
25
+ ```ruby
26
+ client = Statuspageio::Client.new(api_key: '<your_api_key>', page_id: '<your_page_id>')
27
+ client.incidents(:all) # get a list of all your incidents
28
+ ```
29
+
30
+ ##### In Rails you can configure using an initializer
31
+
32
+ `config/intializers/statuspage.rb`
33
+
34
+ ```ruby
35
+ Statuspageio.configure do |config|
36
+ config.api_key = ENV['STATUSPAGE_API_KEY']
37
+ config.page_id = ENV['STATUSPAGE_PAGE_ID']
38
+ end
39
+ ```
26
40
 
27
41
  ## Development
28
42
 
@@ -13,6 +13,11 @@ module Statuspageio
13
13
  get("/pages/#{self.page_id}/incidents")
14
14
  end
15
15
  end
16
+
17
+ def search_incidents(q)
18
+ return incidents if q.nil? || q.empty?
19
+ get("/pages/#{self.page_id}/incidents", { q: q })
20
+ end
16
21
  end
17
22
  end
18
23
  end
@@ -38,8 +38,8 @@ module Statuspageio
38
38
  self.class.handle_response(self.class.delete("#{path}.json", headers: headers))
39
39
  end
40
40
 
41
- def get(path)
42
- self.class.handle_response(self.class.get("#{path}.json", headers: headers))
41
+ def get(path, query = {})
42
+ self.class.handle_response(self.class.get("#{path}.json", query: query, headers: headers))
43
43
  end
44
44
 
45
45
  def post(path, data = {})
@@ -1,3 +1,3 @@
1
1
  module Statuspageio
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statuspageio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Nixon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty