glimmer-dsl-libui 0.9.6 → 0.9.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: 06c9ed7f6b104ec0f5a034ee6f74fa2398de9b1d11ffea2e2d1448f07e2c7e43
4
- data.tar.gz: 48591881860e3317e2e79a88840fcb0b51d093ba017e0b74dc45e8382ead00b3
3
+ metadata.gz: c75651f571b0d519f08be54f306fcfdcecddc44e6f475d15051bedcaa0114e76
4
+ data.tar.gz: 31cf1d94b0273e0a564fa873479ea89aee0c46de4436f7cd2b985e6fce0d715e
5
5
  SHA512:
6
- metadata.gz: d17b5b51140d69186f2237efffdce6a9e65ec675e568fcb96c911593cb934392ad423da0ea64e75573ef5d657f3690b87a3bca9723e04ca103922b98204e24a1
7
- data.tar.gz: 658eb9d2fa4b00a7c4edbb85ef42dbbb3b81f04e4c16e3ccd93715e252a726317bd6fec59081047d6b6698bfb38ab8594413afee6638eccc2373ccb0a8830fcd
6
+ metadata.gz: 79842463d4788be8d50a6d6b203e50a28ac483d6333fcdf934955ba91e32fd51e4aa3f3b654924657c5e28defe128f36b0d26effb6ed5579fc3049d2f3fdc8cb
7
+ data.tar.gz: bb2269219236e14c13ad486ac8ae75dc501654eda0ca955bdb2ae6d41772354112f9ed160882472f79bace06adda838338c04d47cf77870e8a8be36cfb610f7a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.9.7
4
+
5
+ - Scaffold Custom Control Gem via `glimmer scaffold:gem:customcontrol[name,namespace]` (or alias: `glimmer scaffold:gem:cc[name,namespace]`)
6
+ - List Custom Control Gems (expected name format: `glimmer-libui-cc-gemname-namespace`) via `glimmer list:gems:customcontrol[query]` (or alias: `glimmer list:gems:cc[query]`)
7
+
3
8
  ## 0.9.6
4
9
 
