glimmer 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +288 -1
  4. data/VERSION +1 -1
  5. data/glimmer.gemspec +5 -5
  6. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7759feb8da21bb9e696870708163b9aebdecab3c15181a28e86fb8255c4fe4c
4
- data.tar.gz: ee5f7b55fbd6b4cf24ef28df0956b9fcbfa33b0544f81470d8bc2072c97479d2
3
+ metadata.gz: ec140e501dc0c41d90232a6b1bb5117f33072e7b698286dcd0cf906736a26b54
4
+ data.tar.gz: 3eee8ff29cf02bf9919e676f11d99a028e1cffdf5a6c3d3f4985d1b4a2a63844
5
5
  SHA512:
6
- metadata.gz: 2c56a1347768269d1af90d1bd44a39f8bf5d1b3252da9140334a8a342e5855d49528e7b9b5c9a4f80464b91febcd2d59c6c350b148fbb7662167e32f9c818c55
7
- data.tar.gz: d8436f12a3c54baa44692ce5d1d07ea544cd59efedea4ec76b01737b68d90ba2ebae8fe4621960b6c7fb6d792444b3a8e6fab3fc57600b027da20419b14cc5e9
6
+ metadata.gz: '0059dfc9eb5ac3aa959442bb1dd120ba53f96cc8c41274afeb2b7d54064536e0ecc2bea2a8de4f8f4a3060730cb9bab9918af399a0aaab4131d61086b0a2cfca'
7
+ data.tar.gz: f45910594356c3d7a5d54e38371703c59bb77115e0df5f9f1eacf212eab0598f3ca64fe84762a5f2134388af90d2e50c0d99ae22b2ddc5b281eb55aaf8cbc7f7
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
+ ### 2.1.3
7
+
8
+ - Upgrade array_include_methods gem to version 1.1.0
9
+
6
10
  ### 2.1.2
7
11
 
8
12
  - Fix issue with irrelevent error message showing up for ENV['GLIMMER_LOGGER_LEVEL'] being empty (it is not a true error)
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.2'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.1.2` 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.2
1
+ 2.1.3
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.2 ruby lib
5
+ # stub: glimmer 2.1.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "2.1.2"
9
+ s.version = "2.1.3"
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-09-14"
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 = [
@@ -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.1.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.1.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"])
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.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-14 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.1.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.1.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0