zabbirc 0.0.3 → 0.0.4
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 +4 -4
- data/lib/zabbirc/configuration.rb +15 -0
- data/lib/zabbirc/setting.rb +1 -1
- data/templates/zabbirc_config.rb +1 -0
- 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: 518148802e14cf99f7647af570629636edb961e3
|
4
|
+
data.tar.gz: 4d130e7ecf9d6dc962473f3e8cadf6fd6add5363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7197e4008929e5d9e0e76adab0360c078523dbf7552f6aeeac0662a0a65171e5fdca52be52b473594df7c4a345776683ab58716ae692ed9352c4857cd0e90ae7
|
7
|
+
data.tar.gz: 2d0c49eebd46b7f26d73682d9304bc24b05fc4413955bd20ad4d7cfabe5b524e05d13a85fccc21d728567f6c8d736c02f092a9421cb684d6c331b061485ecf82
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'active_support/configurable'
|
2
2
|
|
3
|
+
require 'zabbirc/priority'
|
4
|
+
|
3
5
|
module Zabbirc
|
4
6
|
def self.configure(&block)
|
5
7
|
block.call(@config ||= Zabbirc::Configuration.new)
|
@@ -26,6 +28,18 @@ module Zabbirc
|
|
26
28
|
config.param_name.respond_to?(:call) ? config.param_name.call : config.param_name
|
27
29
|
end
|
28
30
|
|
31
|
+
def default_events_priority= value
|
32
|
+
allowed_priorities = Priority::PRIORITIES.values
|
33
|
+
unless allowed_priorities.include? value
|
34
|
+
raise ArgumentError, "Unexpected value in config file. default_events_priority can be one of `#{allowed_priorities.collect(&:inspect).join(", ")}` but `#{value.inspect}` was stated"
|
35
|
+
end
|
36
|
+
config.default_events_priority = value
|
37
|
+
end
|
38
|
+
|
39
|
+
def default_events_priority
|
40
|
+
config.default_events_priority
|
41
|
+
end
|
42
|
+
|
29
43
|
# define param_name writer (copied from AS::Configurable)
|
30
44
|
writer, line = 'def param_name=(value); config.param_name = value; end', __LINE__
|
31
45
|
singleton_class.class_eval writer, __FILE__, line
|
@@ -36,6 +50,7 @@ module Zabbirc
|
|
36
50
|
configure do |config|
|
37
51
|
config.events_check_interval = 10.seconds
|
38
52
|
config.notify_about_events_from_last = 5.minutes
|
53
|
+
config.default_events_priority = :high
|
39
54
|
|
40
55
|
config.irc_server = "irc.freenode.org"
|
41
56
|
config.irc_channels = ["#zabbirc-test", "#zabbirc-test-2"]
|
data/lib/zabbirc/setting.rb
CHANGED
data/templates/zabbirc_config.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbirc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filip Zachar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|