├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── application.js │ │ └── software.coffee │ └── stylesheets │ │ ├── application.css │ │ └── software.scss ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── software_controller.rb ├── helpers │ ├── application_helper.rb │ └── software_helper.rb ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── application_record.rb │ ├── cloud_software.rb │ ├── concerns │ │ └── .keep │ ├── purchaser.rb │ └── software.rb └── views │ ├── layouts │ └── application.html.erb │ └── software │ ├── _core.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── new.html.erb │ ├── show.html.erb │ └── unathorized.html.erb ├── bin ├── bundle ├── rails └── rake ├── config.ru ├── config ├── application.rb ├── boot.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── backtrace_silencers.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── secret_token.rb │ ├── session_store.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml └── routes.rb ├── db ├── migrate │ ├── 20170526142007_create_softwares.rb │ ├── 20170526182509_add_verification_endpoint_and_license_key.rb │ ├── 20170526183721_add_cloud_to_software.rb │ ├── 20170526184044_add_login_link_to_software.rb │ ├── 20170526192057_add_expiration_date_to_software.rb │ ├── 20170526201005_create_purchasers.rb │ └── 20170526201232_add_purchaser_id_to_software.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico └── robots.txt ├── test ├── controllers │ ├── .keep │ └── software_controller_test.rb ├── fixtures │ ├── .keep │ ├── purchasers.yml │ └── softwares.yml ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── purchaser_test.rb │ └── software_test.rb └── test_helper.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | 18 | # XXX This should removed during development 19 | Gemfile.lock 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # XXX The following gems are known to have CVEs. 4 | gem 'rails', '3.2.22.5' 5 | gem 'paperclip', '4.1' 6 | gem 'devise', '~> 2.2.2' 7 | # XXX The following gems might be compromised as well. 8 | #gem 'rails', '~> 4.2', '>= 4.2.6' # XXX Used for development. 9 | #I wish you could use multiple rails versions in the same Gemfile. 10 | 11 | # Use sqlite3 as the database for Active Record 12 | gem 'sqlite3' 13 | 14 | # Use SCSS for stylesheets 15 | gem 'sass-rails', '~> 3.2.5' 16 | #gem 'sass-rails' # XXX Used for development. 17 | #I wish you could use multiple rails versions in the same Gemfile. 18 | 19 | # Use Uglifier as compressor for JavaScript assets 20 | gem 'uglifier', '>= 1.3.0' 21 | 22 | # Use CoffeeScript for .js.coffee assets and views 23 | gem 'coffee-rails', '~> 3.2.2' 24 | #gem 'coffee-rails' # XXX Used for development. 25 | #I wish you could use multiple rails versions in the same Gemfile. 26 | 27 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 28 | # gem 'therubyracer', platforms: :ruby 29 | 30 | # Use jquery as the JavaScript library 31 | gem 'jquery-rails' 32 | 33 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 34 | #gem 'turbolinks' 35 | 36 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 37 | #gem 'jbuilder', '~> 1.2' 38 | 39 | group :doc do 40 | # bundle exec rake doc:rails generates the API under doc/api. 41 | gem 'sdoc', require: false 42 | end 43 | 44 | # Use ActiveModel has_secure_password 45 | # gem 'bcrypt-ruby', '~> 3.0.0' 46 | 47 | # Use unicorn as the app server 48 | # gem 'unicorn' 49 | 50 | # Use Capistrano for deployment 51 | # gem 'capistrano', group: :development 52 | 53 | # Use debugger 54 | # gem 'debugger', group: [:development, :test] 55 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actionmailer (3.2.22.5) 5 | actionpack (= 3.2.22.5) 6 | mail (~> 2.5.4) 7 | actionpack (3.2.22.5) 8 | activemodel (= 3.2.22.5) 9 | activesupport (= 3.2.22.5) 10 | builder (~> 3.0.0) 11 | erubis (~> 2.7.0) 12 | journey (~> 1.0.4) 13 | rack (~> 1.4.5) 14 | rack-cache (~> 1.2) 15 | rack-test (~> 0.6.1) 16 | sprockets (~> 2.2.1) 17 | activemodel (3.2.22.5) 18 | activesupport (= 3.2.22.5) 19 | builder (~> 3.0.0) 20 | activerecord (3.2.22.5) 21 | activemodel (= 3.2.22.5) 22 | activesupport (= 3.2.22.5) 23 | arel (~> 3.0.2) 24 | tzinfo (~> 0.3.29) 25 | activeresource (3.2.22.5) 26 | activemodel (= 3.2.22.5) 27 | activesupport (= 3.2.22.5) 28 | activesupport (3.2.22.5) 29 | i18n (~> 0.6, >= 0.6.4) 30 | multi_json (~> 1.0) 31 | arel (3.0.3) 32 | bcrypt (3.1.11) 33 | bcrypt-ruby (3.1.5) 34 | bcrypt (>= 3.1.3) 35 | builder (3.0.4) 36 | climate_control (0.2.0) 37 | cocaine (0.5.8) 38 | climate_control (>= 0.0.3, < 1.0) 39 | coffee-rails (3.2.2) 40 | coffee-script (>= 2.2.0) 41 | railties (~> 3.2.0) 42 | coffee-script (2.4.1) 43 | coffee-script-source 44 | execjs 45 | coffee-script-source (1.12.2) 46 | devise (2.2.8) 47 | bcrypt-ruby (~> 3.0) 48 | orm_adapter (~> 0.1) 49 | railties (~> 3.1) 50 | warden (~> 1.2.1) 51 | erubis (2.7.0) 52 | execjs (2.7.0) 53 | hike (1.2.3) 54 | i18n (0.8.1) 55 | journey (1.0.4) 56 | jquery-rails (3.1.4) 57 | railties (>= 3.0, < 5.0) 58 | thor (>= 0.14, < 2.0) 59 | json (1.8.6) 60 | mail (2.5.4) 61 | mime-types (~> 1.16) 62 | treetop (~> 1.4.8) 63 | mime-types (1.25.1) 64 | multi_json (1.12.1) 65 | orm_adapter (0.5.0) 66 | paperclip (4.1.0) 67 | activemodel (>= 3.0.0) 68 | activesupport (>= 3.0.0) 69 | cocaine (~> 0.5.3) 70 | mime-types 71 | polyglot (0.3.5) 72 | rack (1.4.7) 73 | rack-cache (1.7.0) 74 | rack (>= 0.4) 75 | rack-ssl (1.3.4) 76 | rack 77 | rack-test (0.6.3) 78 | rack (>= 1.0) 79 | rails (3.2.22.5) 80 | actionmailer (= 3.2.22.5) 81 | actionpack (= 3.2.22.5) 82 | activerecord (= 3.2.22.5) 83 | activeresource (= 3.2.22.5) 84 | activesupport (= 3.2.22.5) 85 | bundler (~> 1.0) 86 | railties (= 3.2.22.5) 87 | railties (3.2.22.5) 88 | actionpack (= 3.2.22.5) 89 | activesupport (= 3.2.22.5) 90 | rack-ssl (~> 1.3.2) 91 | rake (>= 0.8.7) 92 | rdoc (~> 3.4) 93 | thor (>= 0.14.6, < 2.0) 94 | rake (12.0.0) 95 | rdoc (3.12.2) 96 | json (~> 1.4) 97 | sass (3.4.24) 98 | sass-rails (3.2.6) 99 | railties (~> 3.2.0) 100 | sass (>= 3.1.10) 101 | tilt (~> 1.3) 102 | sdoc (0.3.20) 103 | json (>= 1.1.3) 104 | rdoc (~> 3.10) 105 | sprockets (2.2.3) 106 | hike (~> 1.2) 107 | multi_json (~> 1.0) 108 | rack (~> 1.0) 109 | tilt (~> 1.1, != 1.3.0) 110 | sqlite3 (1.3.13) 111 | thor (0.19.4) 112 | tilt (1.4.1) 113 | treetop (1.4.15) 114 | polyglot 115 | polyglot (>= 0.3.1) 116 | tzinfo (0.3.53) 117 | uglifier (3.2.0) 118 | execjs (>= 0.3.0, < 3) 119 | warden (1.2.7) 120 | rack (>= 1.0) 121 | 122 | PLATFORMS 123 | ruby 124 | 125 | DEPENDENCIES 126 | coffee-rails (~> 3.2.2) 127 | devise (~> 2.2.2) 128 | jquery-rails 129 | paperclip (= 4.1) 130 | rails (= 3.2.22.5) 131 | sass-rails (~> 3.2.5) 132 | sdoc 133 | sqlite3 134 | uglifier (>= 1.3.0) 135 | 136 | BUNDLED WITH 137 | 1.14.6 138 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # darnbrokenrails 2 | An attempt at a cybersecurity / code quality teaching tool for Rails. 3 | 4 | The 'sqlite3' gem is used to prevent this Rails project being hosted in most major online hosts, but this application is 'insecure by design', so care should be taken when enabling this application in any internet connected computer. Care has been taken to ensure 'broken sections' are not executed but this is not a warranty, it is merely a 'helping hand'. I make no guarantees about code quality or reliability. 5 | 6 | # Project Goals and Objectives 7 | This repository plus the accompanying documentation can be used for developers wanting to improve their code from a security / quality perspective. The data contained within should not need a 'Computer Science' degree in order to be understood. Your developers and technical management should be able to comprehend the 'nerd talk' within this project without having any issues. 8 | 9 | The following goals are the unofficial goals of the project. More goals may be added by contributors. 10 | 1. Violates as many [bundler-audit](https://github.com/rubysec/bundler-audit) CVEs as possible. 11 | 2. Violates every warning under [brakeman](https://github.com/presidentbeef/brakeman) whenever possible. 12 | 3. Violates as many suggestions under [rails_best_practices](https://rails-bestpractices.com/) as possible. 13 | 14 | # Tutorials 15 | A tutorial section has been created in the [wiki](https://github.com/WriteCodeEveryday/darnbrokenrails/wiki) to show how to download this repository, install the tooling and execute the tools and each example within the code should have documentation linking back to the original source so the developers may use the available free tools to further their knowledge and write better Rails software. There is no reason to have insecure / non-functional software in the 21st century, at any level of any company. Any sort of software tools used within this project should be free, open source or have a trial, commercial software will be considered based on price. 16 | 17 | # Attributions 18 | Inspired by the [Damn Vulnerable Linux](https://distrowatch.com/table.php?distribution=dvl) project, initial implementation by [Lazaro Herrera](https://www.linkedin.com/in/lazaroherrera/), contributions by you, maybe? 19 | 20 | The following contributors helped achieve this project's goals: 21 | 1) Your Name Could Go Here For The Low Cost Of Helping Make Developers Write Safer and Better Code. 22 | 23 | # Pull Requests and Issues 24 | Pull requests are welcome with any changes, additions, new tooling or just any general feedback. Issues are also welcome; however, build issues will take low priority, since this project's dependencies are just too old to successfully build in some configurations and I don't have the resources to dedicate to fixing build issues at current time. 25 | 26 | I will not accept pull requests that fix the security issues. I will accept all pull requests that make this Rails application less secure (proper documentation is required). 27 | 28 | Be aware, you may have to manually increase your version of Rails beyond the set 3.2.22.5 in order to use fancy features like generators when making changes to the code. 29 | 30 | # License 31 | This code is licensed under CC0 with the understanding that you were warned it was not secure and you may credit me and other contributors if you so please. 32 | -------------------------------------------------------------------------------- /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 | Darnbrokenrails::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 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 turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/assets/javascripts/software.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /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 top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/software.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Software controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # XXX This controller violates the "Cross Site Request Forgery" portion of Brakeman. 3 | # This controller should contain the "protect_from_forgery :with => :exception" 4 | # You may find the documentation relating to this below. 5 | # Source: http://brakemanscanner.org/docs/warning_types/cross-site_request_forgery/ 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/software_controller.rb: -------------------------------------------------------------------------------- 1 | class SoftwareController < ApplicationController 2 | before_action :verify_simple_password, :only => :index 3 | before_action :verify_session, :only => [:upload_new_software_file, :upload_alternative_software_file] 4 | 5 | http_basic_authenticate_with :name => "user", :password => "secret_password", :except => :index 6 | # XXX This code violates the "Basic Authentication" portion of Brakeman. 7 | # This call to the method uses http_basic_authenticate_with against a hard-coded password. 8 | # You may find the documentation relating to this below. 9 | # Source: http://brakemanscanner.org/docs/warning_types/basic_authentication/ 10 | 11 | def verify_simple_password 12 | if params[:password] != 'abcd1234' 13 | redirect_to software_unathorized_path 14 | end 15 | # XXX This code violates the "Authentication" portion of Brakeman. 16 | # This method checks the password against a hard-coded password. 17 | # You may find the documentation relating to this below. 18 | # Source: http://brakemanscanner.org/docs/warning_types/authentication/ 19 | end 20 | 21 | def verify_session 22 | software_name = session[params[:id]] 23 | software = Software.find_by_name(software_name) 24 | if !software 25 | redirect_to software_unathorized_path 26 | end 27 | # XXX This code violates the "Session Manipulation" portion of Brakeman. 28 | # This call to the method uses the session to find the software by name. 29 | # You may find the documentation relating to this below. 30 | # Source: http://brakemanscanner.org/docs/warning_types/session_manipulation/ 31 | end 32 | 33 | def index 34 | if params[:date].present? 35 | software = Software.where("created_at > #{params[:date]}") 36 | else 37 | software = Software.all.paginate(:page => params[:page], :per_page => 20 ) 38 | end 39 | # XXX This code violates the "SQL Injection" portion of Brakeman. 40 | # This SQL call uses parameters from the big scary internet. 41 | # You may find the documentation relating to this below. 42 | # Additionally since .each is being used against "purchaser" in the else on 43 | # the view, this will cause N+1 Queries 44 | # Source: http://brakemanscanner.org/docs/warning_types/sql_injection/ 45 | # Source: https://rails-bestpractices.com/posts/2010/07/25/fix-n-1-queries/ 46 | 47 | timestamp = `date #{params[:format]}` 48 | # XXX This code violates the "Command Injection" portion of Brakeman. 49 | # This call to the method uses command execution with internet parameters. 50 | # You may find the documentation relating to this below. 51 | # Source: http://brakemanscanner.org/docs/warning_types/command_injection/ 52 | 53 | attrs = {:email => 'guy@example.com 11 | 13 | <%= csrf_meta_tags %> 14 | 15 | 16 | 17 | <%= yield %> 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/views/software/_core.html.erb: -------------------------------------------------------------------------------- 1 | Name: <%= item.name %> 2 | Price: $<%= item.price * 100 %> 3 | Expires: <%= item.expiration_date.to_s %> 4 | Last Updated: <%= times_ago_in_words(item.updated_at) %> 5 | 8 | Purchaser: <%= item.purchaser.name %> 9 | -------------------------------------------------------------------------------- /app/views/software/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Edit Software

