rails-gui 0.0.1 → 0.0.3

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: b91a2942d71b74d4cb5253c954fb363f2b1804cdb6335c626ddfaa09ff07db3f
4
- data.tar.gz: c5c31a8fcd25330719e30868a920c6216e51820a889257f9bf85b86550f259ec
3
+ metadata.gz: 5129f8c791e9e26101d9f56444bf00e53f1a562137be9d7597017c856974c004
4
+ data.tar.gz: a5699d7579628285e64df957908de2ee6936d95cd6168afd309490ea015d1a58
5
5
  SHA512:
6
- metadata.gz: fddf98930253e16dbbce24f679aa03355d505c360ff75e880ccf0363b950357d6057f894a76a4dd6eaef6066ebf9d7978b7f65b5577c32f1d165c139d83a53a7
7
- data.tar.gz: d9d4f2a5c601634bb8f42f0e759fd96dd57f540bd66fa7670e0549b17234bcb7195b25b196852a85747d01b6f85fbf5380d51ca503be7045c6d1530466ebd0fd
6
+ metadata.gz: 8484f9efddf7298328c4bcc3770831374ce2be884411fdc3fdfc0eae9e1c0a3d96d81a6cdf520c1f27f97564965a6b1e421cd2bc8a7e22ebd7999df144e69307
7
+ data.tar.gz: f353f79dab5700c76dd67e244626cfb69e43a337e2ce07178a9cfd4f63f8e57237a4ef091c7098a0d1d3f72a8ff1be87d688efda5515ea3e730863874a15d837
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.3
4
+
5
+ - Eliminate header from rails route table content
6
+
7
+ ## 0.0.2
8
+
9
+ - Load app instantly after first run by caching routes in a local file under ~/.rails-gui/routes.yml
10
+ - Routes menu with Refresh menu item
11
+ - Have default focus upon app start be on search field to enable quicker usage (moving refresh button to bottom)
12
+
3
13
  ## 0.0.1
4
14
 
5
15
  - Rails routes
data/README.md CHANGED
@@ -1,11 +1,15 @@
1
- # Rails GUI
1
+ # Rails GUI 0.0.3
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.3
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.3'
26
30
  end
27
31
  ```
28
32
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.3
@@ -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,14 +8,45 @@ 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
10
- `rails routes`.lines.drop(1).map do |line|
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
37
+ `rails routes`.lines.drop(2).map do |line|
11
38
  cells = line.split
12
39
  cells.prepend('') if cells[0] && (cells[0] == cells[0].upcase)
13
40
  cells.insert(1, '') if cells[1] && (cells[1] != cells[1].upcase)
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.1 ruby lib
5
+ # stub: rails-gui 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rails-gui".freeze
9
- s.version = "0.0.1"
9
+ s.version = "0.0.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 = "2022-09-16"
14
+ s.date = "2023-03-16"
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.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-16 00:00:00.000000000 Z
11
+ date: 2023-03-16 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