We are excited to have you with us on this journey.
5 |
6 |
Please feel free to ask questions, make comments, or just connect with us.
7 |
--------------------------------------------------------------------------------
/app/views/user_mailer/registration_confirmation.text.erb:
--------------------------------------------------------------------------------
1 | Thanks for registering!
2 |
3 | We are excited to have you with us on this journey.
4 |
5 | Please feel free to ask questions, make comments, or just connect with us.
--------------------------------------------------------------------------------
/app/views/users/_artist_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for @user, :html => { :class => "artistForm email-form"} do |f| %>
2 |
User Type 2?
3 |
Are you User Type 2? Here's some text telling you whether you should enter your email address below!
Howdy! There were <%= @users.count %> users registered so far..
2 |
3 |
4 |
5 |
Email
6 |
Created
7 |
User Type
8 |
9 | <% @users.each do |user| %>
10 |
11 |
<%= user.email %>
12 |
<%= user.created_at %>
13 |
<%= user.usertype %>
14 |
15 | <% end %>
16 |
17 |
--------------------------------------------------------------------------------
/app/views/users/new.html.erb:
--------------------------------------------------------------------------------
1 | <% provide(:title, "Sign up for beta access") %>
2 |
3 |
Write a little something about your project here. A little hype. C'mon, get us all excited about what you're working on! You should describe the two types of people you're looking attract to your project and lead them to the buttons below. When they click a button, their particular email submission field will be revealed. Swanky.
4 |
5 | <%= render 'users/fan_form' %>
6 | <%= render 'users/artist_form' %>
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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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.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 LaunchpageRails::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(*Rails.groups)
8 |
9 | module LaunchpageRails
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 |
23 | # Do not swallow errors in after_commit/after_rollback callbacks.
24 | config.active_record.raise_in_transactional_callbacks = true
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/database.yml.example:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: postgresql
3 | encoding: unicode
4 | database: launch_development
5 | pool: 5
6 | username: yourUsername
7 | password: yourPassword
8 | test:
9 | adapter: postgresql
10 | encoding: unicode
11 | database: launch_test
12 | pool: 5
13 | username: yourUsername
14 | password: yourPassword
15 |
16 | production:
17 | adapter: postgresql
18 | encoding: unicode
19 | database: launch_production
20 | pool: 5
21 | username: yourUsername
22 | password: yourPassword
23 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = 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 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | # Raises error for missing translations
40 | # config.action_view.raise_on_missing_translations = true
41 | end
42 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.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 threaded 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 = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 | # Add `rack-cache` to your Gemfile before enabling this.
19 | # For large-scale production use, consider using a caching reverse proxy like
20 | # NGINX, varnish or squid.
21 | # config.action_dispatch.rack_cache = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26 |
27 | # Compress JavaScripts and CSS.
28 | config.assets.js_compressor = :uglifier
29 | # config.assets.css_compressor = :sass
30 |
31 | # Do not fallback to assets pipeline if a precompiled asset is missed.
32 | config.assets.compile = false
33 |
34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35 | # yet still be able to expire them through the digest params.
36 | config.assets.digest = true
37 |
38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39 |
40 | # Specifies the header that your server uses for sending files.
41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43 |
44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45 | # config.force_ssl = true
46 |
47 | # Use the lowest log level to ensure availability of diagnostic information
48 | # when problems arise.
49 | config.log_level = :debug
50 |
51 | # Prepend all log lines with the following tags.
52 | # config.log_tags = [ :subdomain, :uuid ]
53 |
54 | # Use a different logger for distributed setups.
55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56 |
57 | # Use a different cache store in production.
58 | # config.cache_store = :mem_cache_store
59 |
60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61 | # config.action_controller.asset_host = 'http://assets.example.com'
62 |
63 | # Ignore bad email addresses and do not raise email delivery errors.
64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65 | # config.action_mailer.raise_delivery_errors = false
66 |
67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68 | # the I18n.default_locale when a translation cannot be found).
69 | config.i18n.fallbacks = true
70 |
71 | # Send deprecation notices to registered listeners.
72 | config.active_support.deprecation = :notify
73 |
74 | # Use default logging formatter so that PID and timestamp are not suppressed.
75 | config.log_formatter = ::Logger::Formatter.new
76 |
77 | # Do not dump schema after migrations.
78 | config.active_record.dump_schema_after_migration = false
79 | end
80 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.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 file server for tests with Cache-Control for performance.
16 | config.serve_static_files = 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 | # Randomize the order test cases are executed.
35 | config.active_support.test_order = :random
36 |
37 | # Print deprecation notices to the stderr.
38 | config.active_support.deprecation = :stderr
39 |
40 | # Raises error for missing translations
41 | # config.action_view.raise_on_missing_translations = true
42 | end
43 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 |
--------------------------------------------------------------------------------
/config/initializers/secret_token.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 | # Make sure the secret is at least 30 characters and all random,
6 | # no regular words or you'll be exposed to dictionary attacks.
7 | LaunchpageRails::Application.config.secret_token = 'ed819a19a9c45315241be89176159118397c255ee5d9588098f39f1dbaf3d2600e868e811fede6f594068fbca0a4b87fb7515063482755ad808c4c0eb0f7a0d9'
8 |
--------------------------------------------------------------------------------
/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: '_launchpage_rails_session'
4 |
--------------------------------------------------------------------------------
/config/initializers/setup_email.rb:
--------------------------------------------------------------------------------
1 | require 'development_mail_interceptor'
2 |
3 | ActionMailer::Base.smtp_settings = {
4 | :address => ENV["SMTP_ADDRESS"],
5 | :port => ENV["SMPT_PORT"],
6 | :domain => ENV["DOMAIN"],
7 | :user_name => ENV["SMTP_USERNAME"],
8 | :password => ENV["SMTP_PASSWORD"],
9 | :authenticaton => "plain",
10 | :enable_starttls_auto => true
11 | }
12 |
13 | ActionMailer::Base.default_url_options[:host] = "localhost:3000"
14 | ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if
15 | Rails.env.development?
16 |
--------------------------------------------------------------------------------
/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 | Rails.application.routes.draw do
2 | root 'users#new'
3 | resources :users, only: [:index, :create, :new]
4 | get 'success' => 'static#success'
5 | get 'csv' => 'users#export_csv', :as => :csv
6 | end
7 |
--------------------------------------------------------------------------------
/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: 21e0bd9b5447860eaceefcf5f3b871df8eb100af22a26cc9d2b1e378d94147d72889df375ed982ea5bf2b1478015e902c241c9f40ff79d6e978997a768458f37
15 |
16 | test:
17 | secret_key_base: 42aade29d52a5fb36e326236fc5bb37d08081f4aa7d9c009fded3094d8cf5ef140ec324bf78ce40e2b89011b0bbe8808742d6f089173e5d4e271d98c18c0c27d
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 |
--------------------------------------------------------------------------------
/db/migrate/20120503005433_create_users.rb:
--------------------------------------------------------------------------------
1 | class CreateUsers < ActiveRecord::Migration
2 | def change
3 | create_table :users do |t|
4 | t.string :email
5 |
6 | t.timestamps
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20120503031547_add_index_to_users_email.rb:
--------------------------------------------------------------------------------
1 | class AddIndexToUsersEmail < ActiveRecord::Migration
2 | def change
3 | add_index :users, :email, unique: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20120503034727_add_type_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddTypeToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :usertype, :integer
4 | add_index :users, :usertype
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/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: 20120503034727) do
15 |
16 | # These are extensions that must be enabled in order to support this database
17 | enable_extension "plpgsql"
18 |
19 | create_table "users", force: :cascade do |t|
20 | t.string "email"
21 | t.datetime "created_at"
22 | t.datetime "updated_at"
23 | t.integer "usertype"
24 | end
25 |
26 | add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
27 | add_index "users", ["usertype"], name: "index_users_on_usertype", using: :btree
28 |
29 | end
30 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/doc/README_FOR_APP:
--------------------------------------------------------------------------------
1 | Use this README file to introduce your application and point to useful places in the API for learning more.
2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
3 |
--------------------------------------------------------------------------------
/lib/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/lib/assets/.gitkeep
--------------------------------------------------------------------------------
/lib/development_mail_interceptor.rb:
--------------------------------------------------------------------------------
1 | class DevelopmentMailInterceptor
2 | def self.delivering_email(message)
3 | message.subject = "#{message.to} #{message.subject}"
4 | message.to = ENV["DEV_EMAIL"]
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/lib/tasks/.gitkeep
--------------------------------------------------------------------------------
/log/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/log/.gitkeep
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
The page you were looking for doesn't exist.
23 |
You may have mistyped the address or the page may have moved.
24 |
25 |
26 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/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 |
--------------------------------------------------------------------------------
/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | APP_PATH = File.expand_path('../../config/application', __FILE__)
5 | require File.expand_path('../../config/boot', __FILE__)
6 | require 'rails/commands'
7 |
--------------------------------------------------------------------------------
/spec/controllers/static_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | describe StaticController do
4 | end
5 |
--------------------------------------------------------------------------------
/spec/controllers/users_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | RSpec.describe UsersController, :type => :controller do
4 |
5 | let(:valid_attributes) {
6 | {email: "test@test.com", usertype: 1}
7 | }
8 |
9 | let(:invalid_attributes) {
10 | {email: "", usertype: nil}
11 | }
12 |
13 | let(:valid_session) { {} }
14 |
15 | let(:user) do
16 | create(:user)
17 | end
18 |
19 | let (:valid_token) {{:token => "i0nlyPass"}}
20 |
21 | let (:invalid_token) {{:token => "!ntrud3r"}}
22 |
23 | describe "GET new" do
24 | it "assigns a new user as @user" do
25 | get :new, {}, valid_session
26 | expect(assigns(:user)).to be_a_new(User)
27 | end
28 | end
29 |
30 | describe "POST create" do
31 | describe "with valid params" do
32 | it "creates a new user" do
33 | expect {
34 | post :create, {:user => valid_attributes}, valid_session
35 | }.to change(User, :count).by(1)
36 | end
37 |
38 | it "assigns a newly created user as @user" do
39 | post :create, {:user => valid_attributes}, valid_session
40 | expect(assigns(:user)).to be_a(User)
41 | expect(assigns(:user)).to be_persisted
42 | end
43 |
44 | end
45 |
46 | describe "with invalid params" do
47 | it "assigns a newly created but unsaved user as @user" do
48 | post :create, {:user => invalid_attributes}, valid_session
49 | expect(assigns(:user)).to be_a_new(User)
50 | end
51 |
52 | it "re-renders the 'new' template" do
53 | post :create, {:user => invalid_attributes}, valid_session
54 | expect(response).to render_template("new")
55 | end
56 | end
57 | end
58 |
59 | describe "with valid token" do
60 | describe "GET index" do
61 | it "assign all users to @users" do
62 | user.save
63 | get :index, valid_token
64 | expect(assigns(:users)).to match_array(User.all)
65 | end
66 |
67 | it "renders the index template" do
68 | get :index, valid_token
69 | expect(response).to render_template("index")
70 | end
71 | end
72 |
73 | describe "GET csv" do
74 | render_views
75 | it "downloads csv" do
76 | get :export_csv, valid_token, :format => :csv
77 | expect(response.content_type).to eq('text/csv')
78 | end
79 |
80 | it "has correct column headers and has users" do
81 | user.save
82 | get :export_csv, valid_token, :format => :csv
83 | user_col = [user.email, user.usertype].join(",")
84 | expect(response.body).to eq("Email,UserType\n#{user_col}\n")
85 | end
86 | end
87 | end
88 |
89 | describe "with invalid token" do
90 | describe "GET index" do
91 | it "restricts access and returns error message" do
92 | get :index, invalid_token
93 | expect(response.body).to eq("You Shall Not Pass!")
94 | end
95 | end
96 |
97 | describe "GET csv" do
98 | it "restricts access and returns generic message" do
99 | get :export_csv, invalid_token
100 | expect(response.body).to eq("You Shall Not Pass!")
101 | end
102 | end
103 | end
104 | end
105 |
--------------------------------------------------------------------------------
/spec/factories/user.rb:
--------------------------------------------------------------------------------
1 | FactoryGirl.define do
2 | factory :user do
3 | email 'test@test.com'
4 | usertype 1
5 |
6 | factory :user_with_blank_email do
7 | email ''
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/helpers/application_helper_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | describe ApplicationHelper do
4 | describe "page title" do
5 | it "returns the default title when title option is not provided" do
6 | expect(helper.full_title).to eq("Project X")
7 | end
8 |
9 | it "returns the project title plus the page title" do
10 | expect(helper.full_title("Home")).to eq("Project X | Home")
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/helpers/static_helper_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | # Specs in this file have access to a helper object that includes
4 | # the StaticHelper. For example:
5 | #
6 | # describe StaticHelper do
7 | # describe "string concat" do
8 | # it "concats two strings with spaces" do
9 | # helper.concat_strings("this","that").should == "this that"
10 | # end
11 | # end
12 | # end
13 | describe StaticHelper do
14 | pending "add some examples to (or delete) #{__FILE__}"
15 | end
16 |
--------------------------------------------------------------------------------
/spec/mailers/user_mailer_spec.rb:
--------------------------------------------------------------------------------
1 | require "spec_helper"
2 |
3 | describe UserMailer do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/spec/models/user_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | RSpec.describe User, :type => :model do
4 |
5 | let(:user) do
6 | create(:user)
7 | end
8 |
9 | describe 'When email' do
10 |
11 | it "is not present" do
12 | expect(build(:user_with_blank_email)).to be_invalid
13 | end
14 |
15 | it "should be invalid" do
16 | addresses = %w[user@foo,com user_at_bar.org this.user@blah.]
17 | addresses.each do |invalid_address|
18 | user.email = invalid_address
19 | expect(user).to be_invalid
20 | end
21 | end
22 |
23 | it "format is valid" do
24 | addresses = %w[me@foo.com A_FINE_USER@f.b.org my.humps@blog.jp a+b@bots.gr]
25 | addresses.each do |valid_address|
26 | user.email = valid_address
27 | expect(user).to be_valid
28 | end
29 | end
30 |
31 | it "is already taken" do
32 | user.save
33 | expect(User.new(user.attributes)).to be_invalid
34 | end
35 | end
36 |
37 | describe 'When status' do
38 |
39 | it 'is 1 witch means ...' do
40 | user.usertype = 1
41 | expect(user).to be_valid
42 | end
43 |
44 | it 'is 2 witch means ...' do
45 | user.usertype = 2
46 | expect(user).to be_valid
47 | end
48 |
49 | it 'is other than 1 or 2' do
50 | user.usertype = 5
51 | expect(user).to be_invalid
52 | end
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/spec/rails_helper.rb:
--------------------------------------------------------------------------------
1 | # This file is copied to spec/ when you run 'rails generate rspec:install'
2 | ENV['RAILS_ENV'] ||= 'test'
3 | require File.expand_path('../../config/environment', __FILE__)
4 | # Prevent database truncation if the environment is production
5 | abort("The Rails environment is running in production mode!") if Rails.env.production?
6 | require 'spec_helper'
7 | require 'rspec/rails'
8 | # Add additional requires below this line. Rails is not loaded until this point!
9 |
10 | # Requires supporting ruby files with custom matchers and macros, etc, in
11 | # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12 | # run as spec files by default. This means that files in spec/support that end
13 | # in _spec.rb will both be required and run as specs, causing the specs to be
14 | # run twice. It is recommended that you do not name files matching this glob to
15 | # end with _spec.rb. You can configure this pattern with the --pattern
16 | # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17 | #
18 | # The following line is provided for convenience purposes. It has the downside
19 | # of increasing the boot-up time by auto-requiring all files in the support
20 | # directory. Alternatively, in the individual `*_spec.rb` files, manually
21 | # require only the support files necessary.
22 | #
23 | # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
24 |
25 | # Checks for pending migrations before tests are run.
26 | # If you are not using ActiveRecord, you can remove this line.
27 | ActiveRecord::Migration.maintain_test_schema!
28 |
29 | RSpec.configure do |config|
30 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
31 | config.fixture_path = "#{::Rails.root}/spec/fixtures"
32 |
33 | # If you're not using ActiveRecord, or you'd prefer not to run each of your
34 | # examples within a transaction, remove the following line or assign false
35 | # instead of true.
36 | config.use_transactional_fixtures = true
37 |
38 | config.include FactoryGirl::Syntax::Methods
39 | # RSpec Rails can automatically mix in different behaviours to your tests
40 | # based on their file location, for example enabling you to call `get` and
41 | # `post` in specs under `spec/controllers`.
42 | #
43 | # You can disable this behaviour by removing the line below, and instead
44 | # explicitly tag your specs with their type, e.g.:
45 | #
46 | # RSpec.describe UsersController, :type => :controller do
47 | # # ...
48 | # end
49 | #
50 | # The different available types are documented in the features, such as in
51 | # https://relishapp.com/rspec/rspec-rails/docs
52 | config.infer_spec_type_from_file_location!
53 | end
54 |
--------------------------------------------------------------------------------
/spec/requests/user_pages_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | feature "User pages" do
4 |
5 | scenario "signup page" do
6 | visit new_user_path
7 | expect(page).to have_title 'Project X'
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | require "codeclimate-test-reporter"
2 | CodeClimate::TestReporter.start
3 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5 | # The generated `.rspec` file contains `--require spec_helper` which will cause
6 | # this file to always be loaded, without a need to explicitly require it in any
7 | # files.
8 | #
9 | # Given that it is always loaded, you are encouraged to keep this file as
10 | # light-weight as possible. Requiring heavyweight dependencies from this file
11 | # will add to the boot time of your test suite on EVERY test run, even for an
12 | # individual file that may not need all of that loaded. Instead, consider making
13 | # a separate helper file that requires the additional dependencies and performs
14 | # the additional setup, and require it from the spec files that actually need
15 | # it.
16 | #
17 | # The `.rspec` file also contains a few flags that are not defaults but that
18 | # users commonly want.
19 | #
20 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
21 | RSpec.configure do |config|
22 | # rspec-expectations config goes here. You can use an alternate
23 | # assertion/expectation library such as wrong or the stdlib/minitest
24 | # assertions if you prefer.
25 | config.expect_with :rspec do |expectations|
26 | # This option will default to `true` in RSpec 4. It makes the `description`
27 | # and `failure_message` of custom matchers include text for helper methods
28 | # defined using `chain`, e.g.:
29 | # be_bigger_than(2).and_smaller_than(4).description
30 | # # => "be bigger than 2 and smaller than 4"
31 | # ...rather than:
32 | # # => "be bigger than 2"
33 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true
34 | end
35 |
36 | # rspec-mocks config goes here. You can use an alternate test double
37 | # library (such as bogus or mocha) by changing the `mock_with` option here.
38 | config.mock_with :rspec do |mocks|
39 | # Prevents you from mocking or stubbing a method that does not exist on
40 | # a real object. This is generally recommended, and will default to
41 | # `true` in RSpec 4.
42 | mocks.verify_partial_doubles = true
43 | end
44 |
45 | # The settings below are suggested to provide a good initial experience
46 | # with RSpec, but feel free to customize to your heart's content.
47 | =begin
48 | # These two settings work together to allow you to limit a spec run
49 | # to individual examples or groups you care about by tagging them with
50 | # `:focus` metadata. When nothing is tagged with `:focus`, all examples
51 | # get run.
52 | config.filter_run :focus
53 | config.run_all_when_everything_filtered = true
54 |
55 | # Allows RSpec to persist some state between runs in order to support
56 | # the `--only-failures` and `--next-failure` CLI options. We recommend
57 | # you configure your source control system to ignore this file.
58 | config.example_status_persistence_file_path = "spec/examples.txt"
59 |
60 | # Limits the available syntax to the non-monkey patched syntax that is
61 | # recommended. For more details, see:
62 | # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
63 | # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
64 | # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
65 | config.disable_monkey_patching!
66 |
67 | # Many RSpec users commonly either run the entire suite or an individual
68 | # file, and it's useful to allow more verbose output when running an
69 | # individual spec file.
70 | if config.files_to_run.one?
71 | # Use the documentation formatter for detailed output,
72 | # unless a formatter has already been configured
73 | # (e.g. via a command-line flag).
74 | config.default_formatter = 'doc'
75 | end
76 |
77 | # Print the 10 slowest examples and example groups at the
78 | # end of the spec run, to help surface which specs are running
79 | # particularly slow.
80 | config.profile_examples = 10
81 |
82 | # Run specs in random order to surface order dependencies. If you find an
83 | # order dependency and want to debug it, you can fix the order by providing
84 | # the seed, which is printed after each run.
85 | # --seed 1234
86 | config.order = :random
87 |
88 | # Seed global randomization in this process using the `--seed` CLI option.
89 | # Setting this allows you to use `--seed` to deterministically reproduce
90 | # test failures related to randomization by passing the same `--seed` value
91 | # as the one that triggered the failure.
92 | Kernel.srand config.seed
93 | =end
94 | end
95 |
--------------------------------------------------------------------------------
/spec/views/static/home.html.erb_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/vendor/assets/javascripts/.gitkeep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/vendor/assets/stylesheets/.gitkeep
--------------------------------------------------------------------------------
/vendor/plugins/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codelitt/launchpage-rails/7c1acffc3cfc526b82e5e2403313e8e1dc809ed0/vendor/plugins/.gitkeep
--------------------------------------------------------------------------------