rails_execution 0.1.11 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/executions/ace.1.32.5/base.min.js +1 -0
- data/app/assets/javascripts/executions/ace.1.32.5/ext-language_tools.min.js +1 -0
- data/app/assets/javascripts/executions/{ace.modes.ruby.min.js → ace.1.32.5/mode-ruby.min.js} +1 -1
- data/app/assets/javascripts/executions/ace.1.32.5/snippets-ruby.min.js +1 -0
- data/app/assets/javascripts/executions/{ace.theme-solarized_dark.min.js → ace.1.32.5/theme-solarized_dark.min.js} +1 -1
- data/app/assets/javascripts/executions/base.js +1 -0
- data/app/controllers/rails_execution/tasks_controller.rb +7 -1
- data/app/models/rails_execution/task.rb +6 -6
- data/app/models/rails_execution/task_review.rb +2 -2
- data/app/services/rails_execution/auto_suggestions_service.rb +36 -0
- data/app/services/rails_execution/tasks/filter_service.rb +1 -1
- data/app/views/rails_execution/tasks/_form_scripts.html.haml +65 -2
- data/app/views/rails_execution/tasks/_quick_filter.html.haml +4 -4
- data/config/routes.rb +1 -0
- data/lib/generators/rails_execution/templates/config.rb.tt +5 -0
- data/lib/generators/rails_execution/templates/install.rb.tt +4 -4
- data/lib/rails_execution/app_model.rb +10 -0
- data/lib/rails_execution/config.rb +5 -0
- data/lib/rails_execution/files/reader.rb +2 -2
- data/lib/rails_execution/services/execution.rb +2 -0
- data/lib/rails_execution/version.rb +1 -1
- metadata +8 -5
- data/app/assets/javascripts/executions/ace.min.js +0 -1
|
@@ -14,7 +14,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
14
14
|
t.column :jid, :string
|
|
15
15
|
end
|
|
16
16
|
add_index :rails_execution_tasks, :status
|
|
17
|
-
add_index :rails_execution_tasks, %i[owner_id owner_type], name: :
|
|
17
|
+
add_index :rails_execution_tasks, %i[owner_id owner_type], name: :re_tasks_owner_index
|
|
18
18
|
|
|
19
19
|
create_table :rails_execution_labels do |t|
|
|
20
20
|
t.timestamps
|
|
@@ -31,7 +31,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
31
31
|
t.column :owner_type, :string
|
|
32
32
|
end
|
|
33
33
|
add_index :rails_execution_comments, :task_id
|
|
34
|
-
add_index :rails_execution_comments, %i[owner_id owner_type], name: :
|
|
34
|
+
add_index :rails_execution_comments, %i[owner_id owner_type], name: :re_comments_owner_index
|
|
35
35
|
|
|
36
36
|
create_table :rails_execution_activities, force: true do |t|
|
|
37
37
|
t.timestamps null: false
|
|
@@ -41,7 +41,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
41
41
|
t.column :owner_type, :string
|
|
42
42
|
end
|
|
43
43
|
add_index :rails_execution_activities, :task_id
|
|
44
|
-
add_index :rails_execution_activities, %i[owner_id owner_type], name: :
|
|
44
|
+
add_index :rails_execution_activities, %i[owner_id owner_type], name: :re_activities_owner_index
|
|
45
45
|
|
|
46
46
|
create_table :rails_execution_task_reviews, force: true do |t|
|
|
47
47
|
t.timestamps null: false
|
|
@@ -51,7 +51,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
|
|
|
51
51
|
t.column :owner_type, :string
|
|
52
52
|
end
|
|
53
53
|
add_index :rails_execution_task_reviews, :task_id
|
|
54
|
-
add_index :rails_execution_task_reviews, %i[owner_id owner_type], name: :
|
|
54
|
+
add_index :rails_execution_task_reviews, %i[owner_id owner_type], name: :re_reviews_owner_index
|
|
55
55
|
|
|
56
56
|
create_table :rails_execution_task_labels, force: true do |t|
|
|
57
57
|
t.timestamps null: false
|
|
@@ -11,4 +11,14 @@ class RailsExecution::AppModel < model_klass
|
|
|
11
11
|
scope :descending, -> { order(id: :desc) }
|
|
12
12
|
scope :ascending, -> { order(id: :asc) }
|
|
13
13
|
|
|
14
|
+
# Supports both old (< Rails 7.0) and new (>= Rails 7.0) `enum` syntax.
|
|
15
|
+
def self.compat_enum(column, values, **options)
|
|
16
|
+
if ActiveRecord::VERSION::MAJOR >= 7
|
|
17
|
+
enum column, values, **options
|
|
18
|
+
else
|
|
19
|
+
legacy_options = options.transform_keys { |key| :"_#{key}" }
|
|
20
|
+
enum({ column => values }.merge(legacy_options))
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
14
24
|
end
|
|
@@ -41,6 +41,7 @@ module RailsExecution
|
|
|
41
41
|
attr_accessor :task_background
|
|
42
42
|
attr_accessor :task_background_executor # lambda
|
|
43
43
|
attr_accessor :acceptable_file_types
|
|
44
|
+
attr_accessor :auto_suggestions # On/Off the code editor auto suggestion
|
|
44
45
|
|
|
45
46
|
# Logger
|
|
46
47
|
attr_accessor :logging # lambda
|
|
@@ -60,6 +61,10 @@ module RailsExecution
|
|
|
60
61
|
self.owner_name_method = :name
|
|
61
62
|
self.owner_avatar = ->(_) { nil }
|
|
62
63
|
|
|
64
|
+
self.auto_suggestions = [
|
|
65
|
+
'app/models',
|
|
66
|
+
'app/jobs',
|
|
67
|
+
]
|
|
63
68
|
self.file_upload = false
|
|
64
69
|
self.acceptable_file_types = DEFAULT_FILE_TYPES
|
|
65
70
|
self.file_uploader = ::RailsExecution::Files::Uploader
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'net/http'
|
|
4
4
|
require 'tempfile'
|
|
5
|
-
require '
|
|
5
|
+
require 'uri'
|
|
6
6
|
|
|
7
7
|
module RailsExecution
|
|
8
8
|
module Files
|
|
@@ -33,7 +33,7 @@ module RailsExecution
|
|
|
33
33
|
attr_reader :task
|
|
34
34
|
|
|
35
35
|
def save_to_tempfile(file_name, url)
|
|
36
|
-
file =
|
|
36
|
+
file = open(url)
|
|
37
37
|
return file if file.is_a?(Tempfile)
|
|
38
38
|
|
|
39
39
|
raise "Unsupported the Filetype #{file.class.name}" unless file.is_a?(StringIO)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_execution
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Khoa Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: haml
|
|
@@ -43,9 +43,11 @@ files:
|
|
|
43
43
|
- app/assets/images/executions/logo.png
|
|
44
44
|
- app/assets/images/executions/rejected.png
|
|
45
45
|
- app/assets/images/executions/robot.png
|
|
46
|
-
- app/assets/javascripts/executions/ace.min.js
|
|
47
|
-
- app/assets/javascripts/executions/ace.
|
|
48
|
-
- app/assets/javascripts/executions/ace.
|
|
46
|
+
- app/assets/javascripts/executions/ace.1.32.5/base.min.js
|
|
47
|
+
- app/assets/javascripts/executions/ace.1.32.5/ext-language_tools.min.js
|
|
48
|
+
- app/assets/javascripts/executions/ace.1.32.5/mode-ruby.min.js
|
|
49
|
+
- app/assets/javascripts/executions/ace.1.32.5/snippets-ruby.min.js
|
|
50
|
+
- app/assets/javascripts/executions/ace.1.32.5/theme-solarized_dark.min.js
|
|
49
51
|
- app/assets/javascripts/executions/base.js
|
|
50
52
|
- app/assets/javascripts/executions/bootstrap.5.2.1.min.js
|
|
51
53
|
- app/assets/javascripts/executions/chart.min.js
|
|
@@ -83,6 +85,7 @@ files:
|
|
|
83
85
|
- app/models/rails_execution/task.rb
|
|
84
86
|
- app/models/rails_execution/task_label.rb
|
|
85
87
|
- app/models/rails_execution/task_review.rb
|
|
88
|
+
- app/services/rails_execution/auto_suggestions_service.rb
|
|
86
89
|
- app/services/rails_execution/tasks/create_service.rb
|
|
87
90
|
- app/services/rails_execution/tasks/filter_service.rb
|
|
88
91
|
- app/views/layouts/execution.html.haml
|