glimmer 2.5.4 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +56 -12
- data/VERSION +1 -1
- data/glimmer.gemspec +91 -90
- data/lib/glimmer/data_binding/model_binding.rb +3 -3
- data/lib/glimmer/data_binding/shine.rb +1 -1
- data/lib/glimmer/dsl/shine_data_binding_expression.rb +39 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9732781d2374eced24ceef11e7b403f0345e63b71e34f35a6c322580b0323123
|
4
|
+
data.tar.gz: f3421f6c71847386eba06848ab2039e62032a3636528bb07ee5ee809f6ea19fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9ebb4484cc2cc7379c4d27c77fe451b9a884201af50dacbb533cdfc420f4a523a44bac16a34df17c28cee1a1f9e9058d69ec0ef4301994c2944f5899827a785
|
7
|
+
data.tar.gz: 607cc126a4193fa251c163794d5a19dbb96fe23b604721695c2a57b8bf22352bd3f209ad612c1b0c5211262ce1d196248a056919901a2e4fc3de810a14d1f3c4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,13 @@
|
|
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
|
+
### 2.5.5
|
7
|
+
|
8
|
+
- Support observing an array object index directly (e.g. `ModelBinding.new(array, '[0]')` as opposed to `ModelBinding.new(self, 'array[0]')`)
|
9
|
+
- Extract Shine data-binding expression from Glimmer DSL for SWT to Glimmer as a reusable class: `Glimmer::DSL::ShineDataBindingExpression`
|
10
|
+
- Avoid compacting model with property in `ModelBinding` yet only compact property/args and keep model as is get a better error message in the case of a `nil` model
|
11
|
+
- Document data-binding options like on_read, after_read, etc...
|
12
|
+
|
6
13
|
### 2.5.4
|
7
14
|
|
8
15
|
- `Glimmer::DataBinding::ObservableModel` support for observing model attributes with specified `:attribute_writer_type` option (default: `:attribute=`), which can be a single symbol or an array (e.g. `attribute_writer_type: [:attribute=, :set_attribute]`). Glimmer automatches attribute name and automatically generates observer notification attribute writer methods.
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
16
16
|
|
17
17
|
[**Glimmer**](https://rubygems.org/gems/glimmer) is a DSL (Domain-Specific Language) Framework that consists of two things:
|
18
18
|
- [DSL Engine](#dsl-engine): enables building internal DSLs embedded in Ruby (e.g. for GUI, XML, or CSS).
|
19
|
-
- [Data-Binding Library](#data-binding-library): enables synchronizing GUI with Model Attributes bidirectionally **(now with [Shine](
|
19
|
+
- [Data-Binding Library](#data-binding-library): enables synchronizing GUI with Model Attributes bidirectionally **(now with [Shine](#shine-data-binding-syntax) syntax support in v2)**.
|
20
20
|
|
21
21
|
[**Glimmer**](https://rubygems.org/gems/glimmer) is ***the cream of the crop*** when it comes to building DSLs in Ruby:
|
22
22
|
- Supports building the tersest most concise domain specific language syntax in Ruby.
|
@@ -27,7 +27,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
27
27
|
- Multiple DSLs may be [mixed](#multi-dsl-support) together safely to achieve maximum expressability, composability, and productivity.
|
28
28
|
- DSLs are fully configurable, so you may activate and deactivate DSLs as per your current needs only.
|
29
29
|
|
30
|
-
Start by checking out Glimmer's original GUI DSL, which got extracted into its own gem
|
30
|
+
Start by checking out Glimmer's original GUI DSL (for [JRuby](https://www.jruby.org/)), which got extracted into its own gem (100% complete); [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt), and Glimmer's CRuby GUI DSL (100% complete), which has no prerequisites beyond installing the Ruby gem; [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui).
|
31
31
|
|
32
32
|
[**Glimmer**](https://rubygems.org/gems/glimmer) supports the following DSLs:
|
33
33
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
@@ -99,7 +99,7 @@ The Glimmer DSL Engine's architecture is based on the following Design Patterns
|
|
99
99
|
- **Stack Data Structure**: to handle processing parent/child nesting of DSL keyword expressions in the correct order
|
100
100
|
- **Proxy Design Pattern**: to shield consumers of GUI libraries built with Glimmer from low-level GUI widget details
|
101
101
|
|
102
|
-
Glimmer's use of the **Interpreter Design Pattern** in processing DSLs is also known as the **Virtual Machine Architectural Style**. After all, DSL expressions are virtual machine opcodes that process nested keywords stored in a stack. I built Glimmer's original DSL back in 2007 without knowing the **Virtual Machine Architectural Style** (except perhaps as an esoteric technology powering Java), but stumbled upon it anyways through following the Gang of Four Design Patterns mentioned above, chiefly the **Interpreter Design Pattern**.
|
102
|
+
Glimmer's use of the **Interpreter Design Pattern** in processing DSLs is also known as the **Virtual Machine Architectural Style**. After all, DSL expressions are virtual machine opcodes that process nested keywords stored in a stack. I built Glimmer's original DSL back in 2007 without knowing the **Virtual Machine Architectural Style** (except perhaps as an esoteric technology powering Java), but stumbled upon it anyways through following the Gang of Four Design Patterns mentioned above, chiefly the **Interpreter Design Pattern** and the **Chain of Responsibility Design Pattern**.
|
103
103
|
|
104
104
|
Every keyword in a Glimmer DSL is represented by a DSL expression that is processed by an `Expression` subclass selected from a chain of expressions (interpreters) pre-configured in a DSL chain of responsibility via `Glimmer::DSL::Engine.add_dynamic_expressions(DSLNameModule, expression_names_array)`.
|
105
105
|
|
@@ -177,9 +177,11 @@ module Glimmer
|
|
177
177
|
end
|
178
178
|
```
|
179
179
|
|
180
|
-
|
181
|
-
|
182
|
-
|
180
|
+
Extra convenience expression mixins/superclasses for use via inclusion/subclassing in Glimmer GUI libraries:
|
181
|
+
- `Glimmer::DSL::BindExpression`: enables usage of `bind` data-binding keyword to build a `Glimmer::DataBinding::ModelBinding` object for [data-binding](#data-binding) purposes.
|
182
|
+
- `Glimmer::DSL::ShineDataBindingExpression`: enables [Shine data-binding syntax](#shine-data-binding-syntax) via `Glimmer::DataBinding::Shine`, a facade for the `bind` keyword, hiding it with the `<=>` operator for bidirectional (two-way) data-binding and the `<=` operator for unidirectional (one-way) data-binding.
|
183
|
+
- `Glimmer::DSL::ObserveExpression`: enables a one-way `observe` operation.
|
184
|
+
You may learn more about them by looking at how [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) uses them.
|
183
185
|
|
184
186
|
DSL expressions go into the `glimmer/dsl/{dsl_name}` namespace directory.
|
185
187
|
|
@@ -230,7 +232,7 @@ end
|
|
230
232
|
### Setup
|
231
233
|
|
232
234
|
Follow these steps to author a [Glimmer](https://rubygems.org/gems/glimmer) DSL:
|
233
|
-
- Add `gem 'glimmer', '~> 2.5.
|
235
|
+
- Add `gem 'glimmer', '~> 2.5.5'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.5.5` and add `require 'glimmer'`
|
234
236
|
- Create `glimmer/dsl/[dsl_name]/dsl.rb`, which requires and adds all dynamic expressions for the [dsl_name] Glimmer DSL module as per the code shown in the previous section (or [Official DSLs](#official-dsls) as examples)
|
235
237
|
- Create `glimmer/dsl/[dsl_name]/[expresion_name]_expresion.rb` for every [expresion_name] expression needed, whether dynamic or static
|
236
238
|
|
@@ -756,9 +758,7 @@ You should see "Apple Calculator Theme"
|
|
756
758
|
|
757
759
|
#### Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
758
760
|
|
759
|
-
[Tcl/Tk](https://www.tcl.tk/) has
|
760
|
-
|
761
|
-
Additionally, [Ruby](https://www.ruby-lang.org/en/) 3.0 Ractor (formerly known as [Guilds](https://olivierlacan.com/posts/concurrency-in-ruby-3-with-guilds/)) supports truly parallel multi-threading, making both [MRI](https://github.com/ruby/ruby) and [Tk](https://www.tcl.tk/) finally viable for support in [Glimmer](https://github.com/AndyObtiva/glimmer) (Ruby Desktop Development GUI Library) as an alternative to [JRuby on SWT](https://github.com/AndyObtiva/glimmer-dsl-swt).
|
761
|
+
[Tcl/Tk](https://www.tcl.tk/) has recently improved by gaining native looking themed widgets on Mac, Windows, and Linux in [Tk version 8.5](https://www.tcl.tk/software/tcltk/8.5.html#:~:text=Highlights%20of%20Tk%208.5&text=Font%20rendering%3A%20Now%20uses%20anti,and%20window%20layout%2C%20and%20more.). Additionally, [Ruby](https://www.ruby-lang.org/en/) 3.0 Ractor (formerly known as [Guilds](https://olivierlacan.com/posts/concurrency-in-ruby-3-with-guilds/)) supports truly parallel multi-threading, making both [MRI](https://github.com/ruby/ruby) and [Tk](https://www.tcl.tk/) finally viable for support in [Glimmer](https://github.com/AndyObtiva/glimmer) (Ruby Desktop Development GUI Library) as an alternative to [JRuby on SWT](https://github.com/AndyObtiva/glimmer-dsl-swt).
|
762
762
|
|
763
763
|
The trade-off is that while [SWT](https://www.eclipse.org/swt/) provides a plethora of high quality reusable widgets for the Enterprise (such as [Nebula](https://www.eclipse.org/nebula/)), [Tk](https://www.tcl.tk/) enables very fast app startup time and a small memory footprint via [MRI Ruby](https://www.ruby-lang.org/en/).
|
764
764
|
|
@@ -1191,7 +1191,7 @@ These are the main classes concerning data-binding:
|
|
1191
1191
|
- `Glimmer::DataBinding::ObservableArray`: Mixin module for any observable array collection that automatically handles notifying observers upon performing array mutation operations (e.g. `push`, `select!`, or `delete`) recursively (meaning if an array contained arrays and they changed, observers are notified). Accepts `recursive: true` option in `add_observer` method to recursively observe nested arrays all the way down. Alternatively, pass `recursive: [integer]` to limit recursion in `Array` observation to a specific number of levels beyond the first level (which is always included).
|
1192
1192
|
- `Glimmer::DataBinding::ObservableHash`: Mixin module for any observable hash that automatically handles notifying observers upon performing hash mutation operations (e.g. `hash[key]=value`, `select!`, `merge!`). Also, it automatically handles observing array values using `ObservableArray` appropriately so they would notify observers upon array mutation changes.
|
1193
1193
|
- `Glimmer::DataBinding::ModelBinding`: a higher-level abstraction that relies on all the other observer/observable classes to support basic data-binding, nested data-binding, and computed data-binding
|
1194
|
-
- `Glimmer::DataBinding::Shine`: enables highly intuitive and visually expressive syntax to perform bidirectional (two-way) data-binding with `<=>` and unidirectional (one-way) data-binding with `<=`
|
1194
|
+
- `Glimmer::DataBinding::Shine`: enables [highly intuitive and visually expressive syntax](#shine-data-binding-syntax) to perform bidirectional (two-way) data-binding with `<=>` and unidirectional (one-way) data-binding with `<=`
|
1195
1195
|
|
1196
1196
|
To do simple observation of models, arrays, or hashes, you can use the `Glimmer::DataBinding::Observer::proc` method, which builds an observer from a block. When invoking the `#observe` method on it, it automatically enhances the object argument being observed into an `Observable` (whether `ObservableModel`, `ObservableArray`, or `ObervableHash`).
|
1197
1197
|
|
@@ -1253,12 +1253,56 @@ ModelBinding.new(model, "grid[5][7]").add_observer do |new_grid_cell_value|
|
|
1253
1253
|
end
|
1254
1254
|
```
|
1255
1255
|
|
1256
|
-
|
1256
|
+
Data-bound `ModelBinding` attribute can be:
|
1257
|
+
- **Direct:** `Symbol` representing attribute reader/writer (e.g. `[person, :name`])
|
1258
|
+
- **Nested:** `String` representing nested attribute path (e.g. `[company, 'address.street']`). That results in "nested data-binding"
|
1259
|
+
- **Indexed:** `String` containing array attribute index (e.g. `[customer, 'addresses[0].street']`). That results in "indexed data-binding"
|
1260
|
+
|
1261
|
+
Data-binding options include:
|
1262
|
+
- `before_read {|value| ...}`: performs an operation before reading data from Model to update View.
|
1263
|
+
- `on_read {|value| ...}`: converts value read from Model to update the View.
|
1264
|
+
- `after_read {|converted_value| ...}`: performs an operation after read from Model to update View.
|
1265
|
+
- `before_write {|value| ...}`: performs an operation before writing data to Model from View.
|
1266
|
+
- `on_write {|value| ...}`: converts value read from View to update the Model.
|
1267
|
+
- `after_write {|converted_value| ...}`: performs an operation after writing to Model from View.
|
1268
|
+
- `computed_by attribute` or `computed_by [attribute1, attribute2, ...]`: indicates model attribute is computed from specified attribute(s), thus updated when they are updated. That is known as "computed data-binding".
|
1269
|
+
|
1270
|
+
Note that if an observed model attribute or hash key is an `Array`, it is automatically observed for `Array` changes (e.g. via mutation methods `<<`, `delete`, `map!`), not just attribute/key-value changes.
|
1257
1271
|
|
1258
1272
|
All of the features above make Glimmer's data-binding library one of the most sophisticated and advanced in the industry since it automates everything instead of requiring endless manual configuration, thus resulting in some of the tersest most declarative syntax for using observers and data-binding.
|
1259
1273
|
|
1260
1274
|
You may learn more by looking into [data-binding specs](/Users/andy/code/glimmer/spec/lib/glimmer/data_binding) as well as [Data-Binding](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#data-binding) and [Observer](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#observer) usage in [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt)
|
1261
1275
|
|
1276
|
+
### Shine Data-Binding Syntax
|
1277
|
+
|
1278
|
+
The Shine data-binding syntax is a highly intuitive and visually expressive way of data-binding that enables performing bidirectional (two-way) data-binding with the `<=>` operator and unidirectional (one-way) data-binding with the `<=` operator.
|
1279
|
+
|
1280
|
+
It is facilitated by the combination of the `Glimmer::DSL::ShineDataBindingExpression` and `Glimmer::DataBinding::Shine` classes, which depend on `Glimmer::DSL::BindExpression` and `Glimmer::DataBinding::ModelBinding`.
|
1281
|
+
|
1282
|
+
Below are some examples of Shine usage in GUI DSLs:
|
1283
|
+
|
1284
|
+
`text <=> [contact, :first_name]`
|
1285
|
+
|
1286
|
+
This example bidirectionally binds the text property of a widget like label to the first name of a contact model.
|
1287
|
+
|
1288
|
+
`text <=> [contact, 'address.street']`
|
1289
|
+
|
1290
|
+
This example binds the text property of a widget like label to the nested street of the address of a contact. This is called nested property data binding.
|
1291
|
+
|
1292
|
+
`text <=> [contact, 'address.street', on_read: :upcase, on_write: :downcase]`
|
1293
|
+
|
1294
|
+
This example adds on the one above it by specifying converters on read and write of the model property, like in the case of a text widget. The text widget will then displays the street upper case and the model will store it lower case. When specifying converters, read and write operations must be symmetric.
|
1295
|
+
|
1296
|
+
`enabled <= [user, :logged_in]`
|
1297
|
+
|
1298
|
+
This example unidirectionally binds the enabled property of a widget like button to the logged in status of a user.
|
1299
|
+
|
1300
|
+
`enabled <= [user, :logged_in, on_read: :!]`
|
1301
|
+
|
1302
|
+
This example unidirectionally binds the enabled property of a widget like entry to the negated logged in status of a user. Note that when using a single on read converter with unidirectional data-binding, there is no need for a symmetric on_write converter as well since writing is never done with unidirectional (one-way) data-binding.
|
1303
|
+
|
1304
|
+
[Learn more about Shine data-binding syntax from its usage in Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine)
|
1305
|
+
|
1262
1306
|
## Glimmer Process
|
1263
1307
|
|
1264
1308
|
[Glimmer Process](PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.5
|
data/glimmer.gemspec
CHANGED
@@ -1,90 +1,91 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer 2.5.
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "glimmer".freeze
|
9
|
-
s.version = "2.5.
|
10
|
-
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib".freeze]
|
13
|
-
s.authors = ["AndyMaleh".freeze]
|
14
|
-
s.date = "
|
15
|
-
s.description = "Glimmer is a Ruby DSL Framework for Ruby GUI and More, consisting of a DSL Engine and an Observable / Observer / Data-Binding Library (including Observable Model, Observable Array, and Observable Hash). Used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps), Glimmer DSL for Tk (Ruby Desktop Development GUI Library), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.".freeze
|
16
|
-
s.email = "andy.am@gmail.com".freeze
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"CHANGELOG.md",
|
19
|
-
"LICENSE.txt",
|
20
|
-
"README.md"
|
21
|
-
]
|
22
|
-
s.files = [
|
23
|
-
"CHANGELOG.md",
|
24
|
-
"CONTRIBUTING.md",
|
25
|
-
"LICENSE.txt",
|
26
|
-
"PROCESS.md",
|
27
|
-
"README.md",
|
28
|
-
"VERSION",
|
29
|
-
"glimmer.gemspec",
|
30
|
-
"lib/glimmer.rb",
|
31
|
-
"lib/glimmer/config.rb",
|
32
|
-
"lib/glimmer/data_binding/model_binding.rb",
|
33
|
-
"lib/glimmer/data_binding/observable.rb",
|
34
|
-
"lib/glimmer/data_binding/observable_array.rb",
|
35
|
-
"lib/glimmer/data_binding/observable_hash.rb",
|
36
|
-
"lib/glimmer/data_binding/observable_hashable.rb",
|
37
|
-
"lib/glimmer/data_binding/observable_model.rb",
|
38
|
-
"lib/glimmer/data_binding/observer.rb",
|
39
|
-
"lib/glimmer/data_binding/shine.rb",
|
40
|
-
"lib/glimmer/dsl/bind_expression.rb",
|
41
|
-
"lib/glimmer/dsl/engine.rb",
|
42
|
-
"lib/glimmer/dsl/expression.rb",
|
43
|
-
"lib/glimmer/dsl/expression_handler.rb",
|
44
|
-
"lib/glimmer/dsl/observe_expression.rb",
|
45
|
-
"lib/glimmer/dsl/parent_expression.rb",
|
46
|
-
"lib/glimmer/dsl/
|
47
|
-
"lib/glimmer/dsl/
|
48
|
-
"lib/glimmer/
|
49
|
-
"lib/glimmer/
|
50
|
-
"lib/glimmer/
|
51
|
-
"lib/glimmer/
|
52
|
-
|
53
|
-
|
54
|
-
s.
|
55
|
-
s.
|
56
|
-
s.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
s.add_runtime_dependency(%q<
|
65
|
-
s.
|
66
|
-
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
67
|
-
s.add_development_dependency(%q<
|
68
|
-
s.add_development_dependency(%q<
|
69
|
-
s.add_development_dependency(%q<
|
70
|
-
s.add_development_dependency(%q<
|
71
|
-
s.add_development_dependency(%q<
|
72
|
-
s.add_development_dependency(%q<
|
73
|
-
s.add_development_dependency(%q<simplecov
|
74
|
-
s.add_development_dependency(%q<
|
75
|
-
|
76
|
-
|
77
|
-
s.add_dependency(%q<
|
78
|
-
s.add_dependency(%q<
|
79
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
80
|
-
s.add_dependency(%q<
|
81
|
-
s.add_dependency(%q<
|
82
|
-
s.add_dependency(%q<
|
83
|
-
s.add_dependency(%q<
|
84
|
-
s.add_dependency(%q<
|
85
|
-
s.add_dependency(%q<
|
86
|
-
s.add_dependency(%q<simplecov
|
87
|
-
s.add_dependency(%q<
|
88
|
-
|
89
|
-
end
|
90
|
-
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: glimmer 2.5.5 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "glimmer".freeze
|
9
|
+
s.version = "2.5.5"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["AndyMaleh".freeze]
|
14
|
+
s.date = "2022-01-09"
|
15
|
+
s.description = "Glimmer is a Ruby DSL Framework for Ruby GUI and More, consisting of a DSL Engine and an Observable / Observer / Data-Binding Library (including Observable Model, Observable Array, and Observable Hash). Used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps), Glimmer DSL for Tk (Ruby Desktop Development GUI Library), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.".freeze
|
16
|
+
s.email = "andy.am@gmail.com".freeze
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"CHANGELOG.md",
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md"
|
21
|
+
]
|
22
|
+
s.files = [
|
23
|
+
"CHANGELOG.md",
|
24
|
+
"CONTRIBUTING.md",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"PROCESS.md",
|
27
|
+
"README.md",
|
28
|
+
"VERSION",
|
29
|
+
"glimmer.gemspec",
|
30
|
+
"lib/glimmer.rb",
|
31
|
+
"lib/glimmer/config.rb",
|
32
|
+
"lib/glimmer/data_binding/model_binding.rb",
|
33
|
+
"lib/glimmer/data_binding/observable.rb",
|
34
|
+
"lib/glimmer/data_binding/observable_array.rb",
|
35
|
+
"lib/glimmer/data_binding/observable_hash.rb",
|
36
|
+
"lib/glimmer/data_binding/observable_hashable.rb",
|
37
|
+
"lib/glimmer/data_binding/observable_model.rb",
|
38
|
+
"lib/glimmer/data_binding/observer.rb",
|
39
|
+
"lib/glimmer/data_binding/shine.rb",
|
40
|
+
"lib/glimmer/dsl/bind_expression.rb",
|
41
|
+
"lib/glimmer/dsl/engine.rb",
|
42
|
+
"lib/glimmer/dsl/expression.rb",
|
43
|
+
"lib/glimmer/dsl/expression_handler.rb",
|
44
|
+
"lib/glimmer/dsl/observe_expression.rb",
|
45
|
+
"lib/glimmer/dsl/parent_expression.rb",
|
46
|
+
"lib/glimmer/dsl/shine_data_binding_expression.rb",
|
47
|
+
"lib/glimmer/dsl/static_expression.rb",
|
48
|
+
"lib/glimmer/dsl/top_level_expression.rb",
|
49
|
+
"lib/glimmer/error.rb",
|
50
|
+
"lib/glimmer/ext/module.rb",
|
51
|
+
"lib/glimmer/invalid_keyword_error.rb",
|
52
|
+
"lib/glimmer/shim/concurrent.rb"
|
53
|
+
]
|
54
|
+
s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
|
55
|
+
s.licenses = ["MIT".freeze]
|
56
|
+
s.rubygems_version = "3.3.1".freeze
|
57
|
+
s.summary = "Glimmer - DSL Engine for Ruby GUI and More".freeze
|
58
|
+
|
59
|
+
if s.respond_to? :specification_version then
|
60
|
+
s.specification_version = 4
|
61
|
+
end
|
62
|
+
|
63
|
+
if s.respond_to? :add_runtime_dependency then
|
64
|
+
s.add_runtime_dependency(%q<array_include_methods>.freeze, ["~> 1.4.0"])
|
65
|
+
s.add_runtime_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
|
66
|
+
s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
67
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
68
|
+
s.add_development_dependency(%q<puts_debuggerer>.freeze, ["~> 0.13"])
|
69
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
70
|
+
s.add_development_dependency(%q<jeweler>.freeze, [">= 2.0.0", "< 3.0.0"])
|
71
|
+
s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
|
72
|
+
s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
|
73
|
+
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
|
74
|
+
s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
75
|
+
s.add_development_dependency(%q<rake-tui>.freeze, ["> 0"])
|
76
|
+
else
|
77
|
+
s.add_dependency(%q<array_include_methods>.freeze, ["~> 1.4.0"])
|
78
|
+
s.add_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
|
79
|
+
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
80
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
81
|
+
s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.13"])
|
82
|
+
s.add_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
83
|
+
s.add_dependency(%q<jeweler>.freeze, [">= 2.0.0", "< 3.0.0"])
|
84
|
+
s.add_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
|
85
|
+
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
|
86
|
+
s.add_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
|
87
|
+
s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
88
|
+
s.add_dependency(%q<rake-tui>.freeze, ["> 0"])
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
@@ -75,7 +75,7 @@ module Glimmer
|
|
75
75
|
# If there are any indexed property names, this returns indexes as properties.
|
76
76
|
# e.g. property name expression "addresses[1].state" gives ['addresses', '[1]', 'state']
|
77
77
|
def nested_property_names
|
78
|
-
@nested_property_names ||= Concurrent::Array.new(property_name_expression.split(/\[|\./).map {|pne| pne.end_with?(']') ? "[#{pne}" : pne })
|
78
|
+
@nested_property_names ||= Concurrent::Array.new(property_name_expression.split(/\[|\./).map {|pne| pne.end_with?(']') ? "[#{pne}" : pne }.reject {|pne| pne.empty? })
|
79
79
|
end
|
80
80
|
|
81
81
|
# Final nested property name
|
@@ -85,7 +85,7 @@ module Glimmer
|
|
85
85
|
end
|
86
86
|
|
87
87
|
# Model representing nested property names
|
88
|
-
# e.g. property name expression "address.state" gives [
|
88
|
+
# e.g. property name expression "address.state" gives ['address']
|
89
89
|
def model_property_names
|
90
90
|
Concurrent::Array.new(nested_property_names[0...-1])
|
91
91
|
end
|
@@ -137,7 +137,7 @@ module Glimmer
|
|
137
137
|
apply_processor(@binding_options[:after_read], converted_value)
|
138
138
|
end
|
139
139
|
end
|
140
|
-
observer_registration = model_binding_observer.observe(*[model
|
140
|
+
observer_registration = model_binding_observer.observe(*([model] + [property_name, observation_options].compact))
|
141
141
|
my_registration = observer.registration_for(self)
|
142
142
|
observer.add_dependent(my_registration => observer_registration)
|
143
143
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright (c) 2007-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/dsl/expression'
|
23
|
+
require 'glimmer/data_binding/shine'
|
24
|
+
|
25
|
+
module Glimmer
|
26
|
+
module DSL
|
27
|
+
class ShineDataBindingExpression < Expression
|
28
|
+
# Including class can override can_interpret? and call super to augment it
|
29
|
+
def can_interpret?(parent, keyword, *args, &block)
|
30
|
+
args.size == 0 and
|
31
|
+
block.nil?
|
32
|
+
end
|
33
|
+
|
34
|
+
def interpret(parent, keyword, *args, &block)
|
35
|
+
Glimmer::DataBinding::Shine.new(parent, keyword)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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: 2.5.
|
4
|
+
version: 2.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: array_include_methods
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- lib/glimmer/dsl/expression_handler.rb
|
242
242
|
- lib/glimmer/dsl/observe_expression.rb
|
243
243
|
- lib/glimmer/dsl/parent_expression.rb
|
244
|
+
- lib/glimmer/dsl/shine_data_binding_expression.rb
|
244
245
|
- lib/glimmer/dsl/static_expression.rb
|
245
246
|
- lib/glimmer/dsl/top_level_expression.rb
|
246
247
|
- lib/glimmer/error.rb
|
@@ -266,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
266
267
|
- !ruby/object:Gem::Version
|
267
268
|
version: '0'
|
268
269
|
requirements: []
|
269
|
-
rubygems_version: 3.
|
270
|
+
rubygems_version: 3.3.1
|
270
271
|
signing_key:
|
271
272
|
specification_version: 4
|
272
273
|
summary: Glimmer - DSL Engine for Ruby GUI and More
|