glimmer-dsl-libui 0.12.6 → 0.12.7

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: b904f97a0c6ac0f1ab428f1e000325a9ddfee1dfdd5a4d5be71592039ed0c2e0
4
- data.tar.gz: 7479c1ca847c105939752122ab0fa8a6319f14e9c68a38ab7a241dbec5947a38
3
+ metadata.gz: d95327be14547ec2bbc41b7d963c00a432a6ae3fbcb5b41c9b900cba967194d8
4
+ data.tar.gz: 3bf11f49b498aabd0d6c2bc35a8e49be99aeb60066a3095a2ce08c866d2861c2
5
5
  SHA512:
6
- metadata.gz: 0a0ca4e301ce0a7edc45af0fb66933ca397c6b653af49688fd86276bb205d90e930a27949abf09e499fc92e66685baa26780a02565059ff26d43fd74a1605fdd
7
- data.tar.gz: 02ee7881c7ef54310b5c7a977a63f4fb03ec57f481c7b0c5659846e916e5846e659061a2de66815f69ffa88d2c58f6dc2e332568e07f1d080dace48eb3598e53
6
+ metadata.gz: 6dca03d07a89a0c700f50509a3f1a56c8321b7b44d38de794f7a4b81d415981c35d463623294b332350517001c2f7c6f841d2d27a18ec79546f884161798799b
7
+ data.tar.gz: bf843b6399671fdd87f7a6c3f60b17a45506d23477e6273dddb6263540925bc73c9ef3031ef9228e9b1d7ea4c37cf8355c5c22b6c3d3896c0ed05e0d6fbf4623
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.12.7
4
+
5
+ - Application Scaffolding now generates the main view as `SomeNameApplication` (with `_application` suffix in file name) to indicate clearly it is a `Glimmer::LibUI::Application` class.
6
+ - Application Scaffolding now generates a `presenter` directory for convenience in case presenters are needed.
7
+
3
8
  ## 0.12.6
4
9
 
5
10
  - Shape Content Data-Binding
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 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.12.6
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.12.7
2
2
  ## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja))
3
3
  ### The Quickest Way From Zero To GUI
4
4
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
@@ -8,6 +8,8 @@
8
8
 
9
9
  (**[Fukuoka Ruby Award Competition 2022 Special Award Winner](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html)** [[Award Announcement]](http://www.digitalfukuoka.jp/topics/187?locale=ja))
10
10
 
11
+ (**[***RubyConf 2024 Workshop - How To Build Basic Desktop Applications in Ruby***](https://www.youtube.com/watch?v=TTSqRdTVtDY)**)
12
+
11
13
  (**[***RubyConf 2023 Workshop - How To Build Desktop Applications in Ruby***](https://github.com/AndyObtiva/how-to-build-desktop-applications-in-ruby)**)
12
14
 
13
15
  (**[***RubyConf 2022 Talk - Building Native GUI Apps in Ruby***](https://andymaleh.blogspot.com/2023/02/rubyconf-2022-talk-video-for-building.html)**)
@@ -464,7 +466,7 @@ gem install glimmer-dsl-libui
464
466
  Or install via Bundler `Gemfile`:
465
467
 
466
468
  ```ruby
467
- gem 'glimmer-dsl-libui', '~> 0.12.6'
469
+ gem 'glimmer-dsl-libui', '~> 0.12.7'
468
470
  ```
469
471
 
470
472
  Test that installation worked by running the [Glimmer Meta-Example](#examples):
@@ -790,7 +792,7 @@ hello_world
790
792
  When you are in a scaffolded application, you can scaffold a new [custom control](#custom-components) (a control that you can put anything in to represent a view concept in your application) by running this command:
791
793
 
792
794
  ```
793
- glimmer scaffold:customcontrol[name,namespace]
795
+ glimmer "scaffold:customcontrol[name,namespace]"
794
796
  ```
795
797
 
796
798
  The `name` represents the [custom control](#custom-components) view class name (it can be underscored, and Glimmer will automatically classify it).
@@ -800,13 +802,13 @@ The `namespace` is optional and represents the module that the [custom control](
800
802
  You can also use the shorter `cc` alias for `customcontrol`:
801
803
 
802
804
  ```
803
- glimmer scaffold:cc[name,namespace]
805
+ glimmer "scaffold:cc[name,namespace]"
804
806
  ```
805
807
 
806
808
  For example by running this command under a `hello_world` application:
807
809
 
808
810
  ```
809
- glimmer scaffold:cc[model_form]
811
+ glimmer "scaffold:cc[model_form]"
810
812
  ```
811
813
 
812
814
  That will generate this class under `app/hello_world/view/model_form`:
@@ -880,7 +882,7 @@ window {
880
882
  Here is an example that generates a [custom control](#custom-components) with a namespace:
881
883
 
882
884
  ```
883
- glimmer scaffold:cc[model_form,common]
885
+ glimmer "scaffold:cc[model_form,common]"
884
886
  ```
885
887
 
886
888
  That will generate this class under `app/common/view/model_form`:
@@ -980,7 +982,7 @@ A custom window is a specialization of a custom control that has a `window` as i
980
982
  When you are in a scaffolded application, you can scaffold a new custom window (a window that you can put anything in to represent a view concept in your application) by running this command:
981
983
 
982
984
  ```
983
- glimmer scaffold:customwindow[name,namespace]
985
+ glimmer "scaffold:customwindow[name,namespace]"
984
986
  ```
985
987
 
986
988
  The `name` represents the custom window view class name (it can be underscored, and Glimmer will automatically classify it).
@@ -990,13 +992,13 @@ The `namespace` is optional and represents the module that the custom window vie
990
992
  You can also use the shorter `cw` alias for `customwindow`:
991
993
 
992
994
  ```
993
- glimmer scaffold:cw[name,namespace]
995
+ glimmer "scaffold:cw[name,namespace]"
994
996
  ```
995
997
 
996
998
  For example by running this command under a `hello_world` application:
997
999
 
998
1000
  ```
999
- glimmer scaffold:cw[greeting_window]
1001
+ glimmer "scaffold:cw[greeting_window]"
1000
1002
  ```
1001
1003
 
1002
1004
  That will generate this class under `app/hello_world/view/greeting_window`:
@@ -1057,7 +1059,7 @@ greeting_window.show
1057
1059
  Here is an example that generates a custom window with a namespace:
1058
1060
 
1059
1061
  ```
1060
- glimmer scaffold:cw[train,station]
1062
+ glimmer "scaffold:cw[train,station]"
1061
1063
  ```
1062
1064
 
1063
1065
  That will generate this class under `app/station/view/train`:
@@ -1132,7 +1134,7 @@ hello_world__view__train.show
1132
1134
  When you are in a scaffolded application, you can scaffold a new [custom shape](#custom-components) (a shape that you can put anything in to represent a view concept in your application) by running this command:
1133
1135
 
1134
1136
  ```
1135
- glimmer scaffold:customshape[name,namespace]
1137
+ glimmer "scaffold:customshape[name,namespace]"
1136
1138
  ```
1137
1139
 
1138
1140
  The `name` represents the [custom shape](#custom-components) view class name (it can be underscored, and Glimmer will automatically classify it).
@@ -1142,13 +1144,13 @@ The `namespace` is optional and represents the module that the [custom shape](#c
1142
1144
  You can also use the shorter `cs` alias for `customshape`:
1143
1145
 
1144
1146
  ```
1145
- glimmer scaffold:cs[name,namespace]
1147
+ glimmer "scaffold:cs[name,namespace]"
1146
1148
  ```
1147
1149
 
1148
1150
  For example by running this command under a `hello_world` application:
1149
1151
 
1150
1152
  ```
1151
- glimmer scaffold:cs[heart]
1153
+ glimmer "scaffold:cs[heart]"
1152
1154
  ```
1153
1155
 
1154
1156
  That will generate this class under `app/hello_world/view/heart`:
@@ -1233,7 +1235,7 @@ window {
1233
1235
  Here is an example that generates a [custom shape](#custom-components) with a namespace:
1234
1236
 
1235
1237
  ```
1236
- glimmer scaffold:cs[heart,acme]
1238
+ glimmer "scaffold:cs[heart,acme]"
1237
1239
  ```
1238
1240
 
1239
1241
  That will generate this class under `app/acme/view/heart`:
@@ -1330,7 +1332,7 @@ window {
1330
1332
  You can scaffold a Ruby gem around a reusable [custom control](#custom-components) to expose publicly and make available for multiple projects by running this command:
1331
1333
 
1332
1334
  ```
1333
- glimmer scaffold:gem:customcontrol[name,namespace]
1335
+ glimmer "scaffold:gem:customcontrol[name,namespace]"
1334
1336
  ```
1335
1337
 
1336
1338
  That will generate a [custom control](#custom-components) gem project under the naming convention: `glimmer-libui-cc-name-namespace`
@@ -1344,7 +1346,7 @@ The `namespace` is needed to avoid clashing with other [custom control](#custom-
1344
1346
  Here is a shorter alias for the [custom control](#custom-components) gem scaffolding command:
1345
1347
 
1346
1348
  ```
1347
- glimmer scaffold:gem:cc[name,namespace]
1349
+ glimmer "scaffold:gem:cc[name,namespace]"
1348
1350
  ```
1349
1351
 
1350
1352
  You can package the newly scaffolded project as a Ruby gem by running this command:
@@ -1398,7 +1400,7 @@ A custom window is a specialization of a custom control that has a `window` as i
1398
1400
  You can scaffold a Ruby gem around a reusable custom window to expose publicly and make available for multiple projects by running this command:
1399
1401
 
1400
1402
  ```
1401
- glimmer scaffold:gem:customwindow[name,namespace]
1403
+ glimmer "scaffold:gem:customwindow[name,namespace]"
1402
1404
  ```
1403
1405
 
1404
1406
  That will generate a custom window gem project under the naming convention: `glimmer-libui-cw-name-namespace`
@@ -1412,7 +1414,7 @@ The `namespace` is needed to avoid clashing with other custom window gems that o
1412
1414
  Here is a shorter alias for the custom window gem scaffolding command:
1413
1415
 
1414
1416
  ```
1415
- glimmer scaffold:gem:cw[name,namespace]
1417
+ glimmer "scaffold:gem:cw[name,namespace]"
1416
1418
  ```
1417
1419
 
1418
1420
  You can package the newly scaffolded project as a Ruby gem by running this command:
@@ -1458,7 +1460,7 @@ greeter.show
1458
1460
  You can scaffold a Ruby gem around a reusable [custom shape](#custom-components) to expose publicly and make available for multiple projects by running this command:
1459
1461
 
1460
1462
  ```
1461
- glimmer scaffold:gem:customshape[name,namespace]
1463
+ glimmer "scaffold:gem:customshape[name,namespace]"
1462
1464
  ```
1463
1465
 
1464
1466
  That will generate a [custom shape](#custom-components) gem project under the naming convention: `glimmer-libui-cc-name-namespace`
@@ -1472,7 +1474,7 @@ The `namespace` is needed to avoid clashing with other [custom shape](#custom-co
1472
1474
  Here is a shorter alias for the [custom shape](#custom-components) gem scaffolding command:
1473
1475
 
1474
1476
  ```
1475
- glimmer scaffold:gem:cs[name,namespace]
1477
+ glimmer "scaffold:gem:cs[name,namespace]"
1476
1478
  ```
1477
1479
 
1478
1480
  You can package the newly scaffolded project as a Ruby gem by running this command:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.6
1
+ 0.12.7
Binary file
@@ -153,6 +153,7 @@ module Glimmer
153
153
  mkdir 'app'
154
154
  write "app/#{file_name(app_name)}.rb", app_main_file(app_name)
155
155
  mkdir_p "app/#{file_name(app_name)}/model"
156
+ mkdir_p "app/#{file_name(app_name)}/presenter"
156
157
  mkdir_p "app/#{file_name(app_name)}/view"
157
158
  custom_window(class_name(app_name), current_dir_name, window_type, custom_window_class_name: 'Application')
158
159
  app_model(current_dir_name)
@@ -195,9 +196,11 @@ module Glimmer
195
196
  namespace ||= current_dir_name
196
197
  root_dir = File.exist?('app') ? 'app' : 'lib'
197
198
  parent_dir = "#{root_dir}/#{file_name(namespace)}/view"
198
- return puts("The file '#{parent_dir}/#{file_name(custom_window_name)}.rb' already exists. Please either remove or pick a different name.") if File.exist?("#{parent_dir}/#{file_name(custom_window_name)}.rb")
199
+ custom_window_file_name_suffix = "_#{file_name(window_options[:custom_window_class_name])}" if window_options[:custom_window_class_name] == 'Application'
200
+ custom_window_file_name = "#{parent_dir}/#{file_name(custom_window_name)}#{custom_window_file_name_suffix}.rb"
201
+ return puts("The file '#{custom_window_file_name}' already exists. Please either remove or pick a different name.") if File.exist?(custom_window_file_name)
199
202
  mkdir_p parent_dir unless File.exist?(parent_dir)
200
- write "#{parent_dir}/#{file_name(custom_window_name)}.rb", custom_window_file(custom_window_name, namespace, window_type, window_options)
203
+ write custom_window_file_name, custom_window_file(custom_window_name, namespace, window_type, window_options)
201
204
  end
202
205
 
203
206
  def custom_control(custom_control_name, namespace)
@@ -437,7 +440,7 @@ module Glimmer
437
440
  LICENSE = File.read(File.join(APP_ROOT, 'LICENSE.txt'))
438
441
  end
439
442
 
440
- require '#{file_name(app_name)}/view/#{file_name(app_name)}'
443
+ require '#{file_name(app_name)}/view/#{file_name(app_name)}_application.rb'
441
444
  MULTI_LINE_STRING
442
445
  end
443
446
 
@@ -457,9 +460,10 @@ module Glimmer
457
460
 
458
461
  def app_launch_file(app_name)
459
462
  <<~MULTI_LINE_STRING
463
+ # this is only a helper for the bin script to launch the app. Developers must generally not need to edit it.
460
464
  require_relative '../#{file_name(app_name)}'
461
465
 
462
- #{class_name(app_name)}::View::#{class_name(app_name)}.launch
466
+ #{class_name(app_name)}::View::#{class_name(app_name)}Application.launch
463
467
  MULTI_LINE_STRING
464
468
  end
465
469
 
@@ -545,7 +549,7 @@ require '#{window_type == :app ? current_dir_name : namespace}/model/greeting'
545
549
  custom_window_file_content += <<-MULTI_LINE_STRING
546
550
  #{namespace_type} #{class_name(namespace)}
547
551
  module View
548
- class #{class_name(custom_window_name)}
552
+ class #{class_name(custom_window_name)}#{window_options[:custom_window_class_name] if window_options[:custom_window_class_name] == 'Application'}
549
553
  include Glimmer::LibUI::#{window_options[:custom_window_class_name]}
550
554
 
551
555
  MULTI_LINE_STRING
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
4
+ version: 0.12.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-24 00:00:00.000000000 Z
11
+ date: 2025-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer