glimmer-dsl-swt 0.6.4 → 0.6.5

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: 82c0437f480a9bfc7064ec9cf10bc196a3bbb644d8fe20832c02eda79565435a
4
- data.tar.gz: 418e810fad2c7f12280b78848931c743d619a8cc28f04f7a438092de9fed12e7
3
+ metadata.gz: 8fa25c1d494d14eac00319e494d3b2f12c9a6b344c084b02a1dde9f60c2f44a5
4
+ data.tar.gz: 648c050a1a25a284e972beb5c129047ef6cbf8fabb1a80981408d900afed0c25
5
5
  SHA512:
6
- metadata.gz: dadb4107a2480af548a5e1f79f60b44a798e0ae2aa130e14dae4e1878d7211418c53ab88be39cb8adcfe42a1fc3846b46e06f5e90dccb984299896eef90f15a9
7
- data.tar.gz: f902727a93b33a3aa0f013484b44f648fc2f991766f612ebb4e093c932389032417f8fe038de17609f7a28e3324d158419a1e502d07cd822b104658a7b4fb33c
6
+ metadata.gz: dc9dedb03e9251f0a88e5530a642c062899be1651b26d2314258925375b871a3e5736141a1ee5b8dfacde1bc7a1d606d4ce00ac8affc8bf160b06f4aa7141306
7
+ data.tar.gz: 00416f75c6c00dc163501209a20839cd23fb51921a5335f8ffff7009bf013cca11ccb54389a55367c0ccbb1b0f1bb1641c61141d376a5c5792584567bd1d7937
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 SWT 0.6.4 (Desktop GUI)
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 SWT 0.6.5 (Desktop GUI)
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
3
3
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-swt/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-swt?branch=master)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env jruby
2
2
 
3
+ if ARGV.empty?
4
+ require 'rake-tui'
5
+ require 'tty-screen'
6
+ end
3
7
  require_relative '../lib/glimmer/launcher'
4
8
 
5
9
  Glimmer::Launcher.new(ARGV).launch
@@ -6,34 +6,26 @@ module Glimmer
6
6
  class Launcher
7
7
  OPERATING_SYSTEMS_SUPPORTED = ["mac", "windows", "linux"]
8
8
 
9
- TEXT_USAGE_PREFIX = <<~MULTI_LINE_STRING
9
+ TEXT_USAGE = <<~MULTI_LINE_STRING
10
10
  Glimmer (Ruby Desktop Development GUI Library) - JRuby Gem: glimmer-dsl-swt v#{File.read(File.expand_path('../../../VERSION', __FILE__))}