2 | <%= link_to "Back", :index %> 3 | <%= form_for @software do |f| %> 4 | <%= f.label :name %>: 5 | <%= f.text_field :name %> 6 |

Name should end in "- Yearly" or "- Monthly"

7 | 8 | <%= f.label :price %>: 9 | <%= f.text_field :price %> 10 |

All prices should be in pennies

11 | 12 | <%= f.label :expiration_date %>: 13 | <%= f.date_field :expiration_date %> 14 | 15 |

This section is for cloud products

16 | <%= f.label :cloud %>: 17 | <%= f.check_box :cloud %> 18 | 19 | <%= f.label :login_link %>: 20 | <%= f.text_field :login_link %> 21 | 22 | <%= f.submit %> 23 | <% end %> 24 | -------------------------------------------------------------------------------- /app/views/software/index.html.erb: -------------------------------------------------------------------------------- 1 |

Software List

2 | 5 | 9 | 10 | <%= content_tag :p, "User ID: #{params[:user_id]} @ #{timestamp}" %> 11 | 15 | 16 | <% if expired %> 17 |

Expired

18 | <% expired.find_each do |item| %> 19 |
20 | <%= render :partial => 'software/core' %> 21 | <%= link_to "Edit", [:edit, item] %> 22 |
23 | <% end %> 24 | <% end %> 25 | 29 | 30 | <% if expiring %> 31 |

