miru 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +52 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +5 -0
- data/README.md +2 -0
- data/lib/miru/event_dispatcher.rb +27 -0
- data/lib/miru/version.rb +3 -0
- data/lib/miru.rb +13 -0
- data/miru.gemspec +26 -0
- metadata +107 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 657320947fc25bc4be32fdca20b9a8a1d577c64eec61921298b12cbf4a95a20e
|
4
|
+
data.tar.gz: 99a6b3cfcedd3776fcb7f410b2785669319bbd301c287c8ce6e2d064f4884ad6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e855508a57e0d378b7780bf26706d83892cd16392e7c573f1c75ea155983ad80b462c8e033484951ac01e89694fd653ec896d09c30c14906e4c50291f52e3293
|
7
|
+
data.tar.gz: 6280cb1c88e8aa65e0993a40664fd6b773a552cfbfd60d0607d1056f6a712dc32acf1dcdaba5b31b240f5c5924cddf29af89623886838d6e2b212b93bf8ace4d
|
data/.gitignore
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
## Specific to RubyMotion:
|
17
|
+
.dat*
|
18
|
+
.repl_history
|
19
|
+
build/
|
20
|
+
*.bridgesupport
|
21
|
+
build-iPhoneOS/
|
22
|
+
build-iPhoneSimulator/
|
23
|
+
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
25
|
+
#
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
29
|
+
#
|
30
|
+
# vendor/Pods/
|
31
|
+
|
32
|
+
## Documentation cache and generated files:
|
33
|
+
/.yardoc/
|
34
|
+
/_yardoc/
|
35
|
+
/doc/
|
36
|
+
/rdoc/
|
37
|
+
|
38
|
+
## Environment normalization:
|
39
|
+
/.bundle/
|
40
|
+
/vendor/bundle
|
41
|
+
/lib/bundler/man/
|
42
|
+
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
45
|
+
Gemfile.lock
|
46
|
+
.ruby-version
|
47
|
+
.ruby-gemset
|
48
|
+
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
50
|
+
.rvmrc
|
51
|
+
|
52
|
+
.rspec_status
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Miru
|
2
|
+
module EventDispatcher
|
3
|
+
def add_event_listener(event_name, method)
|
4
|
+
@event_listeners ||= {}
|
5
|
+
@event_listeners[event_name] ||= []
|
6
|
+
|
7
|
+
if @event_listeners[event_name].include?(method)
|
8
|
+
raise StandardError.new("Listener already registered for event #{event_name}")
|
9
|
+
end
|
10
|
+
|
11
|
+
@event_listeners[event_name] << method
|
12
|
+
end
|
13
|
+
|
14
|
+
def remove_event_listener(event_name, method)
|
15
|
+
if @event_listeners.nil? || !@event_listeners.include?(event_name)
|
16
|
+
raise StandardError.new("No listeners registered for event #{event_name}")
|
17
|
+
end
|
18
|
+
|
19
|
+
@event_listeners[event_name].delete(method)
|
20
|
+
end
|
21
|
+
|
22
|
+
def dispatch_event(event_name, *args)
|
23
|
+
return unless @event_listeners && @event_listeners.has_key?(event_name)
|
24
|
+
@event_listeners[event_name].each { |f| f.call(*args) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/miru/version.rb
ADDED
data/lib/miru.rb
ADDED
data/miru.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'miru/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'miru'
|
7
|
+
spec.version = Miru::VERSION
|
8
|
+
spec.authors = ['John Tuttle']
|
9
|
+
spec.email = ['jtuttle.develops@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'An Entity Component System framework for Ruby'
|
12
|
+
spec.description = 'An Entity Component System framework for Ruby'
|
13
|
+
spec.homepage = 'https://github.com/jtuttle/miru'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
# use double quotes for "\x0" (https://github.com/bundler/bundler/issues/4133)
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 2.0.2'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
25
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.5.0'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: miru
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Tuttle
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.5.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.5.0
|
69
|
+
description: An Entity Component System framework for Ruby
|
70
|
+
email:
|
71
|
+
- jtuttle.develops@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- CHANGELOG.md
|
78
|
+
- Gemfile
|
79
|
+
- README.md
|
80
|
+
- lib/miru.rb
|
81
|
+
- lib/miru/event_dispatcher.rb
|
82
|
+
- lib/miru/version.rb
|
83
|
+
- miru.gemspec
|
84
|
+
homepage: https://github.com/jtuttle/miru
|
85
|
+
licenses:
|
86
|
+
- MIT
|
87
|
+
metadata: {}
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
requirements: []
|
103
|
+
rubygems_version: 3.0.6
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: An Entity Component System framework for Ruby
|
107
|
+
test_files: []
|