utfpr_gp_engine 0.2.0

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.
Files changed (31) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/config/utfpr_gp_engine_manifest.js +2 -0
  6. data/app/assets/javascripts/utfpr_gp_engine/application.js +13 -0
  7. data/app/assets/javascripts/utfpr_gp_engine/students.js +2 -0
  8. data/app/assets/stylesheets/scaffold.css +84 -0
  9. data/app/assets/stylesheets/utfpr_gp_engine/application.css +15 -0
  10. data/app/assets/stylesheets/utfpr_gp_engine/students.css +4 -0
  11. data/app/controllers/utfpr_gp_engine/application_controller.rb +5 -0
  12. data/app/controllers/utfpr_gp_engine/students_controller.rb +62 -0
  13. data/app/helpers/utfpr_gp_engine/application_helper.rb +4 -0
  14. data/app/helpers/utfpr_gp_engine/students_helper.rb +4 -0
  15. data/app/jobs/utfpr_gp_engine/application_job.rb +4 -0
  16. data/app/mailers/utfpr_gp_engine/application_mailer.rb +6 -0
  17. data/app/models/utfpr_gp_engine/application_record.rb +5 -0
  18. data/app/models/utfpr_gp_engine/student.rb +7 -0
  19. data/app/views/layouts/utfpr_gp_engine/application.html.erb +14 -0
  20. data/app/views/utfpr_gp_engine/students/_form.html.erb +22 -0
  21. data/app/views/utfpr_gp_engine/students/edit.html.erb +6 -0
  22. data/app/views/utfpr_gp_engine/students/index.html.erb +27 -0
  23. data/app/views/utfpr_gp_engine/students/new.html.erb +5 -0
  24. data/app/views/utfpr_gp_engine/students/show.html.erb +9 -0
  25. data/config/routes.rb +3 -0
  26. data/db/migrate/20201109192512_create_utfpr_gp_engine_students.rb +9 -0
  27. data/lib/tasks/utfpr_gp_engine_tasks.rake +4 -0
  28. data/lib/utfpr_gp_engine.rb +5 -0
  29. data/lib/utfpr_gp_engine/engine.rb +5 -0
  30. data/lib/utfpr_gp_engine/version.rb +3 -0
  31. metadata +106 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: af3e05d162f016f54de5ee8ffc3af8ed6310eca8873ba4f1bb62c3935942f025