11
11
  Usage: glimmer [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
12
12
 
13
- Runs Glimmer applications/tasks.
14
-
15
- Either a single task or one or more applications may be specified.
16
-
17
- When a task is specified, it runs via rake. Some tasks take arguments in square brackets.
18
-
19
- Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
20
- MULTI_LINE_STRING
21
-
22
- TEXT_USAGE_SUFFIX = <<~MULTI_LINE_STRING
13
+ Runs Glimmer applications and tasks.
23
14
 
24
15
  When applications are specified, they are run using JRuby,
25
16
  automatically preloading the glimmer Ruby gem and SWT jar dependency.
26
17
 
27
- Optionally, extra Glimmer options, JRuby options and environment variables may be passed in.
18
+ Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
28
19
 
29
20
  Glimmer options:
30
21
  - "--quiet" : Does not announce file path of Glimmer application being launched
31
22
  - "--debug" : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
32
23
  - "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)
33
24
 
34
- Example: glimmer samples/hello_world.rb
25
+ Tasks are run via rake. Some tasks take arguments in square brackets.
35
26
 
36
- This runs the Glimmer application samples/hello_world.rb
27
+ Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
28
+
37
29
  MULTI_LINE_STRING
38
30
 
39
31
  GLIMMER_LIB_LOCAL = File.expand_path(File.join('lib', 'glimmer-dsl-swt.rb'))
@@ -180,14 +172,33 @@ module Glimmer
180
172
  end
181
173
 
182
174
  def display_usage
183
- rakefile_dir = File.exist?('Rakefile') ? '.' : File.dirname(__FILE__)
184
- FileUtils.cd(rakefile_dir) do
185
- rake_tasks = `rake -T`.gsub('rake glimmer:', 'glimmer ').split("\n").select {|l| l.start_with?('glimmer ')}
186
- puts TEXT_USAGE_PREFIX
187
- puts rake_tasks.join("\n")
188
- puts TEXT_USAGE_SUFFIX
175
+ puts TEXT_USAGE
176
+ display_tasks
177
+ end
178
+
179
+ def display_tasks
180
+ if OS.windows?
181
+ tasks = Rake.application.tasks
182
+ task_lines = tasks.reject do |task|
183
+ task.comment.nil?
184
+ end.map do |task|
185
+ max_task_size = tasks.map(&:name_with_args).map(&:size).max + 1
186
+ task_name = task.name_with_args.sub('glimmer:', '')
187
+ line = "glimmer #{task_name.ljust(max_task_size)} # #{task.comment}"
188
+ bound = TTY::Screen.width - 6
189
+ line.size <= bound ? line : "#{line[0..(bound - 3)]}..."
190
+ end
191
+ puts task_lines.to_a
192
+ else
193
+ Rake::TUI.run(branding_header: nil, prompt_question: 'Select a Glimmer task to run:') do |task, tasks|
194
+ max_task_size = tasks.map(&:name_with_args).map(&:size).max + 1
195
+ task_name = task.name_with_args.sub('glimmer:', '')
196
+ line = "glimmer #{task_name.ljust(max_task_size)} # #{task.comment}"
197
+ bound = TTY::Screen.width - 6
198
+ line.size <= bound ? line : "#{line[0..(bound - 3)]}..."
199
+ end
189
200
  end
190
- end
201
+ end
191
202
 
192
203
  def extract_application_paths(options)
193
204
  options.select do |option|
@@ -41,16 +41,20 @@ namespace :glimmer do
41
41
  end.map do |path|
42
42
  [path, path.underscore.titlecase, "#{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run[#{path}]"]
43
43
  end.sort
44
- puts
45
- puts " Glimmer Hello Samples (run all via: #{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run:hello):"
46
- puts Text::Table.new(
47
- :head => %w[Name Description Run],
48
- :rows => array_of_arrays,
49
- :horizontal_padding => 1,
50
- :vertical_boundary => ' ',
51
- :horizontal_boundary => ' ',
52
- :boundary_intersection => ' '
53
- )
44
+ if array_of_arrays.empty?
45
+ puts "No Glimmer Hello Samples match the query."
46
+ else
47
+ puts
48
+ puts " Glimmer Hello Samples (run all via: #{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run:hello):"
49
+ puts Text::Table.new(
50
+ :head => %w[Name Description Run],
51
+ :rows => array_of_arrays,
52
+ :horizontal_padding => 1,
53
+ :vertical_boundary => ' ',
54
+ :horizontal_boundary => ' ',
55
+ :boundary_intersection => ' '
56
+ )
57
+ end
54
58
  end
55
59
 
56
60
  task :elaborate, [:query] => :requires do |t, args|
@@ -61,16 +65,20 @@ namespace :glimmer do
61
65
  end.map do |path|
62
66
  [path, path.underscore.titlecase, "#{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run[#{path}]"]
63
67
  end.sort
64
- puts
65
- puts " Glimmer Elaborate Samples (run all via: #{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run:elaborate):"
66
- puts Text::Table.new(
67
- :head => %w[Name Description Run],
68
- :rows => array_of_arrays,
69
- :horizontal_padding => 1,
70
- :vertical_boundary => ' ',
71
- :horizontal_boundary => ' ',
72
- :boundary_intersection => ' '
73
- )
68
+ if array_of_arrays.empty?
69
+ puts "No Glimmer Elaborate Samples match the query."
70
+ else
71
+ puts
72
+ puts " Glimmer Elaborate Samples (run all via: #{'bin/' if Glimmer::Launcher.dev_mode?}glimmer sample:run:elaborate):"
73
+ puts Text::Table.new(
74
+ :head => %w[Name Description Run],
75
+ :rows => array_of_arrays,
76
+ :horizontal_padding => 1,
77
+ :vertical_boundary => ' ',
78
+ :horizontal_boundary => ' ',
79
+ :boundary_intersection => ' '
80
+ )
81
+ end
74
82
  end
75
83
  end
76
84
 
@@ -137,7 +145,6 @@ namespace :glimmer do
137
145
  Rake::Task['glimmer:package:native'].execute(args)
138
146
  end
139
147
 
140
-
141
148
  desc 'Scaffold Glimmer application directory structure to build a new app'
142
149
  task :scaffold, [:app_name] do |t, args|
143
150
  require_relative 'scaffold'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-02 00:00:00.000000000 Z
11
+ date: 2020-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.10.0
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.2.1
75
+ name: rake-tui
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.2.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  requirement: !ruby/object:Gem::Requirement
71
85
  requirements: