whodat 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +4 -0
- data/.travis.yml +3 -0
- data/CODE-OF-CONDUCT.md +60 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +173 -0
- data/HOW-TO-CONTRIBUTE.md +19 -0
- data/MIT-LICENSE +20 -0
- data/README.md +99 -0
- data/Rakefile +24 -0
- data/Users +0 -0
- data/Whodat +0 -0
- data/app/assets/config/whodat_manifest.js +2 -0
- data/app/assets/images/whodat/.keep +0 -0
- data/app/assets/images/whodat/example-app-screencap.png +0 -0
- data/app/assets/images/whodat/navbar-pic-readme.png +0 -0
- data/app/assets/images/whodat/whodat-logo-tiny.png +0 -0
- data/app/assets/images/whodat/whodat-logo-wide.png +0 -0
- data/app/assets/images/whodat/whodat-logo.png +0 -0
- data/app/assets/javascripts/whodat/application.js +15 -0
- data/app/assets/javascripts/whodat/dashboard.js +2 -0
- data/app/assets/javascripts/whodat/sessions.js +2 -0
- data/app/assets/javascripts/whodat/users.js +2 -0
- data/app/assets/stylesheets/whodat/application.css +15 -0
- data/app/assets/stylesheets/whodat/dashboard.css +41 -0
- data/app/assets/stylesheets/whodat/navbar.css +45 -0
- data/app/assets/stylesheets/whodat/sessions.css +4 -0
- data/app/assets/stylesheets/whodat/users.css +4 -0
- data/app/controllers/whodat/application_controller.rb +30 -0
- data/app/controllers/whodat/dashboard_controller.rb +19 -0
- data/app/controllers/whodat/sessions_controller.rb +34 -0
- data/app/controllers/whodat/users_controller.rb +29 -0
- data/app/helpers/whodat/application_helper.rb +12 -0
- data/app/helpers/whodat/sessions_helper.rb +19 -0
- data/app/jobs/whodat/application_job.rb +4 -0
- data/app/mailers/whodat/application_mailer.rb +6 -0
- data/app/models/whodat/application_record.rb +5 -0
- data/app/models/whodat/user.rb +15 -0
- data/app/views/layouts/whodat/application.html.erb +23 -0
- data/app/views/whodat/application/_navbar.html.erb +26 -0
- data/app/views/whodat/dashboard/_navbar.html.erb +16 -0
- data/app/views/whodat/dashboard/index.html.erb +14 -0
- data/app/views/whodat/sessions/new.html.erb +29 -0
- data/app/views/whodat/users/create.html.erb +2 -0
- data/app/views/whodat/users/index.html.erb +2 -0
- data/app/views/whodat/users/new.html.erb +34 -0
- data/bin/rails +14 -0
- data/bin/rspec +29 -0
- data/config/routes.rb +15 -0
- data/db/migrate/20180717210347_create_whodat_users.rb +12 -0
- data/lib/tasks/boolean_as_integer.rake +20 -0
- data/lib/tasks/whodat_tasks.rake +4 -0
- data/lib/whodat.rb +23 -0
- data/lib/whodat/engine.rb +5 -0
- data/lib/whodat/version.rb +3 -0
- data/spec/controllers/sessions_controller_spec.rb +71 -0
- data/spec/controllers/users_controller_spec.rb +104 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +14 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/javascripts/welcome.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/welcome.css +100 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/welcome_controller.rb +4 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +17 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/app/views/welcome/index.html.erb +18 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +35 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +61 -0
- data/spec/dummy/config/environments/production.rb +98 -0
- data/spec/dummy/config/environments/test.rb +53 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/routes.rb +23 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +34 -0
- data/spec/dummy/config/routes.rb +9 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/schema.rb +24 -0
- data/spec/dummy/db/seeds.rb +21 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/controllers/welcome_controller_spec.rb +12 -0
- data/spec/factories.rb +8 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/spec_helper.rb +108 -0
- data/spec/support/factory_bot.rb +7 -0
- data/whodat-logo-wide.png +0 -0
- data/whodat.gemspec +36 -0
- metadata +3065 -0
@@ -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,100 @@
|
|
1
|
+
hero {
|
2
|
+
/* Sizing */
|
3
|
+
width: 100vw;
|
4
|
+
height: 100vh;
|
5
|
+
|
6
|
+
/* Flexbox stuff */
|
7
|
+
display: flex;
|
8
|
+
justify-content: center;
|
9
|
+
align-items: center;
|
10
|
+
|
11
|
+
/* Text styles */
|
12
|
+
text-align: center;
|
13
|
+
font-family: Arial, Helvetica, sans-serif;
|
14
|
+
}
|
15
|
+
|
16
|
+
.hero {
|
17
|
+
/* Sizing */
|
18
|
+
width: 100vw;
|
19
|
+
height: 100vh;
|
20
|
+
|
21
|
+
/* Flexbox stuff */
|
22
|
+
display: flex;
|
23
|
+
justify-content: center;
|
24
|
+
align-items: center;
|
25
|
+
|
26
|
+
/* Text styles */
|
27
|
+
text-align: center;
|
28
|
+
font-family: Arial, Helvetica, sans-serif;
|
29
|
+
|
30
|
+
/* Background styles */
|
31
|
+
background-color: white;
|
32
|
+
}
|
33
|
+
|
34
|
+
.hero image_style {
|
35
|
+
float: center;
|
36
|
+
padding-top: 2em;
|
37
|
+
padding-bottom: 2em;
|
38
|
+
margin-top: .5em;
|
39
|
+
margin-bottom: .5em;
|
40
|
+
}
|
41
|
+
|
42
|
+
.hero h1 {
|
43
|
+
/* Text styles */
|
44
|
+
font-size: 2em;
|
45
|
+
font-family: Arial, Helvetica, sans-serif;
|
46
|
+
|
47
|
+
/* Margins */
|
48
|
+
margin-top: 0em;
|
49
|
+
margin-bottom: .5em;
|
50
|
+
}
|
51
|
+
|
52
|
+
.hero .btn {
|
53
|
+
/* Positioning and sizing */
|
54
|
+
display: block;
|
55
|
+
width: 200px;
|
56
|
+
|
57
|
+
/* Padding and margins */
|
58
|
+
padding: .2em;
|
59
|
+
margin-top: .5em;
|
60
|
+
margin-left: auto;
|
61
|
+
margin-right: auto;
|
62
|
+
|
63
|
+
/* Text style */
|
64
|
+
color: black;
|
65
|
+
text-decoration: none;
|
66
|
+
font-size: 1.5em;
|
67
|
+
text-align: center;
|
68
|
+
|
69
|
+
/* Border styles */
|
70
|
+
border: 3px solid black;
|
71
|
+
border-radius: 20px;
|
72
|
+
}
|
73
|
+
|
74
|
+
.hero p {
|
75
|
+
|
76
|
+
/* Text styles */
|
77
|
+
font-size: 1.55em;
|
78
|
+
text-align: center;
|
79
|
+
color: black;
|
80
|
+
text-decoration: none;
|
81
|
+
|
82
|
+
padding: .2rem;
|
83
|
+
margin-top: .2em;
|
84
|
+
margin-left: auto;
|
85
|
+
margin-right: auto;
|
86
|
+
}
|
87
|
+
|
88
|
+
.hero h3 {
|
89
|
+
|
90
|
+
/* Text styles */
|
91
|
+
font-size: 1.2em;
|
92
|
+
text-align: left;
|
93
|
+
color: black;
|
94
|
+
text-decoration: none;
|
95
|
+
|
96
|
+
padding: .5em;
|
97
|
+
margin-top: 2.5rem;
|
98
|
+
margin-left: auto;
|
99
|
+
margin-right: auto;
|
100
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy - Engine Internal Test App</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
9
|
+
<%= javascript_include_tag 'application' %>
|
10
|
+
<link rel="stylesheet" href="welcome.css">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body>
|
14
|
+
<%= yield %>
|
15
|
+
</body>
|
16
|
+
|
17
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= render partial: "whodat/dashboard/navbar", action: "index" %>
|
2
|
+
|
3
|
+
<section class="hero">
|
4
|
+
|
5
|
+
<div class="hero-inner">
|
6
|
+
<%= image_tag "whodat/whodat-logo.png", :class => "image_style" %>
|
7
|
+
|
8
|
+
<h1>WELCOME to Whodat! </h1> <br/>
|
9
|
+
<h2>You can test the user navbar above.</h2>
|
10
|
+
|
11
|
+
<%#= button_to "Start Whodat", whodat.dashboard_path, :class=> "btn", :method => :get %>
|
12
|
+
|
13
|
+
<h3>You can use the login navbar through out your Rails application <br/>
|
14
|
+
OR just to get one quick user and session. <br/>
|
15
|
+
Simple signup, login and logout. <br/>
|
16
|
+
Fast and easy, in just few steps. </h3>
|
17
|
+
</div>
|
18
|
+
</section>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a starting point to setup your application.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:setup'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a way to update your development environment automatically.
|
14
|
+
# Add necessary update steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
puts "\n== Updating database =="
|
24
|
+
system! 'bin/rails db:migrate'
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
28
|
+
|
29
|
+
puts "\n== Restarting application server =="
|
30
|
+
system! 'bin/rails restart'
|
31
|
+
end
|
data/spec/dummy/bin/yarn
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg", *ARGV
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'boot'
|
2
|
+
|
3
|
+
# require 'rails/all'
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
require "active_job/railtie"
|
9
|
+
require "action_cable/engine"
|
10
|
+
require "rails/test_unit/railtie"
|
11
|
+
require "sprockets/railtie"
|
12
|
+
# require "active_storage"
|
13
|
+
|
14
|
+
Bundler.require(*Rails.groups)
|
15
|
+
require "whodat"
|
16
|
+
|
17
|
+
module Dummy
|
18
|
+
class Application < Rails::Application
|
19
|
+
# Initialize configuration defaults for originally generated Rails version.
|
20
|
+
# config.load_defaults 5.2
|
21
|
+
|
22
|
+
# Settings in config/environments/* take precedence over those specified here.
|
23
|
+
# Application configuration can go into files in config/initializers
|
24
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
25
|
+
# the framework and any gems in your application.
|
26
|
+
|
27
|
+
# Do not swallow errors in after_commit/after_rollback callbacks.
|
28
|
+
# config.active_record.raise_in_transactional_callbacks = true
|
29
|
+
|
30
|
+
# to convert boolean to integer for sqlite3 per error message
|
31
|
+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,61 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = true
|
11
|
+
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
# Run rails dev:cache to toggle caching.
|
17
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
18
|
+
config.action_controller.perform_caching = true
|
19
|
+
|
20
|
+
config.cache_store = :memory_store
|
21
|
+
config.public_file_server.headers = {
|
22
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
23
|
+
}
|
24
|
+
else
|
25
|
+
config.action_controller.perform_caching = false
|
26
|
+
|
27
|
+
config.cache_store = :null_store
|
28
|
+
end
|
29
|
+
|
30
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
31
|
+
# config.active_storage.service = :local # COMMENTED OUT DUE TO ACTIVE STORAGE ERROR
|
32
|
+
|
33
|
+
# Don't care if the mailer can't send.
|
34
|
+
config.action_mailer.raise_delivery_errors = false
|
35
|
+
|
36
|
+
config.action_mailer.perform_caching = false
|
37
|
+
|
38
|
+
# Print deprecation notices to the Rails logger.
|
39
|
+
config.active_support.deprecation = :log
|
40
|
+
|
41
|
+
# Raise an error on page load if there are pending migrations.
|
42
|
+
config.active_record.migration_error = :page_load
|
43
|
+
|
44
|
+
# Highlight code that triggered database queries in logs.
|
45
|
+
config.active_record.verbose_query_logs = true
|
46
|
+
|
47
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
48
|
+
# This option may cause significant delays in view rendering with a large
|
49
|
+
# number of complex assets.
|
50
|
+
config.assets.debug = true
|
51
|
+
|
52
|
+
# Suppress logger output for asset requests.
|
53
|
+
config.assets.quiet = true
|
54
|
+
|
55
|
+
# Raises error for missing translations
|
56
|
+
# config.action_view.raise_on_missing_translations = true
|
57
|
+
|
58
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
59
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
60
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
61
|
+
end
|