rails-gui 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +7 -3
- data/VERSION +1 -1
- data/app/rails_gui/model/rails_command.rb +33 -0
- data/app/rails_gui/view/main_window.rb +17 -8
- data/rails-gui.gemspec +5 -3
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 690558b467a492c85154ab772d2fdfe68aef060d333b4f5f9a87beca5f39e828
|
4
|
+
data.tar.gz: 7b54b2625ffc28aed46c05524b3c2a40d4636983f163c64b627c2d0c6b694bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae9a68b4ec8179912a0f888dd75abaab8f3cf84e2ddea71a447598863825b4948a89ea9a4e78f91d8202d667541d88e84b94ab7b51e56b65abc8424b80c4c899
|
7
|
+
data.tar.gz: 196b3cf21f69874ae44a1d9427aa86a882918a40531749cc3c8b78cbcde29474d77f7e74ab3273fa24f27c56b09c18b21d50f9297c3de2af9505b504e814fed2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.0.2
|
4
|
+
|
5
|
+
- Load app instantly after first run by caching routes in a local file under ~/.rails-gui/routes.yml
|
6
|
+
- Routes menu with Refresh menu item
|
7
|
+
- Have default focus upon app start be on search field to enable quicker usage (moving refresh button to bottom)
|
8
|
+
|
3
9
|
## 0.0.1
|
4
10
|
|
5
11
|
- Rails routes
|
data/README.md
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
# Rails GUI
|
1
|
+
# Rails GUI 0.0.2
|
2
2
|
## User-Friendly Rails Configuration
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rails-gui.svg)](http://badge.fury.io/rb/rails-gui)
|
4
4
|
|
5
|
+
[EARLY ALPHA]
|
6
|
+
|
5
7
|
Rails Graphical User Interface (e.g. display routes in a table, run rails commands visually, etc...)
|
6
8
|
|
7
9
|
![rails gui rails routes screenshot](/screenshots/rails-gui-rails-routes.png)
|
8
10
|
|
11
|
+
Given that the project is still early alpha, this is your chance to contribute ideas and pull requests for the project with whatever you want or see value in! Please open issues or pull requests to share your ideas!
|
12
|
+
|
9
13
|
## Setup
|
10
14
|
|
11
15
|
### RubyGem
|
@@ -13,7 +17,7 @@ Rails Graphical User Interface (e.g. display routes in a table, run rails comman
|
|
13
17
|
Install (if using [RVM](https://rvm.io/), in the same [gemset](https://rvm.io/gemsets/basics) as your Rails app):
|
14
18
|
|
15
19
|
```
|
16
|
-
gem install rails-gui
|
20
|
+
gem install rails-gui -v0.0.2
|
17
21
|
```
|
18
22
|
|
19
23
|
### Bundler
|
@@ -22,7 +26,7 @@ Add to `Gemfile` under `development` group:
|
|
22
26
|
|
23
27
|
```ruby
|
24
28
|
group :development do
|
25
|
-
gem 'rails-gui'
|
29
|
+
gem 'rails-gui', '~> 0.0.2'
|
26
30
|
end
|
27
31
|
```
|
28
32
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'singleton'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'yaml'
|
2
4
|
|
3
5
|
module RailsGui
|
4
6
|
module Model
|
@@ -6,7 +8,32 @@ module RailsGui
|
|
6
8
|
class RailsCommand
|
7
9
|
include Singleton
|
8
10
|
|
11
|
+
FILE_ROUTES = File.join(Dir.home, '.rails-gui', 'routes.yml')
|
12
|
+
|
9
13
|
def routes
|
14
|
+
@routes = load_routes
|
15
|
+
refresh_routes if @routes.nil?
|
16
|
+
@routes
|
17
|
+
end
|
18
|
+
|
19
|
+
def load_routes
|
20
|
+
FileUtils.mkdir_p(File.dirname(FILE_ROUTES))
|
21
|
+
YAML.load(File.read(FILE_ROUTES))
|
22
|
+
rescue => e
|
23
|
+
puts "No routes found at: #{FILE_ROUTES}"
|
24
|
+
Glimmer::Config.logger.error {e.full_message}
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
def save_routes
|
29
|
+
FileUtils.mkdir_p(File.dirname(FILE_ROUTES))
|
30
|
+
File.write(FILE_ROUTES, YAML.dump(@routes))
|
31
|
+
rescue => e
|
32
|
+
puts "Cannot save routes at: #{FILE_ROUTES}"
|
33
|
+
Glimmer::Config.logger.error {e.full_message}
|
34
|
+
end
|
35
|
+
|
36
|
+
def fetch_routes
|
10
37
|
`rails routes`.lines.drop(1).map do |line|
|
11
38
|
cells = line.split
|
12
39
|
cells.prepend('') if cells[0] && (cells[0] == cells[0].upcase)
|
@@ -14,6 +41,12 @@ module RailsGui
|
|
14
41
|
cells
|
15
42
|
end
|
16
43
|
end
|
44
|
+
|
45
|
+
def refresh_routes
|
46
|
+
@routes = fetch_routes
|
47
|
+
save_routes
|
48
|
+
@routes
|
49
|
+
end
|
17
50
|
end
|
18
51
|
end
|
19
52
|
end
|
@@ -12,18 +12,19 @@ module RailsGui
|
|
12
12
|
end
|
13
13
|
|
14
14
|
body {
|
15
|
+
menu('Routes') {
|
16
|
+
menu_item('Refresh') {
|
17
|
+
on_clicked do
|
18
|
+
@rails_routes_table.model_array = @rails_command.refresh_routes
|
19
|
+
end
|
20
|
+
}
|
21
|
+
quit_menu_item
|
22
|
+
}
|
23
|
+
|
15
24
|
window('Rails GUI', 1024, 640) {
|
16
25
|
margined true
|
17
26
|
|
18
27
|
vertical_box {
|
19
|
-
button('Refresh Rails Routes') {
|
20
|
-
stretchy false
|
21
|
-
|
22
|
-
on_clicked do
|
23
|
-
@rails_routes_table.model_array = @rails_command.routes
|
24
|
-
end
|
25
|
-
}
|
26
|
-
|
27
28
|
@rails_routes_table = refined_table(
|
28
29
|
model_array: @rails_command.routes,
|
29
30
|
table_columns: {
|
@@ -35,6 +36,14 @@ module RailsGui
|
|
35
36
|
},
|
36
37
|
per_page: 1_000_000_000, # do not paginate
|
37
38
|
)
|
39
|
+
|
40
|
+
button('Refresh Rails Routes') {
|
41
|
+
stretchy false
|
42
|
+
|
43
|
+
on_clicked do
|
44
|
+
@rails_routes_table.model_array = @rails_command.refresh_routes
|
45
|
+
end
|
46
|
+
}
|
38
47
|
}
|
39
48
|
}
|
40
49
|
}
|
data/rails-gui.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rails-gui 0.0.
|
5
|
+
# stub: rails-gui 0.0.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rails-gui".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.2"
|
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 = "
|
14
|
+
s.date = "2023-03-11"
|
15
15
|
s.description = "Rails Graphical User Interface - User-Friendly Rails Configuration (e.g. display routes in a table, run rails commands visually, etc...)".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.executables = ["rails-gui".freeze]
|
@@ -46,6 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
|
47
47
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
48
48
|
s.add_development_dependency(%q<puts_debuggerer>.freeze, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
|
49
50
|
else
|
50
51
|
s.add_dependency(%q<glimmer-dsl-libui>.freeze, ["~> 0.5.24"])
|
51
52
|
s.add_dependency(%q<shoulda>.freeze, [">= 0"])
|
@@ -53,6 +54,7 @@ Gem::Specification.new do |s|
|
|
53
54
|
s.add_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
|
54
55
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
55
56
|
s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0"])
|
57
|
+
s.add_dependency(%q<rake-tui>.freeze, [">= 0"])
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-gui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer-dsl-libui
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake-tui
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Rails Graphical User Interface - User-Friendly Rails Configuration (e.g.
|
98
112
|
display routes in a table, run rails commands visually, etc...)
|
99
113
|
email: andy.am@gmail.com
|