microevent 1.1.0 → 1.1.1
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 +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +9 -3
- data/README.md +9 -2
- data/Rakefile +41 -0
- data/lib/microevent.rb +3 -1
- data/microevent.gemspec +2 -1
- metadata +8 -8
- data/.travis.yml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2fb5c4d651245d3f8658996389c8dc59fe8f4c5703fb09063203b85d9fb2aa0f
|
4
|
+
data.tar.gz: d0bf7f138bb2058562792f641f711b5bcbcfffbf7869c0480a1052d76b439201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87adc99974e72f9f463a388e32e2fec5335e0d73e19aebd7a6fda37c849596f24505b5c4a209ce33ab72b6178cc735b51a03afcc593f8eaa03d85f4d9f078e16
|
7
|
+
data.tar.gz: 60e378d3135c886cd54abd0257a46a89b13204ce73f5aaf215259160bbf9a9a5bae5aae8d5d960f34a7e8197b331a53b5cae3f3e24f8e79701b013d124c76292
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
microevent
|
5
|
-
|
4
|
+
microevent (1.1.0)
|
5
|
+
added (~> 1.0.1)
|
6
|
+
thread_safe (~> 0.3.5)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
11
|
+
added (1.0.1)
|
12
|
+
minitest (5.5.1)
|
10
13
|
thread_safe (0.3.5)
|
14
|
+
thread_safe (0.3.5-java)
|
11
15
|
|
12
16
|
PLATFORMS
|
17
|
+
java
|
13
18
|
ruby
|
14
19
|
|
15
20
|
DEPENDENCIES
|
16
|
-
microevent
|
21
|
+
microevent!
|
22
|
+
minitest
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# MicroEvent.rb [![[version]](https://badge.fury.io/rb/microevent.svg)](
|
1
|
+
# MicroEvent.rb [![[version]](https://badge.fury.io/rb/microevent.svg)](https://badge.fury.io/rb/microevent) [![[CI]](https://github.com/janlelis/microevent.rb/workflows/Test/badge.svg)](https://github.com/janlelis/microevent.rb/actions?query=workflow%3ATest)
|
2
2
|
|
3
3
|
MicroEvent.rb is a event emitter library which provides the observer pattern to Ruby objects. It is inspired by [MicroEvent.js](https://github.com/jeromeetienne/microevent.js), implemented in less than [20 lines of Ruby](https://github.com/janlelis/microevent.rb/blob/master/lib/microevent.rb).
|
4
4
|
|
@@ -48,6 +48,13 @@ Klass.trigger :slot # => Go
|
|
48
48
|
|
49
49
|
You will find more examples in the [tests](https://github.com/janlelis/microevent.rb/blob/master/spec/microevent_spec.rb).
|
50
50
|
|
51
|
+
## Alternative Variants
|
52
|
+
|
53
|
+
* [threadsafe](https://github.com/janlelis/microevent.rb/tree/threadsafe) - Thread safe version
|
54
|
+
* [added](https://github.com/janlelis/microevent.rb/tree/added) - Thread safe version based on [added](https://github.com/janlelis/added) hook
|
55
|
+
* [min](https://github.com/janlelis/microevent.rb/tree/min) - 275 bytes version
|
56
|
+
|
57
|
+
|
51
58
|
## Projects Using MicroEvent.rb
|
52
59
|
|
53
60
|
* [micrologger](https://github.com/janlelis/micrologger)
|
@@ -55,4 +62,4 @@ You will find more examples in the [tests](https://github.com/janlelis/microeven
|
|
55
62
|
|
56
63
|
## MIT License
|
57
64
|
|
58
|
-
Ruby version by [Jan Lelis](
|
65
|
+
Ruby version by [Jan Lelis](https://janlelis.com). Inspired by [MicroEvent.js](https://github.com/jeromeetienne/microevent.js) by Jerome Etienne.
|
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# # #
|
2
|
+
# Get gemspec info
|
3
|
+
|
4
|
+
gemspec_file = Dir["*.gemspec"].first
|
5
|
+
gemspec = eval File.read(gemspec_file), binding, gemspec_file
|
6
|
+
info = "#{gemspec.name} | #{gemspec.version} | " \
|
7
|
+
"#{gemspec.runtime_dependencies.size} dependencies | " \
|
8
|
+
"#{gemspec.files.size} files"
|
9
|
+
|
10
|
+
# # #
|
11
|
+
# Gem build and install task
|
12
|
+
|
13
|
+
desc info
|
14
|
+
task :gem do
|
15
|
+
puts info + "\n\n"
|
16
|
+
print " "; sh "gem build #{gemspec_file}"
|
17
|
+
FileUtils.mkdir_p "pkg"
|
18
|
+
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
|
19
|
+
puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem}
|
20
|
+
end
|
21
|
+
|
22
|
+
# # #
|
23
|
+
# Start an IRB session with the gem loaded
|
24
|
+
|
25
|
+
desc "#{gemspec.name} | IRB"
|
26
|
+
task :irb do
|
27
|
+
sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}"
|
28
|
+
end
|
29
|
+
|
30
|
+
# # #
|
31
|
+
# Run specs
|
32
|
+
|
33
|
+
desc "#{gemspec.name} | Spec"
|
34
|
+
task :spec do
|
35
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
36
|
+
sh "for %f in (spec/\*.rb) do ruby spec/%f"
|
37
|
+
else
|
38
|
+
sh "for file in spec/*.rb; do ruby $file; done"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
task default: :spec
|
data/lib/microevent.rb
CHANGED
data/microevent.gemspec
CHANGED
@@ -9,11 +9,12 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.description = 'MicroEvent.rb is a event emitter library which provides the observer pattern to Ruby objects. It is inspired by MicroEvent.js and implemented in less than 20 lines of Ruby.'
|
10
10
|
gem.license = "MIT"
|
11
11
|
gem.authors = ["Jan Lelis"]
|
12
|
-
gem.email = "
|
12
|
+
gem.email = ["hi@ruby.consulting"]
|
13
13
|
gem.homepage = "https://github.com/janlelis/microevent.rb"
|
14
14
|
|
15
15
|
gem.files = Dir['{**/}{.*,*}'].select { |path| File.file?(path) }
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ['lib']
|
19
|
+
gem.metadata = { "rubygems_mfa_required" => "true" }
|
19
20
|
end
|
metadata
CHANGED
@@ -1,37 +1,39 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microevent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: MicroEvent.rb is a event emitter library which provides the observer
|
14
14
|
pattern to Ruby objects. It is inspired by MicroEvent.js and implemented in less
|
15
15
|
than 20 lines of Ruby.
|
16
|
-
email:
|
16
|
+
email:
|
17
|
+
- hi@ruby.consulting
|
17
18
|
executables: []
|
18
19
|
extensions: []
|
19
20
|
extra_rdoc_files: []
|
20
21
|
files:
|
21
22
|
- ".gitignore"
|
22
|
-
- ".travis.yml"
|
23
23
|
- CHANGELOG.md
|
24
24
|
- Gemfile
|
25
25
|
- Gemfile.lock
|
26
26
|
- MIT-LICENSE.txt
|
27
27
|
- README.md
|
28
|
+
- Rakefile
|
28
29
|
- lib/microevent.rb
|
29
30
|
- microevent.gemspec
|
30
31
|
- spec/microevent_spec.rb
|
31
32
|
homepage: https://github.com/janlelis/microevent.rb
|
32
33
|
licenses:
|
33
34
|
- MIT
|
34
|
-
metadata:
|
35
|
+
metadata:
|
36
|
+
rubygems_mfa_required: 'true'
|
35
37
|
post_install_message:
|
36
38
|
rdoc_options: []
|
37
39
|
require_paths:
|
@@ -47,12 +49,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
49
|
- !ruby/object:Gem::Version
|
48
50
|
version: '0'
|
49
51
|
requirements: []
|
50
|
-
|
51
|
-
rubygems_version: 2.4.5
|
52
|
+
rubygems_version: 3.2.22
|
52
53
|
signing_key:
|
53
54
|
specification_version: 4
|
54
55
|
summary: MicroEvent.rb is a event emitter library which provides the observer pattern
|
55
56
|
to Ruby objects.
|
56
57
|
test_files:
|
57
58
|
- spec/microevent_spec.rb
|
58
|
-
has_rdoc:
|