glimmer 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/glimmer.gemspec +4 -4
- data/lib/glimmer/data_binding/model_binding.rb +15 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8406be710971b09333b5620c761f4f2e8f462386f97c4921f945947ad6592967
|
4
|
+
data.tar.gz: b10c91c73e32356c3a8de92ad19f8364e2b1005fab08a0acc34db42bedadcdb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da71f67bc904f0141492508e3f084386e98bf4a148d24431672bbe96154dab20a08458cc64f647c1ea3d8204e0278d236917568f12b43c50e68e5a05b67304a0
|
7
|
+
data.tar.gz: 1d28c8c659c5a10621085e719586b0e096d17538550b868beb9fc1f31a2ddfa09093ee7832a420c00d0ebd81d5ff3c40f8730d6c96defebbc351c19e1aa6f38e
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
Related Change Logs:
|
4
4
|
- [glimmer-dsl-swt/CHANGELOG.md](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/CHANGELOG.md)
|
5
5
|
|
6
|
+
## 1.1.1
|
7
|
+
|
8
|
+
- Ensured after_read hook truly happens after notifying observers in ModelBinding
|
9
|
+
|
6
10
|
## 1.1.0
|
7
11
|
|
8
12
|
- ModelBinding hooks for before_read, after_read, before_write, after_write
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 style="position: relative; top: 20px;" />](https://rubygems.org/gems/glimmer) Glimmer
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 style="position: relative; top: 20px;" />](https://rubygems.org/gems/glimmer) Glimmer - DSL Framework for Ruby GUI and More
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
|
3
3
|
[![rspec](https://github.com/AndyObtiva/glimmer/workflows/rspec/badge.svg)](https://github.com/AndyObtiva/glimmer/actions?query=workflow%3Arspec)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer?branch=master)
|
@@ -38,7 +38,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
38
38
|
|
39
39
|
## Table of Contents
|
40
40
|
|
41
|
-
- [Glimmer
|
41
|
+
- [Glimmer](#-glimmer---dsl-framework-for-ruby-gui-and-more)
|
42
42
|
- [Official DSLs](#official-dsls)
|
43
43
|
- [Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)](#glimmer-dsl-for-swt-jruby-desktop-development-gui-framework)
|
44
44
|
- [Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)](#glimmer-dsl-for-opal-pure-ruby-web-gui-and-auto-webifier-of-desktop-apps)
|
@@ -403,9 +403,9 @@ shell {
|
|
403
403
|
caret nil
|
404
404
|
}
|
405
405
|
command_button('AC')
|
406
|
-
operation_button('ÃÃâ€Â
|
407
|
-
operation_button('ÃÃâ€Â
|
408
|
-
operation_button('ÃÃâ€
|
406
|
+
operation_button('÷')
|
407
|
+
operation_button('�')
|
408
|
+
operation_button('−')
|
409
409
|
(7..9).each { |number|
|
410
410
|
number_button(number)
|
411
411
|
}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/glimmer.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer 1.1.
|
5
|
+
# stub: glimmer 1.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer".freeze
|
9
|
-
s.version = "1.1.
|
9
|
+
s.version = "1.1.1"
|
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 = ["AndyMaleh".freeze]
|
14
|
-
s.date = "2021-02-
|
14
|
+
s.date = "2021-02-09"
|
15
15
|
s.description = "Glimmer is a Ruby DSL Framework consisting of a DSL Engine and an Observable/Observer/Data-Binding Library. Used in the Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), the Glimmer DSL for Tk (Ruby Desktop Development GUI Library), the Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps), the Glimmer DSL for XML (& HTML), and the Glimmer DSL for CSS.".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
|
48
48
|
s.licenses = ["MIT".freeze]
|
49
49
|
s.rubygems_version = "3.0.6".freeze
|
50
|
-
s.summary = "Glimmer
|
50
|
+
s.summary = "Glimmer - DSL Engine for Ruby GUI and More".freeze
|
51
51
|
|
52
52
|
if s.respond_to? :specification_version then
|
53
53
|
s.specification_version = 4
|
@@ -49,9 +49,7 @@ module Glimmer
|
|
49
49
|
def nested_models
|
50
50
|
@nested_models = [base_model]
|
51
51
|
model_property_names.reduce(base_model) do |reduced_model, nested_model_property_name|
|
52
|
-
if reduced_model.nil?
|
53
|
-
nil
|
54
|
-
else
|
52
|
+
if !reduced_model.nil?
|
55
53
|
invoke_property_reader(reduced_model, nested_model_property_name).tap do |new_reduced_model|
|
56
54
|
@nested_models << new_reduced_model
|
57
55
|
end
|
@@ -112,7 +110,10 @@ module Glimmer
|
|
112
110
|
property_name => Observer.proc do |new_value|
|
113
111
|
# Ensure reattaching observers when a higher level nested property is updated (e.g. person.address changes reattaches person.address.street observer)
|
114
112
|
add_observer(observer)
|
115
|
-
|
113
|
+
converted_value = evaluate_property
|
114
|
+
observer.call(converted_value).tap do
|
115
|
+
apply_processor(@binding_options[:after_read], converted_value)
|
116
|
+
end
|
116
117
|
end
|
117
118
|
)
|
118
119
|
end
|
@@ -127,7 +128,10 @@ module Glimmer
|
|
127
128
|
add_nested_observers(observer)
|
128
129
|
else
|
129
130
|
model_binding_observer = Observer.proc do |new_value|
|
130
|
-
|
131
|
+
converted_value = evaluate_property
|
132
|
+
observer.call(converted_value).tap do
|
133
|
+
apply_processor(@binding_options[:after_read], converted_value)
|
134
|
+
end
|
131
135
|
end
|
132
136
|
observer_registration = model_binding_observer.observe(model, property_name)
|
133
137
|
my_registration = observer.registration_for(self)
|
@@ -152,7 +156,10 @@ module Glimmer
|
|
152
156
|
@computed_observer_collection ||= Concurrent::Hash.new
|
153
157
|
unless @computed_observer_collection.has_key?(observer)
|
154
158
|
@computed_observer_collection[observer] = Observer.proc do |new_value|
|
155
|
-
|
159
|
+
converted_value = evaluate_property
|
160
|
+
observer.call(converted_value).tap do
|
161
|
+
apply_processor(@binding_options[:after_read], converted_value)
|
162
|
+
end
|
156
163
|
end
|
157
164
|
end
|
158
165
|
@computed_observer_collection[observer]
|
@@ -201,9 +208,7 @@ module Glimmer
|
|
201
208
|
value = nil
|
202
209
|
value = invoke_property_reader(model, property_name) unless model.nil?
|
203
210
|
apply_processor(@binding_options[:before_read], value)
|
204
|
-
|
205
|
-
apply_processor(@binding_options[:after_read], converted_value)
|
206
|
-
converted_value
|
211
|
+
convert_on_read(value)
|
207
212
|
end
|
208
213
|
|
209
214
|
def evaluate_options_property
|
@@ -256,7 +261,6 @@ module Glimmer
|
|
256
261
|
raise "Cannot invoke `#{property_expression}` because ModelBinding#binding_options[:read_only]=true" if @binding_options[:read_only]
|
257
262
|
apply_processor(@binding_options[:before_write], value)
|
258
263
|
converted_value = convert_on_write(value)
|
259
|
-
apply_processor(@binding_options[:after_write], converted_value)
|
260
264
|
if property_indexed?(property_expression)
|
261
265
|
property_method = '[]='
|
262
266
|
property_argument = property_expression[1...-2]
|
@@ -265,6 +269,7 @@ module Glimmer
|
|
265
269
|
else
|
266
270
|
object.send(property_expression, converted_value)
|
267
271
|
end
|
272
|
+
apply_processor(@binding_options[:after_write], converted_value)
|
268
273
|
end
|
269
274
|
end
|
270
275
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer
|
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
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -286,5 +286,5 @@ requirements: []
|
|
286
286
|
rubygems_version: 3.0.6
|
287
287
|
signing_key:
|
288
288
|
specification_version: 4
|
289
|
-
summary: Glimmer
|
289
|
+
summary: Glimmer - DSL Engine for Ruby GUI and More
|
290
290
|
test_files: []
|