4
+ data.tar.gz: c5e1b7ec3f48082b377b3ce2c924d534c46b175a71e841890fb3568e3ecaaffc
5
+ SHA512:
6
+ metadata.gz: 232ac786f16d9dd7a3d204d373b4bb773217749c4a83a1756b92328a14fed8263f1d1c4d5e9e1f5794f569f0a8da3e783e1c4043a293971c485969199e908705
7
+ data.tar.gz: b0379efdff31475c1086db260f920f19348ca51da11ddde64f1a4f4bc679d558752ddfe11dfe87de3c47e6860ba69f6961494782f9e54c1e2ace44867f3429f9
@@ -0,0 +1,20 @@
1
+ Copyright 2020 edumoreira1506
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.
@@ -0,0 +1,28 @@
1
+ # UtfprGpEngine
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 'utfpr_gp_engine'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install utfpr_gp_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](http://opensource.org/licenses/MIT).
@@ -0,0 +1,37 @@
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 = 'UtfprGpEngine'
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", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ require 'bundler/gem_tasks'
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+
37
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/utfpr_gp_engine .js
2
+ //= link_directory ../stylesheets/utfpr_gp_engine .css
@@ -0,0 +1,13 @@
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_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,84 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ }
5
+
6
+ body, p, ol, ul, td {
7
+ font-family: verdana, arial, helvetica, sans-serif;
8
+ font-size: 13px;
9
+ line-height: 18px;
10
+ margin: 33px;
11
+ }
12
+
13
+ pre {
14
+ background-color: #eee;
15
+ padding: 10px;
16
+ font-size: 11px;
17
+ }
18
+
19
+ a {
20
+ color: #000;
21
+ }
22
+
23
+ a:visited {
24
+ color: #666;
25
+ }
26
+
27
+ a:hover {
28
+ color: #fff;
29
+ background-color: #000;
30
+ }
31
+
32
+ th {
33
+ padding-bottom: 5px;
34
+ }
35
+
36
+ td {
37
+ padding-bottom: 7px;
38
+ padding-left: 5px;
39
+ padding-right: 5px;
40
+ }
41
+
42
+ div.field,
43
+ div.actions {
44
+ margin-bottom: 10px;
45
+ }
46
+
47
+ #notice {
48
+ color: green;
49
+ }
50
+
51
+ .field_with_errors {
52
+ padding: 2px;
53
+ background-color: red;
54
+ display: table;
55
+ }
56
+
57
+ #error_explanation {
58
+ width: 450px;
59
+ border: 2px solid red;
60
+ padding: 7px;
61
+ padding-bottom: 0;
62
+ margin-bottom: 20px;
63
+ background-color: #f0f0f0;
64
+ }
65
+
66
+ #error_explanation h2 {
67
+ text-align: left;
68
+ font-weight: bold;
69
+ padding: 5px 5px 5px 15px;
70
+ font-size: 12px;
71
+ margin: -7px;
72
+ margin-bottom: 0;
73
+ background-color: #c00;
74
+ color: #fff;
75
+ }
76
+
77
+ #error_explanation ul li {
78
+ font-size: 12px;
79
+ list-style: square;
80
+ }
81
+
82
+ label {
83
+ display: block;
84
+ }
@@ -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,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,5 @@
1
+ module UtfprGpEngine
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,62 @@
1
+ require_dependency "utfpr_gp_engine/application_controller"
2
+
3
+ module UtfprGpEngine
4
+ class StudentsController < ApplicationController
5
+ before_action :set_student, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /students
8
+ def index
9
+ @students = Student.all
10
+ end
11
+
12
+ # GET /students/1
13
+ def show
14
+ end
15
+
16
+ # GET /students/new
17
+ def new
18
+ @student = Student.new
19
+ end
20
+
21
+ # GET /students/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /students
26
+ def create
27
+ @student = Student.new(student_params)
28
+
29
+ if @student.save
30
+ redirect_to @student, notice: 'Student was successfully created.'
31
+ else
32
+ render :new
33
+ end
34
+ end
35
+
36
+ # PATCH/PUT /students/1
37
+ def update
38
+ if @student.update(student_params)
39
+ redirect_to @student, notice: 'Student was successfully updated.'
40
+ else
41
+ render :edit
42
+ end
43
+ end
44
+
45
+ # DELETE /students/1
46
+ def destroy
47
+ @student.destroy
48
+ redirect_to students_url, notice: 'Student was successfully destroyed.'
49
+ end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_student
54
+ @student = Student.find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def student_params
59
+ params.require(:student).permit(:name)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,4 @@
1
+ module UtfprGpEngine
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module UtfprGpEngine
2
+ module StudentsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module UtfprGpEngine
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module UtfprGpEngine
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module UtfprGpEngine
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module UtfprGpEngine
2
+ class Student < ApplicationRecord
3
+ attr_acessible :name
4
+
5
+ validates :name, presence: true
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Utfpr gp engine</title>
5
+ <%= stylesheet_link_tag "utfpr_gp_engine/application", media: "all" %>
6
+ <%= javascript_include_tag "utfpr_gp_engine/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,22 @@
1
+ <%= form_for(student) do |f| %>
2
+ <% if student.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(student.errors.count, "error") %> prohibited this student from being saved:</h2>
5
+
6
+ <ul>
7
+ <% student.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :name %>
16
+ <%= f.text_field :name %>
17
+ </div>
18
+
19
+ <div class="actions">
20
+ <%= f.submit %>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Student</h1>
2
+
3
+ <%= render 'form', student: @student %>
4
+
5
+ <%= link_to 'Show', @student %> |
6
+ <%= link_to 'Back', students_path %>
@@ -0,0 +1,27 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Students</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th colspan="3"></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @students.each do |student| %>
15
+ <tr>
16
+ <td><%= student.name %></td>
17
+ <td><%= link_to 'Show', student %></td>
18
+ <td><%= link_to 'Edit', edit_student_path(student) %></td>
19
+ <td><%= link_to 'Destroy', student, method: :delete, data: { confirm: 'Are you sure?' } %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <br>
26
+
27
+ <%= link_to 'New Student', new_student_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Student</h1>
2
+
3
+ <%= render 'form', student: @student %>
4
+
5
+ <%= link_to 'Back', students_path %>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @student.name %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_student_path(@student) %> |
9
+ <%= link_to 'Back', students_path %>
@@ -0,0 +1,3 @@
1
+ UtfprGpEngine::Engine.routes.draw do
2
+ resources :students
3
+ end
@@ -0,0 +1,9 @@
1
+ class CreateUtfprGpEngineStudents < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :utfpr_gp_engine_students do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :utfpr_gp_engine do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,5 @@
1
+ require "utfpr_gp_engine/engine"
2
+
3
+ module UtfprGpEngine
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,5 @@
1
+ module UtfprGpEngine
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace UtfprGpEngine
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module UtfprGpEngine
2
+ VERSION = '0.2.0'
3
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: utfpr_gp_engine
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - edumoreira1506
8
+ - Lucassamuel97
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2020-11-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 5.0.7
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 5.0.7.2
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: 5.0.7
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 5.0.7.2
34
+ - !ruby/object:Gem::Dependency
35
+ name: sqlite3
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ description: UtfprGpEngine test.
49
+ email: []
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - MIT-LICENSE
55
+ - README.md
56
+ - Rakefile
57
+ - app/assets/config/utfpr_gp_engine_manifest.js
58
+ - app/assets/javascripts/utfpr_gp_engine/application.js
59
+ - app/assets/javascripts/utfpr_gp_engine/students.js
60
+ - app/assets/stylesheets/scaffold.css
61
+ - app/assets/stylesheets/utfpr_gp_engine/application.css
62
+ - app/assets/stylesheets/utfpr_gp_engine/students.css
63
+ - app/controllers/utfpr_gp_engine/application_controller.rb
64
+ - app/controllers/utfpr_gp_engine/students_controller.rb
65
+ - app/helpers/utfpr_gp_engine/application_helper.rb
66
+ - app/helpers/utfpr_gp_engine/students_helper.rb
67
+ - app/jobs/utfpr_gp_engine/application_job.rb
68
+ - app/mailers/utfpr_gp_engine/application_mailer.rb
69
+ - app/models/utfpr_gp_engine/application_record.rb
70
+ - app/models/utfpr_gp_engine/student.rb
71
+ - app/views/layouts/utfpr_gp_engine/application.html.erb
72
+ - app/views/utfpr_gp_engine/students/_form.html.erb
73
+ - app/views/utfpr_gp_engine/students/edit.html.erb
74
+ - app/views/utfpr_gp_engine/students/index.html.erb
75
+ - app/views/utfpr_gp_engine/students/new.html.erb
76
+ - app/views/utfpr_gp_engine/students/show.html.erb
77
+ - config/routes.rb
78
+ - db/migrate/20201109192512_create_utfpr_gp_engine_students.rb
79
+ - lib/tasks/utfpr_gp_engine_tasks.rake
80
+ - lib/utfpr_gp_engine.rb
81
+ - lib/utfpr_gp_engine/engine.rb
82
+ - lib/utfpr_gp_engine/version.rb
83
+ homepage: https://github.com/edumoreira1506/utfpr_gp_engine
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubygems_version: 3.0.8
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: UtfprGpEngine.
106
+ test_files: []