5
10
  - Scaffold Custom Window Gem via `glimmer scaffold:gem:customwindow[name,namespace]` (or alias: `glimmer scaffold:gem:cw[name,namespace]`)
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.9.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.9.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)
@@ -354,7 +354,9 @@ Learn more about the differences between various [Glimmer](https://github.com/An
354
354
  - [Scaffold Custom Window](#scaffold-custom-window)
355
355
  - [Scaffold Custom Control](#scaffold-custom-control)
356
356
  - [Scaffold Custom Window Gem](#scaffold-custom-window-gem)
357
+ - [Scaffold Custom Control Gem](#scaffold-custom-control-gem)
357
358
  - [List Custom Window Gems](#list-custom-window-gems)
359
+ - [List Custom Control Gems](#list-custom-control-gems)
358
360
  - [List Glimmer DSLs](#list-glimmer-dsls)
359
361
  - [Girb (Glimmer IRB)](#girb-glimmer-irb)
360
362
  - [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
@@ -426,7 +428,7 @@ gem install glimmer-dsl-libui
426
428
  Or install via Bundler `Gemfile`:
427
429
 
428
430
  ```ruby
429
- gem 'glimmer-dsl-libui', '~> 0.9.6'
431
+ gem 'glimmer-dsl-libui', '~> 0.9.7'
430
432
  ```
431
433
 
432
434
  Test that installation worked by running the [Glimmer Meta-Example](#examples):
@@ -1076,7 +1078,7 @@ window {
1076
1078
 
1077
1079
  ### Scaffold Custom Window Gem
1078
1080
 
1079
- You can scaffold a Ruby gem around a reusable Custom Window by running this command:
1081
+ You can scaffold a Ruby gem around a reusable custom window by running this command:
1080
1082
 
1081
1083
  ```
1082
1084
  glimmer scaffold:gem:customwindow[name,namespace]
@@ -1122,7 +1124,7 @@ rake gemspec:generate
1122
1124
 
1123
1125
  The project optionally allows you to run the custom window as its own separate app with a binary script (`bin/gem_name`) to see it, which helps with prototyping it.
1124
1126
 
1125
- But, typically consumers of the gem would include it in their own project, which makes the gem keyword available in the Glimmer GUI DSL where `Glimmer`. `Glimmer::LibUI::Application`, `Glimmer::LibUI::CustomWindow`, or `Glimmer::LibUI::CustomControl` is mixed.
1127
+ But, typically consumers of the gem would include it in their own project, which makes the gem keyword available in the Glimmer GUI DSL anywhere `Glimmer`. `Glimmer::LibUI::Application`, `Glimmer::LibUI::CustomWindow`, or `Glimmer::LibUI::CustomControl` is mixed.
1126
1128
 
1127
1129
  For example:
1128
1130
 
@@ -1134,6 +1136,70 @@ greeter.show
1134
1136
  ...
1135
1137
  ```
1136
1138
 
1139
+ ### Scaffold Custom Control Gem
1140
+
1141
+ You can scaffold a Ruby gem around a reusable custom control by running this command:
1142
+
1143
+ ```
1144
+ glimmer scaffold:gem:customcontrol[name,namespace]
1145
+ ```
1146
+
1147
+ That will generate a custom control gem project under the naming convention: `glimmer-libui-cc-name-namespace`
1148
+
1149
+ The naming convention helps with discoverability of Ruby gems using the command `glimmer list:gems:customcontrol[query]` (or alias: `glimmer list:gems:cc[query]`) where filtering `query` is optional.
1150
+
1151
+ The `name` is the custom control class name, which must not contain dashes by convention (multiple words can be concatenated or can use underscores between them).
1152
+
1153
+ The `namespace` is needed to avoid clashing with other custom control gems that other software engineers might have thought of. It is recommended not to include dashes between words in it by convention yet concatenated words or underscores between them.
1154
+
1155
+ Here is a shorter alias for the custom control gem scaffolding command:
1156
+
1157
+ ```
1158
+ glimmer scaffold:gem:cc[name,namespace]
1159
+ ```
1160
+
1161
+ You can package the newly scaffolded project as a Ruby gem by running this command:
1162
+
1163
+ ```
1164
+ glimmer package:gem
1165
+ ```
1166
+
1167
+ Or by using the raw rake command:
1168
+
1169
+ ```
1170
+ rake build
1171
+ ```
1172
+
1173
+ You can generate the application gemspec explicitly if needed with this command (though it is not needed to build the gem):
1174
+
1175
+ ```
1176
+ glimmer package:gemspec
1177
+ ```
1178
+
1179
+ Or by using the raw rake command:
1180
+
1181
+ ```
1182
+ rake gemspec:generate
1183
+ ```
1184
+
1185
+ Typically, consumers of the gem would include it in their own project, which makes the gem keyword available in the Glimmer GUI DSL anywhere `Glimmer`. `Glimmer::LibUI::Application`, `Glimmer::LibUI::CustomWindow`, or `Glimmer::LibUI::CustomControl` is mixed.
1186
+
1187
+ For example:
1188
+
1189
+ ```ruby
1190
+ require 'glimmer-libui-cc-model_form-acme'
1191
+
1192
+ ...
1193
+ window {
1194
+ vertical_box {
1195
+ label('Form:')
1196
+
1197
+ model_form(model: some_model, attributes: some_attributes)
1198
+ }
1199
+ }
1200
+ ...
1201
+ ```
1202
+
1137
1203
  ### List Custom Window Gems
1138
1204
 
1139
1205
  Custom window gems are scaffolded to follow the naming convention: `glimmer-libui-cw-name-namespace`
@@ -1152,6 +1218,25 @@ glimmer list:gems:cw[query]
1152
1218
 
1153
1219
  The filtering `query` is optional.
1154
1220
 
1221
+
1222
+ ### List Custom Control Gems
1223
+
1224
+ Custom control gems are scaffolded to follow the naming convention: `glimmer-libui-cw-name-namespace`
1225
+
1226
+ The naming convention helps with discoverability of Ruby gems using the command:
1227
+
1228
+ ```
1229
+ glimmer list:gems:customcontrol[query]
1230
+ ```
1231
+
1232
+ Or by using the shorter alias:
1233
+
1234
+ ```
1235
+ glimmer list:gems:cc[query]
1236
+ ```
1237
+
1238
+ The filtering `query` is optional.
1239
+
1155
1240
  ### List Glimmer DSLs
1156
1241
 
1157
1242
  Glimmer DSLs can be listed with this command:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6
1
+ 0.9.7
Binary file
@@ -219,7 +219,7 @@ module Glimmer
219
219
  end
220
220
 
221
221
  def custom_window_gem(custom_window_name, namespace)
222
- gem_name = "glimmer-libui-cw-#{compact_name(custom_window_name)}"
222
+ gem_name = "glimmer-libui-cw-#{custom_window_name.underscore}"
223
223
  gem_summary = "#{human_name(custom_window_name)} - Glimmer Custom Window"
224
224
  begin
225
225
  custom_window_keyword = dsl_control_name(custom_window_name)
@@ -229,7 +229,7 @@ module Glimmer
229
229
  # No Op (keyword is not taken by a built in Ruby method)
230
230
  end
231
231
  if namespace
232
- gem_name += "-#{compact_name(namespace)}"
232
+ gem_name += "-#{namespace.underscore}"
233
233
  gem_summary += " (#{human_name(namespace)})"
234
234
  else
235
235
  return puts('Namespace is required! Usage: glimmer scaffold:gem:customwindow[name,namespace]') unless `git config --get github.user`.to_s.strip == 'AndyObtiva'
@@ -292,10 +292,10 @@ module Glimmer
292
292
  end
293
293
 
294
294
  def custom_control_gem(custom_control_name, namespace)
295
- gem_name = "glimmer-libui-cc-#{compact_name(custom_control_name)}"
295
+ gem_name = "glimmer-libui-cc-#{custom_control_name.underscore}"
296
296
  gem_summary = "#{human_name(custom_control_name)} - Glimmer Custom Control"
297
297
  if namespace
298
- gem_name += "-#{compact_name(namespace)}"
298
+ gem_name += "-#{namespace.underscore}"
299
299
  gem_summary += " (#{human_name(namespace)})"
300
300
  else
301
301
  return puts('Namespace is required! Usage: glimmer scaffold:custom_control_gem[custom_control_name,namespace]') unless `git config --get github.user`.to_s.strip == 'AndyObtiva'
@@ -331,10 +331,10 @@ module Glimmer
331
331
  end
332
332
 
333
333
  def custom_shape_gem(custom_shape_name, namespace)
334
- gem_name = "glimmer-libui-cs-#{compact_name(custom_shape_name)}"
334
+ gem_name = "glimmer-libui-cs-#{custom_shape_name.underscore}"
335
335
  gem_summary = "#{human_name(custom_shape_name)} - Glimmer Custom Shape"
336
336
  if namespace
337
- gem_name += "-#{compact_name(namespace)}"
337
+ gem_name += "-#{namespace.underscore}"
338
338
  gem_summary += " (#{human_name(namespace)})"
339
339
  else
340
340
  return puts('Namespace is required! Usage: glimmer scaffold:custom_shape_gem[custom_shape_name,namespace]') unless `git config --get github.user`.to_s.strip == 'AndyObtiva'
@@ -414,10 +414,6 @@ module Glimmer
414
414
  app_name.underscore.titlecase
415
415
  end
416
416
 
417
- def compact_name(gem_name)
418
- gem_name.underscore.camelcase.downcase
419
- end
420
-
421
417
  def gemfile(window_type)
422
418
  APP_GEMFILE
423
419
  end
@@ -645,12 +641,11 @@ require '#{window_type == :app ? current_dir_name : namespace}/model/greeting'
645
641
 
646
642
  margined true
647
643
 
648
- vertical_box {
649
644
  MULTI_LINE_STRING
650
645
 
651
646
  if window_type == :gem
652
647
  custom_window_file_content += <<-MULTI_LINE_STRING
653
-
648
+ vertical_box {
654
649
  button('Preferences...') {
655
650
  stretchy false
656
651
 
@@ -658,14 +653,21 @@ require '#{window_type == :app ? current_dir_name : namespace}/model/greeting'
658
653
  display_preferences_dialog
659
654
  end
660
655
  }
661
- MULTI_LINE_STRING
662
- end
663
-
664
- custom_window_file_content += <<-MULTI_LINE_STRING
656
+
665
657
  label {
666
658
  #{%i[gem app].include?(window_type) ? "text <= [@greeting, :text]" : "text '#{human_name(custom_window_name)}'"}
667
659
  }
668
660
  }
661
+ MULTI_LINE_STRING
662
+ else
663
+ custom_window_file_content += <<-MULTI_LINE_STRING
664
+ label {
665
+ #{%i[gem app].include?(window_type) ? "text <= [@greeting, :text]" : "text '#{human_name(custom_window_name)}'"}
666
+ }
667
+ MULTI_LINE_STRING
668
+ end
669
+
670
+ custom_window_file_content += <<-MULTI_LINE_STRING
669
671
  }
670
672
  }
671
673
  MULTI_LINE_STRING
@@ -113,7 +113,7 @@ namespace :glimmer do
113
113
  task :cc, [:name, :namespace] => :customcontrol
114
114
  task :custom_control, [:name, :namespace] => :customcontrol
115
115
  task :"custom-control", [:name, :namespace] => :customcontrol
116
- #
116
+
117
117
  # desc 'Scaffold Glimmer::UI::CustomShape subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cs]'
118
118
  # task :customshape, [:name, :namespace] do |t, args|
119
119
  # require_relative 'rake_task/scaffold'
@@ -123,7 +123,7 @@ namespace :glimmer do
123
123
  # task :cs, [:name, :namespace] => :customshape
124
124
  # task :custom_shape, [:name, :namespace] => :customshape
125
125
  # task :"custom-shape", [:name, :namespace] => :customshape
126
- #
126
+
127
127
  namespace :gem do
128
128
  desc 'Scaffold Glimmer::UI::CustomWindow subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:gem:cw]'
129
129
  task :customwindow, [:name, :namespace] do |t, args|
@@ -134,17 +134,17 @@ namespace :glimmer do
134
134
  task :cw, [:name, :namespace] => :customwindow
135
135
  task :custom_window, [:name, :namespace] => :customwindow
136
136
  task :"custom-window", [:name, :namespace] => :customwindow
137
- #
138
- # desc 'Scaffold Glimmer::UI::CustomControl subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cc]'
139
- # task :customcontrol, [:name, :namespace] do |t, args|
140
- # require_relative 'rake_task/scaffold'
141
- # Glimmer::RakeTask::Scaffold.custom_control_gem(args[:name], args[:namespace])
142
- # end
143
- #
144
- # task :cc, [:name, :namespace] => :customcontrol
145
- # task :custom_control, [:name, :namespace] => :customcontrol
146
- # task :"custom-control", [:name, :namespace] => :customcontrol
147
- #
137
+
138
+ desc 'Scaffold Glimmer::UI::CustomControl subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cc]'
139
+ task :customcontrol, [:name, :namespace] do |t, args|
140
+ require_relative 'rake_task/scaffold'
141
+ Glimmer::RakeTask::Scaffold.custom_control_gem(args[:name], args[:namespace])
142
+ end
143
+
144
+ task :cc, [:name, :namespace] => :customcontrol
145
+ task :custom_control, [:name, :namespace] => :customcontrol
146
+ task :"custom-control", [:name, :namespace] => :customcontrol
147
+
148
148
  # desc 'Scaffold Glimmer::UI::CustomShape subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cs]'
149
149
  # task :customshape, [:name, :namespace] do |t, args|
150
150
  # require_relative 'rake_task/scaffold'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
@@ -353,8 +353,9 @@ description: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby
353
353
  GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims to provide
354
354
  declarative DSL syntax that visually maps to GUI control hierarchy, convention over
355
355
  configuration via smart defaults, automation of low-level details, requiring the
356
- least amount of syntax possible to build GUI, bidirectional data-binding, and custom
357
- keyword support. If you liked Shoes, You'll love Glimmer!
356
+ least amount of syntax possible to build GUI, bidirectional data-binding, custom
357
+ control/window support, and application/gem/window/control scaffolding. If you liked
358
+ Shoes, You'll love Glimmer!
358
359
  email: andy.am@gmail.com
359
360
  executables:
360
361
  - glimmer