pushmore 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/push_more.rb +11 -2
  3. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: '0970675fb1f350e790cc90eb12f74b0a75ea77f8'
4
- data.tar.gz: c3ec14061622732b9e5b3940c28a0805ea2e0a14
2
+ SHA256:
3
+ metadata.gz: c9d9b2a23ddce26a428ce4bb774f9c836076c6fafc6d40fb5a569db6bc6d3342
4
+ data.tar.gz: d29136fc1d01eb4935ae9e7d3c824d81c6e6bc487ef6673e04624d5827279428
5
5
  SHA512:
6
- metadata.gz: 5e69d5ff3c843d4f5f725f4953f07eb966d190303f503f3b091015eab804c83f18ece9559952313229c004745ec29e88d55c3bd6e572289bea8f07f7ca29f2c9
7
- data.tar.gz: 6a9d2286f567e3b0ebd1c945f9dca94d84873eeba56834ac52a1d141a8d4edf12d85ae04c0a9502f41db5c04736def155e22a5a8b0e6d0d9a66cfa2a8c22527e
6
+ metadata.gz: 28285e1245a2d86430d659d4da930bd18dabdcecacc5cc268d33eb467388946c5c79f2739cd23d48f2c1f66cd06be142803761be39d39769a2b587f9d60c2273
7
+ data.tar.gz: 1ac98115ed57f412cadd2170bf36c35d4baa570cd4eaee5f5dc4f1b41c37637ad627721621444f0dc95c8004a2a7ec30a1549298f043e7efabfc18cd096f0152
@@ -1,8 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "net/https"
4
+ require "ostruct"
4
5
 
5
6
  class PushMore
7
+ def self.configuration
8
+ @configuration ||= OpenStruct.new
9
+ end
10
+
11
+ def self.configure
12
+ yield(configuration)
13
+ end
14
+
6
15
  # Send notifcations to Telegram through PushMore.io
7
16
  #
8
17
  # Example:
@@ -15,9 +24,9 @@ class PushMore
15
24
 
16
25
  WEBHOOK_BASE_URL = "https://pushmore.io/webhook/"
17
26
 
18
- def initialize(body, key: ENV.fetch("PUSH_MORE_KEY"))
27
+ def initialize(body, key: nil)
19
28
  @body = body
20
- @key = key
29
+ @key = key || PushMore.configuration.api_key || ENV.fetch("PUSH_MORE_KEY")
21
30
  end
22
31
 
23
32
  def deliver
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushmore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Köhlbrugge
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-18 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easily send notifications to Telegram
14
14
  email: hey@marckohlbrugge.com
@@ -21,7 +21,7 @@ homepage: http://rubygems.org/gems/pushmore
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}
24
- post_install_message:
24
+ post_install_message:
25
25
  rdoc_options: []
26
26
  require_paths:
27
27
  - lib
@@ -36,9 +36,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
- rubyforge_project:
40
- rubygems_version: 2.6.11
41
- signing_key:
39
+ rubygems_version: 3.1.2
40
+ signing_key:
42
41
  specification_version: 4
43
42
  summary: Ruby client for PushMore.io
44
43
  test_files: []