evil_events 0.1.0rc2 → 0.1.0rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +2 -0
- data/.jrubyrc +1 -0
- data/.rubocop.yml +4 -1
- data/.travis.yml +1 -1
- data/README.md +6 -7
- data/evil_events.gemspec +4 -4
- data/lib/evil_events/core/activity_logger.rb +28 -0
- data/lib/evil_events/core/broadcasting/emitter.rb +2 -5
- data/lib/evil_events/core/events/abstract_event.rb +8 -6
- data/lib/evil_events/core/events/event_extensions/metadata_extendable/abstract_metadata.rb +25 -0
- data/lib/evil_events/core/events/event_extensions/metadata_extendable.rb +53 -0
- data/lib/evil_events/core/events/event_extensions/payloadable/abstract_payload.rb +1 -0
- data/lib/evil_events/core/events/event_extensions/payloadable.rb +6 -5
- data/lib/evil_events/core/events/serializers/hash.rb +11 -8
- data/lib/evil_events/core/events/serializers/json.rb +9 -6
- data/lib/evil_events/core/events.rb +2 -0
- data/lib/evil_events/core.rb +1 -1
- data/lib/evil_events/shared/combined_context.rb +2 -0
- data/lib/evil_events/system/event_manager.rb +2 -2
- data/lib/evil_events/system/mock.rb +1 -1
- data/lib/evil_events/version.rb +1 -1
- metadata +12 -8
- data/CODE_OF_CONDUCT.md +0 -74
- data/lib/evil_events/core/activity_logging.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ba90c2963630dfa0bd968c6da4fccc798c72e8a
|
4
|
+
data.tar.gz: b403a12b2797da58c9d08271a6f8350faa4ecc9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944e8fe8086ec3e38fd8267a1aa0b5d7c0505357053d55b9cfd814ebf309c25b46c505f1fdb668ba86b00d04a2cc8e4fe3f6cb2ef3559489e1264016254f98f5
|
7
|
+
data.tar.gz: 323332e087b6d55203956b33161cac1e694dc905e9dbc54e414d2895ea795d1f50df3beba53d5ec1cfb2af80809190122040ee00a30c2ee17b501de5807d844a
|
data/.hound.yml
ADDED
data/.jrubyrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
debug.fullTrace=true
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# EvilEvents -
|
1
|
+
# EvilEvents - event subsystem for ruby applications
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/evil_events.svg)](https://badge.fury.io/rb/evil_events)
|
4
4
|
[![Build Status](https://travis-ci.org/ergosploit/evil_events.svg?branch=master)](https://travis-ci.org/ergosploit/evil_events)
|
@@ -7,13 +7,12 @@
|
|
7
7
|
NOTE: Work in progress!
|
8
8
|
|
9
9
|
### ROADMAP
|
10
|
-
- Full test coverage (0.1.0)
|
11
10
|
- Basic documentation (README) (0.1.0)
|
12
|
-
- FULL documentation (0.
|
11
|
+
- FULL documentation (0.1.1)
|
13
12
|
- Notifier abstraction (0.2.0)
|
14
13
|
- Event sourcing (0.3.0)
|
15
14
|
- RSpec matchers (separated gem)
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
- Event
|
15
|
+
- Concrete error messages for exceptions (0.1.1)
|
16
|
+
- Hooks (0.2.0)
|
17
|
+
- Scheduling (0.2.0)
|
18
|
+
- Event logic (0.2.0)
|
data/evil_events.gemspec
CHANGED
@@ -13,10 +13,10 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.email = 'iamdaiver@icloud.com'
|
14
14
|
spec.homepage = 'https://github.com/ergosploit/evil_events'
|
15
15
|
spec.license = 'MIT'
|
16
|
-
spec.summary = 'Event subsystem for
|
17
|
-
spec.description = '
|
18
|
-
'with a wide set of customization interfaces
|
19
|
-
'
|
16
|
+
spec.summary = 'Event subsystem for ruby applications'
|
17
|
+
spec.description = 'Ultra simple, but very flexible and fully customizable event subsystem ' \
|
18
|
+
'for ruby applications with a wide set of customization interfaces ' \
|
19
|
+
' and smart event definition DSL.'
|
20
20
|
|
21
21
|
spec.bindir = 'bin'
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EvilEvents::Core
|
4
|
+
# @api private
|
5
|
+
# @since 0.1.0
|
6
|
+
class ActivityLogger
|
7
|
+
class << self
|
8
|
+
# @param activity [String, NilClass]
|
9
|
+
# @param message [String, NilClass]
|
10
|
+
# @return void
|
11
|
+
#
|
12
|
+
# @since 0.1.0
|
13
|
+
def log(activity: nil, message: nil)
|
14
|
+
progname = "[EvilEvents:#{activity}]"
|
15
|
+
logger.add(logger.level, message, progname)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
# @return [Logger]
|
21
|
+
#
|
22
|
+
# @since 0.1.0
|
23
|
+
def logger
|
24
|
+
EvilEvents::BootPoint[:config].logger
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -4,9 +4,6 @@ module EvilEvents::Core::Broadcasting
|
|
4
4
|
# @api private
|
5
5
|
# @since 0.1.0
|
6
6
|
class Emitter
|
7
|
-
# @since 0.1.0
|
8
|
-
include EvilEvents::Core::ActivityLogging
|
9
|
-
|
10
7
|
# @since 0.1.0
|
11
8
|
EmitterError = Class.new(StandardError)
|
12
9
|
# @since 0.1.0
|
@@ -45,9 +42,9 @@ module EvilEvents::Core::Broadcasting
|
|
45
42
|
# @since 0.1.0
|
46
43
|
def log_emitter_activity(event)
|
47
44
|
activity = "EventEmitted(#{event.adapter_name})"
|
48
|
-
message = "Type: #{event.type} :: Payload: #{event.payload}"
|
45
|
+
message = "Type: #{event.type} :: Payload: #{event.payload} :: Metadata: #{event.metadata}"
|
49
46
|
|
50
|
-
|
47
|
+
EvilEvents::Core::ActivityLogger.log(activity: activity, message: message)
|
51
48
|
end
|
52
49
|
end
|
53
50
|
end
|
@@ -20,14 +20,16 @@ module EvilEvents::Core::Events
|
|
20
20
|
# @since 0.1.0
|
21
21
|
include EventExtensions::Emittable
|
22
22
|
# @since 0.1.0
|
23
|
+
include EventExtensions::MetadataExtendable
|
24
|
+
# @since 0.1.0
|
23
25
|
extend EvilEvents::Shared::CombinedContextMixin
|
24
26
|
|
25
27
|
# @param payload_attributes [Hash]
|
26
28
|
#
|
27
29
|
# @since 0.1.0
|
28
|
-
def initialize(
|
29
|
-
@
|
30
|
-
@
|
30
|
+
def initialize(payload: {}, metadata: {})
|
31
|
+
@payload = build_payload(**payload)
|
32
|
+
@metadata = build_metadata(**metadata)
|
31
33
|
end
|
32
34
|
|
33
35
|
# @return [Hash]
|
@@ -37,11 +39,11 @@ module EvilEvents::Core::Events
|
|
37
39
|
@payload.to_h
|
38
40
|
end
|
39
41
|
|
40
|
-
# @return
|
42
|
+
# @return [Hash]
|
41
43
|
#
|
42
44
|
# @since 0.1.0
|
43
|
-
def
|
44
|
-
|
45
|
+
def metadata
|
46
|
+
@metadata.to_h
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# TODO: dry and refactor with AbstractPayload
|
4
|
+
module EvilEvents::Core::Events::EventExtensions::MetadataExtendable
|
5
|
+
# @abstract
|
6
|
+
# @api private
|
7
|
+
# @since 0.1.0
|
8
|
+
class AbstractMetadata < EvilEvents::Shared::Structure
|
9
|
+
class << self
|
10
|
+
# @since 0.1.0
|
11
|
+
alias_method :_native_attribute, :attribute
|
12
|
+
|
13
|
+
# @param key [Symbol]
|
14
|
+
# @param type [EvilEvents::Shared::Types::Any]
|
15
|
+
#
|
16
|
+
# @since 0.1.0
|
17
|
+
def attribute(key, type = EvilEvents::Types::Any)
|
18
|
+
_native_attribute(key, type)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# NOTE: dry-struct API + dry-initializer API
|
23
|
+
constructor_type :strict_with_defaults
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# TODO: refactor with EvilEvents::Core::Events::EventExtensions::Payloadable
|
4
|
+
module EvilEvents::Core::Events::EventExtensions
|
5
|
+
# @api private
|
6
|
+
# @since 0.1.0
|
7
|
+
module MetadataExtendable
|
8
|
+
class << self
|
9
|
+
# @param base_class [Class]
|
10
|
+
#
|
11
|
+
# @since 0.1.0
|
12
|
+
def included(base_class)
|
13
|
+
base_class.extend(ClassMethods)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
# @return [Class{AbstractMetadata}]
|
20
|
+
#
|
21
|
+
# @since 0.1.0
|
22
|
+
def build_metadata(**metadata_attributes)
|
23
|
+
self.class.const_get(:Metadata).new(**metadata_attributes)
|
24
|
+
end
|
25
|
+
|
26
|
+
# @since 0.1.0
|
27
|
+
module ClassMethods
|
28
|
+
# @param child_class [Class]
|
29
|
+
#
|
30
|
+
# @since 0.1.0
|
31
|
+
def inherited(child_class)
|
32
|
+
child_class.const_set(:Metadata, Class.new(AbstractMetadata))
|
33
|
+
super
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param key [Symbol]
|
37
|
+
# @param type [EvilEvents::Shared::Types::Any]
|
38
|
+
# @return void
|
39
|
+
#
|
40
|
+
# @since 0.1.0
|
41
|
+
def metadata(key, type = EvilEvents::Types::Any)
|
42
|
+
const_get(:Metadata).attribute(key, type)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [Array<Symbol>]
|
46
|
+
#
|
47
|
+
# @since 0.1.0
|
48
|
+
def metadata_fields
|
49
|
+
const_get(:Metadata).attribute_names
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# TODO: refactor with EvilEvents::Core::Events::EventExtensions::MetadataExtendable
|
3
4
|
module EvilEvents::Core::Events::EventExtensions
|
4
5
|
# @api private
|
5
6
|
# @since 0.1.0
|
@@ -15,11 +16,11 @@ module EvilEvents::Core::Events::EventExtensions
|
|
15
16
|
|
16
17
|
private
|
17
18
|
|
18
|
-
# @return [AbstractPayload]
|
19
|
+
# @return [Class{AbstractPayload}]
|
19
20
|
#
|
20
21
|
# @since 0.1.0
|
21
|
-
def
|
22
|
-
self.class.const_get(:Payload)
|
22
|
+
def build_payload(**payload_attributes)
|
23
|
+
self.class.const_get(:Payload).new(**payload_attributes)
|
23
24
|
end
|
24
25
|
|
25
26
|
# @since 0.1.0
|
@@ -37,14 +38,14 @@ module EvilEvents::Core::Events::EventExtensions
|
|
37
38
|
# @return void
|
38
39
|
#
|
39
40
|
# @since 0.1.0
|
40
|
-
def
|
41
|
+
def payload(key, type = EvilEvents::Types::Any)
|
41
42
|
const_get(:Payload).attribute(key, type)
|
42
43
|
end
|
43
44
|
|
44
45
|
# @return [Array<Symbol>]
|
45
46
|
#
|
46
47
|
# @since 0.1.0
|
47
|
-
def
|
48
|
+
def payload_fields
|
48
49
|
const_get(:Payload).attribute_names
|
49
50
|
end
|
50
51
|
end
|
@@ -14,7 +14,7 @@ class EvilEvents::Core::Events::Serializers
|
|
14
14
|
def serialize(event)
|
15
15
|
raise SerializationError unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
|
16
16
|
|
17
|
-
{ type: event.type, payload: event.payload }
|
17
|
+
{ type: event.type, payload: event.payload, metadata: event.metadata }
|
18
18
|
end
|
19
19
|
|
20
20
|
# @param hash [::Hash]
|
@@ -24,13 +24,16 @@ class EvilEvents::Core::Events::Serializers
|
|
24
24
|
# @since 0.1.0
|
25
25
|
def deserialize(hash)
|
26
26
|
raise DeserializationError unless hash.is_a?(::Hash)
|
27
|
-
event_type
|
28
|
-
event_payload
|
29
|
-
|
30
|
-
raise DeserializationError unless event_payload
|
27
|
+
event_type = hash[:type] || hash['type']
|
28
|
+
event_payload = hash[:payload] || hash['payload'] # TODO: || {} here
|
29
|
+
event_metadata = hash[:metadata] || hash['metadata'] # TODO: || {} here
|
30
|
+
raise DeserializationError unless event_type && event_payload && event_metadata
|
31
|
+
raise DeserializationError unless event_payload.is_a?(::Hash) && event_metadata.is_a?(::Hash)
|
31
32
|
|
32
33
|
EvilEvents::BootPoint[:event_system].resolve_event_object(
|
33
|
-
event_type,
|
34
|
+
event_type,
|
35
|
+
payload: symbolized_event_data(event_payload),
|
36
|
+
metadata: symbolized_event_data(event_metadata)
|
34
37
|
)
|
35
38
|
end
|
36
39
|
|
@@ -38,12 +41,12 @@ class EvilEvents::Core::Events::Serializers
|
|
38
41
|
# @return [::Hash]
|
39
42
|
#
|
40
43
|
# @since 0.1.0
|
41
|
-
def
|
44
|
+
def symbolized_event_data(payload_hash)
|
42
45
|
payload_hash.each_pair.each_with_object({}) do |(key, value), result_hash|
|
43
46
|
result_hash[key.to_sym] = value
|
44
47
|
end
|
45
48
|
end
|
46
|
-
private_class_method :
|
49
|
+
private_class_method :symbolized_event_data
|
47
50
|
end
|
48
51
|
|
49
52
|
# @since 0.1.0
|
@@ -14,7 +14,7 @@ class EvilEvents::Core::Events::Serializers
|
|
14
14
|
def serialize(event)
|
15
15
|
raise SerializationError unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
|
16
16
|
|
17
|
-
::JSON.generate(type: event.type, payload: event.payload)
|
17
|
+
::JSON.generate(type: event.type, payload: event.payload, metadata: event.metadata)
|
18
18
|
end
|
19
19
|
|
20
20
|
# @param json [String]
|
@@ -26,15 +26,18 @@ class EvilEvents::Core::Events::Serializers
|
|
26
26
|
raise DeserializationError unless json.is_a?(String)
|
27
27
|
|
28
28
|
begin
|
29
|
-
json_hash
|
30
|
-
event_type
|
31
|
-
event_payload
|
32
|
-
|
29
|
+
json_hash = ::JSON.parse(json, symbolize_names: true)
|
30
|
+
event_type = json_hash[:type]
|
31
|
+
event_payload = json_hash[:payload] # TODO: || {} here
|
32
|
+
event_metadata = json_hash[:metadata] # TODO: || {} here
|
33
|
+
raise DeserializationError unless event_type && event_payload && event_metadata
|
33
34
|
rescue ::JSON::ParserError
|
34
35
|
raise DeserializationError
|
35
36
|
end
|
36
37
|
|
37
|
-
EvilEvents::BootPoint[:event_system].resolve_event_object(
|
38
|
+
EvilEvents::BootPoint[:event_system].resolve_event_object(
|
39
|
+
event_type, payload: event_payload, metadata: event_metadata
|
40
|
+
)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
@@ -13,6 +13,8 @@ module EvilEvents::Core
|
|
13
13
|
require_relative 'events/event_extensions/adapter_customizable'
|
14
14
|
require_relative 'events/event_extensions/observable'
|
15
15
|
require_relative 'events/event_extensions/serializable'
|
16
|
+
require_relative 'events/event_extensions/metadata_extendable'
|
17
|
+
require_relative 'events/event_extensions/metadata_extendable/abstract_metadata'
|
16
18
|
require_relative 'events/event_extensions/emittable'
|
17
19
|
require_relative 'events/abstract_event'
|
18
20
|
require_relative 'events/manager'
|
data/lib/evil_events/core.rb
CHANGED
@@ -106,6 +106,8 @@ module EvilEvents
|
|
106
106
|
__outer_context__.method(method_name)
|
107
107
|
when __required_context__.respond_to?(method_name)
|
108
108
|
__required_context__.method(method_name)
|
109
|
+
when ::Kernel.respond_to?(method_name)
|
110
|
+
::Kernel.method(method_name)
|
109
111
|
else
|
110
112
|
super
|
111
113
|
end
|
@@ -80,8 +80,8 @@ class EvilEvents::System
|
|
80
80
|
# @return [EvilEvents::Core::Events::AbstractEvent]
|
81
81
|
#
|
82
82
|
# @since 0.1.0
|
83
|
-
def resolve_event_object(event_type,
|
84
|
-
manager_of_event_type(event_type).event_class.new(
|
83
|
+
def resolve_event_object(event_type, payload: {}, metadata: {})
|
84
|
+
manager_of_event_type(event_type).event_class.new(payload: payload, metadata: metadata)
|
85
85
|
end
|
86
86
|
|
87
87
|
# @param event_class [EvilEvents::Core::Events::AbstractEvent]
|
@@ -57,7 +57,7 @@ class EvilEvents::System
|
|
57
57
|
|
58
58
|
# @see EvilEvents::System
|
59
59
|
# @since 0.1.0
|
60
|
-
def resolve_event_object(event_type,
|
60
|
+
def resolve_event_object(event_type, payload: {}, metadata: {}); end
|
61
61
|
|
62
62
|
# @see EvilEvents::System
|
63
63
|
# @since 0.1.0
|
data/lib/evil_events/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evil_events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.0rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-types
|
@@ -206,20 +206,22 @@ dependencies:
|
|
206
206
|
- - '='
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: 1.18.0
|
209
|
-
description:
|
210
|
-
a wide set of customization interfaces
|
209
|
+
description: Ultra simple, but very flexible and fully customizable event subsystem
|
210
|
+
for ruby applications with a wide set of customization interfaces and smart event
|
211
|
+
definition DSL.
|
211
212
|
email: iamdaiver@icloud.com
|
212
213
|
executables: []
|
213
214
|
extensions: []
|
214
215
|
extra_rdoc_files: []
|
215
216
|
files:
|
216
217
|
- ".gitignore"
|
218
|
+
- ".hound.yml"
|
219
|
+
- ".jrubyrc"
|
217
220
|
- ".rspec"
|
218
221
|
- ".rubocop.yml"
|
219
222
|
- ".travis.yml"
|
220
223
|
- ".yardopts"
|
221
224
|
- CHANGELOG.md
|
222
|
-
- CODE_OF_CONDUCT.md
|
223
225
|
- Gemfile
|
224
226
|
- LICENSE.txt
|
225
227
|
- README.md
|
@@ -231,7 +233,7 @@ files:
|
|
231
233
|
- lib/evil_events/boot_point.rb
|
232
234
|
- lib/evil_events/config.rb
|
233
235
|
- lib/evil_events/core.rb
|
234
|
-
- lib/evil_events/core/
|
236
|
+
- lib/evil_events/core/activity_logger.rb
|
235
237
|
- lib/evil_events/core/broadcasting.rb
|
236
238
|
- lib/evil_events/core/broadcasting/adapters.rb
|
237
239
|
- lib/evil_events/core/broadcasting/adapters/memory_async.rb
|
@@ -245,6 +247,8 @@ files:
|
|
245
247
|
- lib/evil_events/core/events/event_extensions/adapter_customizable.rb
|
246
248
|
- lib/evil_events/core/events/event_extensions/emittable.rb
|
247
249
|
- lib/evil_events/core/events/event_extensions/manageable.rb
|
250
|
+
- lib/evil_events/core/events/event_extensions/metadata_extendable.rb
|
251
|
+
- lib/evil_events/core/events/event_extensions/metadata_extendable/abstract_metadata.rb
|
248
252
|
- lib/evil_events/core/events/event_extensions/observable.rb
|
249
253
|
- lib/evil_events/core/events/event_extensions/payloadable.rb
|
250
254
|
- lib/evil_events/core/events/event_extensions/payloadable/abstract_payload.rb
|
@@ -296,8 +300,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
300
|
version: 1.3.1
|
297
301
|
requirements: []
|
298
302
|
rubyforge_project:
|
299
|
-
rubygems_version: 2.
|
303
|
+
rubygems_version: 2.6.14
|
300
304
|
signing_key:
|
301
305
|
specification_version: 4
|
302
|
-
summary: Event subsystem for
|
306
|
+
summary: Event subsystem for ruby applications
|
303
307
|
test_files: []
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at iamdaiver@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module EvilEvents::Core
|
4
|
-
# @api private
|
5
|
-
# @since 0.1.0
|
6
|
-
module ActivityLogging
|
7
|
-
# @param activity [String, NilClass]
|
8
|
-
# @param message [String, NilClass]
|
9
|
-
# @return void
|
10
|
-
#
|
11
|
-
# @since 0.1.0
|
12
|
-
def log_activity(activity: nil, message: nil)
|
13
|
-
progname = "[EvilEvents:#{activity}]"
|
14
|
-
activity_logger.add(activity_logger.level, message, progname)
|
15
|
-
end
|
16
|
-
|
17
|
-
# @return [Logger]
|
18
|
-
#
|
19
|
-
# @since 0.1.0
|
20
|
-
def activity_logger
|
21
|
-
EvilEvents::BootPoint[:config].logger
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|