glimmer-cs-gladiator 0.7.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/README.md +72 -16
- data/VERSION +1 -1
- data/bin/gladiator +23 -2
- data/bin/gladiator-setup +80 -0
- data/bin/glimmer-cs-gladiator +22 -0
- data/glimmer-cs-gladiator.gemspec +17 -8
- data/images/glimmer-cs-gladiator-logo.png +0 -0
- data/lib/glimmer-cs-gladiator.rb +1 -0
- data/lib/glimmer-cs-gladiator/launch.rb +6 -0
- data/lib/models/glimmer/gladiator/command.rb +2 -2
- data/lib/models/glimmer/gladiator/dir.rb +10 -5
- data/lib/models/glimmer/gladiator/file.rb +133 -8
- data/lib/views/glimmer/gladiator.rb +494 -585
- data/lib/views/glimmer/gladiator/file_edit_menu.rb +67 -0
- data/lib/views/glimmer/gladiator/gladiator_menu_bar.rb +216 -0
- data/lib/views/glimmer/gladiator/progress_shell.rb +29 -0
- data/lib/views/glimmer/gladiator/text_editor.rb +24 -17
- metadata +30 -6
- data/bin/gladiator_runner.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50517d61cc617ff8301fd56053e04c385e75591a9d4adc7ddf02b9ca6bfb785
|
4
|
+
data.tar.gz: deac989a0cd8086b8c6b3be605606ff96fda4d6ad9a8c8d7fcb4cee6afcde1b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79bd7f9c58f721c17168d51b13a58f2f7ac6817110c76e14170cdebae3c22d4adf2b30763ce2cbb04c220300934c30b3dfc8c2e9533520689444c94c537c3e54
|
7
|
+
data.tar.gz: b04a9bd90fe07bd5c64e947089a017b51925707805d6127866cc10cd789c6ac76f4f40f37669033c8deaf375d98072fbb92e419c37429bcdb368e634ce1e2aa5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,55 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.8.3
|
4
|
+
|
5
|
+
- Switch Scratchpad evaling to loading a temporary local file under `project_dir/.gladiator-scratchpad` for a more realistic Ruby running experience
|
6
|
+
- Fix issue with detecting current gladiator window when handling keyboard shortcuts
|
7
|
+
- Fix issue with Scratchpad opening twice when called twice instead of reusing the existing Scratchpad
|
8
|
+
- Fix issue with closed tabs not closing their file streams/watchers, including the Scratchpad temporary file
|
9
|
+
|
10
|
+
## 0.8.2
|
11
|
+
|
12
|
+
- Add a right click menu on text editor area with undo redo | cut, copy, paste, delete | select all
|
13
|
+
- Replaced error message_box with a more readable error dialog for running Ruby code
|
14
|
+
- Update Ruby Run menu item command to run against the top level binding receiver (ensuring no weird errors when including Glimmer)
|
15
|
+
- In app mode, display an "Open Project..." button
|
16
|
+
- In app mode, set gladiator icon on initial shell
|
17
|
+
- Fix full line selection on Windows (SHIFT+HOME or SHIFT+END)
|
18
|
+
- Fix issue with display saving original file before changes when running in app mode, making changes to an open project, and then closing
|
19
|
+
- Fix caret position after formatting dirty content (when pasting a string that has extra empty spaces for example)
|
20
|
+
|
21
|
+
## 0.8.1
|
22
|
+
|
23
|
+
- Package Gladiator as a Windows MSI file
|
24
|
+
- Fix issue with HOME and END taking to beginning of file and end of file on Windows instead of beginning of line and end of line
|
25
|
+
- Fix opening first tab on Windows (shows up as blank, but second tab shows up fine)
|
26
|
+
- Fix issue with losing focus on changing tabs on Windows via Windows default tab switching shortcuts of CTRL+PGUP & CTRL+PGDN
|
27
|
+
- Fix crazy flashing issue upon hitting CTRL+T on Windows to jump to the File Explorer (doesn't always happen, only the first time in a session)
|
28
|
+
- Fix CMD+R shortcut on Windows via CTRL+R
|
29
|
+
- Fix minimization of Navigation area on Windows (closes but keeps size of expand bar)
|
30
|
+
- Fix shortcuts for Windows/Linux by using ALT as alternative to CTRL when employing both COMMAND (CTRL on Windows/Linux) and CONTROL (ALT on Windows/Linux)
|
31
|
+
|
32
|
+
## 0.8.0
|
33
|
+
|
34
|
+
- Upgrade to glimmer-dsl-swt v4.18.3.5
|
35
|
+
- Multiple language syntax highlighting support (over 20 languages) via the new code_text language option in Glimmer DSL for SWT
|
36
|
+
- Refactor code to use display on_quit event (instead of manual SWT code for quitting on the Mac)
|
37
|
+
- Fix issue with Reset All not working
|
38
|
+
- Fix issue with CMD+F not revealing Navigation Area when in Maximized Editor Mode
|
39
|
+
|
40
|
+
## 0.7.3
|
41
|
+
|
42
|
+
- Add gladiator-setup to make gladiator executable available everywhere
|
43
|
+
- Package Gladiator as Mac DMG file
|
44
|
+
- Shrink minimum height for editor area (too large for putting side by side with another window)
|
45
|
+
- Change initial default size of Gladiator window to the entire screen size
|
46
|
+
- Made layout more resilient to shrinkage so that the Navigation area widgets don't get jumbled up
|
47
|
+
- Show open project dialog when run as Gladiator app (e.g. Mac app) instead of opening the local directory of the app
|
48
|
+
- Extract gladiator_menu_bar custom widget and reuse in open_project shell (to use in app version)
|
49
|
+
- Extract progress_shell custom shell
|
50
|
+
- Fix issue with disposed? error in save_config
|
51
|
+
- Fix issue with first open of a file with an empty brand new gladiator session not showing file content until resizing
|
52
|
+
|
3
53
|
## 0.7.2
|
4
54
|
|
5
55
|
- Fallback font ("Courier") for text editor when "Consolas" is not available
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.
|
1
|
+
# <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.8.3 - [Ugliest Text Editor Ever!](https://www.reddit.com/r/ruby/comments/hgve8k/gladiator_glimmer_editor_ugliest_text_editor_ever/)
|
2
2
|
## [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Custom Shell](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-shell-gem)
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-cs-gladiator.svg)](http://badge.fury.io/rb/glimmer-cs-gladiator)
|
4
4
|
|
@@ -9,15 +9,17 @@ It is not intended to be a full-fledged editor by any means, yet mostly a fun ed
|
|
9
9
|
Gladiator is also a personal tool for shaping an editor exactly the way I like, with all the keyboard shortcuts I prefer.
|
10
10
|
I leave building truly professional text editors to software tooling experts who would hopefully use [Glimmer](https://github.com/AndyObtiva/glimmer) one day. Otherwise, I have been happily using Gladiator to develop all my [open-source projects](https://github.com/AndyObtiva) since May of 2020.
|
11
11
|
|
12
|
+
You may now [download](#download) a packaged version of Gladiator.
|
13
|
+
|
12
14
|
## Features
|
13
15
|
|
14
|
-
Gladiator currently supports the following text editing features (including keyboard shortcuts with Mac CMD=CTRL on Windows/Linux)
|
16
|
+
Gladiator currently supports the following text editing features (including keyboard shortcuts with Mac CMD=CTRL/CTRL=ALT on Windows/Linux)
|
15
17
|
|
16
18
|
![Gladiator Demo](images/glimmer-gladiator.gif)
|
17
19
|
|
18
20
|
### Text Editor
|
19
21
|
|
20
|
-
- Text Editor with Colored
|
22
|
+
- Text Editor with Colored Syntax Highlighting for [Multiple Languages](#multiple-language-syntax-highlighting)
|
21
23
|
- Show Line Numbers
|
22
24
|
- Multi-tab support (CMD+SHIFT+[ & CMD+SHIFT+] for tab navigation. CMD+1-9 to jump to a specific tab)
|
23
25
|
- Drag and drop split pane (drag a file from File Tree or File Lookup List, and it splits the pane)
|
@@ -50,9 +52,9 @@ Gladiator currently supports the following text editing features (including keyb
|
|
50
52
|
### Menus
|
51
53
|
|
52
54
|
- File Menu:
|
55
|
+
- Open Scratchpad for running arbitrary Ruby/Glimmer code (saves a temporary file to `project_dir/.gladiator-scratchpad`) (CMD+SHIFT+S)
|
53
56
|
- Open Project (CMD+O)
|
54
57
|
- Quit Project (CMD+ALT+Q)
|
55
|
-
- New Scratchpad for running arbitrary Ruby/Glimmer code without saving to disk (CMD+SHIFT+S)
|
56
58
|
- View Menu
|
57
59
|
- Split Pane
|
58
60
|
- Orientation change to Horizontal/Vertical (CMD+SHIFT+O)
|
@@ -74,21 +76,58 @@ Gladiator currently supports the following text editing features (including keyb
|
|
74
76
|
- Remember opened tabs, caret position, top pixel, window size, and window location
|
75
77
|
- [Default](#configuration) "ignore paths" to avoid bogging down editor with irrelevant directory files
|
76
78
|
|
79
|
+
### Multiple Language Syntax Highlighting
|
80
|
+
|
81
|
+
- Ruby
|
82
|
+
- Markdown
|
83
|
+
- JavaScript
|
84
|
+
- JSON
|
85
|
+
- Yaml
|
86
|
+
- HTML
|
87
|
+
- C
|
88
|
+
- Haskell
|
89
|
+
- Gradle
|
90
|
+
- C++
|
91
|
+
- CSS
|
92
|
+
- Java
|
93
|
+
- JSP
|
94
|
+
- plist
|
95
|
+
- Haml
|
96
|
+
- XML
|
97
|
+
- INI
|
98
|
+
- Perl
|
99
|
+
- Tcl
|
100
|
+
- SASS
|
101
|
+
- SCSS
|
102
|
+
- SQL
|
103
|
+
- Shell (Bash / Zsh)
|
104
|
+
- Vue
|
105
|
+
|
77
106
|
## Platforms
|
78
107
|
|
79
108
|
- Mac: Gladiator works best on the Mac. This is the platform it is most used on and receives the most maintenance for.
|
80
|
-
- Windows: Gladiator works OK on Windows, but has
|
109
|
+
- Windows: Gladiator works OK on Windows, but has a few annoying issues.
|
81
110
|
- Linux: Gladiator works with handicaps on Linux (performing some text editing operations causes scroll jitter). Contributers could help fix.
|
82
111
|
|
83
112
|
## Pre-requisites
|
84
113
|
|
85
114
|
- [JDK](https://www.oracle.com/java/technologies/javase-downloads.html): Same version required by [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt)
|
86
115
|
- [JRuby](https://www.jruby.org/download): Same version required by [Glimmer](https://github.com/AndyObtiva/glimmer-dsl-swt)
|
87
|
-
- [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Framework)
|
116
|
+
- [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Framework) (dependency included in Ruby gem).
|
117
|
+
|
118
|
+
## Download
|
119
|
+
|
120
|
+
[Download Gladiator 0.8.3 Mac DMG Installer](https://www.dropbox.com/s/suqvzceqj1fxj8o/Gladiator-0.8.3.dmg?dl=1)
|
121
|
+
|
122
|
+
[Download Gladiator 0.8.3 Windows MSI Installer](https://www.dropbox.com/s/7kcrf7r5p6vxfm7/Gladiator-0.8.3.msi?dl=1)
|
123
|
+
|
124
|
+
The packaged version starts with a dialog asking you what project to open. Gladiator does not fully show up until you have selected a project directory.
|
125
|
+
|
126
|
+
Otherwise, if you prefer a command line version, then follow the Setup Instructions below.
|
88
127
|
|
89
128
|
## Setup Instructions
|
90
129
|
|
91
|
-
Note: if you encounter any issues, check if they are documented in [TODO.md](TODO.md), [issues](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues), or [pull requests](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls) as they might be on my radar to fix. Otherwise, please report as an [issue](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues) or better yet fix and submit a [pull request](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls).
|
130
|
+
Note: if you encounter any issues, check if they are documented in [TODO.md](TODO.md), [issues](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues), or [pull requests](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls) as they might be on my radar to fix. Otherwise, please report as an [issue](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues) or better yet fix and submit a [pull request](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls). Also, try going back to a [previous version of the gem](https://rubygems.org/gems/glimmer-cs-gladiator/versions) until you find one that works. Keep in mind this is open-source software provided as is, so there are no guarantees of functionality. If you would like such guarantees, you are welcome to [hire me full-time](https://www.linkedin.com/in/andymaleh/).
|
92
131
|
|
93
132
|
Install Gladiator gem by running (`jgem`, `jruby -S gem`, or `gem` directly if you have [RVM](https://rvm.io/)):
|
94
133
|
|
@@ -110,6 +149,15 @@ Run (`jruby -S bundle` or `bundle` directly if you have [RVM](https://rvm.io/)):
|
|
110
149
|
jruby -S bundle
|
111
150
|
```
|
112
151
|
|
152
|
+
Afterwards, if you are using [RVM](https://rvm.io/) and want to ensure system wide availablility of the `gladiator` command across Ruby versions, run this command in an environment that has JRuby (not needed without [RVM](https://rvm.io/)):
|
153
|
+
|
154
|
+
```
|
155
|
+
gladiator-setup
|
156
|
+
source ~/.gladiator_source
|
157
|
+
```
|
158
|
+
|
159
|
+
You should be able to run `gladiator` from anywhere now.
|
160
|
+
|
113
161
|
## Usage
|
114
162
|
|
115
163
|
You may run the `gladiator` command to bring up the text editor in the project directory you would like to edit:
|
@@ -138,19 +186,13 @@ gladiator relative-or-absolute-path/to/project
|
|
138
186
|
|
139
187
|
Note: If you cloned this project and bundle installed, you may invoke via `bin/gladiator` instead.
|
140
188
|
|
141
|
-
If your project is not a JRuby project, then you cannot install [glimmer-cs-gladiator](https://rubygems.org/gems/glimmer-cs-gladiator), so you must install in a separate JRuby environment and invoke by passing the project path as per command above. Alternatively, you may clone this project, and invoke gladiator via `bin/gladiator` (that's how I use Gladiator for most of my projects):
|
142
|
-
|
143
|
-
```
|
144
|
-
bin/gladiator relative-or-absolute-path/to/project
|
145
|
-
```
|
146
|
-
|
147
189
|
### Glimmer Custom Shell Reuse
|
148
190
|
|
149
191
|
To reuse Gladiator as a Glimmer Custom Shell inside another Glimmer application, add the
|
150
192
|
following to the application's `Gemfile`:
|
151
193
|
|
152
194
|
```
|
153
|
-
gem 'glimmer-cs-gladiator', '>= 0.
|
195
|
+
gem 'glimmer-cs-gladiator', '>= 0.8.3'
|
154
196
|
```
|
155
197
|
|
156
198
|
Run:
|
@@ -181,9 +223,11 @@ Gladiator automatically saves configuration data in a `.gladiator` file at the d
|
|
181
223
|
It currently remembers:
|
182
224
|
- Last opened files (in both split panes if split)
|
183
225
|
- Window size and position
|
184
|
-
- Ignore Paths (default: '.gladiator', '.git', 'coverage', 'packages', 'node_modules', 'tmp', 'vendor')
|
226
|
+
- Ignore Paths under `Glimmer::Gladiator::Dir::IGNORE_PATHS` (default: `['.gladiator', '.git', 'coverage', 'packages', 'node_modules', 'tmp', 'vendor', 'pkg', 'dist']`)
|
185
227
|
|
186
|
-
##
|
228
|
+
## Gotchas
|
229
|
+
|
230
|
+
### Signaling Error
|
187
231
|
|
188
232
|
Gladiator repetitively displays a signaling error that is harmless in practice:
|
189
233
|
```
|
@@ -192,6 +236,17 @@ The signal INT is in use by the JVM and will not work correctly on this platform
|
|
192
236
|
The signal TERM is in use by the JVM and will not work correctly on this platform
|
193
237
|
```
|
194
238
|
|
239
|
+
### App Is Not Responding
|
240
|
+
|
241
|
+
If you run the `gladiator` command from the root directory or some parent directory to many projects, it assumes that is
|
242
|
+
the project directory and attempt to pre-load all files, taking a very long time and not responding for quite a while.
|
243
|
+
|
244
|
+
To avoid this problem, always make sure you are running the `gladiator` command from a single project's directory.
|
245
|
+
|
246
|
+
Also, if you encounter this issue with projects that contain a lot of extra files that you do not need to edit, you
|
247
|
+
could later open the generate `.gladiator` file at the root of the project directory and add unnecessary subdirectories
|
248
|
+
to the `ignore_paths` array.
|
249
|
+
|
195
250
|
## TODO
|
196
251
|
|
197
252
|
[TODO.md](TODO.md)
|
@@ -209,6 +264,7 @@ The signal TERM is in use by the JVM and will not work correctly on this platfor
|
|
209
264
|
- Commit and push until you are happy with your contribution.
|
210
265
|
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
211
266
|
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
267
|
+
- On windows, add this Git config: `git config core.autocrlf input` (or globally if you're working on multiple Glimmer projects)
|
212
268
|
|
213
269
|
## Copyright
|
214
270
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.3
|
data/bin/gladiator
CHANGED
@@ -1,8 +1,29 @@
|
|
1
|
-
#!/usr/bin/env
|
1
|
+
#!/usr/bin/env jruby
|
2
|
+
|
3
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2
23
|
|
3
24
|
require 'glimmer/launcher'
|
4
25
|
|
5
|
-
gladiator_runner = File.expand_path('../
|
26
|
+
gladiator_runner = File.expand_path('../glimmer-cs-gladiator', __FILE__)
|
6
27
|
launcher = Glimmer::Launcher.new([gladiator_runner, '-J-Xrs'] + ARGV)
|
7
28
|
launcher.application_paths.to_a.each do |file|
|
8
29
|
if file != gladiator_runner
|
data/bin/gladiator-setup
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
24
|
+
version = File.read(File.expand_path('../VERSION', __dir__))
|
25
|
+
puts "== Gladiator (Glimmer Editor) Version #{version.strip} =="
|
26
|
+
|
27
|
+
ruby = `which jruby`.to_s.strip
|
28
|
+
if ruby.empty?
|
29
|
+
return puts('jruby is not available. Make sure you have jruby installed and available in path environment (or selected if using RVM)')
|
30
|
+
end
|
31
|
+
|
32
|
+
rvm_command = `which rvm`
|
33
|
+
if rvm_command.to_s.strip.empty?
|
34
|
+
command = "#{ruby} #{File.expand_path('../gladiator', __FILE__)}"
|
35
|
+
else
|
36
|
+
rvm = `rvm current`.strip
|
37
|
+
command = "rvm #{rvm} do #{ruby} #{File.expand_path('../gladiator', __FILE__)}"
|
38
|
+
end
|
39
|
+
|
40
|
+
gladiator_script = <<~SHELL_SCRIPT
|
41
|
+
function gladiator()
|
42
|
+
{
|
43
|
+
#{command}
|
44
|
+
}
|
45
|
+
SHELL_SCRIPT
|
46
|
+
|
47
|
+
|
48
|
+
require 'fileutils'
|
49
|
+
home_dir = `echo ~`.strip
|
50
|
+
FileUtils.mkdir_p("#{home_dir}/bin")
|
51
|
+
gladiator_script_file = "#{home_dir}/.gladiator_source"
|
52
|
+
gladiator_script_file_bash = "$HOME/.gladiator_source"
|
53
|
+
File.write(gladiator_script_file, gladiator_script)
|
54
|
+
|
55
|
+
[
|
56
|
+
['.bash_profile', '.bashrc'],
|
57
|
+
['.zprofile', '.zshrc']
|
58
|
+
].each do |profile_and_fallback|
|
59
|
+
shell_profile_file_name = profile_and_fallback.first
|
60
|
+
shell_profile_file_name = profile_and_fallback.last if !File.exist?("#{home_dir}/#{shell_profile_file_name}")
|
61
|
+
shell_profile_file = "#{home_dir}/#{shell_profile_file_name}"
|
62
|
+
FileUtils.touch(shell_profile_file)
|
63
|
+
shell_profile = File.read(shell_profile_file)
|
64
|
+
gladiator_source_statement = "source \"#{gladiator_script_file_bash}\""
|
65
|
+
unless shell_profile.split("\n").detect {|line| line.include?(gladiator_source_statement) }
|
66
|
+
File.write(shell_profile_file, "#{shell_profile}\n#{gladiator_source_statement}")
|
67
|
+
end
|
68
|
+
puts "~/#{shell_profile_file_name} has been modified to source the `gladiator` function from ~/.gladiator_source"
|
69
|
+
end
|
70
|
+
|
71
|
+
puts <<~OUTPUT
|
72
|
+
|
73
|
+
Before using `gladiator`, start a new shell session (open a new terminal tab) or run:
|
74
|
+
|
75
|
+
source ~/.gladiator_source
|
76
|
+
|
77
|
+
Afterwards, you may run the following command from anywhere to start Gladiator (Glimmer Editor):
|
78
|
+
|
79
|
+
gladiator
|
80
|
+
OUTPUT
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require_relative '../lib/glimmer-cs-gladiator/launch'
|
@@ -2,19 +2,19 @@
|
|
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-cs-gladiator 0.
|
5
|
+
# stub: glimmer-cs-gladiator 0.8.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-cs-gladiator".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.8.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 = ["Andy Maleh".freeze]
|
14
|
-
s.date = "2021-
|
14
|
+
s.date = "2021-03-04"
|
15
15
|
s.description = "Gladiator (short for Glimmer Editor) is a Glimmer sample project under on-going development. It is not intended to be a full-fledged editor by any means, yet mostly a fun educational exercise in using Glimmer to build a text editor. Gladiator is also a personal tool for shaping an editor exactly the way I like. I leave building truly professional text editors to software tooling experts who would hopefully use Glimmer one day.".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
|
-
s.executables = ["gladiator".freeze]
|
17
|
+
s.executables = ["glimmer-cs-gladiator".freeze, "gladiator".freeze, "gladiator-setup".freeze]
|
18
18
|
s.extra_rdoc_files = [
|
19
19
|
"LICENSE.txt",
|
20
20
|
"README.md"
|
@@ -25,20 +25,26 @@ Gem::Specification.new do |s|
|
|
25
25
|
"README.md",
|
26
26
|
"VERSION",
|
27
27
|
"bin/gladiator",
|
28
|
-
"bin/
|
28
|
+
"bin/gladiator-setup",
|
29
|
+
"bin/glimmer-cs-gladiator",
|
29
30
|
"glimmer-cs-gladiator.gemspec",
|
30
31
|
"images/glimmer-cs-gladiator-logo.png",
|
31
32
|
"lib/glimmer-cs-gladiator.rb",
|
33
|
+
"lib/glimmer-cs-gladiator/launch.rb",
|
32
34
|
"lib/models/glimmer/gladiator/command.rb",
|
33
35
|
"lib/models/glimmer/gladiator/dir.rb",
|
34
36
|
"lib/models/glimmer/gladiator/file.rb",
|
35
37
|
"lib/views/glimmer/gladiator.rb",
|
38
|
+
"lib/views/glimmer/gladiator/file_edit_menu.rb",
|
36
39
|
"lib/views/glimmer/gladiator/file_explorer_tree.rb",
|
37
40
|
"lib/views/glimmer/gladiator/file_lookup_list.rb",
|
41
|
+
"lib/views/glimmer/gladiator/gladiator_menu_bar.rb",
|
42
|
+
"lib/views/glimmer/gladiator/progress_shell.rb",
|
38
43
|
"lib/views/glimmer/gladiator/text_editor.rb"
|
39
44
|
]
|
40
45
|
s.homepage = "http://github.com/AndyObtiva/glimmer-cs-gladiator".freeze
|
41
46
|
s.licenses = ["MIT".freeze]
|
47
|
+
s.post_install_message = "\nTo make the gladiator command available system-wide (especially with RVM), make sure you run this command with jruby in path: gladiator-setup\n\n".freeze
|
42
48
|
s.rubygems_version = "3.0.6".freeze
|
43
49
|
s.summary = "Gladiator (Glimmer Editor) - Glimmer Custom Shell - Text Editor Built in Ruby".freeze
|
44
50
|
|
@@ -46,26 +52,29 @@ Gem::Specification.new do |s|
|
|
46
52
|
s.specification_version = 4
|
47
53
|
|
48
54
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
-
s.add_runtime_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.
|
55
|
+
s.add_runtime_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.4.3", "< 5.0.0.0"])
|
50
56
|
s.add_runtime_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
51
57
|
s.add_runtime_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
52
58
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
53
59
|
s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
60
|
+
s.add_development_dependency(%q<warbler>.freeze, ["= 2.0.5"])
|
54
61
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
55
62
|
else
|
56
|
-
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.
|
63
|
+
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.4.3", "< 5.0.0.0"])
|
57
64
|
s.add_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
58
65
|
s.add_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
59
66
|
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
60
67
|
s.add_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
68
|
+
s.add_dependency(%q<warbler>.freeze, ["= 2.0.5"])
|
61
69
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
62
70
|
end
|
63
71
|
else
|
64
|
-
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.
|
72
|
+
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.18.4.3", "< 5.0.0.0"])
|
65
73
|
s.add_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
66
74
|
s.add_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
67
75
|
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
68
76
|
s.add_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
77
|
+
s.add_dependency(%q<warbler>.freeze, ["= 2.0.5"])
|
69
78
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
70
79
|
end
|
71
80
|
end
|