mailqun 0.1.0 → 0.1.1

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 +4 -4
  2. data/mailqun +17 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd52c4bb04fc6ba851e6ebb6bcf33c8bd798810e
4
- data.tar.gz: a9fa98a5782003419ffda122acc2d83c0c1061e1
3
+ metadata.gz: ead41ae24dd509793e62692c85d3c53be8e69520
4
+ data.tar.gz: 52b23a756cf113add2ede8e6a4e77217a75e504c
5
5
  SHA512:
6
- metadata.gz: 1f1d853191de686a4a577b26371d72f8e919bfd83af3a8e2f47ed1be91bc86bb4f778417a228a16054f4534673f1c9304ad939b3cc9cae231e35ec3c4f18017d
7
- data.tar.gz: 7a6a4243247dfd60e0a7e1d04ff5a61d2858f08720042ebbffc6cb21b440df98dcd6665a5a634e20f4c89d4e21ea5e7281f8aee7c8b8cce4251ff1f3584f1e8b
6
+ metadata.gz: 614e070d9c683ebab47472175baaf21a8b2029d05caa13c198f82398ea6c56cbbf31cd0af69cfd10d6c6c192112348c7cdd048b97925cae81d41995da9865450
7
+ data.tar.gz: 7ef3f9951fcc3cb75d924f70853cfa8349b49b24b23b61e288536b298c51ea8939b36ab808844306fab1b94cf14b554d26f244db174172e1f3ca36639bf3c38c
data/mailqun CHANGED
@@ -3,11 +3,27 @@ require 'net/http'
3
3
  require 'optparse'
4
4
  require 'ostruct'
5
5
  require 'json'
6
- require 'colorize'
6
+
7
+ begin
8
+ require 'colorize'
9
+ rescue LoadError
10
+ class String
11
+ def method_missing(name)
12
+ if ['green', 'red'].include? name.to_s
13
+ self
14
+ else
15
+ super
16
+ end
17
+ end
18
+ end
19
+ end
7
20
 
8
21
  def load_env
9
22
  @domain = ENV['MAILGUN_DOMAIN']
10
23
  @secret = ENV['MAILGUN_SECRET']
24
+
25
+ abort("Error: Set MAILGUN_DOMAIN") if @domain.nil?
26
+ abort("Error: Set MAILGUN_SECRET") if @secret.nil?
11
27
  end
12
28
 
13
29
  def load_uri
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailqun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harman Singh