notiffany 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/images/failed.png +0 -0
- data/images/pending.png +0 -0
- data/images/success.png +0 -0
- data/lib/notiffany/notifier/detected.rb +11 -8
- data/lib/notiffany/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50226c277056b78ecdfd1a74f720bddb347b407
|
4
|
+
data.tar.gz: d81a067fa3332250d0e62a7682f9d59277126327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d416757c2e6a5cb916825c76273043a5fa2501f99246afbc1efd3d4674c507aa65ee6bd09cad8ead51a01e0a95d57f21332994c527537592428473cef7e39a4e
|
7
|
+
data.tar.gz: ea09890e05c08217847a7681dd8b89f7d2631e408379e57d4d66f9762027509eceeb69c645fd45a80954b28f9671f5c84b5b94f889902cc5287b3c91270626ac
|
data/images/failed.png
CHANGED
Binary file
|
data/images/pending.png
CHANGED
Binary file
|
data/images/success.png
CHANGED
Binary file
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "nenv"
|
2
|
+
require "yaml"
|
2
3
|
|
3
4
|
require_relative "emacs"
|
4
5
|
require_relative "file"
|
@@ -18,7 +19,7 @@ module Notiffany
|
|
18
19
|
# TODO: use a socket instead of passing env variables to child processes
|
19
20
|
# (currently probably only used by guard-cucumber anyway)
|
20
21
|
YamlEnvStorage = Nenv::Builder.build do
|
21
|
-
create_method(:notifiers=) { |data| YAML::dump(data) }
|
22
|
+
create_method(:notifiers=) { |data| YAML::dump(data || []) }
|
22
23
|
create_method(:notifiers) { |data| data ? YAML::load(data) : [] }
|
23
24
|
end
|
24
25
|
|
@@ -52,11 +53,11 @@ module Notiffany
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def reset
|
55
|
-
@environment.notifiers =
|
56
|
+
@environment.notifiers = []
|
56
57
|
end
|
57
58
|
|
58
59
|
def detect
|
59
|
-
return unless
|
60
|
+
return unless _notifiers.empty?
|
60
61
|
@supported.each do |group|
|
61
62
|
group.detect do |name, _|
|
62
63
|
begin
|
@@ -69,18 +70,18 @@ module Notiffany
|
|
69
70
|
end
|
70
71
|
end
|
71
72
|
|
72
|
-
fail NoneAvailableError, NO_SUPPORTED_NOTIFIERS if
|
73
|
+
fail NoneAvailableError, NO_SUPPORTED_NOTIFIERS if _notifiers.empty?
|
73
74
|
end
|
74
75
|
|
75
76
|
def available
|
76
|
-
@available ||=
|
77
|
+
@available ||= _notifiers.map do |entry|
|
77
78
|
_to_module(entry[:name]).new(entry[:options])
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
81
82
|
def add(name, opts)
|
82
83
|
@available = nil
|
83
|
-
all =
|
84
|
+
all = _notifiers
|
84
85
|
|
85
86
|
# Silently skip if it's already available, because otherwise
|
86
87
|
# we'd have to do :turn_off, then configure, then :turn_on
|
@@ -97,6 +98,8 @@ module Notiffany
|
|
97
98
|
all.each { |item| item[:options] = opts if item[:name] == name }
|
98
99
|
end
|
99
100
|
|
101
|
+
private
|
102
|
+
|
100
103
|
def _to_module(name)
|
101
104
|
@supported.each do |group|
|
102
105
|
next unless (notifier = group.detect { |n, _| n == name })
|
@@ -105,8 +108,8 @@ module Notiffany
|
|
105
108
|
nil
|
106
109
|
end
|
107
110
|
|
108
|
-
def
|
109
|
-
@environment.notifiers
|
111
|
+
def _notifiers
|
112
|
+
@environment.notifiers
|
110
113
|
end
|
111
114
|
end
|
112
115
|
end
|
data/lib/notiffany/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notiffany
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cezary Baginski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nenv
|