├── VERSION ├── public ├── favicon.ico ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── Procfile ├── .coveralls.yml ├── CHANGELOG.md ├── .slugignore ├── config ├── initializers │ ├── puma_auto_tune.rb │ ├── rack_timeout.rb │ ├── cookies_serializer.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── bullet.rb │ ├── filter_parameter_logging.rb │ ├── backtrace_silencers.rb │ ├── assets.rb │ ├── wrap_parameters.rb │ └── inflections.rb ├── boot.rb ├── environment.rb ├── puma.rb ├── locales │ └── en.yml ├── i18n-js.yml ├── secrets.yml ├── application.rb ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── routes.rb ├── database.yml └── newrelic.yml ├── bin ├── rake ├── bundle ├── rails ├── spring └── setup ├── app ├── assets │ ├── images │ │ └── apple-touch-icon-precomposed.png │ ├── javascripts │ │ ├── turbolinks-progress-bar.coffee │ │ ├── twbs.coffee │ │ ├── application.coffee.erb │ │ └── i18n │ │ │ └── translations.js │ └── stylesheets │ │ ├── maze.scss │ │ ├── twbs-variables.scss │ │ ├── turbolinks-progress-bar.scss │ │ ├── twbs.scss │ │ └── application.css ├── controllers │ ├── welcome_controller.rb │ └── application_controller.rb ├── views │ ├── shared │ │ ├── _footer.html.slim │ │ └── _navbar.html.slim │ ├── welcome │ │ └── index.html.slim │ └── layouts │ │ └── application.html.slim ├── helpers │ └── application_helper.rb └── models │ └── maze.rb ├── .travis.yml ├── config.ru ├── .rubocop.yml ├── spec ├── features │ └── welcome_spec.rb ├── support │ ├── mailer_macros.rb │ └── database_cleaner.rb ├── spec_helper.rb └── models │ └── maze_spec.rb ├── db ├── seeds.rb └── schema.rb ├── Rakefile ├── app.json ├── .gitignore ├── README.md ├── Gemfile ├── LICENSE └── Gemfile.lock /VERSION: -------------------------------------------------------------------------------- 1 | 13.7.2 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec puma -C config/puma.rb 2 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: nXAHlJbFjmzCRrHmcf4Mp3yZyNdTsAGBO 2 | 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.0.1 4 | 5 | * Initial version 6 | -------------------------------------------------------------------------------- /.slugignore: -------------------------------------------------------------------------------- 1 | spec 2 | CHANGELOG.md 3 | LICENSE 4 | README.md 5 | VERSION 6 | -------------------------------------------------------------------------------- /config/initializers/puma_auto_tune.rb: -------------------------------------------------------------------------------- 1 | PumaAutoTune.start if defined?(PumaAutoTune) 2 | -------------------------------------------------------------------------------- /config/initializers/rack_timeout.rb: -------------------------------------------------------------------------------- 1 | Rack::Timeout.timeout = 20.seconds if defined?(Rack::Timeout) 2 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /app/assets/images/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/amazed/HEAD/app/assets/images/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /app/assets/javascripts/turbolinks-progress-bar.coffee: -------------------------------------------------------------------------------- 1 | # TODO: Remove with Turbolinks 3 2 | Turbolinks.enableProgressBar() if window.Turbolinks 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/maze.scss: -------------------------------------------------------------------------------- 1 | @import "twbs-variables"; 2 | 3 | td.maze-cell { 4 | border: 3px solid black; 5 | padding: 10px; 6 | } 7 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | sudo: false 3 | rvm: 4 | - 2.2.3 5 | before_install: 6 | - "export DISPLAY=:99.0" 7 | - "sh -e /etc/init.d/xvfb start" 8 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def index 3 | @maze = Maze.new 4 | @maze.construct_and_solve 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_amazed_session' 4 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.slim: -------------------------------------------------------------------------------- 1 | footer 2 | .container 3 | hr 4 | p 5 | = link_to 'https://github.com/diowa/amazed' do 6 | span.fa.fa-github> 7 | | diowa/amazed 8 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/bullet.rb: -------------------------------------------------------------------------------- 1 | if defined? Bullet 2 | # Bullet.enable = true 3 | # Bullet.alert = true 4 | # Bullet.bullet_logger = true 5 | # Bullet.console = true 6 | # Bullet.rails_logger = true 7 | end 8 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/twbs-variables.scss: -------------------------------------------------------------------------------- 1 | /* Override Bootstrap variables here 2 | * Example: $brand-primary: navy; 3 | */ 4 | 5 | $brand-primary: #955251; 6 | 7 | /* Do not edit below this line */ 8 | @import "twbs/bootstrap/variables"; 9 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Exclude: 3 | - 'bin/*' 4 | - 'db/**/*' 5 | - 'spec/**/*' 6 | - 'vendor/bundle/**/*' 7 | RunRailsCops: true 8 | 9 | Metrics/LineLength: 10 | Enabled: false 11 | 12 | Style/Documentation: 13 | Enabled: false 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/turbolinks-progress-bar.scss: -------------------------------------------------------------------------------- 1 | @import "twbs-variables"; 2 | @import "twbs/bootstrap/mixins"; 3 | 4 | html.turbolinks-progress-bar::before { 5 | background-color: $progress-bar-bg !important; 6 | z-index: $zindex-navbar-fixed + 1 !important; 7 | } 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/twbs.coffee: -------------------------------------------------------------------------------- 1 | jQuery -> 2 | # For performance reasons, the Tooltip and Popover data-apis are opt in. 3 | # Uncomment the following line to enable tooltips 4 | # $("[data-toggle='tooltip']").tooltip() 5 | 6 | # Uncomment the following line to enable popovers 7 | # $("[data-toggle='popover']").popover() 8 | -------------------------------------------------------------------------------- /spec/features/welcome_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'Welcome' do 4 | context 'Index' do 5 | it "has title and a maze with 100 cells" do 6 | visit root_path 7 | 8 | expect(page).to have_title I18n.t('hello') 9 | expect(page).to have_css 'td', count: 100 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /spec/support/mailer_macros.rb: -------------------------------------------------------------------------------- 1 | module MailerMacros 2 | def last_email 3 | ActionMailer::Base.deliveries.last 4 | end 5 | 6 | def reset_emails 7 | ActionMailer::Base.deliveries = [] 8 | end 9 | end 10 | 11 | RSpec.configure do |config| 12 | config.include MailerMacros 13 | 14 | config.before(:each) do 15 | reset_emails 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/support/database_cleaner.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | RSpec.configure do |config| 3 | config.before(:suite) do 4 | DatabaseCleaner.clean_with :truncation 5 | end 6 | 7 | config.around(:each) do |example| 8 | DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction 9 | DatabaseCleaner.start 10 | 11 | example.run 12 | 13 | DatabaseCleaner.clean 14 | end 15 | end 16 | =end 17 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | workers Integer(ENV['PUMA_WORKERS'] || 3) 2 | threads Integer(ENV['MIN_THREADS'] || 0), Integer(ENV['MAX_THREADS'] || 16) 3 | 4 | preload_app! 5 | 6 | rackup DefaultRackup 7 | port ENV['PORT'] || 3000 8 | environment ENV['RACK_ENV'] || 'development' 9 | 10 | on_worker_boot do 11 | # worker specific setup 12 | # ActiveSupport.on_load(:active_record) do 13 | # ActiveRecord::Base.establish_connection 14 | # end 15 | end 16 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /app/views/shared/_navbar.html.slim: -------------------------------------------------------------------------------- 1 | nav.navbar.navbar-default 2 | .container 3 | .navbar-header 4 | button.navbar-toggle.collapsed type='button' data-toggle='collapse' data-target='.navbar-collapse' 5 | span.sr-only= t('.toggle_navigation') 6 | span.icon-bar 7 | span.icon-bar 8 | span.icon-bar 9 | = link_to Rails.application.class.parent_name, root_path, class: 'navbar-brand' 10 | .collapse.navbar-collapse 11 | ul.nav.navbar-nav 12 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | begin 7 | require 'rubocop/rake_task' 8 | RuboCop::RakeTask.new 9 | rescue LoadError 10 | desc 'Run RuboCop' 11 | task :rubocop do 12 | $stderr.puts 'Rubocop is disabled' 13 | end 14 | end 15 | 16 | task test: :spec 17 | 18 | task default: [:rubocop, :spec] 19 | 20 | Rails.application.load_tasks 21 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast 4 | # It gets overwritten when you run the `spring binstub` command 5 | 6 | unless defined?(Spring) 7 | require "rubygems" 8 | require "bundler" 9 | 10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) 11 | ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) 12 | ENV["GEM_HOME"] = "" 13 | Gem.paths = ENV 14 | 15 | gem "spring", match[1] 16 | require "spring/binstub" 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/assets/stylesheets/twbs.scss: -------------------------------------------------------------------------------- 1 | /* Use twbs-variables to define new variables and override Bootstrap defaults. 2 | * Import "twbs-variables" instead of "twbs/bootstrap/variables" 3 | * in each new stylesheet. 4 | */ 5 | @import "twbs-variables"; 6 | 7 | /* Start editing below this line */ 8 | @import "twbs/bootstrap"; 9 | 10 | /* Bootstrap Theme */ 11 | //@import "twbs/bootstrap/theme"; 12 | 13 | /* Glyphs */ 14 | //@import "twbs/bootstrap/glyphicons"; 15 | @import "fontawesome/font-awesome"; 16 | 17 | /* Standard Rails form errors */ 18 | .field_with_errors { 19 | @extend .has-error; 20 | } 21 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 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 vendor/assets/stylesheets of plugins, if any, 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 styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_self 14 | *= stub twbs-variables 15 | *= require twbs 16 | *= require_tree . 17 | */ 18 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Amazed" 24 | shared: 25 | navbar: 26 | toggle_navigation: Toggle Navigation 27 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | def title(page_title) 3 | content_for(:title) { page_title.to_s } 4 | end 5 | 6 | def yield_or_default(section, default = '') 7 | content_for?(section) ? content_for(section) : default 8 | end 9 | 10 | def style_for_cell(cell_position) 11 | style = [] 12 | @maze.carving_steps.each do |step| 13 | style << "border-#{border_from(step[2])}: 0;" if [step[0], step[1]] == cell_position 14 | end 15 | @maze.solution_steps.each do |step| 16 | style << 'background: #7AF7A1;' if step == cell_position 17 | end 18 | style.join 19 | end 20 | 21 | def border_from(direction) 22 | case direction 23 | when :U then 'top' 24 | when :D then 'bottom' 25 | when :L then 'left' 26 | when :R then 'right' 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 0) do 15 | 16 | end 17 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /config/i18n-js.yml: -------------------------------------------------------------------------------- 1 | # Split context in several files. 2 | # By default only one file with all translations is exported and 3 | # no configuration is required. Your settings for asset pipeline 4 | # are automatically recognized. 5 | # 6 | # If you want to split translations into several files or specify 7 | # locale contexts that will be exported, just use this file to do 8 | # so. 9 | # 10 | # If you're going to use the Rails 3.1 asset pipeline, change 11 | # the following configuration to something like this: 12 | # 13 | # translations: 14 | # - file: "app/assets/javascripts/i18n/translations.js" 15 | # 16 | # If you're running an old version, you can use something 17 | # like this: 18 | # 19 | # translations: 20 | # - file: "public/javascripts/translations.js" 21 | # only: "*" 22 | # 23 | 24 | translations: 25 | - file: 'app/assets/javascripts/i18n/translations.js' 26 | only: ['*.date', '*.time', '*.datetime'] 27 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Amazed", 3 | "description": "Application to create and solve a perfect maze", 4 | "keywords": [ 5 | "Maze", 6 | "Ruby 2", 7 | "Rails 4", 8 | "Bootstrap", 9 | "Font Awesome", 10 | "Nitrous.IO" 11 | ], 12 | "website": "http://amazed.herokuapp.com/", 13 | "repository": "https://github.com/diowa/amazed", 14 | "success_url": "/", 15 | "env": { 16 | "NEW_RELIC_APP_NAME": { 17 | "description": "Sets the name of your application as it will appear on the New Relic dashboard.", 18 | "value": "Amazed App" 19 | }, 20 | "RAILS_ENV": "production", 21 | "RAILS_SERVE_STATIC_FILES": "enabled", 22 | "RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR": { 23 | "description": "Reduces RGenGC's memory consumption", 24 | "value": "1.3" 25 | }, 26 | "SECRET_KEY_BASE": { 27 | "description": "This gets generated", 28 | "generator": "secret" 29 | } 30 | }, 31 | "addons": [ 32 | "papertrail", 33 | "newrelic" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 5d4338b7c5670da523290f759352904fb2791e2e3fac31daebf541376d090d455f319888ccb48d5b26d2f287b423fc626f72c5392842134d9dd2f6ccbac9bb90 15 | 16 | test: 17 | secret_key_base: 334452fcb32cd42a8e301e6c846618cbbbf4292384ad44268bec4d28ebdd69ebb67fd68b7de057fb8ce91d7baa1318e88470b6fcd59badc9414e75b294a90324 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.coffee.erb: -------------------------------------------------------------------------------- 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 vendor/assets/javascripts of plugins, if any, 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. 9 | # 10 | # Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | # about supported directives. 12 | # 13 | #= require jquery 14 | #= require jquery_ujs 15 | #= require jquery.turbolinks 16 | #= require turbolinks 17 | 18 | # BOOTSTRAP 19 | #= require twbs/bootstrap 20 | 21 | # I18n 22 | #= require i18n 23 | #= require i18n/translations 24 | 25 | # ALL THE REST 26 | #= require_tree . 27 | 28 | I18n.defaultLocale = '<%= I18n.default_locale.to_s %>' 29 | I18n.locale = document.getElementsByTagName('html')[0].getAttribute('lang') 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Linux.gitignore 2 | .* 3 | !.coveralls.yml 4 | !.gitignore 5 | !.rspec 6 | !.rubocop.yml 7 | !.slugignore 8 | !.travis.yml 9 | *~ 10 | 11 | 12 | 13 | # OSX.gitignore 14 | .DS_Store 15 | .AppleDouble 16 | .LSOverride 17 | Icon 18 | 19 | 20 | # Thumbnails 21 | ._* 22 | 23 | # Files that might appear on external disk 24 | .Spotlight-V100 25 | .Trashes 26 | 27 | 28 | 29 | # Rails.gitignore 30 | *.rbc 31 | *.sassc 32 | .sass-cache 33 | capybara-*.html 34 | .rvmrc 35 | /.bundle 36 | /vendor/bundle 37 | /log/* 38 | /tmp/* 39 | /db/*.sqlite3 40 | /public/system/* 41 | /coverage/ 42 | /spec/tmp/* 43 | **.orig 44 | rerun.txt 45 | pickle-email-*.html 46 | .project 47 | 48 | 49 | 50 | # Ignore Redis' dataset snapshot 51 | dump.rdb 52 | 53 | # Ignore chrome driver log 54 | chromedriver.log 55 | 56 | # Ignore rails_best_practices report 57 | rails_best_practices_output.html 58 | 59 | # Ignore brakeman report 60 | brakeman.html 61 | 62 | # Ignore file uploads 63 | /public/uploads 64 | 65 | # Ignore precompiled assets and source maps 66 | /public/assets 67 | 68 | # Ignore sensitive data 69 | /config/settings/local.rb 70 | -------------------------------------------------------------------------------- /app/views/welcome/index.html.slim: -------------------------------------------------------------------------------- 1 | - title t('hello') 2 | 3 | .container 4 | .row 5 | .col-sm-8.col-sm-offset-2 6 | h1.text-center 7 | | Amazed 8 | p 9 | | Amazed is an application that creates and solves perfect mazes using the recursive backtracker algorithm. 10 | p 11 | | Amazed has been developed using the following technology stack: 12 | ul 13 | li Ruby 2.2.3 14 | li Rails 4.2.5 15 | li RSpec 4 16 | li Twitter Bootstrap for Sass 3.3.6 17 | li Autoprefixer 18 | li Font Awesome 4.5.0 19 | li SLIM 20 | li RuboCop 21 | p 22 | | Source code available at: 23 | = " " 24 | = link_to "github.com/diowa/amazed", "https://github.com/diowa/amazed" 25 | 26 | h3 Update the page to see different mazes. 27 | 28 | .row 29 | .col-sm-6.col-sm-offset-3 30 | table.table-responsive 31 | - @maze.height.times do |y| 32 | tr 33 | - @maze.width.times do |x| 34 | td.maze-cell style=style_for_cell([x, y]) 35 | .small= "#{x},#{y}" 36 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.slim: -------------------------------------------------------------------------------- 1 | doctype html 2 | html lang=I18n.locale.to_s 3 | head 4 | title= yield_or_default :title, action_name.titlecase 5 | meta charset='utf-8' 6 | meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0' 7 | meta content='IE=edge' http-equiv='X-UA-Compatible' 8 | = csrf_meta_tags 9 | = yield :head 10 | 11 | = stylesheet_link_tag 'application', media: 'all', data: { turbolinks_track: true } 12 | 13 | /! Favicons 14 | link href=asset_path('apple-touch-icon-precomposed.png') rel='apple-touch-icon-precomposed' sizes='144x144' 15 | 16 | /! Turbolinks require javascript tags inside the head 17 | = javascript_include_tag 'application', data: { turbolinks_track: true } 18 | 19 | /! HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries 20 | /[if lt IE 9] 21 | = javascript_include_tag '//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js', 'respond.js' 22 | 23 | body 24 | == render 'shared/navbar' 25 | 26 | #main-container.container= yield 27 | 28 | == render 'shared/footer' 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Amazed 2 | [](https://travis-ci.org/diowa/amazed) [](https://gemnasium.com/diowa/amazed) [](https://codeclimate.com/github/diowa/amazed) [](https://coveralls.io/r/diowa/amazed?branch=master) 3 | 4 | [](https://heroku.com/deploy) 5 | 6 | 7 | Application to create and solve perfect mazes based on the following technology stack: 8 | 9 | * [Ruby 2.2.3][1] 10 | * [Rails 4.2.5][2] 11 | * [Puma][3] 12 | * [RSpec][4] 13 | * [Twitter Bootstrap for Sass 3.3.6][5] 14 | * [Autoprefixer][6] 15 | * [Font Awesome 4.5.0][7] 16 | * [SLIM][8] 17 | * [RuboCop][9] 18 | 19 | [1]: http://www.ruby-lang.org/en/ 20 | [2]: http://rubyonrails.org/ 21 | [3]: http://puma.io/ 22 | [4]: http://rspec.info/ 23 | [5]: http://getbootstrap.com/ 24 | [6]: http://github.com/ai/autoprefixer/ 25 | [7]: http://fontawesome.io/ 26 | [8]: http://slim-lang.com/ 27 | [9]: http://github.com/bbatsov/rubocop 28 | 29 | Amazed is deployable on [Heroku](http://www.heroku.com/). Demo: http://diowa-amazed.herokuapp.com/ 30 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'action_controller/railtie' 4 | require 'action_mailer/railtie' 5 | require 'sprockets/railtie' 6 | require 'rails/test_unit/railtie' 7 | 8 | # Require the gems listed in Gemfile, including any gems 9 | # you've limited to :test, :development, or :production. 10 | Bundler.require(*Rails.groups) 11 | 12 | module Amazed 13 | class Application < Rails::Application 14 | # Settings in config/environments/* take precedence over those specified here. 15 | # Application configuration should go into files in config/initializers 16 | # -- all .rb files in that directory are automatically loaded. 17 | 18 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 19 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 20 | # config.time_zone = 'Central Time (US & Canada)' 21 | 22 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 23 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 24 | # config.i18n.default_locale = :de 25 | 26 | # Do not swallow errors in after_commit/after_rollback callbacks. 27 | # config.active_record.raise_in_transactional_callbacks = true 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | if ENV['CI'] 2 | require 'coveralls' 3 | Coveralls.wear! 'rails' 4 | end 5 | 6 | require 'simplecov' 7 | SimpleCov.start 'rails' 8 | 9 | # This file is copied to spec/ when you run 'rails generate rspec:install' 10 | ENV['RAILS_ENV'] ||= 'test' 11 | require File.expand_path('../../config/environment', __FILE__) 12 | require 'rspec/rails' 13 | 14 | # Requires supporting ruby files with custom matchers and macros, etc, 15 | # in spec/support/ and its subdirectories. 16 | Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } 17 | 18 | require 'webmock/rspec' 19 | require 'capybara/rspec' 20 | 21 | # Capybara.ignore_hidden_elements = false # testing hidden fields 22 | 23 | RSpec.configure do |config| 24 | # == Mock Framework 25 | # 26 | # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: 27 | # 28 | # config.mock_with :mocha 29 | # config.mock_with :flexmock 30 | # config.mock_with :rr 31 | # config.mock_with :rspec 32 | 33 | # Run specs in random order to surface order dependencies. If you find an 34 | # order dependency and want to debug it, you can fix the order by providing 35 | # the seed, which is printed after each run. 36 | # --seed 1234 37 | config.order = 'random' 38 | 39 | config.infer_spec_type_from_file_location! 40 | config.color = true 41 | config.formatter = :documentation 42 | end 43 | -------------------------------------------------------------------------------- /app/assets/javascripts/i18n/translations.js: -------------------------------------------------------------------------------- 1 | var I18n = I18n || {}; 2 | I18n.translations = {"en":{"date":{"formats":{"default":"%Y-%m-%d","short":"%b %d","long":"%B %d, %Y"},"day_names":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"abbr_day_names":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"month_names":[null,"January","February","March","April","May","June","July","August","September","October","November","December"],"abbr_month_names":[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"order":["year","month","day"]},"time":{"formats":{"default":"%a, %d %b %Y %H:%M:%S %z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},"am":"am","pm":"pm"},"datetime":{"distance_in_words":{"half_a_minute":"half a minute","less_than_x_seconds":{"one":"less than 1 second","other":"less than %{count} seconds"},"x_seconds":{"one":"1 second","other":"%{count} seconds"},"less_than_x_minutes":{"one":"less than a minute","other":"less than %{count} minutes"},"x_minutes":{"one":"1 minute","other":"%{count} minutes"},"about_x_hours":{"one":"about 1 hour","other":"about %{count} hours"},"x_days":{"one":"1 day","other":"%{count} days"},"about_x_months":{"one":"about 1 month","other":"about %{count} months"},"x_months":{"one":"1 month","other":"%{count} months"},"about_x_years":{"one":"about 1 year","other":"about %{count} years"},"over_x_years":{"one":"over 1 year","other":"over %{count} years"},"almost_x_years":{"one":"almost 1 year","other":"almost %{count} years"}},"prompts":{"year":"Year","month":"Month","day":"Day","hour":"Hour","minute":"Minute","second":"Seconds"}}}}; -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | ruby '2.2.3' 4 | gem 'rails', '4.2.5' 5 | 6 | # Servers 7 | gem 'puma' 8 | 9 | # Multi-environment configuration 10 | # gem 'figaro' 11 | 12 | # API 13 | # gem 'rabl' 14 | 15 | # ORM 16 | # gem 'pg' 17 | 18 | # Pagination 19 | # gem 'kaminari' 20 | 21 | # App monitoring 22 | # gem 'airbrake' 23 | gem 'newrelic_rpm' 24 | 25 | # Security 26 | # gem 'secure_headers' 27 | 28 | # Miscellanea 29 | # gem 'google-analytics-rails' 30 | # gem 'http_accept_language' 31 | # gem 'resque', require: 'resque/server' # Resque web interface 32 | gem 'slim-rails' 33 | 34 | # Assets 35 | gem 'autoprefixer-rails' 36 | gem 'coffee-rails', '~> 4.1.0' 37 | gem 'i18n-js' 38 | gem 'jquery-rails' 39 | gem 'jquery-turbolinks' 40 | gem 'sass-rails', '~> 5.0' 41 | gem 'slim_assets' 42 | gem 'turbolinks' 43 | gem 'twbs_sass_rails' 44 | gem 'uglifier', '>= 1.3.0' 45 | 46 | group :development, :test do 47 | gem 'byebug' 48 | gem 'factory_girl_rails' 49 | gem 'faker' 50 | gem 'pry' 51 | gem 'pry-byebug' 52 | gem 'pry-rails' 53 | gem 'rspec-rails' 54 | gem 'web-console' 55 | end 56 | 57 | group :development do 58 | gem 'better_errors' 59 | gem 'binding_of_caller' 60 | gem 'bullet' 61 | gem 'meta_request' 62 | gem 'quiet_assets' 63 | gem 'spring' 64 | gem 'spring-commands-rspec' 65 | end 66 | 67 | group :test do 68 | gem 'capybara' 69 | gem 'coveralls', require: false 70 | gem 'database_cleaner' 71 | gem 'email_spec' 72 | gem 'rspec' 73 | gem 'rubocop', require: false 74 | gem 'selenium-webdriver' 75 | gem 'simplecov', require: false 76 | gem 'webmock', require: false 77 | end 78 | 79 | group :staging, :production do 80 | # gem 'puma_auto_tune' 81 | gem 'rack-timeout' 82 | gem 'rails_12factor' 83 | end 84 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |If you are the application owner check the logs for more information.
64 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |