This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
RSpec.configure do |config| | |
config.before(:suite) do | |
begin | |
DatabaseCleaner.start | |
setup_biz | |
FactoryBot.lint unless config.files_to_run.one? | |
ensure | |
DatabaseCleaner.clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/environments/production.rb | |
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
config.lograge.enabled = true | |
# add time to lograge | |
config.lograge.custom_options = lambda do |event| | |
{ time: event.time, params: event.payload[:params].except('controller', 'action', 'utf8', 'authenticity_token', 'commit') } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/string.rb | |
class String | |
# TODO: Don't know how to convert to UTF-16BE encoding using built-in methods, and then arrive | |
# at the result similar to: http://api.mvaayoo.com/unicodeutil/unicode.jsp | |
def to_unicode | |
unpack('U*').map { |i| i.to_s(16).rjust(4, '0') }.join | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the host name for URL creation | |
SitemapGenerator::Sitemap.default_host = 'http://www.pycosystems.com' | |
SitemapGenerator::Sitemap.create do | |
# Put links creation logic here. | |
# | |
# The root path '/' and sitemap index file are added automatically for you. | |
# Links are added to the Sitemap in the order they are specified. | |
# | |
# Usage: add(path, options={}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require: | |
- rubocop-rspec | |
AllCops: | |
Include: | |
- '**/Capfile' | |
- '**/Gemfile' | |
- '**/Rakefile' | |
- '**/config.ru' | |
- '**/app/**/*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleCov.minimum_coverage 98.00 | |
SimpleCov.minimum_coverage_by_file 80 | |
SimpleCov.refuse_coverage_drop | |
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter | |
SimpleCov.start :rails do | |
add_group 'Mailers', 'app/mailers' | |
add_group 'Policies', 'app/policies' | |
add_group 'Services', 'app/services' | |
add_group 'Uploaders', 'app/uploaders' | |
add_group 'Validators', 'app/validators' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') | |
"https://github.com/#{repo_name}.git" | |
end | |
source 'https://rubygems.org' | |
ruby '2.4.2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Application < Rails::Application | |
config.generators do |g| | |
g.orm :active_record | |
g.template_engine :erb | |
g.stylesheets false | |
g.javascripts false | |
g.test_framework :rspec, | |
fixtures: true, | |
view_specs: false, | |
helper_specs: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TimeSplits | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def not_null?(attribute) | |
where(arel_table[attribute].not_eq(nil)) | |
end | |
def in_future?(attribute, default_threshold = Time.current) | |
not_null?(attribute).where(arel_table[attribute].gt(default_threshold)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var isRelease = (process.env.RELEASE && process.env.RELEASE === "1"); | |
// Turn this on only for release | |
if (isRelease !== true) { | |
return; | |
} | |
var fs = require('fs'); | |
var path = require('path'); |