glimmer 1.1.2 → 1.2.0

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
  SHA256:
3
- metadata.gz: 9d0de24c574be6e42a7cade68606d7dace341333cd2922307d15aee307f77a42
4
- data.tar.gz: 3ae8fe64ba1fc958bca990d13c02966101f7eef91b03d60ddf28cd6f406b1af8
3
+ metadata.gz: 91c30ea530add452134bdbe1b691612d1cbc1df62e9d96d934aba1b8208ac1bf
4
+ data.tar.gz: 2e54d62f536bd132379c195032e62b82e5f6f973f3aa95df002464c99ed39ce1
5
5
  SHA512:
6
- metadata.gz: 3ea0f3c6733f9274b06067f6e3888a017f4ff4a7bf99b5c446f4cadf38eb705b6ddbc1f76a2b0e2d4ee9e6620626f07069d2c4ff199b682f7be38fda1a6d6749
7
- data.tar.gz: 5ae1155117530b0e3808000057fae31a5ee5345dbc8fc28b4eae797d916d72ec1c7c643e2f314f8ffcb26121d33a7dc43080a2d30639ded865bb90c4a2bfbebc
6
+ metadata.gz: 2793b625f74e8fcbd17e1463aa87f4f5cdd7e63d9219f55d9a749f18ce56acef87a86147d227d4246251accc48d7bd451eef170d0e0c34fa4be1a1fa251a6bdb
7
+ data.tar.gz: 596cfae4c4545bb7d2bfcb8a6ef4c3be243f70f1dd129e27b16b718ed7b234ab9e5d685075cd6720c8459960c5966f4bd93f494a46d9a0adf7fba5902542d818
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.2.0
7
+
8
+ - Alter `Engine`/`Expression`/`ParentExpression` API to pass `keyword` and `args` to `#add_content` method. This enables consumers to vary behavior based on `keyword` and `args`, not just `parent` and presence of `block`.
9
+
6
10
  ## 1.1.2
7
11
 
8
12
  - Add more logging for which DSL is assumed before interpreting expressions
data/README.md CHANGED
@@ -98,7 +98,7 @@ Every `Expression` sublcass must specify two methods at least:
98
98
  `StaticExpression` sublcasses may skip the `can_interpret?` method since they include a default implementation for it that matches the name of the keyword from the class name by convention. For example, a `color` keyword would have a `ColorExpression` class, so `color` is inferred automatically from class name and used in deciding whether the class can handle a `color` keyword or not.
99
99
 
100
100
  `ParentExpression` subclasses can optionally override this extra method, which is included by default and simply invokes the parent's passed block to process its children:
101
- - `add_content(parent, &block)`
101
+ - `add_content(parent, keyword, *args, &block)`
102
102
 
103
103
  For example, some parent widgets use their block for other reasons or process their children at very specific times, so they may override that method and disable it, or otherwise call `super` and do additional work.
104
104
 
@@ -123,7 +123,7 @@ module Glimmer
123
123
  Glimmer::SWT::WidgetProxy.create(keyword, parent, args)
124
124
  end
125
125
 
126
- def add_content(parent, &block)
126
+ def add_content(parent, keyword, *args, &block)
127
127
  super
128
128
  parent.post_add_content
129
129
  end
@@ -201,7 +201,7 @@ end
201
201
  ### Setup
202
202
 
203
203
  Follow these steps to author a [Glimmer](https://rubygems.org/gems/glimmer) DSL:
204
- - Add `gem 'glimmer', '~> 1.1.2'` to `Gemfile` and run `bundle` or run `gem install glimmer -v1.1.2` and add `require 'glimmer'`
204
+ - Add `gem 'glimmer', '~> 1.2.0'` to `Gemfile` and run `bundle` or run `gem install glimmer -v1.2.0` and add `require 'glimmer'`
205
205
  - 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)
206
206
  - Create `glimmer/dsl/[dsl_name]/[expresion_name]_expresion.rb` for every [expresion_name] expression needed, whether dynamic or static
207
207
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.2.0
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.2 ruby lib
5
+ # stub: glimmer 1.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "1.1.2"
9
+ s.version = "1.2.0"
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-20"
14
+ s.date = "2021-03-03"
15
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. 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 = [
@@ -177,7 +177,7 @@ module Glimmer
177
177
 
178
178
  def interpret_expression(expression, keyword, *args, &block)
179
179
  expression.interpret(parent, keyword, *args, &block).tap do |ui_object|
180
- add_content(ui_object, expression, &block)
180
+ add_content(ui_object, expression, keyword, *args, &block)
181
181
  dsl_stack.pop
182
182
  end
183
183
  end
@@ -187,12 +187,12 @@ module Glimmer
187
187
  # This allows evaluating parent UI object properties and children
188
188
  #
189
189
  # For example, a shell widget would get properties set and children added
190
- def add_content(parent, expression, &block)
190
+ def add_content(parent, expression, keyword, *args, &block)
191
191
  if block_given? && expression.is_a?(ParentExpression)
192
192
  dsl_stack.push(expression.class.dsl)
193
193
  parent_stack.push(parent)
194
194
  begin
195
- expression.add_content(parent, &block)
195
+ expression.add_content(parent, keyword, *args, &block)
196
196
  ensure
197
197
  parent_stack.pop
198
198
  dsl_stack.pop
@@ -50,7 +50,7 @@ module Glimmer
50
50
  # Adds block content to specified parent UI object (Optional)
51
51
  #
52
52
  # Only expressions that receive a content block should implement
53
- def add_content(parent, &block)
53
+ def add_content(parent, keyword, *args, &block)
54
54
  # No Op by default
55
55
  end
56
56
 
@@ -25,7 +25,7 @@ module Glimmer
25
25
  module DSL
26
26
  # Mixin that represents expressions that always have a content block
27
27
  module ParentExpression
28
- def add_content(parent, &block)
28
+ def add_content(parent, keyword, *args, &block)
29
29
  block.call(parent)
30
30
  end
31
31
  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.2
4
+ version: 1.2.0
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-20 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: array_include_methods