Expiring

32 | <% expiring.find_each do |item| %> 33 |
34 | <%= render :partial => 'software/core' %> 35 | <%= link_to "Edit", [:edit, item] %> 36 |
37 | <% end %> 38 | <% end %> 39 | 42 | 43 | <% if renewed %> 44 |

Renewed

45 | <% renewed.find_each do |item| %> 46 |
47 | <%= render :partial => 'software/core' %> 48 | <%= link_to "Edit", [:edit, item] %> 49 |
50 | <% end %> 51 | <% end %> 52 | 56 | 57 |

All Software

58 | <%= link_to "New", :new %> 59 | <% software.each do |item| %> 60 |
61 | <%= render :partial => 'software/core' %> 62 | Access: <%= item.cloud ? item.login_link : "Local" %> 63 | <%= link_to "Edit", [:edit, item] %> 64 |
65 | <% end %> 66 | 70 | -------------------------------------------------------------------------------- /app/views/software/new.html.erb: -------------------------------------------------------------------------------- 1 |

Create Software

2 | <%= link_to "Back", :index %> 3 | <%= form_for @software do |f| %> 4 | <%= f.label :name %>: 5 | <%= f.text_field :name %> 6 |

Name should end in "- Yearly" or "- Monthly"

7 | 8 | <%= f.label :price %>: 9 | <%= f.text_field :price %> 10 |

