rake-ui 0.0.1 → 0.1.0

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: 218a68e063a489cf4b9f781a1f764fbe01439d8f40ab9a7ec2c887993b1b8cc6
4
- data.tar.gz: a76cca82acafcb84c0e2039448eb0c0f0fad464dcfc9ad68a5378a7059abfc32
3
+ metadata.gz: bd7aaae9a795ec46917f67bc68117f375f0c6fa4e22bc6e320fe082a8f633a37
4
+ data.tar.gz: cbf32b74d4a96a8156278a0e36c71f9f76672396a4a15031e094f8886ea5b4d7
5
5
  SHA512:
6
- metadata.gz: b68e5dca03e6235494047686a766cc8a15cecb71d3bde9ac3767859d9d0971a00194527c756ac767434e15b3c7a56f833a46f9a80a99d1084bf43bae5b3f5ddb
7
- data.tar.gz: f24ad6edc4612031b9cdf53b5df8046ff93a51451d216ed23cd12c7423a7c71469114d0b09e967061a78017af0268a7b5d2802a6ec15cc552a46f7acab38da2e
6
+ metadata.gz: 1509e6793d3f88ec54ed69a4f5cbce635dc0212b48bc657a56562fa8494a8c870c75d086287ee0786804eb14ab118d140e8a2ab4101ccf0f147e07224947e540
7
+ data.tar.gz: c8baa27913c7c15ba812e3f4d4832783003fa47eb47c16c90603d9107083c1258a2b6f14562ab6f3208502c91fec767cd90258c589bc033071a5bc1ad12c4762
data/README.md CHANGED
@@ -1,13 +1,23 @@
1
1
  # RakeUi
2
2
  Rake UI is a Rails engine that enables the discovery and execution rake tasks in a UI.
3
3
 
4
+ ![Example](./README_example.gif)
5
+
6
+ ## Routes
7
+
8
+ NOTE: Relative to mountpoint in application
9
+
10
+ - GET /rake_tasks(.html/.json) - list all available rake tasks
11
+ - GET /rake_tasks/:id(.html/.json) - list info a single tasks
12
+ - POST /rake_tasks/:id/execute - execute a rake task
13
+ - GET /rake_task_logs(.html/.json) - list rake task history
14
+ - GET /rake_task_logs/:id(.html/.json) - list a single rake task history
15
+
4
16
  ## Installation
5
17
  Add this line to your application's Gemfile:
6
18
 
7
19
  ```ruby
8
- group :development do
9
- gem 'rake-ui'
10
- end
20
+ gem 'rake-ui'
11
21
  ```
12
22
 
13
23
  And then execute:
@@ -34,7 +44,13 @@ end
34
44
 
35
45
  This tool is built to enable developer productivity in development. It exposes rake tasks through a UI.
36
46
 
37
- This tool will currently not work in production because we add a guard in the root controller to respond not found if the environment is development or test.
47
+ This tool will currently not work in production because we add a guard in the root controller to respond not found if the environment is development or test. You may override this guard clause with the following configuration.
48
+
49
+ ```rb
50
+ RakeUi.configuration do |config|
51
+ config.allow_production = true
52
+ end
53
+ ```
38
54
 
39
55
  We recommend adding guards in your route to ensure that the proper authentication is in place to ensure that users are authenticated so that if this were ever to be rendered in production, you would be covered. The best way for that is [router constraints](https://guides.rubyonrails.org/routing.html#specifying-constraints)
40
56
 
@@ -7,7 +7,9 @@ module RakeUi
7
7
  private
8
8
 
9
9
  def black_hole_production
10
- raise ActionController::RoutingError, "Not Found" unless Rails.env.test? || Rails.env.development?
10
+ return if Rails.env.test? || Rails.env.development? || RakeUi.configuration.allow_production
11
+
12
+ raise ActionController::RoutingError, "Not Found"
11
13
  end
12
14
  end
13
15
  end
@@ -53,13 +53,13 @@ module RakeUi
53
53
  end
54
54
 
55
55
  new(id: id,
56
- name: name,
57
- args: args,
58
- environment: environment,
59
- rake_command: rake_command,
60
- rake_definition_file: rake_definition_file,
61
- log_file_name: log_file_name,
62
- log_file_full_path: log_file_full_path)
56
+ name: name,
57
+ args: args,
58
+ environment: environment,
59
+ rake_command: rake_command,
60
+ rake_definition_file: rake_definition_file,
61
+ log_file_name: log_file_name,
62
+ log_file_full_path: log_file_full_path)
63
63
  end
64
64
 
65
65
  def self.all
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RakeUi
4
- VERSION = "0.0.1"
4
+ VERSION = "0.1.0"
5
5
  end
data/lib/rake-ui.rb CHANGED
@@ -3,4 +3,11 @@
3
3
  require "rake-ui/engine"
4
4
 
5
5
  module RakeUi
6
+ mattr_accessor :allow_production
7
+ self.allow_production = false
8
+
9
+ def self.configuration
10
+ yield(self) if block_given?
11
+ self
12
+ end
6
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Story
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport