notifaction 0.3.0 → 0.3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1fbf23fc97a9f930d9dd79d440516eb4b33b148
4
- data.tar.gz: eaf15cfb3496e21a565ae26d7710edc16a93ede9
3
+ metadata.gz: 77df94c1102f5000ccf7ed328b995f6b00959421
4
+ data.tar.gz: d4cafdd7d6cd7282e158c6e5759bc7e605e70699
5
5
  SHA512:
6
- metadata.gz: 4b733df88dbbda18da7cb2f5e4563b37d918c72032e62f7dbc9481f2b9e94f39d683ac9db93583116fe5e03de6cbcbf1148550155692ed779779583362a0a57c
7
- data.tar.gz: 4b63bc5169ee2ee76ffba4b9d79943b5d3d824dce2f36847b53fd861b1ca8f2c2f8cc3ff5feb614ae4eb23edb013437a3301b59ebaca8bcb0656597aefc38286
6
+ metadata.gz: 595feaf6b98cea3fb016df821b678800db211e5b69b7b1995ea724a8bacb0018549d17810c7a36c82c735e0691242f9ccfa6b6fc61b295cbec8ecc0f72558c72
7
+ data.tar.gz: a47f2a2474241f442f88193b34ac53c9f3fa269a26379b32493b4e2a20bdc98e319c2a1ad4ebc8ecfe3f198a0b1354fb4c3b4d11296ad91be179e4fb21314193
@@ -9,5 +9,3 @@ require "notifaction/notify"
9
9
  require "notifaction/config"
10
10
  require "notifaction/version"
11
11
  require "notifaction/utils"
12
-
13
- $config = Notifaction::Cfg.new
@@ -26,7 +26,7 @@ class Notify
26
26
  def self.error(message, config = {})
27
27
  handler = Notifaction::Type::Terminal.new
28
28
  handler.error(message, config)
29
- handler.quit unless self.auto_quit_enabled(config)
29
+ handler.quit unless self.auto_quit_enabled(config, handler.user_conf)
30
30
  end
31
31
 
32
32
  # Prints a pre-formatted warning message to the console
@@ -104,7 +104,7 @@ class Notify
104
104
 
105
105
  #
106
106
  # @since 0.3.0
107
- def self.auto_quit_enabled(config)
108
- config[:auto_quit] == false || $config.conf["auto_quit"] == false
107
+ def self.auto_quit_enabled(config, user_conf)
108
+ config[:auto_quit] == false || user_conf.conf["auto_quit"] == false
109
109
  end
110
110
  end
@@ -4,6 +4,14 @@ require "uri"
4
4
  module Notifaction
5
5
  module Type
6
6
  class Base
7
+ attr_accessor :user_conf
8
+
9
+ #
10
+ # @since 0.3.0.1
11
+ def initialize
12
+ @user_conf = Notifaction::Cfg.new
13
+ end
14
+
7
15
  #
8
16
  # @since 0.2.8
9
17
  def deprecation_notice(version)
@@ -19,7 +27,7 @@ module Notifaction
19
27
  #
20
28
  # @since 0.3.0
21
29
  def fire_hooks(payload)
22
- hooks = $config.hooks
30
+ hooks = @user_conf.hooks
23
31
 
24
32
  return if hooks.nil?
25
33
 
@@ -82,15 +82,15 @@ module Notifaction
82
82
  end
83
83
 
84
84
  def show_symbol(config)
85
- config[:symbol] || config[:fancy] || $config.conf["fancy"] == true
85
+ config[:symbol] || config[:fancy] || @user_conf.conf["fancy"] == true
86
86
  end
87
87
 
88
88
  def show_time(config)
89
- config[:show_time] || $config.conf["show_time"]
89
+ config[:show_time] || @user_conf.conf["show_time"]
90
90
  end
91
91
 
92
92
  def show_message(config)
93
- config[:print] == false || $config.conf["print"] == false
93
+ config[:print] == false || @user_conf.conf["print"] == false
94
94
  end
95
95
  end
96
96
  end
@@ -1,3 +1,3 @@
1
1
  module Notifaction
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Яyan Priebe