All prices should be in pennies

11 | 12 | <%= f.label :expiration_date %>: 13 | <%= f.date_field :expiration_date %> 14 | 15 |

This section is for cloud products

16 | <%= f.label :cloud %>: 17 | <%= f.check_box :cloud %> 18 | 19 | <%= f.label :login_link %>: 20 | <%= f.text_field :login_link %> 21 | 22 | <%= f.submit %> 23 | <% end %> 24 | -------------------------------------------------------------------------------- /app/views/software/show.html.erb: -------------------------------------------------------------------------------- 1 |

Software Details

2 |

<%= "Timestamp: #{timestamp}" %>

3 | Software ID: <%= raw params[:id] %> 4 | 8 | Software Name: <%= software.name %> 9 | Software Price: $<%= software.price %> 10 | Software Expiration: <%= software.expiration.to_s %> 11 | Software Purchaser: <%= software.purchaser.name %> 12 | -------------------------------------------------------------------------------- /app/views/software/unathorized.html.erb: -------------------------------------------------------------------------------- 1 |

You are not authorized!

2 | Seriously, someone write a better unathorized page. 3 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 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 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) 8 | 9 | module Darnbrokenrails 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | config.active_support.escape_html_entities_in_json = false 23 | # XXX This code violates the "Cross Site Scripting (JSON)" portion of Brakeman. 24 | #This section allows a JSON formatted item to cause a cross-site scripting issue. 25 | #You may find the documentation relating to this below. 26 | #Source: http://brakemanscanner.org/docs/warning_types/cross_site_scripting_to_json/ --> 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 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 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | 27 | # XXX This file should abuse the & and * to merge options 28 | # Source: https://rails-bestpractices.com/posts/2010/07/28/dry-your-database-yml/ 29 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Darnbrokenrails::Application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Darnbrokenrails::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 = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Darnbrokenrails::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = true 15 | # XXX This setting violates the "Information Disclosure" portion of Brakeman. 16 | # This would allow information leakage in Production. 17 | # You may find the documentation relating to this below. 18 | # Source: http://brakemanscanner.org/docs/warning_types/information_disclosure/ 19 | 20 | config.action_controller.perform_caching = true 21 | 22 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 23 | # Add `rack-cache` to your Gemfile before enabling this. 24 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 25 | # config.action_dispatch.rack_cache = true 26 | 27 | # Disable Rails's static asset server (Apache or nginx will already do this). 28 | config.serve_static_assets = false 29 | 30 | # Compress JavaScripts and CSS. 31 | config.assets.js_compressor = :uglifier 32 | # config.assets.css_compressor = :sass 33 | 34 | # Do not fallback to assets pipeline if a precompiled asset is missed. 35 | config.assets.compile = false 36 | 37 | # Generate digests for assets URLs. 38 | config.assets.digest = true 39 | 40 | # Version of your assets, change this if you want to expire all your assets. 41 | config.assets.version = '1.0' 42 | 43 | # Specifies the header that your server uses for sending files. 44 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 45 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 46 | 47 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 48 | # config.force_ssl = true 49 | 50 | # Set to :debug to see everything in the log. 51 | config.log_level = :info 52 | 53 | # Prepend all log lines with the following tags. 54 | # config.log_tags = [ :subdomain, :uuid ] 55 | 56 | # Use a different logger for distributed setups. 57 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 58 | 59 | # Use a different cache store in production. 60 | # config.cache_store = :mem_cache_store 61 | 62 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 63 | # config.action_controller.asset_host = "http://assets.example.com" 64 | 65 | # Precompile additional assets. 66 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 67 | # config.assets.precompile += %w( search.js ) 68 | 69 | # Ignore bad email addresses and do not raise email delivery errors. 70 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 71 | # config.action_mailer.raise_delivery_errors = false 72 | 73 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 74 | # the I18n.default_locale when a translation can not be found). 75 | config.i18n.fallbacks = true 76 | 77 | # Send deprecation notices to registered listeners. 78 | config.active_support.deprecation = :notify 79 | 80 | # Disable automatic flushing of the log to improve performance. 81 | # config.autoflush_log = false 82 | 83 | # Use default logging formatter so that PID and timestamp are not suppressed. 84 | config.log_formatter = ::Logger::Formatter.new 85 | end 86 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Darnbrokenrails::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 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 your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Darnbrokenrails::Application.config.secret_key_base = 'aaaee43966126a2db8f85ea81df6a32e6a4b10892520f63a10a551f1dbf0124d21a6bd03adc0a091b102c08de3e462d7d1a178e8367efa8fd3be03940b476172' 13 | # XXX This code violates the "Session Setting" portion of Brakeman. 14 | # This section commits the secret_key_base to your Github. 15 | # You may find the documentation relating to this below. 16 | # Source: http://brakemanscanner.org/docs/warning_types/session_setting/ 17 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Darnbrokenrails::Application.config.session_store :cookie_store, key: '_darnbrokenrails_session' 4 | -------------------------------------------------------------------------------- /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/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: "Hello world" 24 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Darnbrokenrails::Application.routes.draw do 2 | root 'software#index' 3 | resources :softwares 4 | # XXX The softwares routes have not been properly restricted, using ":only" can 5 | # be used to ensure noone can just delete your super critical data. 6 | # Source: https://rails-bestpractices.com/posts/2011/08/19/restrict-auto-generated-routes/ 7 | 8 | get '/software/unathorized' => 'software#unathorized' 9 | post '/software/execute' => 'software#execute_method' 10 | post '/software/upload' => 'software#upload_new_software_file' 11 | post '/software/upload_yaml' => 'software#upload_alternative_software_file' 12 | post '/software/upload_marshal' => 'software#upload_marshaled_software_file' 13 | post '/software/confirm' => 'software#confirm_software_expiration' 14 | match ':controller(/:action(/:id(.:format)))', :via => [:get, :post] 15 | # XXX This code violates the "Default Routes" portion of Brakeman. 16 | # This call to the method uses dangerous sends to the underlying controller. 17 | # You may find the documentation relating to this below. 18 | # Source: http://brakemanscanner.org/docs/warning_types/default_routes/ 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20170526142007_create_softwares.rb: -------------------------------------------------------------------------------- 1 | class CreateSoftwares < ActiveRecord::Migration 2 | def change 3 | create_table :softwares do |t| 4 | t.string :name 5 | t.integer :price 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20170526182509_add_verification_endpoint_and_license_key.rb: -------------------------------------------------------------------------------- 1 | class AddVerificationEndpointAndLicenseKey < ActiveRecord::Migration 2 | def change 3 | add_column :softwares, :verification_endpoint, :string 4 | add_column :softwares, :license_key, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20170526183721_add_cloud_to_software.rb: -------------------------------------------------------------------------------- 1 | class AddCloudToSoftware < ActiveRecord::Migration 2 | def change 3 | add_column :softwares, :cloud, :boolean, default: false 4 | # XXX The next two migrations should be merged into this one. Rails can 5 | # optimize adding columns as long as it's in the same table. The larger the table, 6 | # the more useful this is. 7 | # Source: https://rails-bestpractices.com/posts/2011/10/30/optimize-db-migration/ 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170526184044_add_login_link_to_software.rb: -------------------------------------------------------------------------------- 1 | class AddLoginLinkToSoftware < ActiveRecord::Migration 2 | def change 3 | add_column :softwares, :login_link, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170526192057_add_expiration_date_to_software.rb: -------------------------------------------------------------------------------- 1 | class AddExpirationDateToSoftware < ActiveRecord::Migration 2 | def change 3 | add_column :softwares, :expiration_date, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170526201005_create_purchasers.rb: -------------------------------------------------------------------------------- 1 | class CreatePurchasers < ActiveRecord::Migration 2 | def change 3 | create_table :purchasers do |t| 4 | t.string :name, default: "unnamed" 5 | 6 | t.timestamps null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20170526201232_add_purchaser_id_to_software.rb: -------------------------------------------------------------------------------- 1 | class AddPurchaserIdToSoftware < ActiveRecord::Migration 2 | def change 3 | add_column :softwares, :purchaser_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /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: 20170526201232) do 15 | 16 | create_table "ar_internal_metadata", primary_key: "key", force: :cascade do |t| 17 | t.string "value" 18 | t.datetime "created_at", null: false 19 | t.datetime "updated_at", null: false 20 | end 21 | 22 | add_index "ar_internal_metadata", ["key"], name: "sqlite_autoindex_ar_internal_metadata_1", unique: true 23 | 24 | create_table "purchasers", force: :cascade do |t| 25 | t.string "name", default: "unnamed" 26 | t.datetime "created_at", null: false 27 | t.datetime "updated_at", null: false 28 | end 29 | 30 | create_table "softwares", force: :cascade do |t| 31 | t.string "name" 32 | t.integer "price" 33 | t.datetime "created_at" 34 | t.datetime "updated_at" 35 | t.string "verification_endpoint" 36 | t.string "license_key" 37 | t.boolean "cloud", default: false 38 | t.string "login_link" 39 | t.datetime "expiration_date" 40 | t.integer "purchaser_id" 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/log/.keep -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The page you were looking for doesn't exist.

54 |

You may have mistyped the address or the page may have moved.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The change you wanted was rejected.

54 |

Maybe you tried to change something you didn't have access to.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

We're sorry, but something went wrong.

54 |
55 |

If you are the application owner check the logs for more information.

56 | 57 | 58 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.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 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/software_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SoftwareControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/purchasers.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | 6 | two: 7 | name: MyString 8 | -------------------------------------------------------------------------------- /test/fixtures/softwares.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | price: 1 6 | 7 | two: 8 | name: MyString 9 | price: 1 10 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/test/models/.keep -------------------------------------------------------------------------------- /test/models/purchaser_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PurchaserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/software_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class SoftwareTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | ActiveRecord::Migration.check_pending! 7 | 8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 9 | # 10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 11 | # -- they do not yet inherit this setting 12 | fixtures :all 13 | 14 | # Add more helper methods to be used by all tests here... 15 | end 16 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WriteCodeEveryday/darnbrokenrails/a77f1f6f8fcbe0e8e1e1c675071446abd6f35d9d/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------