fxruby-enhancement 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/README.org +20 -0
- data/fxruby-enhancement.gemspec +3 -3
- data/lib/fxruby-enhancement/enhancement.rb +11 -3
- 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: b794b2f54a98c4013d5b65dac69a9941ed161e67
|
4
|
+
data.tar.gz: ed4a967374dede324ae343e9db62ee5a0f0c2f9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22536ce016e05481e0ac75d6be53eb04e57298961d42f88e73b6076ae17aed1660d8eaa6389aaa0cac050c581e8ade966b90baf303ac7d5537805e5ad1294a26
|
7
|
+
data.tar.gz: bbd2e87f25028ffc0b9b74ea7c4a17302ff833a0657411634b712cdd11b7383f16bdee6e90c6526a319ec3cd7e302accb4afbca57072d5916bb9d930d9a0254a
|
data/.semver
CHANGED
data/README.org
CHANGED
@@ -360,6 +360,25 @@
|
|
360
360
|
You may declare your ingress_handler anywhere in your code and have
|
361
361
|
the expected happen.
|
362
362
|
|
363
|
+
igress_handler may also be specified with more than one tag, for
|
364
|
+
instance:
|
365
|
+
#+begin_src ruby
|
366
|
+
ingress_handler :warn, :info, :error do |type, log|
|
367
|
+
case type
|
368
|
+
when :warn
|
369
|
+
...
|
370
|
+
when :info
|
371
|
+
...
|
372
|
+
when :error
|
373
|
+
...
|
374
|
+
else
|
375
|
+
raise "Unknown log type"
|
376
|
+
end
|
377
|
+
end
|
378
|
+
#+end_src
|
379
|
+
|
380
|
+
The same block is assigned to all the given tags of :warn, :info, and :error.
|
381
|
+
|
363
382
|
**** TODO deferred_setup
|
364
383
|
**** TODO Mapping between fx_* declarations and the FX* FXRuby objects
|
365
384
|
**** binding.fx
|
@@ -872,6 +891,7 @@ end
|
|
872
891
|
|---------+------------+---------------------------------------------------------|
|
873
892
|
| 0.0.2 | 2017-01-11 | Initial release |
|
874
893
|
| 0.0.3 | 2017-01-15 | Needed to require fox16/colors for FXColor to be loaded |
|
894
|
+
| 0.0.4 | 2017-01-16 | ingress_handler now handles multiple tags. |
|
875
895
|
|
876
896
|
** Known Issues
|
877
897
|
| Version | Date | Issues |
|
data/fxruby-enhancement.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: fxruby-enhancement 0.0.
|
5
|
+
# stub: fxruby-enhancement 0.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "fxruby-enhancement".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Fred Mitchell".freeze]
|
14
|
-
s.date = "2017-01-
|
14
|
+
s.date = "2017-01-16"
|
15
15
|
s.description = "The fxruby library is an excellent wrapper for the FOX toolkit. However, it reflects the\n C++-ness of FOX, rather than being more Ruby-like. As such, creating composed objects with\n it tends to be rather ugly and cumbersome.\n\n fxruby-enhancement is a wrapper for the wrapper, to \"rubyfy\" it and make it more easy to \n use for Rubyists. \n\n fxruby-enhancement is basically a DSL of sorts, and every effort has been taken to make \n it intuitive to use. Once you get the hang of it, you should be able to look at the FXRuby\n API documentation and infer the DSL construct for fxruby-enhancement.".freeze
|
16
16
|
s.email = "fred.mitchell@gmx.de".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -128,15 +128,23 @@ module Fox
|
|
128
128
|
alias_method :fxi, :fox_instance
|
129
129
|
|
130
130
|
# Handles incomming external messages of type given
|
131
|
-
# block, written by user, is called with |type, message
|
132
|
-
|
133
|
-
|
131
|
+
# block, written by user, is called with |type, message|.
|
132
|
+
# Zero or more symbols may be given,
|
133
|
+
# in which case the given block will
|
134
|
+
# be associated with all the given symbols.
|
135
|
+
def ingress_handler *types, &block
|
136
|
+
raise "No block given" unless block_given?
|
137
|
+
types = [:all] if types.empty?
|
138
|
+
types.each do |type|
|
139
|
+
Enhancement.ingress_map[type] = block
|
140
|
+
end
|
134
141
|
end
|
135
142
|
|
136
143
|
# This is invoked after we have
|
137
144
|
# a real application in place. Invocation
|
138
145
|
# of this is held off until the last possible
|
139
146
|
# moment.
|
147
|
+
# TODO: Not sure we need this. This may go away.
|
140
148
|
def deferred_setup &block
|
141
149
|
Enhancement.deferred_setups << block
|
142
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fxruby-enhancement
|
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
|
- Fred Mitchell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semver2
|