Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rubycritic and sandi meter #43

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

#Ignore sandimeter
*.sandi_meter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove all added sandi_meter files from the previous commits? 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They aren't really needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! :D

sandi_meter/

# Ignore bundler config.
/.bundle

Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.6'

gem 'rubycritic'

gem 'sandi_meter'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.4'
# Use sqlite3 as the database for Active Record
Expand Down
69 changes: 69 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ GEM
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.1)
autoprefixer-rails (10.0.1.2)
execjs
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.4.8)
Expand All @@ -79,22 +84,43 @@ GEM
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (3.0.0)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.7)
crass (1.0.6)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
docile (1.3.2)
equalizer (0.0.11)
erubi (1.9.0)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.13.1)
ffi (1.13.1-x64-mingw32)
flay (2.12.1)
erubis (~> 2.7.0)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.6.4)
path_expander (~> 1.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.8)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jbuilder (2.10.1)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.3.1)
kwalify (0.7.2)
launchy (2.5.0)
addressable (~> 2.7)
loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand All @@ -107,16 +133,23 @@ GEM
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.2)
mixlib-cli (2.1.8)
msgpack (1.3.3)
msgpack (1.3.3-x64-mingw32)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.10-x64-mingw32)
mini_portile2 (~> 2.4.0)

parser (2.7.2.0)
ast (~> 2.4.1)
path_expander (1.1.0)

pg (1.2.3)
pg (1.2.3-x64-mingw32)
popper_js (1.16.0)
psych (3.2.0)
public_suffix (4.0.6)
puma (4.3.6)
nio4r (~> 2.0)
Expand Down Expand Up @@ -151,9 +184,32 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
reek (6.0.2)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
psych (~> 3.1)
rainbow (>= 2.0, < 4.0)
regexp_parser (1.8.2)
ruby_parser (3.15.0)
sexp_processor (~> 4.9)
rubycritic (4.5.2)
flay (~> 2.8)
flog (~> 4.4)
launchy (>= 2.0.0)
parser (>= 2.6.0)
rainbow (~> 3.0)
reek (~> 6.0, < 7.0)
ruby_parser (~> 3.8)
simplecov (>= 0.17.0)
tty-which (~> 0.4.0)
virtus (~> 1.0)
rubyzip (2.3.0)
sandi_meter (1.2.0)
json
launchy
mixlib-cli
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand All @@ -169,6 +225,11 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sexp_processor (4.15.1)
simplecov (0.19.1)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -179,13 +240,19 @@ GEM
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
tty-which (0.4.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
tzinfo-data (1.2020.4)
tzinfo (>= 1.0.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
web-console (4.0.4)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -221,6 +288,8 @@ DEPENDENCIES
pg
puma (~> 4.1)
rails (~> 6.0.3, >= 6.0.3.4)
rubycritic
sandi_meter
sass-rails (>= 6)
selenium-webdriver
turbolinks (~> 5)
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/branches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def new
def create
@branch = Branch.new(branch_params)
respond_to do |format|
if @branch.save
format.html { redirect_to branches_url, notice: 'Branch was successfully created.' }
else
format.html { render :new }
end
if @branch.save
format.html { redirect_to branches_url, notice: 'Branch was successfully created.' }
else
format.html { render :new }
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def welcome
end

def destroy
session[:admin_id] = nil
redirect_to '/welcome'
session[:admin_id] = nil
redirect_to '/welcome'
end

def page_requires_login
Expand Down
3 changes: 2 additions & 1 deletion app/views/branches/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

<% if info.present? %>
<div class="notification is-link is-light">
<%= info %></div>
<%= info %>
</div>
<% end %>

<% if @branch.errors.any? %>
Expand Down
3 changes: 2 additions & 1 deletion app/views/branches/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<p id="notice"><%= notice %></p>
<% if notice.present? %>
<div class="notification is-link is-light">
<%= notice %></div>
<%= notice %>
</div>
<% end %>

<% if @branch.errors.any? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/branches/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="jumbotron text-center" style="margin-bottom:0">
<h1>Branch Information</h1>
<h1>Branch Information</h1>
</div>

<h2><%= @branch.name %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/employees/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container p-3 my-3 border">
<h3>Update Employee</h3>
<h3>Update Employee</h3>
</div>

<div class="container p-3 my-3 border">
Expand Down
60 changes: 30 additions & 30 deletions app/views/employees/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<div class="jumbotron text-center" style="margin-bottom:0">
<h1>Employees</h1>
<h1>Employees</h1>
</div>

<div class="container mt-5">
<div class="row">
<div class="col">
<table id="employees" class="display table table-hover">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Status</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
<% @employees.each do |employee| %>
<tr>
<td><%= link_to employee.name, employee_path(employee) %></td>
<% if employee.status =="t"%>
<td>Active</td>
<% else %>
<td>Disabled</td>
<%end%>
<td><%= button_to 'Edit', edit_employee_path(employee), method: 'get', :class => "btn btn-primary"%></td>
</tr>
<% end %>
<tbody>
</table>
</div>
<div class="col-4">
<%= link_to "Add a New Employee", new_employee_path, :class => "btn btn-primary"%>
</div>
</div>
<div class="row">
<div class="col">
<table id="employees" class="display table table-hover">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Status</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
<% @employees.each do |employee| %>
<tr>
<td><%= link_to employee.name, employee_path(employee) %></td>
<% if employee.status =="t"%>
<td>Active</td>
<% else %>
<td>Disabled</td>
<%end%>
<td><%= button_to 'Edit', edit_employee_path(employee), method: 'get', :class => "btn btn-primary"%></td>
</tr>
<% end %>
<tbody>
</table>
</div>
<div class="col-4">
<%= link_to "Add a New Employee", new_employee_path, :class => "btn btn-primary"%>
</div>
</div>
</div>

2 changes: 1 addition & 1 deletion app/views/employees/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container p-3 my-3 border">
<h1>New Employee</h1>
<h1>New Employee</h1>
</div>

<div class="container p-3 my-3 border">
Expand Down
2 changes: 1 addition & 1 deletion app/views/employees/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div class="jumbotron text-center" style="margin-bottom:0">
<h1>Employee Information</h1>
<h1>Employee Information</h1>
</div>

<h2><%= @employee.name %></h2>
Expand Down
12 changes: 12 additions & 0 deletions sandi_meter/assets/chart.js

Large diffs are not rendered by default.

Binary file added sandi_meter/assets/forkme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions sandi_meter/assets/jquery.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sandi_meter/assets/morris.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading