super_test_engine 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '082e167d6480b851ec917a5376402d02be1cfbd987bc82142514f1fa0d75dcfd'
4
+ data.tar.gz: 783d8ddba1c7e1c160a57539fe3807a0275ecd4181b33883476a29b5a54e4bb4
5
+ SHA512:
6
+ metadata.gz: e7c2d20c430e254b759fb4579e7326ab22e02938641bb851dda6483b50de43471c99ad8e7de4115c33412fbfb26724716a5e58bde81a75febcb2536b611546a2
7
+ data.tar.gz: fab9a9e65be26034894bdcae8c03522f0451ae5b5e3873762fe5f77628f0173df91cdf0539977c76cc74ea77b3cab031fa51ee490dece70565dc4b7fb1a0ec8a
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2019 Zach Ahn
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.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # SuperTestEngine
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'super_test_engine'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install super_test_engine
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'SuperTestEngine'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/super_test_engine .js
2
+ //= link_directory ../stylesheets/super_test_engine .css
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require rails-ujs
14
+ //= require activestorage
15
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,9 @@
1
+ module Admin
2
+ class MembersController < AdminController
3
+ private
4
+
5
+ def dashboard
6
+ MemberDashboard.new
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ class AdminController < Super::ApplicationController
2
+ end
@@ -0,0 +1,81 @@
1
+ class MemberDashboard
2
+ def title
3
+ Member.name.pluralize
4
+ end
5
+
6
+ def model
7
+ Member
8
+ end
9
+
10
+ def index_scope
11
+ Member.all
12
+ end
13
+
14
+ def index_columns
15
+ [
16
+ :name,
17
+ :rank,
18
+ :position,
19
+ :created_at,
20
+ ]
21
+ end
22
+
23
+ def create_scope
24
+ Member.all
25
+ end
26
+
27
+ def new_scope
28
+ Member.all
29
+ end
30
+
31
+ def new_columns
32
+ [
33
+ :name,
34
+ :rank,
35
+ :position,
36
+ ]
37
+ end
38
+
39
+ def edit_scope
40
+ Member.all
41
+ end
42
+
43
+ def edit_columns
44
+ [
45
+ :name,
46
+ :rank,
47
+ :position,
48
+ ]
49
+ end
50
+
51
+ def show_scope
52
+ Member.all
53
+ end
54
+
55
+ def show_columns
56
+ [
57
+ :id,
58
+ :name,
59
+ :rank,
60
+ :position,
61
+ :created_at,
62
+ :updated_at,
63
+ ]
64
+ end
65
+
66
+ def update_scope
67
+ Member.all
68
+ end
69
+
70
+ def destroy_scope
71
+ Member.all
72
+ end
73
+
74
+ def permitted_create_params(params)
75
+ params.require(:member).permit(:name, :rank, :position)
76
+ end
77
+
78
+ def permitted_update_params(params)
79
+ params.require(:member).permit(:name, :rank, :position)
80
+ end
81
+ end
@@ -0,0 +1,4 @@
1
+ module SuperTestEngine
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SuperTestEngine
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module SuperTestEngine
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ class Member < ApplicationRecord
2
+ enum rank: {
3
+ captain: "Captain",
4
+ commander: "Commander",
5
+ lieutenant_commander: "Lieutenant Commander",
6
+ lieutenant: "Lieutenant",
7
+ lieutenant_junior_grade: "Lieutenant Junior Grade",
8
+ ensign: "Ensign",
9
+ nco: "NCO",
10
+ }
11
+
12
+ validates :name, presence: true
13
+ validates :rank, presence: true
14
+ end
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Super test engine</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "super_test_engine/application", media: "all" %>
9
+ <%= javascript_include_tag "super_test_engine/application" %>
10
+ </head>
11
+ <body>
12
+
13
+ <%= yield %>
14
+
15
+ </body>
16
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ namespace :admin do
3
+ resources :members
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreateMembers < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :members do |t|
4
+ t.string :name, null: false
5
+ t.string :rank, null: false
6
+ t.string :position
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,34 @@
1
+ class EnterpriseSeeder
2
+ def initialize
3
+ @seeded = {}
4
+ end
5
+
6
+ def seed(basename, key, klass, value)
7
+ @seeded[basename] ||= {}
8
+ puts "--> #{key} (#{value})"
9
+ @seeded[basename][key] = klass.find_or_create_by(value)
10
+ puts " success!"
11
+ rescue => e
12
+ puts " failure (#{e.message})"
13
+ end
14
+
15
+ def seed_from_fixture(basename, klass)
16
+ puts "==> #{basename}"
17
+ fixtures(basename).each do |key, value|
18
+ seed(basename, key, klass, value)
19
+ end
20
+
21
+ nil
22
+ end
23
+
24
+ private
25
+
26
+ def fixtures(basename)
27
+ @fixtures_dir ||= Pathname.new("../test/fixtures").expand_path(__dir__)
28
+
29
+ YAML.load_file(@fixtures_dir.join("#{basename}.yml"))
30
+ end
31
+ end
32
+
33
+ seeder = EnterpriseSeeder.new
34
+ seeder.seed_from_fixture("members", Member)
@@ -0,0 +1,5 @@
1
+ require "super_test_engine/engine"
2
+
3
+ module SuperTestEngine
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,9 @@
1
+ module SuperTestEngine
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace SuperTestEngine
4
+
5
+ initializer "config.paths" do |app|
6
+ app.config.paths["db/migrate"].push(*config.paths["db/migrate"].expanded)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module SuperTestEngine
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :super_test_engine do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: super_test_engine
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Zach Ahn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - engineering@zachahn.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - app/assets/config/super_test_engine_manifest.js
52
+ - app/assets/javascripts/super_test_engine/application.js
53
+ - app/assets/stylesheets/super_test_engine/application.css
54
+ - app/controllers/admin/members_controller.rb
55
+ - app/controllers/admin_controller.rb
56
+ - app/dashboards/member_dashboard.rb
57
+ - app/helpers/super_test_engine/application_helper.rb
58
+ - app/jobs/super_test_engine/application_job.rb
59
+ - app/mailers/super_test_engine/application_mailer.rb
60
+ - app/models/member.rb
61
+ - app/views/layouts/super_test_engine/application.html.erb
62
+ - config/routes.rb
63
+ - db/migrate/20190216224956_create_members.rb
64
+ - db/seeds.rb
65
+ - lib/super_test_engine.rb
66
+ - lib/super_test_engine/engine.rb
67
+ - lib/super_test_engine/version.rb
68
+ - lib/tasks/super_test_engine_tasks.rake
69
+ homepage:
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.0.3
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: An engine to help test Super
92
+ test_files: []