glimmer 2.1.0 → 2.1.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
  SHA256:
3
- metadata.gz: 912a0642f9a9a7a0811c8ba1fc41cd0cc1c0d0782bb358309bf2d2f70d5a187e
4
- data.tar.gz: 3d35f07751808800467b9e267aab343a04e0609d71ca15048273b725c1525ce4
3
+ metadata.gz: e347803a2f2ad58f9ab84df9c663d4e78e711b2bcbf272918c9275eb500b43e1
4
+ data.tar.gz: b7f5e950293c72c6b507671d4834f83358382fc715c7c213bec16bed699f6289
5
5
  SHA512:
6
- metadata.gz: 0e185959434641f56cc0ce6b031a2444348cdb076681ec026d2fb78851602f069e79eed56f55b0abe50281bf6595555642aeff92cb721f236b49bc5dbf8101b2
7
- data.tar.gz: a2be36ee355356c73217bed677f09eb4e1e54b5f7c473cf8fa2a5de8e17d8cd423164af7c9f5f10285dc365dcc4475216e75965c6f804c9b4fdc77e533224229
6
+ metadata.gz: 8678476836358cc1a6235ba9120e14c9f18c08bde90bd562961e0742acc5d36f8c81999f9932bb9b7ff30ea0697a57097ce0ffa0dd937f3aebc0d4226e743024
7
+ data.tar.gz: a5713b33a300c15d842aafe0e7b8f106d122ac32063f70e42dd34cd2e1b75d69e6848c4ecb46c8de24015833b27d2ad4148855c0cdcc8da1b41781d9972beb2f
data/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.1.4
7
+
8
+ - Upgrade array_include_methods gem to version 1.2.0
9
+
10
+ ### 2.1.3
11
+
12
+ - Upgrade array_include_methods gem to version 1.1.0
13
+
14
+ ### 2.1.2
15
+
16
+ - Fix issue with irrelevent error message showing up for ENV['GLIMMER_LOGGER_LEVEL'] being empty (it is not a true error)
17
+
18
+ ### 2.1.1
19
+
20
+ - Support double/triple/arbitrary dimension indexed arrays in ModelBinding property (e.g. `'grid[1][0]'` )
21
+
22
+ ### 2.1.0
23
+
24
+ - Extracted ObserveExpression from Glimmer DSL for SWT
25
+
26
+ ### 2.0.1
27
+
28
+ - ObservableArray notify observers on shift
29
+
6
30
  ### 2.0.0
7
31
 
8
32
  - Extract Glimmer::DSL::BindExpression from Glimmer DSL for SWT
data/README.md CHANGED
@@ -35,6 +35,7 @@ Start by checking out Glimmer's original GUI DSL, which got extracted into its o
35
35
  - [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
36
36
  - [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
37
37
  - [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
38
+ - [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
38
39
 
39
40
  ## Table of Contents
40
41
 
@@ -49,6 +50,7 @@ Start by checking out Glimmer's original GUI DSL, which got extracted into its o
49
50
  - [Glimmer DSL for XML (& HTML)](#glimmer-dsl-for-xml--html)
50
51
  - [Glimmer DSL for CSS](#glimmer-dsl-for-css)
51
52
  - [Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)](#glimmer-dsl-for-tk-mri-ruby-desktop-development-gui-library)
53
+ - [Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)](#glimmer-dsl-for-libui-prerequisite-free-ruby-desktop-development-gui-library)
52
54
  - [Data-Binding Library](#data-binding-library)
53
55
  - [Glimmer Process](#glimmer-process)
54
56
  - [Resources](#resources)
@@ -208,7 +210,7 @@ end
208
210
  ### Setup
209
211
 
210
212
  Follow these steps to author a [Glimmer](https://rubygems.org/gems/glimmer) DSL:
211
- - Add `gem 'glimmer', '~> 2.1.0'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.1.0` and add `require 'glimmer'`
213
+ - Add `gem 'glimmer', '~> 2.1.3'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.1.3` and add `require 'glimmer'`
212
214
  - 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)
213
215
  - Create `glimmer/dsl/[dsl_name]/[expresion_name]_expresion.rb` for every [expresion_name] expression needed, whether dynamic or static
214
216
 
@@ -926,6 +928,291 @@ Glimmer app:
926
928
  ![glimmer dsl tk screenshot sample hello combo](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-tk/master/images/glimmer-dsl-tk-screenshot-sample-hello-combo.png)
927
929
  ![glimmer dsl tk screenshot sample hello combo dropdown](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-tk/master/images/glimmer-dsl-tk-screenshot-sample-hello-combo-dropdown.png)
928
930
 
931
+ #### Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
932
+
933
+ [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui) is a prerequisite-free Ruby desktop development GUI library. No need to pre-install any prerequisites. Just install the gem and have platform-independent native GUI that just works!
934
+
935
+ [LibUI](https://github.com/kojix2/LibUI) is a thin [Ruby](https://www.ruby-lang.org/en/) wrapper around [libui](https://github.com/andlabs/libui), a relatively new C GUI library that renders native controls on every platform (similar to [SWT](https://www.eclipse.org/swt/), but without the heavy weight of the [Java Virtual Machine](https://www.java.com/en/)).
936
+
937
+ The main trade-off in using [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) as opposed to [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) or [Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk) is the fact that [SWT](https://www.eclipse.org/swt/) and [Tk](https://www.tcl.tk/) are more mature than mid-alpha [libui](https://github.com/andlabs/libui) as GUI toolkits. Still, if there is only a need to build a small simple application, [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) could be a good convenient choice due to having zero prerequisites beyond the dependencies included in the [Ruby gem](https://rubygems.org/gems/glimmer-dsl-libui). Also, just like [Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk), its apps start instantly and have a small memory footprint. [LibUI](https://github.com/kojix2/LibUI) is a promising new GUI toolkit that might prove quite worthy in the future.
938
+
939
+ [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui) aims to provide a DSL similar to the [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) to enable more productive desktop development in Ruby with:
940
+ - Declarative DSL syntax that visually maps to the GUI widget hierarchy
941
+ - Convention over configuration via smart defaults and automation of low-level details
942
+ - Requiring the least amount of syntax possible to build GUI
943
+ - Bidirectional Data-Binding to declaratively wire and automatically synchronize GUI with Business Models
944
+ - Custom Widget support
945
+ - Scaffolding for new custom widgets, apps, and gems
946
+ - Native-Executable packaging on Mac, Windows, and Linux
947
+
948
+ ##### Glimmer DSL for LibUI Samples
949
+
950
+ ###### Hello, World!
951
+
952
+ Mac
953
+
954
+ ![glimmer-dsl-libui-mac-basic-window.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-mac-basic-window.png)
955
+
956
+ Linux
957
+
958
+ ![glimmer-dsl-libui-linux-basic-window.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-linux-basic-window.png)
959
+
960
+ ```ruby
961
+ require 'glimmer-dsl-libui'
962
+
963
+ include Glimmer
964
+
965
+ window('hello world').show
966
+ ```
967
+
968
+ ###### Basic Button
969
+
970
+ Mac
971
+
972
+ ![glimmer-dsl-libui-mac-basic-button.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-mac-basic-button.png)
973
+ ![glimmer-dsl-libui-mac-basic-button-msg-box.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-mac-basic-button-msg-box.png)
974
+
975
+ Linux
976
+
977
+ ![glimmer-dsl-libui-linux-basic-button.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-linux-basic-button.png)
978
+ ![glimmer-dsl-libui-linux-basic-button-msg-box.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-linux-basic-button-msg-box.png)
979
+
980
+ ```ruby
981
+ require 'glimmer-dsl-libui'
982
+
983
+ include Glimmer
984
+
985
+ window('hello world', 300, 200) { |w|
986
+ button('Button') {
987
+ on_clicked do
988
+ msg_box(w, 'Information', 'You clicked the button')
989
+ end
990
+ }
991
+
992
+ on_closing do
993
+ puts 'Bye Bye'
994
+ end
995
+ }.show
996
+ ```
997
+
998
+ ###### Control Gallery
999
+
1000
+ Mac
1001
+
1002
+ ![glimmer-dsl-libui-mac-control-gallery.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-mac-control-gallery.png)
1003
+
1004
+ Linux
1005
+
1006
+ ![glimmer-dsl-libui-linux-control-gallery.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-linux-control-gallery.png)
1007
+
1008
+ ```ruby
1009
+ require 'glimmer-dsl-libui'
1010
+
1011
+ include Glimmer
1012
+
1013
+ menu('File') {
1014
+ menu_item('Open') {
1015
+ on_clicked do
1016
+ file = open_file(MAIN_WINDOW)
1017
+ puts file unless file.nil?
1018
+ end
1019
+ }
1020
+
1021
+ menu_item('Save') {
1022
+ on_clicked do
1023
+ file = save_file(MAIN_WINDOW)
1024
+ puts file unless file.nil?
1025
+ end
1026
+ }
1027
+
1028
+ quit_menu_item {
1029
+ on_clicked do
1030
+ puts 'Bye Bye'
1031
+ end
1032
+ }
1033
+
1034
+ preferences_menu_item # Can optionally contain an on_clicked listener
1035
+ }
1036
+
1037
+ menu('Edit') {
1038
+ check_menu_item('Checkable Item_')
1039
+ separator_menu_item
1040
+ menu_item('Disabled Item_') {
1041
+ enabled false
1042
+ }
1043
+ }
1044
+
1045
+ menu('Help') {
1046
+ menu_item('Help')
1047
+
1048
+ about_menu_item # Can optionally contain an on_clicked listener
1049
+ }
1050
+
1051
+ MAIN_WINDOW = window('Control Gallery', 600, 500) {
1052
+ margined true
1053
+
1054
+ on_closing do
1055
+ puts 'Bye Bye'
1056
+ end
1057
+
1058
+ vertical_box {
1059
+ horizontal_box {
1060
+ group('Basic Controls') {
1061
+ vertical_box {
1062
+ button('Button') {
1063
+ stretchy false
1064
+
1065
+ on_clicked do
1066
+ msg_box(MAIN_WINDOW, 'Information', 'You clicked the button')
1067
+ end
1068
+ }
1069
+
1070
+ checkbox('Checkbox') {
1071
+ stretchy false
1072
+
1073
+ on_toggled do |c|
1074
+ checked = c.checked == 1
1075
+ MAIN_WINDOW.title = "Checkbox is #{checked}"
1076
+ c.text = "I am the checkbox (#{checked})"
1077
+ end
1078
+ }
1079
+
1080
+ label('Label') { stretchy false }
1081
+
1082
+ horizontal_separator { stretchy false }
1083
+
1084
+ date_picker { stretchy false }
1085
+
1086
+ time_picker { stretchy false }
1087
+
1088
+ date_time_picker { stretchy false }
1089
+
1090
+ font_button { stretchy false }
1091
+
1092
+ color_button { stretchy false }
1093
+ }
1094
+ }
1095
+
1096
+ vertical_box {
1097
+ group('Numbers') {
1098
+ stretchy false
1099
+
1100
+ vertical_box {
1101
+ spinbox(0, 100) {
1102
+ stretchy false
1103
+ value 42
1104
+
1105
+ on_changed do |s|
1106
+ puts "New Spinbox value: #{s.value}"
1107
+ end
1108
+ }
1109
+
1110
+ slider(0, 100) {
1111
+ stretchy false
1112
+
1113
+ on_changed do |s|
1114
+ v = s.value
1115
+ puts "New Slider value: #{v}"
1116
+ @progress_bar.value = v
1117
+ end
1118
+ }
1119
+
1120
+ @progress_bar = progress_bar { stretchy false }
1121
+ }
1122
+ }
1123
+
1124
+ group('Lists') {
1125
+ stretchy false
1126
+
1127
+ vertical_box {
1128
+ combobox {
1129
+ stretchy false
1130
+ items 'combobox Item 1', 'combobox Item 2', 'combobox Item 3' # also accepts a single array argument
1131
+
1132
+ on_selected do |c|
1133
+ puts "New combobox selection: #{c.selected}"
1134
+ end
1135
+ }
1136
+
1137
+ editable_combobox {
1138
+ stretchy false
1139
+ items 'Editable Item 1', 'Editable Item 2', 'Editable Item 3' # also accepts a single array argument
1140
+ }
1141
+
1142
+ radio_buttons {
1143
+ items 'Radio Button 1', 'Radio Button 2', 'Radio Button 3' # also accepts a single array argument
1144
+ }
1145
+ }
1146
+ }
1147
+
1148
+ tab {
1149
+ tab_item('Page 1') {
1150
+ horizontal_box {
1151
+ entry {
1152
+ text 'Please enter your feelings'
1153
+
1154
+ on_changed do |e|
1155
+ puts "Current textbox data: '#{e.text}'"
1156
+ end
1157
+ }
1158
+ }
1159
+ }
1160
+
1161
+ tab_item('Page 2') {
1162
+ horizontal_box
1163
+ }
1164
+
1165
+ tab_item('Page 3') {
1166
+ horizontal_box
1167
+ }
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+
1174
+ MAIN_WINDOW.show
1175
+ ```
1176
+
1177
+ ###### Basic Table
1178
+
1179
+ Mac
1180
+
1181
+ ![glimmer-dsl-libui-mac-basic-table.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-mac-basic-table.png)
1182
+
1183
+ Linux
1184
+
1185
+ ![glimmer-dsl-libui-linux-basic-table.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-libui/master/images/glimmer-dsl-libui-linux-basic-table.png)
1186
+
1187
+ ```ruby
1188
+ require 'glimmer-dsl-libui'
1189
+
1190
+ include Glimmer
1191
+
1192
+ data = [
1193
+ %w[cat meow],
1194
+ %w[dog woof],
1195
+ %w[chicken cock-a-doodle-doo],
1196
+ %w[hourse neigh],
1197
+ %w[cow moo]
1198
+ ]
1199
+
1200
+ window('Animal sounds', 300, 200) {
1201
+ horizontal_box {
1202
+ table {
1203
+ text_column('Animal')
1204
+ text_column('Description')
1205
+
1206
+ cell_rows data
1207
+ }
1208
+ }
1209
+
1210
+ on_closing do
1211
+ puts 'Bye Bye'
1212
+ end
1213
+ }.show
1214
+ ```
1215
+
929
1216
  ## Data-Binding Library
930
1217
 
931
1218
  Data-Binding enables mapping GUI properties (like text and color) to Model attributes (like name and age) for bidirectional or unidirectional synchronization and conversion as needed.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.4
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 2.1.0 ruby lib
5
+ # stub: glimmer 2.1.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "2.1.0"
9
+ s.version = "2.1.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 = ["AndyMaleh".freeze]
14
- s.date = "2021-08-08"
14
+ s.date = "2021-09-25"
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 = [
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
50
50
  ]
51
51
  s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
52
52
  s.licenses = ["MIT".freeze]
53
- s.rubygems_version = "3.2.3".freeze
53
+ s.rubygems_version = "3.2.22".freeze
54
54
  s.summary = "Glimmer - DSL Engine for Ruby GUI and More".freeze
55
55
 
56
56
  if s.respond_to? :specification_version then
@@ -58,7 +58,7 @@ Gem::Specification.new do |s|
58
58
  end
59
59
 
60
60
  if s.respond_to? :add_runtime_dependency then
61
- s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.0.4", "< 2.0.0"])
61
+ s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.2.0", "< 2.0.0"])
62
62
  s.add_runtime_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
63
63
  s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
64
64
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
@@ -71,7 +71,7 @@ Gem::Specification.new do |s|
71
71
  s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
72
72
  s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
73
73
  else
74
- s.add_dependency(%q<array_include_methods>.freeze, [">= 1.0.4", "< 2.0.0"])
74
+ s.add_dependency(%q<array_include_methods>.freeze, [">= 1.2.0", "< 2.0.0"])
75
75
  s.add_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
76
76
  s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
77
77
  s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
@@ -59,7 +59,7 @@ module Glimmer
59
59
  self.logger = Logger.new($stdout).tap do |logger|
60
60
  logger.level = Logger::ERROR
61
61
  begin
62
- logger.level = ENV['GLIMMER_LOGGER_LEVEL']&.strip&.downcase
62
+ logger.level = ENV['GLIMMER_LOGGER_LEVEL'].strip.downcase unless ENV['GLIMMER_LOGGER_LEVEL'].to_s.strip.empty?
63
63
  rescue => e
64
64
  puts e.message
65
65
  end
@@ -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.match(/([^\[]+)(\[[^\]]+\])?/).to_a.drop(1)}.flatten.compact)
78
+ @nested_property_names ||= Concurrent::Array.new(property_name_expression.split(/\[|\./).map {|pne| pne.end_with?(']') ? "[#{pne}" : pne })
79
79
  end
80
80
 
81
81
  # Final nested property name
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.1.0
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-08 00:00:00.000000000 Z
11
+ date: 2021-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: array_include_methods
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.4
19
+ version: 1.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.4
29
+ version: 1.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  requirements: []
271
- rubygems_version: 3.2.3
271
+ rubygems_version: 3.2.22
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Glimmer - DSL Engine for Ruby GUI and More