processing 1.1.4 → 1.1.5
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/ChangeLog.md +5 -0
- data/VERSION +1 -1
- data/lib/processing/all.rb +11 -4
- data/lib/processing.rb +25 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8f47bfbe64ef981036e63d3764e68d0136d9279f155eda380484c5e82b09c0b
|
4
|
+
data.tar.gz: 8d73f1f9a94c04ebe2050007ab2a07c9ca5febae8611373af831b9b1ab30973b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38a551e8d521bd34f3c6fd41c554f3fc95cf33fee013e40b4142580cf679078d248d2fe00c5ee84d19a2f24b8108a9bfe6541678e103a59cd5bb845d8fd8006
|
7
|
+
data.tar.gz: 9b7fe7c09c8daee0e9d7e0fb44a1e9fe66a95145f20003614492480c2325a650ec860f263062e9b9f4b7defa92a89cd98a59eca446a034f912e48a5d2a95e960
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.5
|
data/lib/processing/all.rb
CHANGED
@@ -29,12 +29,19 @@ module Processing
|
|
29
29
|
|
30
30
|
window = Processing::Window.new(w, h) {start}
|
31
31
|
context = namespace::Context.new window
|
32
|
-
|
32
|
+
|
33
|
+
return window, context
|
34
|
+
end
|
35
|
+
|
36
|
+
# @private
|
37
|
+
def self.funcs__(context)
|
38
|
+
(context.methods - Object.instance_methods)
|
33
39
|
.reject {_1 =~ /__$/} # methods for internal use
|
34
|
-
|
35
|
-
.each.with_object({}) {|event, hash| hash[event] = -> {__send__ event}}
|
40
|
+
end
|
36
41
|
|
37
|
-
|
42
|
+
# @private
|
43
|
+
def self.events__(context)
|
44
|
+
to_snake_case__(EVENT_NAMES__).flatten.uniq.select {context.respond_to? _1}
|
38
45
|
end
|
39
46
|
|
40
47
|
# @private
|
data/lib/processing.rb
CHANGED
@@ -2,26 +2,35 @@ require 'processing/all'
|
|
2
2
|
|
3
3
|
|
4
4
|
module Processing
|
5
|
-
Processing.
|
6
|
-
|
7
|
-
WINDOW__, CONTEXT__, funcs, events = Processing.setup__ Processing
|
5
|
+
WINDOW__, CONTEXT__ = Processing.setup__ Processing
|
8
6
|
|
9
7
|
refine Object do
|
10
|
-
|
8
|
+
context = CONTEXT__
|
9
|
+
Processing.funcs__(context).each do |func|
|
11
10
|
define_method func do |*args, **kwargs, &block|
|
12
|
-
|
11
|
+
context.__send__ func, *args, **kwargs, &block
|
13
12
|
end
|
14
13
|
end
|
14
|
+
end
|
15
|
+
end# Processing
|
16
|
+
|
17
|
+
|
18
|
+
def Processing(snake_case: false)
|
19
|
+
return Processing unless snake_case
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
$processing_refinements_with_snake_case ||= Module.new do
|
22
|
+
Processing.alias_snake_case_methods__ Processing
|
23
|
+
|
24
|
+
refine Object do
|
25
|
+
context = Processing::CONTEXT__
|
26
|
+
Processing.funcs__(context).each do |func|
|
27
|
+
define_method func do |*args, **kwargs, &block|
|
28
|
+
context.__send__ func, *args, **kwargs, &block
|
29
|
+
end
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
24
|
-
end
|
33
|
+
end
|
25
34
|
|
26
35
|
|
27
36
|
begin
|
@@ -33,6 +42,11 @@ begin
|
|
33
42
|
|
34
43
|
w.__send__ :begin_draw
|
35
44
|
at_exit do
|
45
|
+
Processing.events__(c).each do |event|
|
46
|
+
m = begin method event; rescue NameError; nil end
|
47
|
+
c.__send__(event) {__send__ event} if m
|
48
|
+
end
|
49
|
+
|
36
50
|
w.__send__ :end_draw
|
37
51
|
Processing::App.new {w.show}.start if c.hasUserBlocks__ && !$!
|
38
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: processing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rexml
|