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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3c7b8e5a27a1d979f10f9f7111b0c1dab700078
4
- data.tar.gz: 2ecedc52cf7ec206590c7cc0a4646cd4c8f36c40
3
+ metadata.gz: b794b2f54a98c4013d5b65dac69a9941ed161e67
4
+ data.tar.gz: ed4a967374dede324ae343e9db62ee5a0f0c2f9c
5
5
  SHA512:
6
- metadata.gz: 960a428b033f972f812d4c4c28fa3932b2cc7322b6f3109230727c7a257697b2092f44d4123361cdbbcb96f4734481e6b3d67f22e57fbf0301c3e1eb2c66129b
7
- data.tar.gz: f34e2d2b3e1363e63dec4be1b04f9131e16af4f9c08063db207aa7c5e9ff317a20c329a1c86e8a7ab1ec8c5bc295c72c3dbeb4bc8908cc5345a6c5f76b8570e1
6
+ metadata.gz: 22536ce016e05481e0ac75d6be53eb04e57298961d42f88e73b6076ae17aed1660d8eaa6389aaa0cac050c581e8ade966b90baf303ac7d5537805e5ad1294a26
7
+ data.tar.gz: bbd2e87f25028ffc0b9b74ea7c4a17302ff833a0657411634b712cdd11b7383f16bdee6e90c6526a319ec3cd7e302accb4afbca57072d5916bb9d930d9a0254a
data/.semver CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 3
4
+ :patch: 4
5
5
  :special: ''
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 |
@@ -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.3 ruby lib
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.3"
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-15"
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
- def ingress_handler type = :all, &block
133
- Enhancement.ingress_map[type] = block
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.3
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-15 00:00:00.000000000 Z
11
+ date: 2017-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semver2