├── log └── .keep ├── storage └── .keep ├── tmp ├── .keep ├── pids │ └── .keep └── storage │ └── .keep ├── vendor └── .keep ├── lib └── tasks │ └── .keep ├── test ├── mailers │ └── .keep ├── models │ └── .keep ├── controllers │ └── .keep ├── integration │ └── .keep ├── fixtures │ └── files │ │ └── .keep ├── channels │ └── application_cable │ │ └── connection_test.rb └── test_helper.rb ├── .ruby-version ├── app ├── models │ ├── concerns │ │ └── .keep │ ├── application_record.rb │ ├── post.rb │ └── user.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── application_controller.rb │ ├── users │ │ ├── unlocks_controller.rb │ │ ├── confirmations_controller.rb │ │ ├── passwords_controller.rb │ │ ├── omniauth_callbacks_controller.rb │ │ ├── sessions_controller.rb │ │ └── registrations_controller.rb │ └── api │ │ └── v1 │ │ └── posts_controller.rb ├── views │ └── layouts │ │ ├── mailer.text.erb │ │ └── mailer.html.erb ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── mailers │ └── application_mailer.rb └── jobs │ └── application_job.rb ├── .rspec ├── coverage ├── .resultset.json.lock ├── .last_run.json ├── assets │ └── 0.12.3 │ │ ├── loading.gif │ │ ├── magnify.png │ │ ├── favicon_red.png │ │ ├── favicon_green.png │ │ ├── favicon_yellow.png │ │ ├── colorbox │ │ ├── border.png │ │ ├── loading.gif │ │ ├── controls.png │ │ └── loading_background.png │ │ ├── images │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_454545_256x240.png │ │ ├── ui-icons_888888_256x240.png │ │ ├── ui-icons_cd0a0a_256x240.png │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── DataTables-1.10.20 │ │ └── images │ │ │ ├── sort_asc.png │ │ │ ├── sort_both.png │ │ │ ├── sort_desc.png │ │ │ ├── sort_asc_disabled.png │ │ │ └── sort_desc_disabled.png │ │ └── application.css └── .resultset.json ├── bin ├── rake ├── rails ├── setup └── bundle ├── public └── robots.txt ├── config ├── environment.rb ├── boot.rb ├── cable.yml ├── application.rb ├── initializers │ ├── cors.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ └── devise.rb ├── credentials.yml.enc ├── routes.rb ├── locales │ ├── en.yml │ └── devise.en.yml ├── storage.yml ├── puma.rb ├── environments │ ├── development.rb │ ├── test.rb │ └── production.rb └── database.yml ├── db ├── migrate │ ├── 20230726140027_add_label_to_posts.rb │ ├── 20230802212550_add_username_to_users.rb │ ├── 20230726122151_create_posts.rb │ └── 20230802155008_devise_create_users.rb ├── seeds.rb └── schema.rb ├── config.ru ├── spec ├── factories │ ├── user.rb │ └── post.rb ├── spec_helper.rb ├── models │ ├── user_spec.rb │ └── post_spec.rb ├── rails_helper.rb ├── routing │ └── posts_routing_spec.rb └── requests │ └── api │ └── v1 │ └── posts_spec.rb ├── Rakefile ├── .gitattributes ├── Gemfile ├── .gitignore ├── README.md └── Gemfile.lock /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/pids/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.1.2 2 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /coverage/.resultset.json.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /coverage/.last_run.json: -------------------------------------------------------------------------------- 1 | { 2 | "result": { 3 | "line": 92.43 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::API 2 | end 3 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/loading.gif -------------------------------------------------------------------------------- /coverage/assets/0.12.3/magnify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/magnify.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/favicon_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/favicon_red.png -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/favicon_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/favicon_green.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/favicon_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/favicon_yellow.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/colorbox/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/colorbox/border.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/colorbox/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/colorbox/loading.gif -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/colorbox/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/colorbox/controls.png -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/colorbox/loading_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/colorbox/loading_background.png -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png -------------------------------------------------------------------------------- /db/migrate/20230726140027_add_label_to_posts.rb: -------------------------------------------------------------------------------- 1 | class AddLabelToPosts < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :posts, :label, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /db/migrate/20230802212550_add_username_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddUsernameToUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :users, :username, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmrwor/journal-api/HEAD/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /app/models/post.rb: -------------------------------------------------------------------------------- 1 | class Post < ApplicationRecord 2 | validates :title, presence: true 3 | validates :content, presence: true 4 | validates :label, inclusion: { in: %w(idea fun work life) } 5 | end 6 | -------------------------------------------------------------------------------- /spec/factories/user.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :user do 3 | email { Faker::Internet.email } 4 | password { "password" } 5 | username { Faker::Internet.username } 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /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_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: journal_api_production 11 | -------------------------------------------------------------------------------- /db/migrate/20230726122151_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :content 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | Bundler.require(*Rails.groups) 6 | 7 | module JournalApi 8 | class Application < Rails::Application 9 | config.load_defaults 7.0 10 | config.api_only = true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/initializers/cors.rb: -------------------------------------------------------------------------------- 1 | Rails.application.config.middleware.insert_before 0, Rack::Cors do 2 | allow do 3 | origins "http://localhost:4000", "https://journal-frontend-smoky.vercel.app" 4 | 5 | resource "*", 6 | headers: :any, 7 | methods: [:get, :post, :put, :patch, :delete, :options, :head] 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /spec/factories/post.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :post do 3 | title { Faker::Lorem.sentence } 4 | content { Faker::Lorem.paragraph } 5 | label {["idea", "fun", "work", "life"].sample} 6 | created_at { Faker::Time.between(from: 1.year.ago, to: Time.zone.now, format: :default) } 7 | updated_at { Faker::Time.between(from: created_at, to: Time.zone.now, format: :default) } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'simplecov' 2 | 3 | SimpleCov.start 4 | 5 | RSpec.configure do |config| 6 | config.expect_with :rspec do |expectations| 7 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 8 | end 9 | 10 | config.mock_with :rspec do |mocks| 11 | mocks.verify_partial_doubles = true 12 | end 13 | 14 | config.shared_context_metadata_behavior = :apply_to_host_groups 15 | end 16 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | # Include default devise modules. Others available are: 3 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable 4 | devise :database_authenticatable, :jwt_authenticatable, jwt_revocation_strategy: Devise::JWT::RevocationStrategies::Null 5 | 6 | validates :email, presence: true 7 | validates :password, presence: true 8 | validates :username, presence: true 9 | end 10 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | 1cgLMVRumcbCIjhcTdh5Azxhgn5F+FT1Y8Cz27xEbBjqcFhk9A/yVS3EoSVC+3xHBwd3etONZdMLo+bhSFUn9omAMGkEQ/28wzlPAKNustqzAUiBw+G45xg/iS5hbULvABaxydR0BEp/1tHiUTwer5QkVAOqS+vcMBOi2ICnaMRNKGB38vXWk05fzJMHtx18fx6cFmPADGclha8l/Nfb6Ol1P60zLHFYwjTII/0tLfdOiKw/9nXcLUQn7tYLpWZ96oQR9C1bl+TTjNLlTzX7K3ObSM+/FosSwRF4zoaSE6Hqx8BbIG6McS4g6eA6p3m8H2hokuvb30Mi6CPZsCwSRnGHL4wtalerGuN88XVxpcVH8JtyLdqmPUh5nyzebrL6/XGob/U/Rkn9Q9U2FO4ohps0gDJrRMw89U1N--fyRS7mcL6XP2++m4--JMJI3Q+XOSDdCbtLDJu8pA== -------------------------------------------------------------------------------- /spec/models/user_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe User, type: :model do 4 | it "is valid with valid attributes" do 5 | user = build(:user) 6 | expect(user).to be_valid 7 | end 8 | it "is not valid without an email" do 9 | user = build(:user, email: nil) 10 | expect(user).not_to be_valid 11 | expect(user.errors[:email]).to include("can't be blank") 12 | end 13 | 14 | it "is not valid without a password" do 15 | user = build(:user, password: nil) 16 | expect(user).not_to be_valid 17 | expect(user.errors[:password]).to include("can't be blank") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby "3.1.2" 5 | 6 | gem "rails", "~> 7.0.6" 7 | gem "pg", "~> 1.1" 8 | gem "puma", "~> 5.0" 9 | gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] 10 | gem "bootsnap", require: false 11 | gem "rack-cors" 12 | gem 'faker' 13 | gem 'devise' 14 | gem 'devise-jwt' 15 | gem 'dotenv-rails' 16 | 17 | group :development, :test do 18 | gem "debug", platforms: %i[ mri mingw x64_mingw ] 19 | gem 'rspec-rails' 20 | gem 'capybara' 21 | end 22 | 23 | group :test do 24 | gem 'factory_bot_rails' 25 | gem 'simplecov', require: false 26 | end 27 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | require 'faker' 2 | 3 | [Post].each do |table| 4 | ActiveRecord::Base.connection.execute("TRUNCATE #{table.table_name} RESTART IDENTITY CASCADE") 5 | end 6 | 7 | day_count = -365 8 | 9 | 730.times do 10 | post = Post.create( 11 | title: Faker::FunnyName.name, 12 | content: Faker::Quote.famous_last_words, 13 | label: ["idea", "fun", "work", "life"].sample, 14 | ) 15 | post.update_attribute(:created_at, Date.today - day_count) 16 | p "Created post - title: #{post.title} | content: #{post.content.truncate(20)} | label: #{post.label} | created_at: #{post.created_at}" 17 | day_count += 1 18 | end 19 | p "Created #{Post.count} posts" 20 | -------------------------------------------------------------------------------- /spec/rails_helper.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | ENV['RAILS_ENV'] ||= 'test' 3 | require_relative '../config/environment' 4 | abort("The Rails environment is running in production mode!") if Rails.env.production? 5 | require 'rspec/rails' 6 | 7 | begin 8 | ActiveRecord::Migration.maintain_test_schema! 9 | rescue ActiveRecord::PendingMigrationError => e 10 | abort e.to_s.strip 11 | end 12 | RSpec.configure do |config| 13 | config.fixture_path = "#{::Rails.root}/spec/fixtures" 14 | config.use_transactional_fixtures = true 15 | config.infer_spec_type_from_file_location! 16 | config.filter_rails_from_backtrace! 17 | config.include FactoryBot::Syntax::Methods 18 | end 19 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | devise_for :users, controllers: { 3 | sessions: 'users/sessions', 4 | registrations: 'users/registrations' 5 | } 6 | devise_scope :user do 7 | post '/login', to: 'users/sessions#create' 8 | delete '/logout', to: 'users/sessions#destroy' 9 | end 10 | namespace :api do 11 | namespace :v1 do 12 | resources :posts, only: [:index, :show, :create, :update, :destroy] do 13 | collection do 14 | get 'date=:date', action: :show_by_date, as: :show_by_date 15 | get 'label=:label', action: :index_by_label, as: :index_by_label 16 | end 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /app/controllers/users/unlocks_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::UnlocksController < Devise::UnlocksController 4 | # GET /resource/unlock/new 5 | # def new 6 | # super 7 | # end 8 | 9 | # POST /resource/unlock 10 | # def create 11 | # super 12 | # end 13 | 14 | # GET /resource/unlock?unlock_token=abcdef 15 | # def show 16 | # super 17 | # end 18 | 19 | # protected 20 | 21 | # The path used after sending unlock password instructions 22 | # def after_sending_unlock_instructions_path_for(resource) 23 | # super(resource) 24 | # end 25 | 26 | # The path used after unlocking the resource 27 | # def after_unlock_path_for(resource) 28 | # super(resource) 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/users/confirmations_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::ConfirmationsController < Devise::ConfirmationsController 4 | # GET /resource/confirmation/new 5 | # def new 6 | # super 7 | # end 8 | 9 | # POST /resource/confirmation 10 | # def create 11 | # super 12 | # end 13 | 14 | # GET /resource/confirmation?confirmation_token=abcdef 15 | # def show 16 | # super 17 | # end 18 | 19 | # protected 20 | 21 | # The path used after resending confirmation instructions. 22 | # def after_resending_confirmation_instructions_path_for(resource_name) 23 | # super(resource_name) 24 | # end 25 | 26 | # The path used after confirmation. 27 | # def after_confirmation_path_for(resource_name, resource) 28 | # super(resource_name, resource) 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-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 all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore pidfiles, but keep the directory. 17 | /tmp/pids/* 18 | !/tmp/pids/ 19 | !/tmp/pids/.keep 20 | 21 | # Ignore uploaded files in development. 22 | /storage/* 23 | !/storage/.keep 24 | /tmp/storage/* 25 | !/tmp/storage/ 26 | !/tmp/storage/.keep 27 | 28 | # Ignore master key for decrypting credentials and more. 29 | /config/master.key 30 | 31 | .env 32 | -------------------------------------------------------------------------------- /app/controllers/users/passwords_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::PasswordsController < Devise::PasswordsController 4 | # GET /resource/password/new 5 | # def new 6 | # super 7 | # end 8 | 9 | # POST /resource/password 10 | # def create 11 | # super 12 | # end 13 | 14 | # GET /resource/password/edit?reset_password_token=abcdef 15 | # def edit 16 | # super 17 | # end 18 | 19 | # PUT /resource/password 20 | # def update 21 | # super 22 | # end 23 | 24 | # protected 25 | 26 | # def after_resetting_password_path_for(resource) 27 | # super(resource) 28 | # end 29 | 30 | # The path used after sending reset password instructions 31 | # def after_sending_reset_password_instructions_path_for(resource_name) 32 | # super(resource_name) 33 | # end 34 | end 35 | -------------------------------------------------------------------------------- /app/controllers/users/omniauth_callbacks_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController 4 | # You should configure your model like this: 5 | # devise :omniauthable, omniauth_providers: [:twitter] 6 | 7 | # You should also create an action method in this controller like this: 8 | # def twitter 9 | # end 10 | 11 | # More info at: 12 | # https://github.com/heartcombo/devise#omniauth 13 | 14 | # GET|POST /resource/auth/twitter 15 | # def passthru 16 | # super 17 | # end 18 | 19 | # GET|POST /users/auth/twitter/callback 20 | # def failure 21 | # super 22 | # end 23 | 24 | # protected 25 | 26 | # The path used when OmniAuth fails 27 | # def after_omniauth_failure_path_for(scope) 28 | # super(scope) 29 | # end 30 | end 31 | -------------------------------------------------------------------------------- /app/controllers/users/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::SessionsController < Devise::SessionsController 4 | respond_to :json 5 | 6 | def create 7 | super do |user| 8 | if request.format.json? 9 | render json: { 10 | user: user, 11 | token: JWT.encode({ 12 | user_id: user.id, 13 | username: user.username, 14 | }, ENV['DEVISE_JWT_SECRET_KEY'], 'HS256') 15 | } and return 16 | end 17 | end 18 | end 19 | 20 | def destroy 21 | signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)) 22 | 23 | if request.format.json? 24 | render json: { message: 'Signed out successfully' }, status: :ok 25 | else 26 | redirect_to after_sign_out_path_for(resource_name) 27 | end 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /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 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # "true": "foo" 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | Devise.setup do |config| 2 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' 3 | require 'devise/orm/active_record' 4 | config.case_insensitive_keys = [:email] 5 | config.strip_whitespace_keys = [:email] 6 | config.skip_session_storage = [:http_auth] 7 | config.stretches = Rails.env.test? ? 1 : 12 8 | config.reconfirmable = true 9 | config.expire_all_remember_me_on_sign_out = true 10 | config.password_length = 6..128 11 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/ 12 | config.reset_password_within = 6.hours 13 | config.sign_out_via = :delete 14 | config.responder.error_status = :unprocessable_entity 15 | config.responder.redirect_status = :see_other 16 | 17 | config.jwt do |jwt| 18 | jwt.secret = ENV['DEVISE_JWT_SECRET_KEY'] 19 | jwt.dispatch_requests = [ 20 | ['POST', %r{^/login$}] 21 | ] 22 | jwt.revocation_requests = [ 23 | ['DELETE', %r{^/logout$}] 24 | ] 25 | end 26 | 27 | end 28 | -------------------------------------------------------------------------------- /spec/models/post_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Post, type: :model do 4 | describe "validations" do 5 | it "is valid with valid attributes" do 6 | post = build(:post) 7 | expect(post).to be_valid 8 | end 9 | 10 | it "is not valid without a title" do 11 | post = build(:post, title: nil) 12 | expect(post).not_to be_valid 13 | expect(post.errors[:title]).to include("can't be blank") 14 | end 15 | 16 | it "is not valid without content" do 17 | post = build(:post, content: nil) 18 | expect(post).not_to be_valid 19 | expect(post.errors[:content]).to include("can't be blank") 20 | end 21 | 22 | it "is not valid with an invalid label" do 23 | post = build(:post, label: "invalid_label") 24 | expect(post).not_to be_valid 25 | expect(post.errors[:label]).to include("is not included in the list") 26 | end 27 | 28 | it "is valid with a valid label (idea)" do 29 | post = build(:post, label: "idea") 30 | expect(post).to be_valid 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /spec/routing/posts_routing_spec.rb: -------------------------------------------------------------------------------- 1 | require "rails_helper" 2 | 3 | RSpec.describe Api::V1::PostsController, type: :routing do 4 | describe "routing" do 5 | it "routes to #index" do 6 | expect(get: "/api/v1/posts").to route_to("api/v1/posts#index") 7 | end 8 | 9 | it "routes to #show" do 10 | expect(get: "/api/v1/posts/1").to route_to("api/v1/posts#show", id: "1") 11 | end 12 | 13 | it "routes to #create" do 14 | expect(post: "/api/v1/posts").to route_to("api/v1/posts#create") 15 | end 16 | 17 | it "routes to #update via PUT" do 18 | expect(put: "/api/v1/posts/1").to route_to("api/v1/posts#update", id: "1") 19 | end 20 | 21 | it "routes to #update via PATCH" do 22 | expect(patch: "/api/v1/posts/1").to route_to("api/v1/posts#update", id: "1") 23 | end 24 | 25 | it "routes to #destroy" do 26 | expect(delete: "/api/v1/posts/1").to route_to("api/v1/posts#destroy", id: "1") 27 | end 28 | 29 | it "routes to #show_by_date" do 30 | expect(get: "/api/v1/posts/date=2021-01-01").to route_to("api/v1/posts#show_by_date", date: "2021-01-01") 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket-<%= Rails.env %> 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket-<%= Rails.env %> 23 | 24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name-<%= Rails.env %> 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /db/migrate/20230802155008_devise_create_users.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class DeviseCreateUsers < ActiveRecord::Migration[7.0] 4 | def change 5 | create_table :users do |t| 6 | ## Database authenticatable 7 | t.string :email, null: false, default: "" 8 | t.string :encrypted_password, null: false, default: "" 9 | 10 | ## Recoverable 11 | t.string :reset_password_token 12 | t.datetime :reset_password_sent_at 13 | 14 | ## Rememberable 15 | t.datetime :remember_created_at 16 | 17 | ## Trackable 18 | # t.integer :sign_in_count, default: 0, null: false 19 | # t.datetime :current_sign_in_at 20 | # t.datetime :last_sign_in_at 21 | # t.string :current_sign_in_ip 22 | # t.string :last_sign_in_ip 23 | 24 | ## Confirmable 25 | # t.string :confirmation_token 26 | # t.datetime :confirmed_at 27 | # t.datetime :confirmation_sent_at 28 | # t.string :unconfirmed_email # Only if using reconfirmable 29 | 30 | ## Lockable 31 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts 32 | # t.string :unlock_token # Only if unlock strategy is :email or :both 33 | # t.datetime :locked_at 34 | 35 | 36 | t.timestamps null: false 37 | end 38 | 39 | add_index :users, :email, unique: true 40 | add_index :users, :reset_password_token, unique: true 41 | # add_index :users, :confirmation_token, unique: true 42 | # add_index :users, :unlock_token, unique: true 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /app/controllers/users/registrations_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Users::RegistrationsController < Devise::RegistrationsController 4 | # before_action :configure_sign_up_params, only: [:create] 5 | # before_action :configure_account_update_params, only: [:update] 6 | 7 | # GET /resource/sign_up 8 | # def new 9 | # super 10 | # end 11 | 12 | # POST /resource 13 | # def create 14 | # super 15 | # end 16 | 17 | # GET /resource/edit 18 | # def edit 19 | # super 20 | # end 21 | 22 | # PUT /resource 23 | # def update 24 | # super 25 | # end 26 | 27 | # DELETE /resource 28 | # def destroy 29 | # super 30 | # end 31 | 32 | # GET /resource/cancel 33 | # Forces the session data which is usually expired after sign 34 | # in to be expired now. This is useful if the user wants to 35 | # cancel oauth signing in/up in the middle of the process, 36 | # removing all OAuth session data. 37 | # def cancel 38 | # super 39 | # end 40 | 41 | # protected 42 | 43 | # If you have extra params to permit, append them to the sanitizer. 44 | # def configure_sign_up_params 45 | # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute]) 46 | # end 47 | 48 | # If you have extra params to permit, append them to the sanitizer. 49 | # def configure_account_update_params 50 | # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute]) 51 | # end 52 | 53 | # The path used after sign up. 54 | # def after_sign_up_path_for(resource) 55 | # super(resource) 56 | # end 57 | 58 | # The path used after sign up for inactive accounts. 59 | # def after_inactive_sign_up_path_for(resource) 60 | # super(resource) 61 | # end 62 | end 63 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[7.0].define(version: 2023_08_02_212550) do 14 | # These are extensions that must be enabled in order to support this database 15 | enable_extension "plpgsql" 16 | 17 | create_table "posts", force: :cascade do |t| 18 | t.string "title" 19 | t.text "content" 20 | t.datetime "created_at", null: false 21 | t.datetime "updated_at", null: false 22 | t.string "label" 23 | end 24 | 25 | create_table "users", force: :cascade do |t| 26 | t.string "email", default: "", null: false 27 | t.string "encrypted_password", default: "", null: false 28 | t.string "reset_password_token" 29 | t.datetime "reset_password_sent_at" 30 | t.datetime "remember_created_at" 31 | t.datetime "created_at", null: false 32 | t.datetime "updated_at", null: false 33 | t.string "username" 34 | t.index ["email"], name: "index_users_on_email", unique: true 35 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `bin/rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable server timing 18 | config.server_timing = true 19 | 20 | # Enable/disable caching. By default caching is disabled. 21 | # Run rails dev:cache to toggle caching. 22 | if Rails.root.join("tmp/caching-dev.txt").exist? 23 | config.cache_store = :memory_store 24 | config.public_file_server.headers = { 25 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 26 | } 27 | else 28 | config.action_controller.perform_caching = false 29 | 30 | config.cache_store = :null_store 31 | end 32 | 33 | # Store uploaded files on the local file system (see config/storage.yml for options). 34 | config.active_storage.service = :local 35 | 36 | # Don't care if the mailer can't send. 37 | config.action_mailer.raise_delivery_errors = false 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Print deprecation notices to the Rails logger. 42 | config.active_support.deprecation = :log 43 | 44 | # Raise exceptions for disallowed deprecations. 45 | config.active_support.disallowed_deprecation = :raise 46 | 47 | # Tell Active Support which deprecation messages to disallow. 48 | config.active_support.disallowed_deprecation_warnings = [] 49 | 50 | # Raise an error on page load if there are pending migrations. 51 | config.active_record.migration_error = :page_load 52 | 53 | # Highlight code that triggered database queries in logs. 54 | config.active_record.verbose_query_logs = true 55 | 56 | 57 | # Raises error for missing translations. 58 | # config.i18n.raise_on_missing_translations = true 59 | 60 | # Annotate rendered view with file names. 61 | # config.action_view.annotate_rendered_view_with_filenames = true 62 | 63 | # Uncomment if you wish to allow Action Cable access from any origin. 64 | # config.action_cable.disable_request_forgery_protection = true 65 | end 66 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # API for Quote App 2 | 3 | How to run: `rails s` - runs on port 3000 4 | To run tests simply run `rspec` 5 | 6 | # Endpoints 7 | 8 | Built in Ruby on Rails, the app is a RESTful API only for a React client. The API endpoints are below: 9 | 10 | ### `GET /posts` 11 | 12 | Returns a JSON array of all posts. 13 | 14 | #### Parameters 15 | None 16 | 17 | #### Example Response 18 | 19 | Sure! Here's the raw markdown for the Ruby on Rails controller actions documentation: 20 | 21 | shell 22 | Copy code 23 | ## Api::V1::PostsController 24 | 25 | ### `GET /posts` 26 | 27 | Returns a JSON array of all posts. 28 | 29 | #### Parameters 30 | None 31 | 32 | #### Example Response 33 | ``` 34 | [ 35 | { 36 | "id": 1, 37 | "title": "Example Post 1", 38 | "content": "This is an example post.", 39 | "label": "idea", 40 | "created_at": "2023-07-31T12:34:56.789Z" 41 | }, 42 | { 43 | "id": 2, 44 | "title": "Example Post 2", 45 | "content": "Another example post.", 46 | "label": "fun", 47 | "created_at": "2023-07-31T15:30:00.000Z" 48 | }, 49 | ... 50 | ] 51 | ``` 52 | 53 | ### `GET /posts?label=idea` 54 | 55 | Returns a JSON array of posts with the specified label. 56 | 57 | #### Parameters 58 | - `label` (string): The label to filter posts by. 59 | 60 | ### `GET /posts/1` 61 | 62 | Returns a JSON object representing the post with the specified ID. 63 | 64 | #### Parameters 65 | - `id` (integer): The ID of the post to retrieve. 66 | 67 | 68 | ### `GET /posts?date=2021-01-01` 69 | 70 | Returns a JSON object representing the post created on the specified date. 71 | 72 | #### Parameters 73 | - `date` (string, format: "YYYY-MM-DD"): The date to filter posts by. 74 | 75 | 76 | ### `POST /posts` 77 | 78 | Creates a new post with the specified parameters. 79 | 80 | #### Parameters 81 | - `post` (object): An object containing the post data. 82 | - `title` (string, required): The title of the post. 83 | - `content` (string, required): The content of the post. 84 | - `label` (string): The label of the post. 85 | - `created_at` (string, format: "YYYY-MM-DDTHH:mm:ss.SSSZ"): The creation date of the post. 86 | 87 | 88 | ### `PATCH/PUT /posts/1` 89 | 90 | Updates the post with the specified ID using the provided parameters. 91 | 92 | #### Parameters 93 | - `id` (integer): The ID of the post to update. 94 | - `post` (object): An object containing the updated post data. 95 | - `title` (string): The updated title of the post. 96 | - `content` (string): The updated content of the post. 97 | - `label` (string): The updated label of the post. 98 | - `created_at` (string, format: "YYYY-MM-DDTHH:mm:ss.SSSZ"): The updated creation date of the post. 99 | 100 | 101 | ### `DELETE /posts/1` 102 | 103 | Deletes the post with the specified ID. 104 | 105 | #### Parameters 106 | - `id` (integer): The ID of the post to delete. 107 | 108 | #### Example Response 109 | Status: 204 No Content 110 | -------------------------------------------------------------------------------- /app/controllers/api/v1/posts_controller.rb: -------------------------------------------------------------------------------- 1 | class Api::V1::PostsController < ApplicationController 2 | before_action :check_jwt, only: %i[ create update destroy ] 3 | before_action :set_post, only: %i[ show update destroy ] 4 | before_action :set_cors_headers, except: :options 5 | 6 | # GET /posts 7 | def index 8 | @posts = Post.all 9 | 10 | render json: @posts 11 | end 12 | 13 | # GET /posts?label=idea 14 | def index_by_label 15 | @posts = Post.where(label: params[:label]) 16 | 17 | render json: @posts 18 | end 19 | 20 | # GET /posts/1 21 | def show 22 | @post = Post.find(params[:id]) 23 | 24 | render json: @post 25 | end 26 | 27 | # GET /posts?date=2021-01-01 28 | def show_by_date 29 | date = Date.parse(params[:date]) 30 | date_range = date.beginning_of_day..date.end_of_day 31 | @post = Post.find_by(created_at: date_range) 32 | 33 | render json: @post 34 | end 35 | 36 | 37 | # POST /posts 38 | def create 39 | @post = Post.new(post_params) 40 | 41 | if @post.save 42 | render json: @post, status: :created, location: api_v1_post_path(@post) 43 | else 44 | render json: @post.errors, status: :unprocessable_entity 45 | end 46 | end 47 | 48 | # PATCH/PUT /posts/1 49 | def update 50 | if @post.update(post_params) 51 | render json: @post 52 | else 53 | render json: @post.errors, status: :unprocessable_entity 54 | end 55 | end 56 | 57 | # DELETE /posts/1 58 | def destroy 59 | @post.destroy 60 | end 61 | 62 | private 63 | # Use callbacks to share common setup or constraints between actions. 64 | def set_post 65 | @post = Post.find(params[:id]) 66 | end 67 | 68 | # Only allow a list of trusted parameters through. 69 | def post_params 70 | params.require(:post).permit(:title, :content, :label, :created_at, :updated_at) 71 | end 72 | 73 | def set_cors_headers 74 | origin = Rails.env.production? ? 'https://journal-frontend-smoky.vercel.app' : 'http://localhost:4000' 75 | 76 | 77 | response.headers['Access-Control-Allow-Origin'] = origin 78 | response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD' 79 | response.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept' 80 | response.headers['Access-Control-Allow-Credentials'] = 'true' 81 | end 82 | 83 | def check_jwt 84 | auth_header = request.headers['Authorization'] 85 | token = auth_header&.split(' ')&.last 86 | 87 | if token 88 | begin 89 | decoded_token = JWT.decode(token, ENV['DEVISE_JWT_SECRET_KEY'], true, algorithm: 'HS256') 90 | payload = decoded_token.first 91 | user_id = payload['user_id'] 92 | 93 | @current_user = User.find(user_id) 94 | rescue JWT::DecodeError 95 | render json: { error: 'Invalid token' }, status: :unauthorized 96 | end 97 | else 98 | render json: { error: 'Token missing' }, status: :unauthorized 99 | end 100 | end 101 | end 102 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.3 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On macOS with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On macOS with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem "pg" 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | # For details on connection pooling, see Rails configuration guide 21 | # https://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | username: postgres 24 | password: password 25 | 26 | development: 27 | <<: *default 28 | database: journal_api_development 29 | 30 | # The specified database role being used to connect to postgres. 31 | # To create additional roles in postgres see `$ createuser --help`. 32 | # When left blank, postgres will use the default role. This is 33 | # the same name as the operating system user running Rails. 34 | #username: journal_api 35 | 36 | # The password associated with the postgres role (username). 37 | #password: 38 | 39 | # Connect on a TCP socket. Omitted by default since the client uses a 40 | # domain socket that doesn't need configuration. Windows does not have 41 | # domain sockets, so uncomment these lines. 42 | #host: localhost 43 | 44 | # The TCP port the server listens on. Defaults to 5432. 45 | # If your server runs on a different port number, change accordingly. 46 | #port: 5432 47 | 48 | # Schema search path. The server defaults to $user,public 49 | #schema_search_path: myapp,sharedapp,public 50 | 51 | # Minimum log levels, in increasing order: 52 | # debug5, debug4, debug3, debug2, debug1, 53 | # log, notice, warning, error, fatal, and panic 54 | # Defaults to warning. 55 | #min_messages: notice 56 | 57 | # Warning: The database defined as "test" will be erased and 58 | # re-generated from your development database when you run "rake". 59 | # Do not set this db to the same as development or production. 60 | test: 61 | <<: *default 62 | database: journal_api_test 63 | 64 | # As with config/credentials.yml, you never want to store sensitive information, 65 | # like your database password, in your source code. If your source code is 66 | # ever seen by anyone, they now have access to your database. 67 | # 68 | # Instead, provide the password or a full connection URL as an environment 69 | # variable when you boot the app. For example: 70 | # 71 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 72 | # 73 | # If the connection URL is provided in the special DATABASE_URL environment 74 | # variable, Rails will automatically merge its configuration values on top of 75 | # the values provided in this file. Alternatively, you can specify a connection 76 | # URL environment variable explicitly: 77 | # 78 | # production: 79 | # url: <%= ENV["MY_APP_DATABASE_URL"] %> 80 | # 81 | # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database 82 | # for a full overview on how database connection configuration can be specified. 83 | # 84 | production: 85 | <<: *default 86 | database: journal_api_production 87 | username: journal_api 88 | password: <%= ENV["JOURNAL_API_DATABASE_PASSWORD"] %> 89 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../Gemfile", __dir__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_requirement 64 | @bundler_requirement ||= 65 | env_var_version || cli_arg_version || 66 | bundler_requirement_for(lockfile_version) 67 | end 68 | 69 | def bundler_requirement_for(version) 70 | return "#{Gem::Requirement.default}.a" unless version 71 | 72 | bundler_gem_version = Gem::Version.new(version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | 18 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 19 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 20 | # config.require_master_key = true 21 | 22 | # Disable serving static files from the `/public` folder by default since 23 | # Apache or NGINX already handles this. 24 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 25 | 26 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 27 | # config.asset_host = "http://assets.example.com" 28 | 29 | # Specifies the header that your server uses for sending files. 30 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 31 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 32 | 33 | # Store uploaded files on the local file system (see config/storage.yml for options). 34 | config.active_storage.service = :local 35 | 36 | # Mount Action Cable outside main process or domain. 37 | # config.action_cable.mount_path = nil 38 | # config.action_cable.url = "wss://example.com/cable" 39 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 40 | 41 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 42 | # config.force_ssl = true 43 | 44 | # Include generic and useful information about system operation, but avoid logging too much 45 | # information to avoid inadvertent exposure of personally identifiable information (PII). 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | config.log_tags = [ :request_id ] 50 | 51 | # Use a different cache store in production. 52 | # config.cache_store = :mem_cache_store 53 | 54 | # Use a real queuing backend for Active Job (and separate queues per environment). 55 | # config.active_job.queue_adapter = :resque 56 | # config.active_job.queue_name_prefix = "journal_api_production" 57 | 58 | config.action_mailer.perform_caching = false 59 | 60 | # Ignore bad email addresses and do not raise email delivery errors. 61 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 62 | # config.action_mailer.raise_delivery_errors = false 63 | 64 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 65 | # the I18n.default_locale when a translation cannot be found). 66 | config.i18n.fallbacks = true 67 | 68 | # Don't log any deprecations. 69 | config.active_support.report_deprecations = false 70 | 71 | # Use default logging formatter so that PID and timestamp are not suppressed. 72 | config.log_formatter = ::Logger::Formatter.new 73 | 74 | # Use a different logger for distributed setups. 75 | # require "syslog/logger" 76 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 77 | 78 | if ENV["RAILS_LOG_TO_STDOUT"].present? 79 | logger = ActiveSupport::Logger.new(STDOUT) 80 | logger.formatter = config.log_formatter 81 | config.logger = ActiveSupport::TaggedLogging.new(logger) 82 | end 83 | 84 | # Do not dump schema after migrations. 85 | config.active_record.dump_schema_after_migration = false 86 | end 87 | -------------------------------------------------------------------------------- /config/locales/devise.en.yml: -------------------------------------------------------------------------------- 1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n 2 | 3 | en: 4 | devise: 5 | confirmations: 6 | confirmed: "Your email address has been successfully confirmed." 7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." 8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." 9 | failure: 10 | already_authenticated: "You are already signed in." 11 | inactive: "Your account is not activated yet." 12 | invalid: "Invalid %{authentication_keys} or password." 13 | locked: "Your account is locked." 14 | last_attempt: "You have one more attempt before your account is locked." 15 | not_found_in_database: "Invalid %{authentication_keys} or password." 16 | timeout: "Your session expired. Please sign in again to continue." 17 | unauthenticated: "You need to sign in or sign up before continuing." 18 | unconfirmed: "You have to confirm your email address before continuing." 19 | mailer: 20 | confirmation_instructions: 21 | subject: "Confirmation instructions" 22 | reset_password_instructions: 23 | subject: "Reset password instructions" 24 | unlock_instructions: 25 | subject: "Unlock instructions" 26 | email_changed: 27 | subject: "Email Changed" 28 | password_change: 29 | subject: "Password Changed" 30 | omniauth_callbacks: 31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." 32 | success: "Successfully authenticated from %{kind} account." 33 | passwords: 34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." 35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." 36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." 37 | updated: "Your password has been changed successfully. You are now signed in." 38 | updated_not_active: "Your password has been changed successfully." 39 | registrations: 40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." 41 | signed_up: "Welcome! You have signed up successfully." 42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." 43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." 44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." 45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address." 46 | updated: "Your account has been updated successfully." 47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again." 48 | sessions: 49 | signed_in: "Signed in successfully." 50 | signed_out: "Signed out successfully." 51 | already_signed_out: "Signed out successfully." 52 | unlocks: 53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." 54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." 55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue." 56 | errors: 57 | messages: 58 | already_confirmed: "was already confirmed, please try signing in" 59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" 60 | expired: "has expired, please request a new one" 61 | not_found: "not found" 62 | not_locked: "was not locked" 63 | not_saved: 64 | one: "1 error prohibited this %{resource} from being saved:" 65 | other: "%{count} errors prohibited this %{resource} from being saved:" 66 | -------------------------------------------------------------------------------- /spec/requests/api/v1/posts_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe "Api::V1::Posts", type: :request do 4 | context "without authenticated user" do 5 | describe "GET /api/v1/posts" do 6 | it "returns all posts" do 7 | create_list(:post, 3) 8 | get "/api/v1/posts" 9 | expect(response).to have_http_status(:ok) 10 | expect(JSON.parse(response.body).size).to eq(3) 11 | end 12 | end 13 | 14 | describe "GET /api/v1/posts?label=idea" do 15 | it "returns all posts with the specified label" do 16 | create_list(:post, 3, label: "idea") 17 | get "/api/v1/posts?label=idea" 18 | expect(response).to have_http_status(:ok) 19 | expect(JSON.parse(response.body).size).to eq(3) 20 | end 21 | end 22 | 23 | describe "GET /api/v1/posts/:id" do 24 | it "returns a single post" do 25 | post = create(:post) 26 | get "/api/v1/posts/#{post.id}" 27 | expect(response).to have_http_status(:ok) 28 | expect(JSON.parse(response.body)["title"]).to eq(post.title) 29 | end 30 | end 31 | 32 | describe "GET /api/v1/posts?date=2021-01-01" do 33 | it "returns a post created on the specified date" do 34 | post = create(:post) 35 | today_date = Date.today.strftime("%Y-%m-%d") 36 | get "/api/v1/posts?date=#{today_date}" 37 | expect(response).to have_http_status(:ok) 38 | expect(JSON.parse(response.body).first["title"]).to eq(post.title) 39 | end 40 | end 41 | 42 | describe "POST /api/v1/posts" do 43 | it "creates a new post" do 44 | post_params = { post: { title: "New Post", content: "Lorem ipsum", label: "fun" } } 45 | post "/api/v1/posts", params: post_params 46 | expect(response).to have_http_status(:unauthorized) 47 | # expect(JSON.parse(response.body)["title"]).to eq("New Post") 48 | end 49 | end 50 | 51 | describe "PATCH /api/v1/posts/:id" do 52 | it "updates an existing post" do 53 | post = create(:post) 54 | patch "/api/v1/posts/#{post.id}", params: { post: { title: "Updated Post" } } 55 | expect(response).to have_http_status(:unauthorized) 56 | # expect(JSON.parse(response.body)["title"]).to eq("Updated Post") 57 | end 58 | end 59 | 60 | describe "DELETE /api/v1/posts/:id" do 61 | it "deletes a post" do 62 | post = create(:post) 63 | delete "/api/v1/posts/#{post.id}" 64 | expect(response).to have_http_status(:unauthorized) 65 | # expect { post.reload }.to raise_error(ActiveRecord::RecordNotFound) 66 | end 67 | end 68 | end 69 | 70 | context "with authenticated user" do 71 | let(:user) { create(:user) } 72 | let(:token) { JWT.encode({ 73 | user_id: user.id, 74 | username: user.username, 75 | }, ENV['DEVISE_JWT_SECRET_KEY'], 'HS256') 76 | } 77 | 78 | before do 79 | headers = { "Authorization" => "Bearer #{token}" } 80 | end 81 | 82 | describe "GET /api/v1/posts" do 83 | it "returns all posts" do 84 | create_list(:post, 3) 85 | get "/api/v1/posts" 86 | expect(response).to have_http_status(:ok) 87 | expect(JSON.parse(response.body).size).to eq(3) 88 | end 89 | end 90 | 91 | describe "GET /api/v1/posts?label=idea" do 92 | it "returns all posts with the specified label" do 93 | create_list(:post, 3, label: "idea") 94 | get "/api/v1/posts?label=idea" 95 | expect(response).to have_http_status(:ok) 96 | expect(JSON.parse(response.body).size).to eq(3) 97 | end 98 | end 99 | 100 | describe "GET /api/v1/posts/:id" do 101 | it "returns a single post" do 102 | post = create(:post) 103 | get "/api/v1/posts/#{post.id}" 104 | expect(response).to have_http_status(:ok) 105 | expect(JSON.parse(response.body)["title"]).to eq(post.title) 106 | end 107 | end 108 | 109 | describe "GET /api/v1/posts?date=2021-01-01" do 110 | it "returns a post created on the specified date" do 111 | post = create(:post) 112 | today_date = Date.today.strftime("%Y-%m-%d") 113 | get "/api/v1/posts?date=#{today_date}" 114 | expect(response).to have_http_status(:ok) 115 | expect(JSON.parse(response.body).first["title"]).to eq(post.title) 116 | end 117 | end 118 | 119 | describe "POST /api/v1/posts" do 120 | it "creates a new post" do 121 | post_params = { post: { title: "New Post", content: "Lorem ipsum", label: "fun" } } 122 | post "/api/v1/posts", params: post_params 123 | expect(response).to have_http_status(:unauthorized) 124 | # expect(JSON.parse(response.body)["title"]).to eq("New Post") 125 | end 126 | end 127 | 128 | describe "PATCH /api/v1/posts/:id" do 129 | it "updates an existing post" do 130 | post = create(:post) 131 | patch "/api/v1/posts/#{post.id}", params: { post: { title: "Updated Post" } } 132 | expect(response).to have_http_status(:unauthorized) 133 | # expect(JSON.parse(response.body)["title"]).to eq("Updated Post") 134 | end 135 | end 136 | 137 | describe "DELETE /api/v1/posts/:id" do 138 | it "deletes a post" do 139 | post = create(:post) 140 | delete "/api/v1/posts/#{post.id}" 141 | expect(response).to have_http_status(:unauthorized) 142 | # expect { post.reload }.to raise_error(ActiveRecord::RecordNotFound) 143 | end 144 | end 145 | end 146 | end 147 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (7.0.6) 5 | actionpack (= 7.0.6) 6 | activesupport (= 7.0.6) 7 | nio4r (~> 2.0) 8 | websocket-driver (>= 0.6.1) 9 | actionmailbox (7.0.6) 10 | actionpack (= 7.0.6) 11 | activejob (= 7.0.6) 12 | activerecord (= 7.0.6) 13 | activestorage (= 7.0.6) 14 | activesupport (= 7.0.6) 15 | mail (>= 2.7.1) 16 | net-imap 17 | net-pop 18 | net-smtp 19 | actionmailer (7.0.6) 20 | actionpack (= 7.0.6) 21 | actionview (= 7.0.6) 22 | activejob (= 7.0.6) 23 | activesupport (= 7.0.6) 24 | mail (~> 2.5, >= 2.5.4) 25 | net-imap 26 | net-pop 27 | net-smtp 28 | rails-dom-testing (~> 2.0) 29 | actionpack (7.0.6) 30 | actionview (= 7.0.6) 31 | activesupport (= 7.0.6) 32 | rack (~> 2.0, >= 2.2.4) 33 | rack-test (>= 0.6.3) 34 | rails-dom-testing (~> 2.0) 35 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 36 | actiontext (7.0.6) 37 | actionpack (= 7.0.6) 38 | activerecord (= 7.0.6) 39 | activestorage (= 7.0.6) 40 | activesupport (= 7.0.6) 41 | globalid (>= 0.6.0) 42 | nokogiri (>= 1.8.5) 43 | actionview (7.0.6) 44 | activesupport (= 7.0.6) 45 | builder (~> 3.1) 46 | erubi (~> 1.4) 47 | rails-dom-testing (~> 2.0) 48 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 49 | activejob (7.0.6) 50 | activesupport (= 7.0.6) 51 | globalid (>= 0.3.6) 52 | activemodel (7.0.6) 53 | activesupport (= 7.0.6) 54 | activerecord (7.0.6) 55 | activemodel (= 7.0.6) 56 | activesupport (= 7.0.6) 57 | activestorage (7.0.6) 58 | actionpack (= 7.0.6) 59 | activejob (= 7.0.6) 60 | activerecord (= 7.0.6) 61 | activesupport (= 7.0.6) 62 | marcel (~> 1.0) 63 | mini_mime (>= 1.1.0) 64 | activesupport (7.0.6) 65 | concurrent-ruby (~> 1.0, >= 1.0.2) 66 | i18n (>= 1.6, < 2) 67 | minitest (>= 5.1) 68 | tzinfo (~> 2.0) 69 | addressable (2.8.4) 70 | public_suffix (>= 2.0.2, < 6.0) 71 | bcrypt (3.1.19) 72 | bootsnap (1.16.0) 73 | msgpack (~> 1.2) 74 | builder (3.2.4) 75 | capybara (3.39.2) 76 | addressable 77 | matrix 78 | mini_mime (>= 0.1.3) 79 | nokogiri (~> 1.8) 80 | rack (>= 1.6.0) 81 | rack-test (>= 0.6.3) 82 | regexp_parser (>= 1.5, < 3.0) 83 | xpath (~> 3.2) 84 | concurrent-ruby (1.2.2) 85 | crass (1.0.6) 86 | date (3.3.3) 87 | debug (1.8.0) 88 | irb (>= 1.5.0) 89 | reline (>= 0.3.1) 90 | devise (4.9.2) 91 | bcrypt (~> 3.0) 92 | orm_adapter (~> 0.1) 93 | railties (>= 4.1.0) 94 | responders 95 | warden (~> 1.2.3) 96 | devise-jwt (0.11.0) 97 | devise (~> 4.0) 98 | warden-jwt_auth (~> 0.8) 99 | diff-lcs (1.5.0) 100 | docile (1.4.0) 101 | dotenv (2.8.1) 102 | dotenv-rails (2.8.1) 103 | dotenv (= 2.8.1) 104 | railties (>= 3.2) 105 | dry-auto_inject (1.0.1) 106 | dry-core (~> 1.0) 107 | zeitwerk (~> 2.6) 108 | dry-configurable (1.1.0) 109 | dry-core (~> 1.0, < 2) 110 | zeitwerk (~> 2.6) 111 | dry-core (1.0.0) 112 | concurrent-ruby (~> 1.0) 113 | zeitwerk (~> 2.6) 114 | erubi (1.12.0) 115 | factory_bot (6.2.1) 116 | activesupport (>= 5.0.0) 117 | factory_bot_rails (6.2.0) 118 | factory_bot (~> 6.2.0) 119 | railties (>= 5.0.0) 120 | faker (3.2.0) 121 | i18n (>= 1.8.11, < 2) 122 | globalid (1.1.0) 123 | activesupport (>= 5.0) 124 | i18n (1.14.1) 125 | concurrent-ruby (~> 1.0) 126 | io-console (0.6.0) 127 | irb (1.7.4) 128 | reline (>= 0.3.6) 129 | jwt (2.7.1) 130 | loofah (2.21.3) 131 | crass (~> 1.0.2) 132 | nokogiri (>= 1.12.0) 133 | mail (2.8.1) 134 | mini_mime (>= 0.1.1) 135 | net-imap 136 | net-pop 137 | net-smtp 138 | marcel (1.0.2) 139 | matrix (0.4.2) 140 | method_source (1.0.0) 141 | mini_mime (1.1.2) 142 | minitest (5.18.1) 143 | msgpack (1.7.2) 144 | net-imap (0.3.6) 145 | date 146 | net-protocol 147 | net-pop (0.1.2) 148 | net-protocol 149 | net-protocol (0.2.1) 150 | timeout 151 | net-smtp (0.3.3) 152 | net-protocol 153 | nio4r (2.5.9) 154 | nokogiri (1.15.3-arm64-darwin) 155 | racc (~> 1.4) 156 | nokogiri (1.15.3-x86_64-linux) 157 | racc (~> 1.4) 158 | orm_adapter (0.5.0) 159 | pg (1.5.3) 160 | public_suffix (5.0.3) 161 | puma (5.6.6) 162 | nio4r (~> 2.0) 163 | racc (1.7.1) 164 | rack (2.2.7) 165 | rack-cors (2.0.1) 166 | rack (>= 2.0.0) 167 | rack-test (2.1.0) 168 | rack (>= 1.3) 169 | rails (7.0.6) 170 | actioncable (= 7.0.6) 171 | actionmailbox (= 7.0.6) 172 | actionmailer (= 7.0.6) 173 | actionpack (= 7.0.6) 174 | actiontext (= 7.0.6) 175 | actionview (= 7.0.6) 176 | activejob (= 7.0.6) 177 | activemodel (= 7.0.6) 178 | activerecord (= 7.0.6) 179 | activestorage (= 7.0.6) 180 | activesupport (= 7.0.6) 181 | bundler (>= 1.15.0) 182 | railties (= 7.0.6) 183 | rails-dom-testing (2.1.1) 184 | activesupport (>= 5.0.0) 185 | minitest 186 | nokogiri (>= 1.6) 187 | rails-html-sanitizer (1.6.0) 188 | loofah (~> 2.21) 189 | nokogiri (~> 1.14) 190 | railties (7.0.6) 191 | actionpack (= 7.0.6) 192 | activesupport (= 7.0.6) 193 | method_source 194 | rake (>= 12.2) 195 | thor (~> 1.0) 196 | zeitwerk (~> 2.5) 197 | rake (13.0.6) 198 | regexp_parser (2.8.1) 199 | reline (0.3.6) 200 | io-console (~> 0.5) 201 | responders (3.1.0) 202 | actionpack (>= 5.2) 203 | railties (>= 5.2) 204 | rspec-core (3.12.2) 205 | rspec-support (~> 3.12.0) 206 | rspec-expectations (3.12.3) 207 | diff-lcs (>= 1.2.0, < 2.0) 208 | rspec-support (~> 3.12.0) 209 | rspec-mocks (3.12.6) 210 | diff-lcs (>= 1.2.0, < 2.0) 211 | rspec-support (~> 3.12.0) 212 | rspec-rails (6.0.3) 213 | actionpack (>= 6.1) 214 | activesupport (>= 6.1) 215 | railties (>= 6.1) 216 | rspec-core (~> 3.12) 217 | rspec-expectations (~> 3.12) 218 | rspec-mocks (~> 3.12) 219 | rspec-support (~> 3.12) 220 | rspec-support (3.12.1) 221 | simplecov (0.22.0) 222 | docile (~> 1.1) 223 | simplecov-html (~> 0.11) 224 | simplecov_json_formatter (~> 0.1) 225 | simplecov-html (0.12.3) 226 | simplecov_json_formatter (0.1.4) 227 | thor (1.2.2) 228 | timeout (0.4.0) 229 | tzinfo (2.0.6) 230 | concurrent-ruby (~> 1.0) 231 | warden (1.2.9) 232 | rack (>= 2.0.9) 233 | warden-jwt_auth (0.8.0) 234 | dry-auto_inject (>= 0.8, < 2) 235 | dry-configurable (>= 0.13, < 2) 236 | jwt (~> 2.1) 237 | warden (~> 1.2) 238 | websocket-driver (0.7.6) 239 | websocket-extensions (>= 0.1.0) 240 | websocket-extensions (0.1.5) 241 | xpath (3.2.0) 242 | nokogiri (~> 1.8) 243 | zeitwerk (2.6.9) 244 | 245 | PLATFORMS 246 | arm64-darwin-22 247 | x86_64-linux 248 | 249 | DEPENDENCIES 250 | bootsnap 251 | capybara 252 | debug 253 | devise 254 | devise-jwt 255 | dotenv-rails 256 | factory_bot_rails 257 | faker 258 | pg (~> 1.1) 259 | puma (~> 5.0) 260 | rack-cors 261 | rails (~> 7.0.6) 262 | rspec-rails 263 | simplecov 264 | tzinfo-data 265 | 266 | RUBY VERSION 267 | ruby 3.1.2p20 268 | 269 | BUNDLED WITH 270 | 2.3.18 271 | -------------------------------------------------------------------------------- /coverage/.resultset.json: -------------------------------------------------------------------------------- 1 | { 2 | "RSpec": { 3 | "coverage": { 4 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/models/post_spec.rb": { 5 | "lines": [ 6 | 1, 7 | null, 8 | 1, 9 | 1, 10 | 1, 11 | 1, 12 | 1, 13 | null, 14 | null, 15 | 1, 16 | 1, 17 | 1, 18 | 1, 19 | null, 20 | null, 21 | 1, 22 | 1, 23 | 1, 24 | 1, 25 | null, 26 | null, 27 | 1, 28 | 1, 29 | 1, 30 | 1, 31 | null, 32 | null, 33 | 1, 34 | 1, 35 | 1, 36 | null, 37 | null, 38 | null 39 | ] 40 | }, 41 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/rails_helper.rb": { 42 | "lines": [ 43 | 1, 44 | 1, 45 | 1, 46 | 1, 47 | 1, 48 | null, 49 | null, 50 | 1, 51 | null, 52 | 0, 53 | null, 54 | 1, 55 | 1, 56 | 1, 57 | 1, 58 | 1, 59 | 1, 60 | null 61 | ] 62 | }, 63 | "/Users/aaronlambley/code/lambley/grad-project/api/config/environment.rb": { 64 | "lines": [ 65 | null, 66 | 1, 67 | null, 68 | null, 69 | 1 70 | ] 71 | }, 72 | "/Users/aaronlambley/code/lambley/grad-project/api/config/application.rb": { 73 | "lines": [ 74 | 1, 75 | null, 76 | 1, 77 | null, 78 | 1, 79 | null, 80 | 1, 81 | 1, 82 | 1, 83 | 1, 84 | null, 85 | null 86 | ] 87 | }, 88 | "/Users/aaronlambley/code/lambley/grad-project/api/config/boot.rb": { 89 | "lines": [ 90 | 1, 91 | null, 92 | 1, 93 | 1 94 | ] 95 | }, 96 | "/Users/aaronlambley/code/lambley/grad-project/api/config/environments/test.rb": { 97 | "lines": [ 98 | 1, 99 | null, 100 | null, 101 | null, 102 | null, 103 | null, 104 | null, 105 | 1, 106 | null, 107 | null, 108 | null, 109 | 1, 110 | null, 111 | null, 112 | null, 113 | null, 114 | 1, 115 | null, 116 | null, 117 | 1, 118 | 1, 119 | null, 120 | null, 121 | null, 122 | null, 123 | 1, 124 | 1, 125 | 1, 126 | null, 127 | null, 128 | 1, 129 | null, 130 | null, 131 | 1, 132 | null, 133 | null, 134 | 1, 135 | null, 136 | 1, 137 | null, 138 | null, 139 | null, 140 | null, 141 | 1, 142 | null, 143 | null, 144 | 1, 145 | null, 146 | null, 147 | 1, 148 | null, 149 | null, 150 | 1, 151 | null, 152 | null, 153 | null, 154 | null, 155 | null, 156 | null, 157 | null 158 | ] 159 | }, 160 | "/Users/aaronlambley/code/lambley/grad-project/api/config/initializers/cors.rb": { 161 | "lines": [ 162 | 1, 163 | 1, 164 | 1, 165 | null, 166 | 1, 167 | null, 168 | null, 169 | null, 170 | null 171 | ] 172 | }, 173 | "/Users/aaronlambley/code/lambley/grad-project/api/config/initializers/devise.rb": { 174 | "lines": [ 175 | 1, 176 | 1, 177 | 1, 178 | 1, 179 | 1, 180 | 1, 181 | 1, 182 | 1, 183 | 1, 184 | 1, 185 | 1, 186 | 1, 187 | 1, 188 | 1, 189 | 1, 190 | null, 191 | 1, 192 | 1, 193 | 1, 194 | null, 195 | null, 196 | 1, 197 | null, 198 | null, 199 | null, 200 | null, 201 | null 202 | ] 203 | }, 204 | "/Users/aaronlambley/code/lambley/grad-project/api/config/initializers/filter_parameter_logging.rb": { 205 | "lines": [ 206 | null, 207 | null, 208 | null, 209 | null, 210 | null, 211 | 1, 212 | null, 213 | null 214 | ] 215 | }, 216 | "/Users/aaronlambley/code/lambley/grad-project/api/config/initializers/inflections.rb": { 217 | "lines": [ 218 | null, 219 | null, 220 | null, 221 | null, 222 | null, 223 | null, 224 | null, 225 | null, 226 | null, 227 | null, 228 | null, 229 | null, 230 | null, 231 | null, 232 | null, 233 | null 234 | ] 235 | }, 236 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/factories/post.rb": { 237 | "lines": [ 238 | 1, 239 | 1, 240 | 25, 241 | 25, 242 | 18, 243 | 26, 244 | 26, 245 | null, 246 | null 247 | ] 248 | }, 249 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/factories/user.rb": { 250 | "lines": [ 251 | 1, 252 | 1, 253 | 10, 254 | 10, 255 | 11, 256 | null, 257 | null 258 | ] 259 | }, 260 | "/Users/aaronlambley/code/lambley/grad-project/api/config/routes.rb": { 261 | "lines": [ 262 | 1, 263 | 1, 264 | null, 265 | null, 266 | null, 267 | 1, 268 | 1, 269 | 1, 270 | null, 271 | 1, 272 | 1, 273 | 1, 274 | 1, 275 | 1, 276 | 1, 277 | null, 278 | null, 279 | null, 280 | null, 281 | null 282 | ] 283 | }, 284 | "/Users/aaronlambley/code/lambley/grad-project/api/app/models/user.rb": { 285 | "lines": [ 286 | 1, 287 | null, 288 | null, 289 | 1, 290 | null, 291 | 1, 292 | 1, 293 | 1, 294 | null 295 | ] 296 | }, 297 | "/Users/aaronlambley/code/lambley/grad-project/api/app/models/application_record.rb": { 298 | "lines": [ 299 | 1, 300 | 1, 301 | null 302 | ] 303 | }, 304 | "/Users/aaronlambley/code/lambley/grad-project/api/app/models/post.rb": { 305 | "lines": [ 306 | 1, 307 | 1, 308 | 1, 309 | 1, 310 | null 311 | ] 312 | }, 313 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/models/user_spec.rb": { 314 | "lines": [ 315 | 1, 316 | null, 317 | 1, 318 | 1, 319 | 1, 320 | 1, 321 | null, 322 | 1, 323 | 1, 324 | 1, 325 | 1, 326 | null, 327 | null, 328 | 1, 329 | 1, 330 | 1, 331 | 1, 332 | null, 333 | null 334 | ] 335 | }, 336 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/requests/api/v1/posts_spec.rb": { 337 | "lines": [ 338 | 1, 339 | null, 340 | 1, 341 | 1, 342 | 1, 343 | 1, 344 | 1, 345 | 1, 346 | 1, 347 | 1, 348 | null, 349 | null, 350 | null, 351 | 1, 352 | 1, 353 | 1, 354 | 1, 355 | 1, 356 | 1, 357 | null, 358 | null, 359 | null, 360 | 1, 361 | 1, 362 | 1, 363 | 1, 364 | 1, 365 | 1, 366 | null, 367 | null, 368 | null, 369 | 1, 370 | 1, 371 | 1, 372 | 1, 373 | 1, 374 | 1, 375 | 1, 376 | null, 377 | null, 378 | null, 379 | 1, 380 | 1, 381 | 1, 382 | 1, 383 | 1, 384 | null, 385 | null, 386 | null, 387 | null, 388 | 1, 389 | 1, 390 | 1, 391 | 1, 392 | 1, 393 | null, 394 | null, 395 | null, 396 | null, 397 | 1, 398 | 1, 399 | 1, 400 | 1, 401 | 1, 402 | null, 403 | null, 404 | null, 405 | null, 406 | null, 407 | 1, 408 | 8, 409 | 8, 410 | null, 411 | null, 412 | null, 413 | null, 414 | null, 415 | 1, 416 | 7, 417 | null, 418 | null, 419 | 1, 420 | 1, 421 | 1, 422 | 1, 423 | 1, 424 | 1, 425 | null, 426 | null, 427 | null, 428 | 1, 429 | 1, 430 | 1, 431 | 1, 432 | 1, 433 | 1, 434 | null, 435 | null, 436 | null, 437 | 1, 438 | 1, 439 | 1, 440 | 1, 441 | 1, 442 | 1, 443 | null, 444 | null, 445 | null, 446 | 1, 447 | 1, 448 | 1, 449 | 1, 450 | 1, 451 | 1, 452 | 1, 453 | null, 454 | null, 455 | null, 456 | 1, 457 | 1, 458 | 1, 459 | 1, 460 | 1, 461 | null, 462 | null, 463 | null, 464 | null, 465 | 1, 466 | 1, 467 | 1, 468 | 1, 469 | 1, 470 | null, 471 | null, 472 | null, 473 | null, 474 | 1, 475 | 1, 476 | 1, 477 | 1, 478 | 1, 479 | null, 480 | null, 481 | null, 482 | null, 483 | null 484 | ] 485 | }, 486 | "/Users/aaronlambley/code/lambley/grad-project/api/spec/routing/posts_routing_spec.rb": { 487 | "lines": [ 488 | 1, 489 | null, 490 | 1, 491 | 1, 492 | 1, 493 | 1, 494 | null, 495 | null, 496 | 1, 497 | 1, 498 | null, 499 | null, 500 | 1, 501 | 1, 502 | null, 503 | null, 504 | 1, 505 | 1, 506 | null, 507 | null, 508 | 1, 509 | 1, 510 | null, 511 | null, 512 | 1, 513 | 1, 514 | null, 515 | null, 516 | 1, 517 | 1, 518 | null, 519 | null, 520 | null 521 | ] 522 | }, 523 | "/Users/aaronlambley/code/lambley/grad-project/api/app/controllers/api/v1/posts_controller.rb": { 524 | "lines": [ 525 | 1, 526 | 1, 527 | 1, 528 | 1, 529 | null, 530 | null, 531 | 1, 532 | 6, 533 | null, 534 | 6, 535 | null, 536 | null, 537 | null, 538 | 1, 539 | 0, 540 | null, 541 | 0, 542 | null, 543 | null, 544 | null, 545 | 1, 546 | 2, 547 | null, 548 | 2, 549 | null, 550 | null, 551 | null, 552 | 1, 553 | 0, 554 | 0, 555 | 0, 556 | null, 557 | 0, 558 | null, 559 | null, 560 | null, 561 | null, 562 | 1, 563 | 0, 564 | null, 565 | 0, 566 | 0, 567 | null, 568 | 0, 569 | null, 570 | null, 571 | null, 572 | null, 573 | 1, 574 | 0, 575 | 0, 576 | null, 577 | 0, 578 | null, 579 | null, 580 | null, 581 | null, 582 | 1, 583 | 0, 584 | null, 585 | null, 586 | 1, 587 | null, 588 | 1, 589 | 2, 590 | null, 591 | null, 592 | null, 593 | 1, 594 | 0, 595 | null, 596 | null, 597 | 1, 598 | 8, 599 | null, 600 | null, 601 | 8, 602 | 8, 603 | 8, 604 | 8, 605 | null, 606 | null, 607 | 1, 608 | 6, 609 | 6, 610 | null, 611 | 6, 612 | null, 613 | 0, 614 | 0, 615 | 0, 616 | null, 617 | 0, 618 | 0, 619 | 0, 620 | null, 621 | null, 622 | 6, 623 | null, 624 | null, 625 | null 626 | ] 627 | }, 628 | "/Users/aaronlambley/code/lambley/grad-project/api/app/controllers/application_controller.rb": { 629 | "lines": [ 630 | 1, 631 | null 632 | ] 633 | } 634 | }, 635 | "timestamp": 1691069150 636 | } 637 | } 638 | -------------------------------------------------------------------------------- /coverage/assets/0.12.3/application.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,code,del,dfn,em,img,q,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,dialog,figure,footer,header,hgroup,nav,section{margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}article,aside,dialog,figure,footer,header,hgroup,nav,section{display:block}body{line-height:1.5}table{border-collapse:separate;border-spacing:0}caption,th,td{text-align:left;font-weight:normal}table,td,th{vertical-align:middle}blockquote:before,blockquote:after,q:before,q:after{content:""}blockquote,q{quotes:"" ""}a img{border:0}html{font-size:100.01%}body{font-size:82%;color:#222;background:#fff;font-family:"Helvetica Neue",Arial,Helvetica,sans-serif}h1,h2,h3,h4,h5,h6{font-weight:normal;color:#111}h1{font-size:3em;line-height:1;margin-bottom:.5em}h2{font-size:2em;margin-bottom:.75em}h3{font-size:1.5em;line-height:1;margin-bottom:1em}h4{font-size:1.2em;line-height:1.25;margin-bottom:1.25em}h5{font-size:1em;font-weight:bold;margin-bottom:1.5em}h6{font-size:1em;font-weight:bold}h1 img,h2 img,h3 img,h4 img,h5 img,h6 img{margin:0}p{margin:0 0 1.5em}p img.left{float:left;margin:1.5em 1.5em 1.5em 0;padding:0}p img.right{float:right;margin:1.5em 0 1.5em 1.5em}a:focus,a:hover{color:#000}a{color:#009;text-decoration:underline}blockquote{margin:1.5em;color:#666;font-style:italic}strong{font-weight:bold}em,dfn{font-style:italic}dfn{font-weight:bold}sup,sub{line-height:0}abbr,acronym{border-bottom:1px dotted #666}address{margin:0 0 1.5em;font-style:italic}del{color:#666}pre{margin:1.5em 0;white-space:pre}pre,code,tt{font:1em 'andale mono','lucida console',monospace;line-height:1.5}li ul,li ol{margin:0}ul,ol{margin:0 1.5em 1.5em 0;padding-left:3.333em}ul{list-style-type:disc}ol{list-style-type:decimal}dl{margin:0 0 1.5em 0}dl dt{font-weight:bold}dd{margin-left:1.5em}table{margin-bottom:1.4em;width:100%}th{font-weight:bold}thead th{background:#c3d9ff}th,td,caption{padding:4px 10px 4px 5px}tr.even td{background:#efefef}tfoot{font-style:italic}caption{background:#eee}.small{font-size:.8em;margin-bottom:1.875em;line-height:1.875em}.large{font-size:1.2em;line-height:2.5em;margin-bottom:1.25em}.hide{display:none}.quiet{color:#666}.loud{color:#000}.highlight{background:#ff0}.added{background:#060;color:#fff}.removed{background:#900;color:#fff}.first{margin-left:0;padding-left:0}.last{margin-right:0;padding-right:0}.top{margin-top:0;padding-top:0}.bottom{margin-bottom:0;padding-bottom:0}label{font-weight:bold}fieldset{padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc}legend{font-weight:bold;font-size:1.2em}input[type=text],input[type=password],input.text,input.title,textarea,select{background-color:#fff;border:1px solid #bbb}input[type=text]:focus,input[type=password]:focus,input.text:focus,input.title:focus,textarea:focus,select:focus{border-color:#666}input[type=text],input[type=password],input.text,input.title,textarea,select{margin:.5em 0}input.text,input.title{width:300px;padding:5px}input.title{font-size:1.5em}textarea{width:390px;height:250px;padding:5px}input[type=checkbox],input[type=radio],input.checkbox,input.radio{position:relative;top:.25em}form.inline{line-height:3}form.inline p{margin-bottom:0}.error,.notice,.success{padding:.8em;margin-bottom:1em;border:2px solid #ddd}.error{background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4}.notice{background:#fff6bf;color:#514721;border-color:#ffd324}.success{background:#e6efc2;color:#264409;border-color:#c6d880}.error a{color:#8a1f11}.notice a{color:#514721}.success a{color:#264409}.box{padding:1.5em;margin-bottom:1.5em;background:#e5ecf9}hr{background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:0}hr.space{background:#fff;color:#fff;visibility:hidden}.clearfix:after,.container:after{content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden}.clearfix,.container{display:block}.clear{clear:both}table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:0}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("DataTables-1.10.20/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("DataTables-1.10.20/images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("DataTables-1.10.20/images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("DataTables-1.10.20/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("DataTables-1.10.20/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:0}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:0}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,white),color-stop(100%,#dcdcdc));background:-webkit-linear-gradient(top,white 0,#dcdcdc 100%);background:-moz-linear-gradient(top,white 0,#dcdcdc 100%);background:-ms-linear-gradient(top,white 0,#dcdcdc 100%);background:-o-linear-gradient(top,white 0,#dcdcdc 100%);background:linear-gradient(to bottom,white 0,#dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#585858),color-stop(100%,#111));background:-webkit-linear-gradient(top,#585858 0,#111 100%);background:-moz-linear-gradient(top,#585858 0,#111 100%);background:-ms-linear-gradient(top,#585858 0,#111 100%);background:-o-linear-gradient(top,#585858 0,#111 100%);background:linear-gradient(to bottom,#585858 0,#111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:0;background-color:#2b2b2b;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#2b2b2b),color-stop(100%,#0c0c0c));background:-webkit-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:-moz-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:-ms-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:-o-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:linear-gradient(to bottom,#2b2b2b 0,#0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(25%,rgba(255,255,255,0.9)),color-stop(75%,rgba(255,255,255,0.9)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,0.9) 25%,rgba(255,255,255,0.9) 75%,rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,0.9) 25%,rgba(255,255,255,0.9) 75%,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,0.9) 25%,rgba(255,255,255,0.9) 75%,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,0.9) 25%,rgba(255,255,255,0.9) 75%,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,0.9) 25%,rgba(255,255,255,0.9) 75%,rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:0}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width:767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width:640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}}pre .comment,pre .template_comment,pre .diff .header,pre .javadoc{color:#998;font-style:italic}pre .keyword,pre .css .rule .keyword,pre .winutils,pre .javascript .title,pre .lisp .title{color:#000;font-weight:bold}pre .number,pre .hexcolor{color:#458}pre .string,pre .tag .value,pre .phpdoc,pre .tex .formula{color:#d14}pre .subst{color:#712}pre .constant,pre .title,pre .id{color:#900;font-weight:bold}pre .javascript .title,pre .lisp .title,pre .subst{font-weight:normal}pre .class .title,pre .haskell .label,pre .tex .command{color:#458;font-weight:bold}pre .tag,pre .tag .title,pre .rules .property,pre .django .tag .keyword{color:navy;font-weight:normal}pre .attribute,pre .variable,pre .instancevar,pre .lisp .body{color:teal}pre .regexp{color:#009926}pre .class{color:#458;font-weight:bold}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .lisp .keyword,pre .tex .special,pre .input_number{color:#990073}pre .builtin,pre .built_in,pre .lisp .title{color:#0086b3}pre .preprocessor,pre .pi,pre .doctype,pre .shebang,pre .cdata{color:#999;font-weight:bold}pre .deletion{background:#fdd}pre .addition{background:#dfd}pre .diff .change{background:#0086b3}pre .chunk{color:#aaa}pre .tex .formula{opacity:.5}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute;left:-99999999px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}/*\*/* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}/**/.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default !important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-widget :active{outline:0}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-off{background-position:-96px -144px}.ui-icon-radio-on{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px}.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-corner-top{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-bottom{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-corner-right{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-corner-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.30;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.30;filter:Alpha(Opacity=30);-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}#colorbox,#cboxOverlay,#cboxWrapper{position:absolute;top:0;left:0;z-index:9999;overflow:hidden}#cboxOverlay{position:fixed;width:100%;height:100%}#cboxMiddleLeft,#cboxBottomLeft{clear:left}#cboxContent{position:relative}#cboxLoadedContent{overflow:auto}#cboxTitle{margin:0}#cboxLoadingOverlay,#cboxLoadingGraphic{position:absolute;top:0;left:0;width:100%;height:100%}#cboxPrevious,#cboxNext,#cboxClose,#cboxSlideshow{cursor:pointer}.cboxPhoto{float:left;margin:auto;border:0;display:block;max-width:none}.cboxIframe{width:100%;height:100%;display:block;border:0}#colorbox,#cboxContent,#cboxLoadedContent{box-sizing:content-box}#cboxOverlay{background:#000}#cboxTopLeft{width:14px;height:14px;background:url(colorbox/controls.png) no-repeat 0 0}#cboxTopCenter{height:14px;background:url(colorbox/border.png) repeat-x top left}#cboxTopRight{width:14px;height:14px;background:url(colorbox/controls.png) no-repeat -36px 0}#cboxBottomLeft{width:14px;height:43px;background:url(colorbox/controls.png) no-repeat 0 -32px}#cboxBottomCenter{height:43px;background:url(colorbox/border.png) repeat-x bottom left}#cboxBottomRight{width:14px;height:43px;background:url(colorbox/controls.png) no-repeat -36px -32px}#cboxMiddleLeft{width:14px;background:url(colorbox/controls.png) repeat-y -175px 0}#cboxMiddleRight{width:14px;background:url(colorbox/controls.png) repeat-y -211px 0}#cboxContent{background:#fff;overflow:visible}.cboxIframe{background:#fff}#cboxError{padding:50px;border:1px solid #ccc}#cboxLoadedContent{margin-bottom:5px}#cboxLoadingOverlay{background:url(colorbox/loading_background.png) no-repeat center center}#cboxLoadingGraphic{background:url(colorbox/loading.gif) no-repeat center center}#cboxTitle{position:absolute;bottom:-25px;left:0;text-align:center;width:100%;font-weight:bold;color:#7c7c7c}#cboxCurrent{position:absolute;bottom:-25px;left:58px;font-weight:bold;color:#7c7c7c}#cboxPrevious,#cboxNext,#cboxClose,#cboxSlideshow{position:absolute;bottom:-29px;background:url(colorbox/controls.png) no-repeat 0 0;width:23px;height:23px;text-indent:-9999px}#cboxPrevious{left:0;background-position:-51px -25px}#cboxPrevious:hover{background-position:-51px 0}#cboxNext{left:27px;background-position:-75px -25px}#cboxNext:hover{background-position:-75px 0}#cboxClose{right:0;background-position:-100px -25px}#cboxClose:hover{background-position:-100px 0}.cboxSlideshow_on #cboxSlideshow{background-position:-125px 0;right:27px}.cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0}.cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px;right:27px}.cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0}#loading{position:fixed;left:40%;top:50%}a{color:#333;text-decoration:none}a:hover{color:#000;text-decoration:underline}body{font-family:"Lucida Grande",Helvetica,"Helvetica Neue",Arial,sans-serif;padding:12px;background-color:#333}h1,h2,h3,h4{color:#1c2324;margin:0;padding:0;margin-bottom:12px}table{width:100%}#content{clear:left;background-color:white;border:2px solid #ddd;border-top:8px solid #ddd;padding:18px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px;-webkit-border-top-right-radius:5px;-moz-border-radius-bottomleft:5px;-moz-border-radius-bottomright:5px;-moz-border-radius-topright:5px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top-right-radius:5px}.dataTables_filter,.dataTables_info{padding:2px 6px}abbr.timeago{text-decoration:none;border:0;font-weight:bold}.timestamp{float:right;color:#ddd}.group_tabs{list-style:none;float:left;margin:0;padding:0}.group_tabs li{display:inline;float:left}.group_tabs li a{font-family:Helvetica,Arial,sans-serif;display:block;float:left;text-decoration:none;padding:4px 8px;background-color:#aaa;background:-webkit-gradient(linear,0 0,0 bottom,from(#ddd),to(#aaa));background:-moz-linear-gradient(#ddd,#aaa);background:linear-gradient(#ddd,#aaa);text-shadow:#e5e5e5 1px 1px 0;border-bottom:0;color:#333;font-weight:bold;margin-right:8px;border-top:1px solid #efefef;-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.group_tabs li a:hover{background-color:#ccc;background:-webkit-gradient(linear,0 0,0 bottom,from(#eee),to(#aaa));background:-moz-linear-gradient(#eee,#aaa);background:linear-gradient(#eee,#aaa)}.group_tabs li a:active{padding-top:5px;padding-bottom:3px}.group_tabs li.active a{color:black;text-shadow:#fff 1px 1px 0;background-color:#ddd;background:-webkit-gradient(linear,0 0,0 bottom,from(white),to(#ddd));background:-moz-linear-gradient(white,#ddd);background:linear-gradient(white,#ddd)}.file_list{margin-bottom:18px}.file_list--responsive{overflow-x:auto;overflow-y:hidden}a.src_link{background:url("./magnify.png") no-repeat left 50%;padding-left:18px}tr,td{margin:0;padding:0}th{white-space:nowrap}th.ui-state-default{cursor:pointer}th span.ui-icon{float:left}td{padding:4px 8px}td.strong{font-weight:bold}.cell--number{text-align:right}.source_table h3,.source_table h4{padding:0;margin:0;margin-bottom:4px}.source_table .header{padding:10px}.source_table pre{margin:0;padding:0;white-space:normal;color:#000;font-family:"Monaco","Inconsolata","Consolas",monospace}.source_table code{color:#000;font-family:"Monaco","Inconsolata","Consolas",monospace}.source_table pre{background-color:#333}.source_table pre ol{margin:0;padding:0;margin-left:45px;font-size:12px;color:white}.source_table pre li{margin:0;padding:2px 6px;border-left:5px solid white}.source_table pre li code{white-space:pre;white-space:pre-wrap}.source_table pre .hits{float:right;margin-left:10px;padding:2px 4px;background-color:#444;background:-webkit-gradient(linear,0 0,0 bottom,from(#222),to(#666));background:-moz-linear-gradient(#222,#666);background:linear-gradient(#222,#666);color:white;font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;font-size:10px;font-weight:bold;text-align:center;border-radius:6px}#footer{color:#ddd;font-size:12px;font-weight:bold;margin-top:12px;text-align:right}#footer a{color:#eee;text-decoration:underline}#footer a:hover{color:#fff;text-decoration:none}.green{color:#090}.red{color:#900}.yellow{color:#da0}.blue{color:blue}thead th{background:white}.source_table .covered{border-color:#090}.source_table .missed{border-color:#900}.source_table .never{border-color:black}.source_table .skipped{border-color:#fc0}.source_table .missed-branch{border-color:#bf0000}.source_table .covered:nth-child(odd){background-color:#cdf2cd}.source_table .covered:nth-child(even){background-color:#dbf2db}.source_table .missed:nth-child(odd){background-color:#f7c0c0}.source_table .missed:nth-child(even){background-color:#f7cfcf}.source_table .never:nth-child(odd){background-color:#efefef}.source_table .never:nth-child(even){background-color:#f4f4f4}.source_table .skipped:nth-child(odd){background-color:#fbf0c0}.source_table .skipped:nth-child(even){background-color:#fbffcf}.source_table .missed-branch:nth-child(odd){background-color:#cc8e8e}.source_table .missed-branch:nth-child(even){background-color:#cc6e6e} --------------------------------------------------------------------------------