text stringlengths 10 2.61M |
|---|
require 'pathname'
module Twigg
autoload :Cacher, 'twigg/cacher'
autoload :Command, 'twigg/command'
autoload :Commit, 'twigg/commit'
autoload :CommitSet, 'twigg/commit_set'
autoload :CommitSetDecorator, 'twigg/commit_set_decorator'
autoload :Config, 'twigg/config'
autoload :Console, 'twigg/console'
autoload :Dependency, 'twigg/dependency'
autoload :Decorator, 'twigg/decorator'
autoload :Decoratable, 'twigg/decoratable'
autoload :Flesch, 'twigg/flesch'
autoload :Gatherer, 'twigg/gatherer'
autoload :PairMatrix, 'twigg/pair_matrix'
autoload :Repo, 'twigg/repo'
autoload :RepoSet, 'twigg/repo_set'
autoload :RussianNovel, 'twigg/russian_novel'
autoload :Settings, 'twigg/settings'
autoload :Team, 'twigg/team'
autoload :Util, 'twigg/util'
autoload :VERSION, 'twigg/version'
# Returns a Pathname instance corresponding to the root directory of the gem
# (ie. the directory containing the `files` and `templates` directories).
def self.root
Pathname.new(__dir__) + '..'
end
end
Twigg::Config.boot
|
class Api::V1::TodoListPresenter < Api::V1::BasePresenter
def present_object(object, options = {})
return object unless object.errors.empty? # Renders validation errors
unless options[:include_root]
if options[:minimal]
{
:id => object.id,
:name => object.name
}
elsif options[:awesome]
{
:id => object.id,
:name => object.name,
:awesome => true,
:message => object.hello
}
else
object.as_json
end
else
options.merge!(:include_root => false)
{ subject_class.to_sym => present_object(object, options) }
end
end
end
|
require "requests/spec_helper"
# This file will be required by
# all file in this directory and subdirectory
shared_context "setup_s2_environment_for_dna_rna_manual_extraction" do
let(:user_uuid) { "2ea2d340-7f57-0130-e344-282066132de2" }
let(:study_uuid) { "2ea2dc40-7f57-0130-e344-282066132de2" }
let(:sample_uuids) { ["2ea393c0-7f57-0130-e344-282066132de2", "2ea423b0-7f57-0130-e344-282066132de2", "2ea4b420-7f57-0130-e344-282066132de2"] }
let(:tube_uuids) { ["2ea58a10-7f57-0130-e344-282066132de2", "2ea6d7b0-7f57-0130-e344-282066132de2", "2ea83c50-7f57-0130-e344-282066132de2"] }
let(:labellable_uuids) { ["2ea59590-7f57-0130-e344-282066132de2", "2ea6e160-7f57-0130-e344-282066132de2", "2ea84ed0-7f57-0130-e344-282066132de2"] }
let(:order_uuids) { ["2ea9d600-7f57-0130-e344-282066132de2", "2eaaf660-7f57-0130-e344-282066132de2"] }
let(:source_tube_barcodes) { ["1220017279667", "1220017279668", "1220017279669"] }
# Needed for the order creation
# - a valid study uuid
# - a valid user uuid
# Add a user and a study in the core
let(:order_config) {
user = Lims::LaboratoryApp::Organization::User.new
study = Lims::LaboratoryApp::Organization::Study.new
save_with_uuid({user => user_uuid, study => study_uuid})
{:user_uuid => user_uuid, :study_uuid => study_uuid}
}
# Setup the orders for dna_rna manual extraction pipeline
# 2 tubes in 1 order
# 1 tube in 1 order
# Create the tubes for dna+rna manual extraction orders
# Barcode each tube
let(:create_samples) {
[0, 1, 2].each do |i|
sample = Lims::LaboratoryApp::Laboratory::Sample.new(:name => "sample_#{i}")
save_with_uuid(sample => sample_uuids[i])
end
}
let(:create_labelled_tubes) {
[0, 1, 2].each do |i|
store.with_session do |session|
tube = Lims::LaboratoryApp::Laboratory::Tube.new
tube << Lims::LaboratoryApp::Laboratory::Aliquot.new(:sample => session[sample_uuids[i]],
:type => "NA+P",
:quantity => 1000)
labellable = Lims::LaboratoryApp::Labels::Labellable.new(:name => tube_uuids[i], :type => "resource")
labellable["barcode"] = Lims::LaboratoryApp::Labels::Labellable::Label.new(:type => "ean13-barcode",
:value => source_tube_barcodes[i])
set_uuid(session, tube, tube_uuids[i])
set_uuid(session, labellable, labellable_uuids[i])
end
end
}
# Create orders
# First order with 2 tubes, Second order with 1 tube
let(:create_orders) {
[[tube_uuids[0], tube_uuids[1]], [tube_uuids[2]]].each_with_index do |source_tubes, index|
store.with_session do |session|
order = Lims::LaboratoryApp::Organization::Order.new(:creator => session[user_uuid],
:study => session[study_uuid],
:pipeline => "DNA+RNA manual extraction",
:cost_code => "cost code")
order.add_source("tube_to_be_extracted_nap", source_tubes)
set_uuid(session, order, order_uuids[index])
end
end
}
let!(:setup) {
order_config
create_samples
create_labelled_tubes
create_orders
}
end
|
class Post::TopRatingQuery
include ActiveModel::Validations
validates :quantity, presence: true, numericality: { only_integer: true }
attr_reader :collection, :quantity, :page
def initialize(params:)
@quantity = params[:quantity]
@page = params[:page].to_i > 0 ? params[:page] : 1
end
def perform
return errors unless valid?
fetch_posts
apply_by_quantity
apply_paginate
collection
end
private
def fetch_posts
@collection = Post.order(rating: :desc)
end
def apply_by_quantity
@collection = collection.limit(quantity)
end
def apply_paginate
@collection = collection.page(page).per(formatted_per)
end
def formatted_per
quantity.to_i < 50 ? quantity : 50
end
end |
class LinkedinUserUpdateComment < ActiveRecord::Base
belongs_to :linkedin_user_comment_like,:foreign_key => "linkedin_user_comment_like_id"
def self.process_hash(comment)
if (comment.nil?)
return nil
end
comment['linkedin_id'] = comment['person']['id']
comment['first_name'] = comment['person']['first_name']
comment['last_name'] = comment['person']['last_name']
comment['headline'] = comment['person']['headline']
comment['api_standard_profile_request'] = comment['person']['api_standard_profile_request']['url']
comment['id'] = comment['person']['id']
comment['site_standard_profile_request'] = comment['person']['site_standard_profile_request']['url']
comment.delete('person')
return comment
end
def initialize(hash)
hash = process_hash(hash)
super(hash)
end
def compare_hash(hash_from_database,hash_from_server)
result = Hash.new
hash_from_database.each { |key,value|
if key.to_s != 'linkedin_user_id'.to_s && key.to_s != 'created_at'.to_s && key.to_s != 'updated_at'.to_s && value != hash_from_server[key]
result[key] = hash_from_server[key]
end
}
return result
end
def update_attributes(hash)
hash = process_hash(hash)
hash = compare_hash(self.attributes,hash)
super(hash)
end
end
|
require 'test_helper'
describe Rack::PrxAuth do
let(:app) { Proc.new {|env| env } }
let(:prxauth) { Rack::PrxAuth.new(app) }
let(:fake_token) { 'afawefawefawefawegstgnsrtiohnlijblublwjnvrtoign'}
let(:env) { {'HTTP_AUTHORIZATION' => 'Bearer ' + fake_token } }
let(:iat) { Time.now.to_i }
let(:exp) { 3600 }
let(:claims) { {'sub'=>3, 'exp'=>exp, 'iat'=>iat, 'token_type'=>'bearer', 'scope'=>nil, 'iss'=>'id.prx.org'} }
describe '#call' do
it 'does nothing if there is no authorization header' do
env = {}
assert prxauth.call(env.clone) == env
end
it 'does nothing if the token is from another issuer' do
claims['iss'] = 'auth.elsewhere.org'
JSON::JWT.stub(:decode, claims) do
assert prxauth.call(env.clone) == env
end
end
it 'does nothing if token is invalid' do
assert prxauth.call(env.clone) == env
end
it 'does nothing if the token is nil' do
env = { "HTTP_AUTHORIZATION" => "Bearer "}
assert prxauth.call(env) == env
end
it 'returns 401 if verification fails' do
auth_validator = prxauth.build_auth_validator('sometoken')
JSON::JWT.stub(:decode, claims) do
prxauth.stub(:build_auth_validator, auth_validator) do
auth_validator.stub(:valid?, false) do
assert prxauth.call(env) == Rack::PrxAuth::INVALID_TOKEN
end
end
end
end
it 'returns 401 if access token has expired' do
auth_validator = prxauth.build_auth_validator('sometoken')
JSON::JWT.stub(:decode, claims) do
prxauth.stub(:build_auth_validator, auth_validator) do
auth_validator.stub(:expired?, true) do
assert prxauth.call(env) == Rack::PrxAuth::INVALID_TOKEN
end
end
end
end
it 'attaches claims to request params if verification passes' do
auth_validator = prxauth.build_auth_validator('sometoken')
JSON::JWT.stub(:decode, claims) do
prxauth.stub(:build_auth_validator, auth_validator) do
prxauth.call(env)['prx.auth'].tap do |token|
assert token.instance_of? Rack::PrxAuth::TokenData
assert token.user_id == claims['sub']
end
end
end
end
end
describe 'initialize' do
it 'takes a certificate location as an option' do
loc = nil
Rack::PrxAuth::Certificate.stub(:new, Proc.new{|l| loc = l}) do
Rack::PrxAuth.new(app, cert_location: :location)
assert loc == :location
end
end
end
end
|
require 'spec_helper'
describe Tapir::Reports::Template do
context 'given an object attribute tag' do
let(:content) { '<%= @foo.bar %>' }
it 'should output Twitter Bootstrapped erb (for displaying as a preview)' do
expect(Tapir::Reports::Template.to_bootstrap_erb(content)).to eq('<%= @foo.bar %>')
end
end
context 'given a Word template' do
let(:template) { Tapir::Reports::Template.new(fixture('products.docx')) }
it 'should output Twitter Bootstrapped erb (for displaying as a preview)' do
html_erb = Tapir::Reports::Template.to_bootstrap_erb(template.contents)
# File.write('doc.html.erb', html_erb.force_encoding('UTF-8')) # for debug purposes
expect(html_erb).to include('<link href="https://cdn.jsdelivr.net/npm/bootstrap')
end
end
end
|
class TuristicPoint < ActiveRecord::Base
include Visitavel
belongs_to :pais
belongs_to :estado
belongs_to :cidade
#Galleria
has_many :turistic_point_galleries
accepts_nested_attributes_for :turistic_point_galleries
#Validação
validates :nome, presence: true
validates :pais, presence: true
validates :estado, presence: true
validates :cidade, presence: true
validates :rua, presence: true
end
|
class MetabolicRatesController < ApplicationController
layout 'tracking'
before_filter :authenticate_user!
def edit
@user = current_user
end
def update
if current_user.birthdate.blank?
redirect_to(user_edit_personal_info_path(current_user), :alert => 'Please set your birthdate first, we need it to perform your BMR/RMR calculations of your goal.') and return
elsif params[:user][:activity_level].blank?
redirect_to(edit_metabolic_rates_path, :alert => 'Please select your level of activity.') and return
end
if params[:user][:desired_weight].to_i >= current_user.weight
flash.now[:warning] = 'We currently only calculate for weight lose, please choose a desired weight lower than your current weight'
render(:action => :edit) and return
end
current_user.attributes = params[:user]
current_user.calculate_metabolic_rates
if current_user.save
redirect_to user_path(current_user), :notice => 'Your goal has been saved.'
else
render :action => :edit
end
end
end
|
class SemanticalPhase
@@operators = ['StartSym', 'PlusOp', 'MinusOp', 'MultiplyOp', 'DivideOp',
'NegOp', 'LParen', 'RParen', 'AssignOp', 'SemiColon', 'Comma']
@@comparison_operators = ['EqSym', 'NotEqSym', 'LsSym', 'LsEqSym',
'GrSym', 'GrEqSym']
def initialize(sem_path, lis_path, lexemes, atoms,
symbol_table, int_literal_table)
@lis_path = lis_path
@sem_path = sem_path
@labels = []
@lexemes = []
@atoms = atoms
@label_num = 0
@temp_num = 0
@symbol_table = symbol_table
@int_literal_table = int_literal_table
divide_lexemes_into_statements(lexemes)
end
def run
@lexemes.each do |line|
evaluate_expression(line)
end
message = 'Semantical phase successful - .sem file generated'
write_sem
write_lis(message)
puts(message)
end
private
# push all the lexemes for a single line statement
# onto the @lexemes stack
def divide_lexemes_into_statements(lexemes)
statement = []
lexemes.each do |lexeme|
if ['@', 'BeginSym', 'EndSym', 'EofSym'].member?(lexeme)
if !statement.empty?
@lexemes.push(statement)
statement = []
end
else
statement.push(lexeme)
end
end
end
# evaluate_expression will return either nil,
# or the name of a variable
def evaluate_expression(lexemes)
lexeme = lexemes.first.split('_').first
return if !lexeme
if lexeme == 'ReadSym'
return read_expression(lexemes)
elsif lexeme == 'WriteSym'
return write_expression(lexemes)
elsif lexeme == 'IfSym'
return if_expression(lexemes)
elsif lexeme == 'ElseSym'
label_atom = ['Lbl', pop_next_label]
branch_atom = ['Br', push_next_label]
@atoms.push(branch_atom)
@atoms.push(label_atom)
elsif lexeme == 'EndIfSym'
@atoms.push(['Lbl', pop_next_label])
elsif lexeme == 'WhileSym'
return while_expression(lexemes)
elsif lexeme == 'EndLoopSym'
@atoms.push(['Br', pop_next_label])
@atoms.push(['Lbl', pop_next_label])
elsif lexeme == 'Id'
return id_expression(lexemes)
elsif lexeme == 'IntLiteral'
return int_literal_expression(lexemes)
else
return polishize(lexemes)
end
end
def read_expression(lexemes)
lexemes.each do |lexeme|
first = lexeme.split('_').first
if (first == 'Id' || first == 'IntLiteral')
atom = ['ReadSym', get_lexeme_value(lexeme)]
@atoms.push(atom)
end
end
end
def write_expression(lexemes)
statement = []
# Reverse lexemes so we can pop off the
# lexemes from the beginning of the string.
lexemes.reverse!
# Get rid of WriteSym
lexemes.pop
# Get rid of LParen
lexemes.pop
while lexeme = lexemes.pop
statement.push(lexeme) if lexeme != 'SemiColon'
if lexeme == 'Comma' || lexeme == 'SemiColon'
atom = ['WriteSym', evaluate_expression(statement)]
@atoms.push(atom)
statement = []
end
end
end
def if_expression(lexemes)
statement = []
test_atom = ['Tst']
comparison_operator = ''
lexemes.reverse!
# Get rid of IfSym
lexemes.pop
# Get rid of LParen
lexemes.pop
while lexeme = lexemes.pop
if lexeme == 'ThenSym'
test_atom.push(evaluate_expression(statement))
break
elsif @@comparison_operators.include?(lexeme)
statement.push('Comma')
test_atom.push(evaluate_expression(statement))
statement = []
comparison_operator = lexeme
else
statement.push(lexeme)
end
end
test_atom.push(comparison_operator)
test_atom.push(push_next_label)
@atoms.push(test_atom)
end
def while_expression(lexemes)
statement = []
test_atom = ['Tst']
comparison_operator = ''
lexemes.reverse!
# Get rid of WhileSym
lexemes.pop
# Get rid of LParen
lexemes.pop
while lexeme = lexemes.pop
if lexeme == 'LoopSym'
test_atom.push(evaluate_expression(statement))
break
elsif @@comparison_operators.include?(lexeme)
statement.push('Comma')
test_atom.push(evaluate_expression(statement))
statement = []
comparison_operator = lexeme
else
statement.push(lexeme)
end
end
test_atom.push(comparison_operator)
test_atom.push(push_next_label)
@atoms.push(['Lbl', push_next_label])
@atoms.push(test_atom)
end
# If this expression is just a single Id,
# possibly followed by a Comma or RParen,
# just return the Id.
# Otherwise, polishize the lexemes.
def id_expression(lexemes)
return get_lexeme_value(lexemes.first) if lexemes.length <= 2
return polishize(lexemes)
end
# If this expression is just a single IntLiteral,
# possibly followed by a Comma or RParen,
# just return the IntLiteral.
# Otherwise, polishize the lexemes.
def int_literal_expression(lexemes)
return get_lexeme_value(lexemes.first) if lexemes.length <= 2
return polishize(lexemes)
end
# This method will order a statement
# into Reverse Polish Notation
def polishize(lexemes)
operators = []
operands = []
operators.push('StartSym')
lexemes.reverse!
while lexeme = lexemes.pop
if @@operators.member?(lexeme)
compare_precedence(lexeme, operators, operands)
else
operands.push(lexeme)
end
end
return atomize(operands)
end
def compare_precedence(lexeme, operators, operands)
precedence = PrecedenceTable.compare(lexeme, operators.last)
if precedence.less_than?
operators.push(lexeme)
elsif precedence.greater_than?
operator = operators.pop
operands.push(operator)
compare_precedence(lexeme, operators, operands)
elsif precedence.erase?
operators.pop
end
end
# This method takes a collection of lexemes
# in Reverse Polish Notation, and creates atoms
def atomize(lexemes)
while lexemes.length > 1
lexemes.each_index do |i|
lexeme = lexemes[i]
if @@operators.member?(lexeme)
if lexeme == 'AssignOp'
lexeme = lexemes.delete_at(i)
operand = lexemes.delete_at(i - 1)
id = lexemes.delete_at(i - 2)
atom = [lexeme, get_lexeme_value(id),
get_lexeme_value(operand)]
@atoms.push(atom)
break
elsif lexeme == 'NegOp'
temp = get_next_temp
@int_literal_table.push('0') if !@int_literal_table.include?('0')
zero = "IntLiteral_#{@int_literal_table.index('0')}"
lexemes[i] = temp
operand = lexemes.delete_at(i - 1)
atom = ['MinusOp', temp, get_lexeme_value(zero),
get_lexeme_value(operand)]
@atoms.push(atom)
break
else
temp = get_next_temp
lexemes[i] = temp
operand2 = lexemes.delete_at(i - 1)
operand1 = lexemes.delete_at(i - 2)
atom = [lexeme, temp, get_lexeme_value(operand1),
get_lexeme_value(operand2)]
@atoms.push(atom)
break
end
end
end
end
# return the last Identifier
return @atoms.last[1]
end
# If the lexeme is an Id, return the Id stored in the symbol table.
# If the lexeme is an IntLiteral, return symbol to reference int.
# Otherwise, just return the lexeme.
def get_lexeme_value(lexeme)
token, value = lexeme.split('_')
if token == 'Id'
return @symbol_table[value.to_i]
elsif token == 'IntLiteral'
return "_int#{value}"
else
return lexeme
end
end
def get_next_temp
temp = "_temp#{@temp_num}"
@temp_num = @temp_num.next
return temp
end
# This will create a new label, push it onto the @labels stack,
# and return the label
def push_next_label
label = "lbl#{@label_num}"
@label_num = @label_num.next
@labels.push(label)
return label
end
# This will pop the first label off the stack, and return it as an atom
def pop_next_label
return @labels.pop
end
def write_sem
File.open(@sem_path, "w") do |sem|
@atoms.each {|atom| sem.puts(atom.join(','))}
end
end
def write_lis(message)
File.open(@lis_path, "a") do |file|
file.puts(message)
end
end
end |
# frozen_string_literal: true
require_relative 'mixins/command'
# select-pane (alias: selectp)
# [-DdeLlMmRUZ]
# [-T title] [-t target-pane]
module Build
module Util
class Tmux
module SelectPane
include Mixins::Command
aka :selectp
switch D: :below
switch d: :disable_input
switch e: :enable_input
switch L: :left
switch l: :last_pane
switch M: :clear_marked_pane
switch m: :set_marked_pane
switch R: :right
switch U: :above
switch Z: :zoom
flag T: :title
flag t: :target_pane
end
end
end
end
|
class AccountController < ApplicationController
before_filter :build, :except=>'index'
require 'account' #Explicit include of model because we use derived classes
#so autoloader gets confused cos I didn't make each one its own file
def graph
case @code
when false
else
@basex=8
@basey=4
end
end
def report
end
def index
#list available accounts
@accounts=PertainingCategory.available_categories.
concat(DirectCategory.available_categories).
concat(JiraAccount.available_issues).
concat([
EverythingAccount.new,
SourcesAccount.new
])
end
private
def build
if params[:account]
@account=RawAccount.new(account)
elsif params[:everything]
@account=EverythingAccount.new
elsif params[:sources]
@account=EverythingAccount.new
elsif params[:allpath]
@account=PertainingCategory.new(params[:allpath])
elsif params[:textpath]
@account=DirectCategory.new(params[:textpath])
elsif params[:project]
@account=JiraAccount.new(params[:project],params[:issue])
else
raise "Invalid route"
end
@code=@account.code
@label=@account.label
#lossy encoding as partial names must be valid variable names
end
end
|
class UsersController < ApplicationController
before_filter :authenticate_user!
before_filter :verify_is_admin
def index
if params[:approved] == "false"
@users = User.find_all_by_approved(false)
else
@users = User.find(:all, :conditions => ["id != 1"])
end
end
def approve
@user = User.find(params[:id])
@user.toggle!(:approved)
UserMailer.signup_confirmation(@user).deliver
redirect_to users_path, :action => "index", :approved => "false", notice: "#{@user.email} has been approved, and an email sent."
end
def make_admin
user = User.find(params[:id])
user.toggle!(:admin)
redirect_to users_path
flash[:sucess] = "#{user.name} has been updated"
end
def destroy
user = User.find(params[:id])
if (user.admin?)
flash[:error] = "You cannot delete an Administrator!"
else
user.destroy
flash[:success] = "User destroyed. Name: #{user.name}"
end
redirect_to users_path
end
private
def verify_is_admin
(current_user.nil?) ? redirect_to(root_path) : (redirect_to(root_path, notice: "You do not have the priviledges to proceed") unless current_user.admin?)
end
end |
require 'rails_helper'
RSpec.describe ProfileSocial, type: :model do
it {should belong_to(:profile)}
it {should belong_to(:social_type)}
it {should validate_presence_of(:profile)}
it {should validate_presence_of(:social_type)}
it {should validate_presence_of(:link)}
end
|
require 'station'
describe Station do
context 'station returns expected attributes' do
before (:each) do
@subject = Station.new("Baker Street", 1)
end
it 'returns Baker Street when asked for station name' do
expect(@subject.name).to eq("Baker Street")
end
it 'returns 1 when asked for a zone' do
expect(@subject.zone).to eq(1)
end
end
end
|
class AddOptionToImageFiles < ActiveRecord::Migration[5.0]
def change
change_column :image_files, :file, :text, null: false
change_column :image_files, :about_file, :text, null: false
change_column :image_files, :status, :integer, null: false
end
end
|
class JobType < ActiveRecord::Base
has_and_belongs_to_many :requirements
end
|
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
Offer.__elasticsearch__.create_index!(force: true)
user = User.create(email: 'user@justcars.pl', password: 'justcars123')
image_base_64 = <<-BASE64
data:image/jpeg;base64,/9j/4iN8SUNDX1BST0ZJTEUAAQEAACNsbGNtcwIQAABtbnRyUkdCIFhZWiAH4gAKAAUAEAAnAC5hY3NwTVNGVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5kZXNjAAABLAAAAHRjcHJ0AAABoAAAABd3dHB0AAABuAAAABRjaGFkAAABzAAAACxyWFlaAAAB+AAAABRiWFlaAAACDAAAABRnWFlaAAACIAAAABRyVFJDAAACNAAAIAxnVFJDAAACNAAAIAxiVFJDAAACNAAAIAxjaHJtAAAiQAAAACRkbW5kAAAiZAAAAIBkbWRkAAAi5AAAAHRia3B0AAAjWAAAABRkZXNjAAAAAAAAAAhzUkdCAAAAAAAAAAAAAAAJAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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1mNJOkFsSN4J8QW5YcH/hggyGOJSCx3epxmMxyz3OqIA1LhQrhXu1r25wH30iQRbBYm1xxjMZjMroHsVK7igJ5H1xiko21CQ7sF3Dy+mMxmBACMhCyByWjhJ8F/ib1J88GNPteBQg7ycC8nmo6WAxmMxot0hUZxJBJK6+GAhVQcA38z6nAWXyu3eONzvfr8sZjMPuEtwmV3ew3WUEqoA6DFhdlui6LUFHqXP80d5o9PwxPFSW8MskhNmZvRdt7W5NueMZjMdfARU+KgpK9Th4+csfDNxdO0vfJJ/AgWcZ/WamzJ6/MpC8syggeSIAdqD5D+ZOEXvEiuSSC3S9vK9sZjMcLnKbc5O2z0VFR9VLRG5ZSsvdgDbEtwLdTe2ANM+0yFrs+65OMxmKYlsEmXfI11FkHAHn0wFhsQEEnvL3v1sDjMZiB9TYlC2AXhRa18J1dmXr8V7+d8ZjMUILmclwDzYWF/IYNqIu5p6NVbwy+NwONx+eMxmHHr99xL3QS7s7O3ALH0vgoOz92jG4W5H8f5YzGYEyjHm20NSxUl3ded3QdcLM8LQ19PA2zuo6OJolRAm0Moa3z5J5PJxmMx0Nvkr2ebMv71+vkM3esB5dbdMbMh3C/JI6+nGMxmMEjQAGvDYjkG/XAb3lYeR4tjMZiBgC5CC3rjTElm+l8ZjMAj/9k=
BASE64
offer = user.offers.create(
title: 'BMW 320i g20',
description: 'new bmw 3 series, model g20 M Sport is awesome',
price: 230500
)
offer.image.attach(data: image_base_64)
offer.save
|
class ChangeNotesTypeInTmk < ActiveRecord::Migration[4.2]
def change
change_column :tmks, :notes, :text
end
end
|
# frozen_string_literal: true
# rubocop:todo all
# Copyright (C) 2014-2020 MongoDB Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module Mongo
module Auth
class X509
# Defines behavior around a single X.509 conversation between the
# client and server.
#
# @since 2.0.0
# @api private
class Conversation < ConversationBase
# The login message.
#
# @since 2.0.0
LOGIN = { authenticate: 1, mechanism: X509::MECHANISM }.freeze
# Start the X.509 conversation. This returns the first message that
# needs to be sent to the server.
#
# @param [ Server::Connection ] connection The connection being
# authenticated.
#
# @return [ Protocol::Message ] The first X.509 conversation message.
#
# @since 2.0.0
def start(connection)
validate_external_auth_source
selector = client_first_document
build_message(connection, '$external', selector)
end
# Returns the hash to provide to the server in the handshake
# as value of the speculativeAuthenticate key.
#
# If the auth mechanism does not support speculative authentication,
# this method returns nil.
#
# @return [ Hash | nil ] Speculative authentication document.
def speculative_auth_document
client_first_document
end
private
def client_first_document
LOGIN.dup.tap do |payload|
payload[:user] = user.name if user.name
end
end
end
end
end
end
|
Rails.application.routes.draw do
devise_for :users
resources :entries do
resources :comments
end
root 'entries#index'
get '/list', to: "entries#list"
namespace :api do
resources :entries, path: 'news' do
resources :comments
end
end
end
|
class FinancialYear
include Comparable
class InvalidYear < StandardError; end
attr_reader :start_year, :end_year
def initialize(start_year)
@start_year = DateTime.strptime(start_year.to_s, "%Y").year
@end_year = @start_year + 1
rescue ArgumentError
raise InvalidYear
end
class << self
def for_date(date)
if [1, 2, 3].include?(date.month)
new(date.year - 1)
else
new(date.year)
end
end
def next_ten
this_financial_year = for_date(Date.today).to_i
tenth_year = this_financial_year + 9
(this_financial_year..tenth_year).map { |year| new(year) }
end
def previous_ten
this_financial_year = for_date(Date.today).to_i
first_year = this_financial_year - 9
(first_year..this_financial_year).map { |year| new(year) }
end
def from_twenty_ten_to_ten_years_ahead
twenty_ten = for_date(Date.parse("2011-01-01")).to_i
ten_years_ahead = for_date(Date.today).to_i + 9
(twenty_ten..ten_years_ahead).map { |year| new(year) }
end
end
def <=>(other)
start_year <=> other.start_year
end
def ==(other)
start_year == other.start_year
end
def start_date
Date.new(start_year, 4, 1)
end
def end_date
Date.new(end_year, 3, 31)
end
def to_i
start_year
end
def to_s
[start_year, end_year].join("-")
end
def quarters
FinancialQuarter::QUARTERS.map { |q| FinancialQuarter.new(start_year, q) }
end
def pred
FinancialYear.new(start_year - 1)
end
def succ
FinancialYear.new(start_year + 1)
end
end
|
class MP3Importer
attr_accessor :path, :file
def initialize(path)
@path = path
@file = file
end
def files
Dir.chdir(@path) {| path | Dir.glob("*.mp3")}
# Dir.entries(path).each {|filename| @file_names << "#{filename}"}
end
def import
self.files.each {|filename| Song.new_by_filename(filename)}
end
end
|
require 'test_helper'
class SupervisortsControllerTest < ActionDispatch::IntegrationTest
setup do
@supervisort = supervisorts(:one)
end
test "should get index" do
get supervisorts_url
assert_response :success
end
test "should get new" do
get new_supervisort_url
assert_response :success
end
test "should create supervisort" do
assert_difference('Supervisort.count') do
post supervisorts_url, params: { supervisort: { apellido: @supervisort.apellido, cedula: @supervisort.cedula, nombre: @supervisort.nombre, telefono: @supervisort.telefono } }
end
assert_redirected_to supervisort_url(Supervisort.last)
end
test "should show supervisort" do
get supervisort_url(@supervisort)
assert_response :success
end
test "should get edit" do
get edit_supervisort_url(@supervisort)
assert_response :success
end
test "should update supervisort" do
patch supervisort_url(@supervisort), params: { supervisort: { apellido: @supervisort.apellido, cedula: @supervisort.cedula, nombre: @supervisort.nombre, telefono: @supervisort.telefono } }
assert_redirected_to supervisort_url(@supervisort)
end
test "should destroy supervisort" do
assert_difference('Supervisort.count', -1) do
delete supervisort_url(@supervisort)
end
assert_redirected_to supervisorts_url
end
end
|
# frozen_string_literal: true
(1..99).each { |number| puts number, ' ' if number.even? }
|
class AddTimestapsToTmpgImpressions < ActiveRecord::Migration
def change_table
add_column(:tmpg_impressions, :created_at, :datetime)
add_column(:tmpg_impressions, :updated_at, :datetime)
end
end
|
class MessagesController < ApplicationController
before_action :signed_in?, only: :create
def create
@post = Post.find_by id: params[:post_id]
user = photographer_signed_in? ? current_photographer : current_customer
unless (@post.customer.eql?(user) || @post.photographer.eql?(user))
flash[:alert] = t ".no_permission"
redirect_to root_path
else
@msg = Message.new post: @post, content: params[:message][:content]
user.messages << @msg
end
end
private
def signed_in?
unless photographer_signed_in? || customer_signed_in?
flash[:alert] = t ".must_login"
redirect_to root_path
end
end
def render_message message
self.render partial: "messages/message", locals: {message: message}
end
end
|
module Workflow
module Concerns
module DynamicAnnotationFieldConcern
DynamicAnnotation::Field.class_eval do
attr_accessor :previous_status
before_validation :normalize_workflow_status
validate :workflow_status_is_valid
validate :can_set_workflow_status, unless: proc { |x| x.skip_check_ability }
def previous_value
self.will_save_change_to_value? ? self.value_was : self.value
end
def status
self.value if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
end
def index_on_es_background
obj = self&.annotation&.annotated
if !obj.nil? && obj.class.name == 'ProjectMedia'
updated_at = Time.now
# Update PG
obj.update_columns(updated_at: updated_at)
data = {
self.annotation_type => { method: 'value', klass: self.class.name, id: self.id },
'updated_at' => updated_at.utc
}
self.update_elasticsearch_doc(data.keys, data, obj.id)
end
end
def index_on_es_foreground
return if self.disable_es_callbacks || RequestStore.store[:disable_es_callbacks]
obj = self&.annotation&.annotated
if !obj.nil? && obj.class.name == 'ProjectMedia'
updated_at = Time.now
obj.update_columns(updated_at: updated_at)
options = {
keys: [self.annotation_type, 'updated_at'],
data: { self.annotation_type => self.value, 'updated_at' => updated_at.utc },
pm_id: obj.id,
doc_id: Base64.encode64("#{obj.class.name}/#{obj.id}")
}
self.update_elasticsearch_doc_bg(options)
end
end
::Workflow::Workflow.workflow_ids.each do |id|
define_method "field_formatter_name_#{id}_status" do
value = nil
self.workflow_options[:statuses].each do |option|
value = option[:label] if option[:id] == self.value
end
value || begin self.value.titleize rescue nil end
end
end
def workflow_options
if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
annotated = self.annotation.annotated
annotation_type = self.annotation.annotation_type
::Workflow::Workflow.options(annotated, annotation_type)
end
end
def workflow_options_and_roles
if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
options_and_roles = {}
self.workflow_options[:statuses].each do |option|
options_and_roles[option[:id]] = option[:role]
end
options_and_roles.with_indifferent_access
end
end
def workflow_options_from_key(key)
statuses = self.workflow_options[:statuses]
statuses.collect{ |s| s[:id] } if key == :any
end
protected
def cant_change_status(user, options, from_status, to_status)
!user.nil? && !options[to_status].blank? && !user.is_admin? && (!user.role?(options[to_status]) || !user.role?(options[from_status]))
end
def call_workflow_action(field_name, params)
transition = (params.has_key?(:from) && params.has_key?(:to))
if self.field_name == field_name && params[:if].call && self.valid_workflow_transition?(transition, params[:from], params[:to])
self.send(params[:action])
end
end
def valid_workflow_transition?(transition, from, to)
!transition || (self.previous_status.to_s != self.value.to_s && self.workflow_transition_applies?(from, to))
end
def workflow_transition_applies?(from, to)
from = self.workflow_options_from_key(from)
to = self.workflow_options_from_key(to)
to.include?(self.value.to_s) && from.include?(self.previous_status.to_s)
end
private
def normalize_workflow_status
if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
self.value = self.value.tr(' ', '_').downcase unless self.value.blank?
end
end
def workflow_status_is_valid
if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
options = self.workflow_options_and_roles
value = self.value.to_s
valid = options.keys.map(&:to_s)
errors.add(:base, I18n.t(:workflow_status_is_not_valid, status: value, valid: valid.join(', '))) unless valid.include?(value)
end
end
def can_set_workflow_status
if ::Workflow::Workflow.is_field_name_a_workflow?(self.field_name)
options = self.workflow_options_and_roles
value = self.value&.to_sym
old_value = self.previous_value&.to_sym
self.previous_status = old_value
user = User.current
if self.cant_change_status(user, options, old_value, value)
errors.add(:base, I18n.t(:workflow_status_permission_error))
end
end
end
end # DynamicAnnotation::Field.class_eval
end
end
end
|
# frozen_string_literal: true
module RakutenWebService
class Recipe < Resource
def self.large_categories
categories('large')
end
def self.medium_categories
categories('medium')
end
def self.small_categories
categories('small')
end
def self.categories(category_type)
@categories ||= {}
@categories[category_type] ||= Category.search(category_type: category_type).response['result'][category_type].map do |category|
Category.new(category.merge(categoryType: category_type))
end
end
class << self
protected :search
end
class Category < Resource
endpoint 'https://app.rakuten.co.jp/services/api/Recipe/CategoryList/20170426'
attribute :categoryId, :categoryName, :categoryUrl, :parentCategoryId, :categoryType
def ranking
Recipe.ranking(absolute_category_id)
end
def parent_category
return nil if parent_category_type.nil?
Recipe.categories(parent_category_type).find do |c|
c.id.to_i == parent_category_id.to_i
end
end
def absolute_category_id
if parent_category
[parent_category.absolute_category_id, id.to_s].join('-')
else
id.to_s
end
end
private
def parent_category_type
case type
when 'small' then 'medium'
when 'medium' then 'large'
end
end
end
end
end
|
module YelpAPI
API_HOST = "https://api.yelp.com"
SEARCH_PATH = "/v3/businesses/search"
BUSINESS_PATH = "/v3/businesses/" # trailing / because we append the business id to the path
TOKEN_PATH = "/oauth2/token"
GRANT_TYPE = "client_credentials"
SEARCH_LIMIT = 20
def self.test(location, term)
url = "#{API_HOST}#{SEARCH_PATH}"
params = set_params({term: term, location: location})
response = HTTP.auth(bearer_token).get(url, params: params)
response.parse
end
def self.set_params(params)
params = {
term: params[:term],
location: params[:location],
limit: SEARCH_LIMIT, # The search return max is 50
}
end
def self.bearer_token
url = "#{API_HOST}#{TOKEN_PATH}"
params = {
client_id: ENV["yelp_id"],
client_secret: ENV["yelp_secret"],
grant_type: GRANT_TYPE
}
response = HTTP.post(url, params: params)
parsed = response.parse
"#{parsed['token_type']} #{parsed['access_token']}"
# byebug
end
end
|
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "pebblebed/version"
Gem::Specification.new do |s|
s.name = "pebblebed"
s.version = Pebblebed::VERSION
s.authors = ["Katrina Owen", "Simen Svale Skogsrud"]
s.email = ["katrina@bengler.no", "simen@bengler.no"]
s.homepage = ""
s.summary = %q{Development tools for working with Pebblebed}
s.description = %q{Development tools for working with Pebblebed}
s.rubyforge_project = "pebblebed"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
# specify any dependencies here; for example:
s.add_development_dependency "rspec", "~> 2.99"
s.add_development_dependency "rake"
s.add_development_dependency "simplecov"
s.add_development_dependency "sinatra" # for testing purposes
s.add_development_dependency "rack-test" # for testing purposes
s.add_development_dependency "memcache_mock"
s.add_development_dependency "webmock"
s.add_runtime_dependency "deepstruct", ">= 0.0.4"
s.add_runtime_dependency "excon", ">= 0.52.0"
s.add_runtime_dependency "addressable"
s.add_runtime_dependency "yajl-ruby"
s.add_runtime_dependency "queryparams"
s.add_runtime_dependency "futurevalue"
s.add_runtime_dependency "pathbuilder"
s.add_runtime_dependency "nokogiri"
s.add_runtime_dependency 'activesupport'
s.add_runtime_dependency 'bunny'
s.add_runtime_dependency 'absolute_time'
end
|
class PublisherAuthorizer < ApplicationAuthorizer
# Users can view all publishers
def self.readable_by?(user)
true
end
# Users can create publishers if they are admins
def self.creatable_by?(user)
user.has_role? :admin
end
# Users can edit publishers if they are admins
def self.updatable_by?(user)
user.has_role? :admin
end
# Users can delete publishers if they are admins
def self.deletable_by?(user)
user.has_role? :admin
end
# Users cannot do anything else
def self.default(able, user)
false
end
end |
class DropSuppliersTableIfExists < ActiveRecord::Migration
def change
drop_table :suppliers if table_exists? :suppliers
end
end
|
#! /usr/bin/env ruby
#
# Check Graphite Thresholds
# ===
#
# This is a Sensu plugin to check Graphite Thresholds.
#
#
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/check/cli'
require 'sensu-plugin/utils'
require 'json'
require 'open-uri'
require 'openssl'
require 'cgi'
class CheckGraphiteThresholds < Sensu::Plugin::Check::CLI
include Sensu::Plugin::Utils
COMPARISON_FUNCTIONS = {
:greaterThan => lambda { |a, b| a > b },
:lowerThan => lambda { |a, b| a < b }
}
option :help,
:description => 'Show this message',
:short => '-h',
:long => '--help'
option :services,
:short => '-c service1,service2,serviceN',
:required => true
def run
if config[:help]
puts opt_parser if config[:help]
exit
end
unless settings['graphite_url']
puts "Graphite configuration is missing."
exit
end
services = parse_services_argument config[:services]
services_thresholds = services.map { |service| settings['thresholds'][service] }
results = services_thresholds.map { |service_thresholds|
check_service_thresholds service_thresholds
}.flatten.compact.sort { |a, b| a[:severity] <=> b[:severity] }
unless results.empty?
global_severity = nil
if results.any? { |result| result[:severity].eql?(:critical) }
global_severity = :critical
else
global_severity = :warning
end
global_message = "#{results.length} Alerts: \n #{results.map { |result| "- #{result[:message]}" }.join(" \n ")}"
send(global_severity, global_message)
else
ok("Everything is okay")
end
end
private
def parse_services_argument services_arg
(services_arg && services_arg.split(',')) || []
end
def check_service_thresholds service_thresholds
service_thresholds.map { |threshold|
check_threshold threshold
}.flatten.compact
end
def check_threshold threshold
graphite_values = retrieve_graphite_values threshold['target']
graphite_values.map { |graphite_value|
datapoint = graphite_value[:datapoint]
severity = check_datapoint_threshold datapoint, threshold
{
:severity => severity,
:message => "#{severity.upcase}: '#{threshold['name']}' has reached #{severity} threshold (value=#{datapoint}, target=#{graphite_value[:target]})"
} if severity
}.compact
end
def check_datapoint_threshold datapoint, threshold
if check_datapoint_threshold_by_severity datapoint, threshold, 'critical'
:critical
elsif check_datapoint_threshold_by_severity datapoint, threshold, 'warning'
:warning
end
end
def check_datapoint_threshold_by_severity datapoint, threshold, severity
if threshold[severity]
threshold[severity].each do |key, value|
return true if COMPARISON_FUNCTIONS[key.to_sym][datapoint, value]
end
end
false
end
def retrieve_graphite_values target
begin
url = "#{settings['graphite_url']}/render?format=json&target=#{CGI::escape(target)}&from=-5mins"
raw_data = open(url, { ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE }).gets
if raw_data == '[]'
unknown 'Empty data received from Graphite - metric probably doesn\'t exists.'
else
json_data = JSON.parse(raw_data)
json_data.map { |raw|
raw['datapoints'].delete_if { |v| v.first.nil? }
next if raw['datapoints'].empty?
{
:target => raw['target'],
:datapoint => raw['datapoints'].map(&:first).first,
:start => raw['datapoints'].first.last,
:end => raw['datapoints'].last.last
}
}.compact
end
rescue OpenURI::HTTPError => e
unknown 'Failed to connect to graphite server'
end
end
def build_url_opts
url_opts = {}
if config[:no_ssl_verify]
url_opts[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
end
url_opts
end
end |
require 'scorched_earth/helpers'
module ScorchedEarth
module Services
class Deform
include Helpers
attr_reader :array
def initialize(array)
@array = array
end
def call(center_x, radius, center_y = array[center_x])
new_array = array.dup
circle(radius) do |offset_x, offset_y|
x = center_x + offset_x
y = array[x]
next unless y
z = offset_y * 2
q = center_y - offset_y
q = y if q > y
new_array[x] = [y - z, q, 0].max
end
new_array
end
end
end
end
|
# your code goes here
# #begins_with_r
# Return true if every element of the tools array starts with an "r" and false otherwise. (FAILED - 1)
# should return false if there's an element that does not begin with r (FAILED - 2)
def begins_with_r(tools)
counter = 0
tools.each do |data|
counter +=1 if data[0].downcase == 'r'
end
counter == tools.size ? true : false
end
# #contain_a
# return all elements that contain the letter 'a' (FAILED - 3)
def contain_a(array)
has_a = []
array.each do |word|
has_a << word if word.include?('a')
end
has_a
end
# #first_wa
# Return the first element that begins with the letters 'wa' (FAILED - 4)
def first_wa(array)
array.each do |word|
temp = word.to_s
return temp if temp.start_with?("wa")
end
end
# #remove_non_strings
# remove anything that's not a string from an array (FAILED - 5)
def remove_non_strings (array)
temp = []
array.each do |data|
if data.class == String
temp << data
end
end
temp
end
#count_elements
# count how many times something appears in an array (FAILED - 1)
def count_elements (array)
result_array = []
array.each do |data|
flag =0
result_array.each do |k|
if k[:name] == data[:name]
k[:count] +=1
flag =1
end
end
if(flag == 0)
data[:count] = 1
result_array << data
end
end
result_array
end
# keys =
# [
# {
# :first_name => "blake"
# },
# {
# :first_name => "ashley"
# }
# ]
#
#
# data =
# [
# {
# "blake" => {
# :awesomeness => 10,
# :height => "74",
# :last_name => "johnson"
# },
# "ashley" => {
# :awesomeness => 9,
# :height => 60,
# :last_name => "dubs"
# }
# }
# ]
# #merge_data
# combines two nested data structures into one (FAILED - 2)
def merge_data(k,v)
merged = []
k.each do |name|
v.each do |data|
# puts "keys #{data.keys} + #{name[:first_name]}"
# puts data[name[:first_name]]
temp = data[name[:first_name]]
merged << name.merge(temp)
end #v
end #k
merged
end
# puts merge_data(keys,data)
# #find_cool
# find all cool hashes (FAILED - 3)
def find_cool(cool)
ans = []
cool.each do |data|
ans << data if data[:temperature] == "cool"
end
ans
end
# #organize_schools
# organizes the schools by location (FAILED - 4)
def organize_schools (schools)
ans = {}
schools.each do |key,data|
if ans.keys.include?(data[:location])
ans[data[:location]] << key
else
ans[data[:location]] = []
ans[data[:location]] << key
end
end #schools
ans
end
|
module ETL #:nodoc:
module Processor #:nodoc:
# Row-level processor that will convert a single row into multiple rows designed to be inserted
# into a hierarchy bridge table.
class HierarchyExploderProcessor < ETL::Processor::RowProcessor
attr_accessor :id_field
attr_accessor :parent_id_field
# Initialize the processor
#
# Configuration options:
# * <tt>:connection</tt>: The ActiveRecord adapter connection
# * <tt>:id_field</tt>: The name of the id field (defaults to 'id')
# * <tt>:parent_id_field</tt>: The name of the parent id field (defaults to 'parent_id')
#
# TODO: Allow resolver to be implemented in a customizable fashion, i.e. don't rely
# on AR as the only resolution method.
def initialize(control, configuration={})
@id_field = configuration[:id_field] || 'id'
@parent_id_field = configuration[:parent_id_field] || 'parent_id'
super
end
# Process the row expanding it into hierarchy values
def process(row)
return row unless row
rows = []
target = configuration[:target]
table = configuration[:table]
conn = ETL::Engine.connection(target)
build_rows([row[:id]], row[:id], row[:id], row[:parent_id].nil?, 0, rows, table, conn)
rows
end
protected
# Recursive function that will add a row for the current level and then call build_rows
# for all of the children of the current level
def build_rows(ids, parent_id, row_id, root, level, rows, table, conn)
ids.each do |id|
child_ids = conn.select_values("SELECT #{id_field} FROM #{table} WHERE #{parent_id_field} = #{id}")
row = {
:parent_id => row_id,
:child_id => id,
:num_levels_from_parent => level,
:is_bottom => (child_ids.empty? ? 1 : 0),
:is_top => (root ? 1 : 0),
}
rows << row
build_rows(child_ids, id, row_id, false, level + 1, rows, table, conn)
end
end
end
end
end |
# frozen_string_literal: true
require 'cinch'
class JoinPart
include Cinch::Plugin
extend Usagi::Help
info 'join', 'Join channel. join <channel>'
info 'part', 'Leave channel. part [channel]'
match /join (.+)/, method: :join
match /part(?: (.+))?/, method: :part
def initialize(*args)
super
@admins = ['']
end
def check_user(user)
user.refresh # be sure to refresh the data, or someone could steal
# the nick
@admins.include?(user.authname)
end
def join(_m, channel)
# return unless check_user(m.user)
Channel(channel).join
end
def part(m, channel)
# return unless check_user(m.user)
channel ||= m.channel
Channel(channel).part if channel
end
end
|
# frozen_string_literal: true
class AddStatusDefaultToPets < ActiveRecord::Migration[5.1]
def change
change_column :pets, :status, :string, default: 'Adoptable'
end
end
|
require "rubygems"
require "eventmachine"
# From "An EventMachine Tutorial"
# http://20bits.com/articles/an-eventmachine-tutorial/
# ハンドラー
module EchoServer
# connectionからデータを受け取った時に呼び出されるメソッド
def receive_data(data)
# receive_dataを呼び出したconnectionにデータを返す
# receive_dataしたらsend_dataする
send_data(data)
end
end
# イベントループ開始
# EventMachine::stop_event_loopを呼び出すまで止まらない
EventMachine::run do
host = '0.0.0.0'
port = 8080
# 3番目の引数はHandlerで、コールバック用の関数でグローバル変数を汚染しないために
# moduleを定義することが多い。
EventMachine::start_server host,port,EchoServer
puts "started EchoServer on #{host}:#{port}"
end |
module Socialable
extend ActiveSupport::Concern
included do
has_many :social_media_accounts, as: :socialable, dependent: :destroy
end
def facebook_url
return '' if self.is_a?(Beer)
account = social_media_accounts.find_by(website: 'Facebook')
account ? "http://www.facebook.com/#{account.handle}" : ''
end
def twitter_url
return '' if self.is_a?(Beer)
account = social_media_accounts.find_by(website: 'Twitter')
account ? "http://twitter.com/#{account.handle}" : ''
end
def foursquare_url
return '' if self.is_a?(Beer)
account = social_media_accounts.find_by(website: 'Foursquare')
account ? "http://foursquare.com/v/#{account.handle}" : ''
end
def untappd_url
account = social_media_accounts.find_by(website: 'Untappd')
account ? "http://untappd.com/#{self.class.to_s.downcase}/#{account.handle}" : ''
end
def ratebeer_url
account = social_media_accounts.find_by(website: 'RateBeer')
return '' unless account
case self
when Beer
"http://www.ratebeer.com/beer/#{self.slug}/#{account.handle}"
when Brewery
"http://www.ratebeer.com/brewers/#{self.slug}/#{account.handle}/"
end
end
def beeradvocate_url
# No BeerAdvocate URLs for beers yet
return '' if self.is_a?(Beer)
account = social_media_accounts.where(website: 'BeerAdvocate').first
account ? "http://www.beeradvocate.com/beer/profile/#{account.handle}" : ''
end
end
|
#!/usr/bin/env ruby
require 'vanagon/logger'
script = File.basename($0)
VanagonLogger.info "#{script}: Warning: use of stand alone '#{script}' command is deprecated and may be removed.
Use: 'vanagon #{script}' instead."
exec "vanagon", script, *ARGV
|
require 'spec_helper'
describe G5Authenticatable do
it 'should have a version' do
expect(G5Authenticatable::VERSION).to_not be_blank
end
end
|
class PendingRequest < ActiveRecord::Base
belongs_to :household
belongs_to :request
before_create :assign_default_status
def send_request_volunteered_email(users)
for user in users
PendingRequestMailer.deliver_request_volunteered_email(self, user)
end
end
def send_volunteer_confirmed_email
PendingRequestMailer.deliver_volunteer_confirmed_email(self)
end
protected
def assign_default_status
self.pending = "true"
self.confirmed = "false"
end
end
|
require 'rails_helper'
RSpec.describe Thing, type: :model do
describe 'associations' do
it { should belong_to(:user) }
it { should belong_to(:borrower).class_name('User') }
it { should have_db_index(:borrower_id) }
it { should have_db_index(:user_id) }
end
describe 'validations' do
it { should validate_presence_of(:name) }
it { should validate_length_of(:name).is_at_most(255) }
end
end
|
class ProjectsController < ApplicationController
def index
projects = Project.all
render json: projects.sort_by { |project| project.created_at }
end
def create
project = Project.new(project_params)
if project.save
render json: project
serialized_data= ActiveModelSerializers::Adapter::Json.new(ProjectSerializer.new(project)).serializable_hash
ActionCable.server.broadcast 'projects_channel', serialized_data
head :ok
else
render json: self.errors.full_messages
end
end
def update
project = Project.find(params[:id])
if project.update(body: params[:body])
render json: project
serialized_data= ActiveModelSerializers::Adapter::Json.new(ProjectSerializer.new(project)).serializable_hash
ActionCable.server.broadcast 'projects_channel', serialized_data
head :ok
else
render json: self.errors.full_messages
end
end
private
def project_params
params.require(:project).permit(:title, :body, :user_id)
end
end
|
#
# Cookbook Name:: mariadb
# Recipe:: _debian_server
#
# Copyright 2014, blablacar.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if Chef::Config[:solo]
Chef::Log.warn('This recipe uses search. Chef Solo does not support search.')
else
exist_data_bag_mariadb_root = begin
search(:mariadb, 'id:user_root').first
rescue Net::HTTPServerException, Chef::Exceptions::InvalidDataBagPath
nil
end
unless exist_data_bag_mariadb_root.nil?
data_bag_mariadb_root = data_bag_item('mariadb', 'user_root')
node.override['mariadb']['server_root_password'] = data_bag_mariadb_root['password']
end
exist_data_bag_mariadb_debian = begin
search(:mariadb, 'id:user_debian').first
rescue Net::HTTPServerException, Chef::Exceptions::InvalidDataBagPath
nil
end
unless exist_data_bag_mariadb_debian.nil?
data_bag_mariadb_debian = data_bag_item('mariadb', 'user_debian')
node.override['mariadb']['debian']['password'] = data_bag_mariadb_debian['password']
end
end
# To be sure that debconf is installed
package 'debconf-utils' do
action :install
end
# Preseed Debian Package
# (but test for resource, as it can be declared by apt recipe)
begin
resources(directory: '/var/cache/local/preseeding')
rescue Chef::Exceptions::ResourceNotFound
directory '/var/cache/local/preseeding' do
owner 'root'
group 'root'
mode '0755'
recursive true
end
end
template '/var/cache/local/preseeding/mariadb-server.seed' do
source 'mariadb-server.seed.erb'
owner 'root'
group 'root'
mode '0600'
variables(package_name: 'mariadb-server')
notifies :run, 'execute[preseed mariadb-server]', :immediately
sensitive true
end
execute 'preseed mariadb-server' do
command '/usr/bin/debconf-set-selections ' \
'/var/cache/local/preseeding/mariadb-server.seed'
action :nothing
end
package "mariadb-server-#{node['mariadb']['install']['version']}" do
action :install
end
|
class AddUserIdToPointOfInterest < ActiveRecord::Migration
def change
add_column :point_of_interests, :user_id, :integer
add_index :point_of_interests, :user_id
end
end
|
class CreateAUsers < ActiveRecord::Migration
def change
create_table :a_users do |t|
t.string :username, :limit => 100, null: false
t.string :password, null: false
t.string :encrypted_password, null: false
t.string :nickname, :limit => 100, null: false
t.string :fullname, null: false
t.integer :gender , null: false, default: 0
t.date :birthdate
t.timestamps
end
end
end
|
require 'rails_helper'
describe ComputeHistory, type: :model do
it { is_expected.to be_mongoid_document }
it { is_expected.to embed_many(:ips) }
it { is_expected.to validate_presence_of(:computed_at) }
end
|
module UseCase
class Base
def self.call(params:)
new(params: params).call
end
def initialize(params:)
@params = params
end
def call
ActiveRecord::Base.transaction do
persist.tap do
rescue Exception => e
Rails.logger.error(
e.message + "\n" + e.backtrace[0, 10].join("\n\t")
)
render json: {type: e.class, error: e.message}, status: :bad_request
end
end
end
private
attr_reader :params
end
end |
require 'rails_helper'
describe EadIndexer::Behaviors do
let(:behaviors){ Class.new{ extend EadIndexer::Behaviors } }
describe "#repository_display" do
subject { behaviors.repository_display }
context "when EAD variable is a folder in the client application" do
before { stub_const('ENV', {'EAD' => 'config/locales'}) }
it { is_expected.to eql("locales") }
end
context "when EAD variable is a file in the client application" do
before { stub_const('ENV', {'EAD' => 'config/locales/en.yml'}) }
it { is_expected.to eql("locales")}
end
context "when there is no EAD variable" do
before { stub_const('ENV', {'EAD' => nil}) }
it { is_expected.to be_nil }
end
end
describe "#get_language_from_code" do
let(:language_code) { "eng" }
subject { behaviors.get_language_from_code(language_code) }
context "when language code is eng" do
it { is_expected.to eql("English") }
end
context "when language code is ger" do
let(:language_code) { "ger" }
it { is_expected.to eql("German") }
end
end
describe "#fix_subfield_demarcators" do
let(:subfield) { "Long Island (N.Y.) |x History |y 17th century" }
subject { behaviors.fix_subfield_demarcators(subfield) }
context "when subfield is Long Island (N.Y.) |x History |y 17th century" do
it { is_expected.to eql("Long Island (N.Y.) -- History -- 17th century")}
end
context "when subfield is Chemistry |w History |y 19th century" do
let(:subfield) { "Chemistry |w History |y 19th century" }
it { is_expected.to eql("Chemistry -- History -- 19th century")}
end
end
end
|
class ChangeDataTypeForFieldname < ActiveRecord::Migration
def up
rename_column :emojis, :transaction, :transaction_id
end
def down
end
end
|
require "colored"
require "forwardable"
require "highline"
require "hirb-colors"
require "hirb"
module TrelloFlow
class Cli
class << self
extend Forwardable
def_delegators :client, :table, :open_url, :say, :success, :ask, :title, :error, :run, :read
attr_accessor :client
end
self.client = Cli.new
def table(items)
puts Hirb::Helpers::AutoTable.render(items, unicode: true)
end
def open_url(url)
return title(url) if ENV['BROWSER'] == 'echo'
`open \"#{url}\"`
end
def say(*args)
highline.say(*args)
end
def success(message)
highline.say(message.green.bold)
end
def ask(message, type = nil)
highline.ask(message, type)
end
def title(message)
highline.say(message.bold)
end
def error(message)
say(message.red.bold)
exit(false)
end
def run(command)
title(command)
system(command) || error("Error running: #{command}")
end
def read(command)
`#{command}`.strip.presence
end
private
def highline
@_highline ||= HighLine.new
end
end
end
|
class Step8Proc < ActiveRecord::Migration
def up
connection.execute(%q{
-- STEP 8 of process
CREATE OR REPLACE FUNCTION public.proc_step_8(process_representative integer,
experience_period_lower_date date,
experience_period_upper_date date,
current_payroll_period_lower_date date,
current_payroll_period_upper_date date
)
RETURNS void AS
$BODY$
DECLARE
run_date timestamp := LOCALTIMESTAMP;
BEGIN
-- STEP 8A -- CREATE FINAL POLICY PREMIUMS AND PROJECTIONS
Insert into final_policy_group_rating_and_premium_projections
(
representative_number,
policy_number,
policy_status,
data_source,
created_at,
updated_at
)
(Select
representative_number,
policy_number,
policy_status,
'bwc' as data_source,
run_date as created_at,
run_date as updated_at
FROM final_policy_experience_calculations
WHERE representative_number = process_representative
);
-- STEP 8B -- CREATE MANUAL LEVEL GROUP RATING AND PREMIUM CALCULATIONS
INSERT INTO final_manual_class_group_rating_and_premium_projections
(
representative_number,
policy_number,
manual_number,
-- ADD ALL INDUSTRY_GROUP'S PAYROLL WITHIN A POLICY_NUMBER SURE TO UPDATE THIS AFTER GOING AF
-- PAYROLL IS PREVIOUS EXPERIENCE YEARS PAYROLL FROM THE TRANSACTIONS TABLE 'July & January'
manual_class_current_estimated_payroll,
data_source,
created_at,
updated_at
)
(
SELECT
a.representative_number,
a.policy_number,
b.manual_number,
round(sum(b.manual_class_payroll)::numeric,2) as manual_class_current_estimated_payroll,
'bwc' as data_source,
run_date as created_at,
run_date as updated_at
FROM public.final_employer_demographics_informations a
Inner Join public.process_payroll_all_transactions_breakdown_by_manual_classes b
ON a.policy_number = b.policy_number
WHERE (b.reporting_period_start_date >= current_payroll_period_lower_date) and a.representative_number = process_representative
GROUP BY a.representative_number, a.policy_number, b.manual_number
);
-- UPDATE THE Industry_group
update public.final_manual_class_group_rating_and_premium_projections mcgr SET (manual_class_industry_group, updated_at) = (t1.manual_class_industry_group, t1.updated_at)
FROM
(SELECT
a.policy_number as policy_number,
a.manual_number as manual_number,
c.industry_group as manual_class_industry_group,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
LEFT JOIN public.bwc_codes_ncci_manual_classes c
ON a.manual_number = c.ncci_manual_classification
WHERE a.representative_number = process_representative
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number
;
-- Update base_rate of manual_cass
update public.final_manual_class_group_rating_and_premium_projections mcgr SET (manual_class_base_rate, updated_at) = (t1.manual_class_base_rate, t1.updated_at)
FROM
(SELECT
a.policy_number as policy_number,
a.manual_number as manual_number,
b.base_rate as manual_class_base_rate,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
LEFT JOIN public.bwc_codes_base_rates_exp_loss_rates b
ON a.manual_number = b.class_code
WHERE a.representative_number = process_representative
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number;
update public.final_manual_class_group_rating_and_premium_projections mcgr SET (manual_class_standard_premium, updated_at) = (t1.manual_class_standard_premium, t1.updated_at)
FROM
(SELECT
a.policy_number as policy_number,
a.manual_number as manual_number,
round((a.manual_class_base_rate * a.manual_class_current_estimated_payroll * pec.policy_individual_experience_modified_rate)::numeric,2) as manual_class_standard_premium,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
LEFT JOIN public.final_policy_experience_calculations pec
ON a.policy_number = pec.policy_number
WHERE a.representative_number = process_representative
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number;
-- UPDATE manual_class industry_group PAYROLL totals
update public.final_manual_class_group_rating_and_premium_projections mcgr SET
(manual_class_industry_group_premium_total, updated_at) = (t1.manual_class_industry_group_premium_total, t1.updated_at)
FROM
(
SELECT
a.policy_number as policy_number,
a.manual_class_industry_group as manual_class_industry_group,
round(sum(a.manual_class_standard_premium)::numeric,2) as manual_class_industry_group_premium_total,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
WHERE a.representative_number = process_representative
GROUP BY a.policy_number, a.manual_class_industry_group
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_class_industry_group = t1.manual_class_industry_group
;
update public.final_policy_group_rating_and_premium_projections pgr SET (policy_total_standard_premium, updated_at) =
(t1.policy_total_standard_premium, t1.updated_at)
FROM
(SELECT
a.policy_number as policy_number,
sum(a.manual_class_standard_premium) as policy_total_standard_premium,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
WHERE a.representative_number = process_representative
GROUP BY a.policy_number
) t1
WHERE pgr.policy_number = t1.policy_number;
update public.final_policy_group_rating_and_premium_projections pgr SET (policy_total_current_payroll, updated_at) =
(t1.policy_total_current_payroll, t1.updated_at)
FROM
(SELECT
a.policy_number as policy_number,
sum(a.manual_class_current_estimated_payroll) as policy_total_current_payroll,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
WHERE a.representative_number = process_representative
GROUP BY a.policy_number
) t1
WHERE pgr.policy_number = t1.policy_number;
--
--
--
-- UPDATE manual_class_industry_group_payroll_percentage
update public.final_manual_class_group_rating_and_premium_projections mcgr SET
(manual_class_industry_group_premium_percentage, updated_at) = (t1.manual_class_industry_group_premium_percentage, t1.updated_at)
FROM
(SELECT mc.policy_number, mc.manual_number,
round((CASE WHEN (p.policy_total_standard_premium is null) or (p.policy_total_standard_premium = '0') or (mc.manual_class_industry_group_premium_total = '0') or (mc.manual_class_industry_group_premium_total is null) THEN '0'
ELSE
( mc.manual_class_industry_group_premium_total / p.policy_total_standard_premium)
END )::numeric,3) as manual_class_industry_group_premium_percentage,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections mc
RIGHT JOIN public.final_policy_group_rating_and_premium_projections p
ON mc.policy_number = p.policy_number
WHERE p.representative_number = process_representative
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number;
-- UPDATE modification rate
update public.final_manual_class_group_rating_and_premium_projections mcgr SET
(manual_class_modification_rate, updated_at) = (t1.manual_class_modification_rate, t1.updated_at)
FROM
(
SELECT
a.policy_number as policy_number,
a.manual_number as manual_number,
round((a.manual_class_base_rate * plec.policy_individual_experience_modified_rate)::numeric,4) as manual_class_modification_rate,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
LEFT JOIN public.final_policy_experience_calculations plec
ON a.policy_number = plec.policy_number
WHERE a.representative_number = process_representative
) t1
WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number;
-- update Individual Total Rate
UPDATE public.final_manual_class_group_rating_and_premium_projections mcgr SET
(manual_class_individual_total_rate) =
(round((manual_class_modification_rate * (1 + (SELECT rate from public.bwc_codes_constant_values
where name = 'administrative_rate' and completed_date is null)))::numeric,6));
-- ADDED Logic to find industry_group by using the Homogeneity File
update public.final_policy_group_rating_and_premium_projections c SET
(policy_industry_group, updated_at) = (t1.manual_class, t1.updated_at)
FROM
(SELECT a.policy_number as policy_number,
(SELECT cast_to_int(b.industry_code)
FROM public.phmgn_detail_records b
WHERE b.policy_number = a.policy_number and cast_to_int(b.industry_code) != 0
ORDER BY premium_percentage DESC NULLS LAST LIMIT 1) as manual_class,
run_date as updated_at
FROM final_policy_group_rating_and_premium_projections a
) t1
WHERE c.policy_number = t1.policy_number;
-- Update policy industry group based on highest payroll percentage by industry group of all manual classes.
-- Adds up like manual classes if different manual classes for a policy belong to the same policy.
update public.final_policy_group_rating_and_premium_projections c SET
(policy_industry_group, updated_at) = (t1.manual_class, t1.updated_at)
FROM
(SELECT a.policy_number as policy_number,
(SELECT b.manual_class_industry_group
FROM final_manual_class_group_rating_and_premium_projections b
WHERE b.policy_number = a.policy_number
ORDER BY manual_class_industry_group_premium_percentage DESC NULLS LAST LIMIT 1) as manual_class,
run_date as updated_at
FROM final_policy_group_rating_and_premium_projections a
WHERE a.representative_number = process_representative
) t1
WHERE c.policy_number = t1.policy_number and c.policy_industry_group is null;
-- ADD logic to update a new industry_group when the industry_group is 10.
-- LOGIC: query to find the policy_numbers that have an industry_group of 10 and a experience ratio between .05 and .86
-- THEN find a manual_class within for a policy_number within that list that has a 20% or above premium for the policy_number
UPDATE public.final_policy_group_rating_and_premium_projections c SET
(policy_industry_group, updated_at) = (t1.manual_class_industry_group, t1.updated_at)
FROM
(SELECT l.policy_number, l.manual_class_industry_group, run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections l
WHERE policy_number in (SELECT fp.policy_number
FROM public.final_policy_group_rating_and_premium_projections fp
WHERE fp.policy_industry_group = '10' and fp.representative_number = process_representative) and policy_number in (SELECT fpe.policy_number FROM final_policy_experience_calculations fpe where fpe.policy_group_ratio between '.05' and '.86')
and manual_class_industry_group != '10' and manual_class_industry_group_premium_percentage > '.2'
and representative_number = process_representative
GROUP BY representative_number, policy_number, manual_class_industry_group, manual_class_industry_group_premium_percentage
ORDER BY manual_class_industry_group_premium_percentage
) t1
WHERE c.policy_number = t1.policy_number;
-- 06/06/2016 ADDED condition for creating group_rating_tier only when the policy_status is Active, ReInsured, or Lapse
-- update group_rating_tier
-- update public.final_policy_group_rating_and_premium_projections c SET
-- (group_rating_tier, updated_at) = (t1.group_rating_tier, t1.updated_at)
-- FROM
-- (SELECT
-- a.policy_number,
-- (SELECT (CASE WHEN (a.policy_group_ratio = '0') THEN '-.53'
-- ELSE min(market_rate)
-- END) as group_rating_tier
-- FROM public.bwc_codes_industry_group_savings_ratio_criteria
-- WHERE (a.policy_group_ratio /ratio_criteria <= 1) and (industry_group = b.policy_industry_group)),
-- run_date as updated_at
-- FROM public.final_policy_experience_calculations a
-- LEFT JOIN final_policy_group_rating_and_premium_projections b
-- ON a.policy_number = b.policy_number
-- WHERE a.representative_number = process_representative and a.policy_group_ratio is not null
-- GROUP BY a.policy_number, a.policy_group_ratio, a.policy_status, b.policy_industry_group
-- ) t1
-- WHERE c.policy_number = t1.policy_number;
-- UPDATE public.final_manual_class_group_rating_and_premium_projections mcgr SET
-- (manual_class_group_total_rate, updated_at) = (t1.manual_class_group_total_rate, t1.updated_at)
-- FROM
-- (
-- SELECT a.policy_number as policy_number,
-- a.manual_number as manual_number,
-- ((1+ b.group_rating_tier) * a.manual_class_base_rate * (1 + (SELECT rate from public.bwc_codes_constant_values
-- where name = 'administrative_rate' and completed_date is null))) as manual_class_group_total_rate,
-- run_date as updated_at
-- FROM public.final_manual_class_group_rating_and_premium_projections a
-- Left Join public.final_policy_group_rating_and_premium_projections b
-- ON a.policy_number = b.policy_number
-- WHERE a.representative_number = process_representative
-- ) t1
-- WHERE mcgr.policy_number = t1.policy_number and mcgr.manual_number = t1.manual_number;
--Update Premium Values
UPDATE public.final_manual_class_group_rating_and_premium_projections mcgr SET
(
manual_class_estimated_group_premium,
manual_class_estimated_individual_premium) =
(
manual_class_current_estimated_payroll * manual_class_group_total_rate
,
manual_class_current_estimated_payroll * manual_class_individual_total_rate
);
UPDATE public.final_policy_group_rating_and_premium_projections pgr SET (policy_total_individual_premium, updated_at) = (t1.policy_total_individual_premium, t1.updated_at)
FROM
(SELECT a.policy_number,
round(SUM(a.manual_class_estimated_individual_premium)::numeric,2) as policy_total_individual_premium,
run_date as updated_at
FROM public.final_manual_class_group_rating_and_premium_projections a
WHERE a.representative_number = process_representative
Group BY a.policy_number
) t1
WHERE pgr.policy_number = t1.policy_number;
-- Update policy_total_group_savings
-- UPDATE public.final_policy_group_rating_and_premium_projections pgr SET (policy_total_group_savings, updated_at) =
-- (t1.policy_total_group_savings, t1.updated_at)
-- FROM
-- (SELECT a.policy_number,
-- round((a.policy_total_individual_premium - a.policy_total_group_premium)::numeric,2) as policy_total_group_savings,
-- run_date as updated_at
-- FROM final_policy_group_rating_and_premium_projections a
-- WHERE a.representative_number = process_representative
--) t1
--WHERE pgr.policy_number = t1.policy_number;
DELETE FROM process_policy_experience_period_peos
WHERE id IN (SELECT id
FROM (SELECT id,
ROW_NUMBER() OVER (partition BY representative_number, policy_number, manual_class_sf_peo_lease_effective_date,
manual_class_sf_peo_lease_termination_date, manual_class_si_peo_lease_effective_date,
manual_class_si_peo_lease_termination_date, data_source ORDER BY id) AS rnum
FROM process_policy_experience_period_peos) t
WHERE t.rnum > 1);
end;
$BODY$
LANGUAGE plpgsql;
})
end
def down
connection.execute(%q{
DROP FUNCTION public.proc_step_8(integer, date, date, date);
})
end
end
|
require 'spec_helper'
describe Contact do
it "has a valid factory" do
expect(build(:contact)).to be_valid
end
it { should validate_presence_of :first_name }
it { should validate_presence_of :last_name }
it { should validate_presence_of :email }
it { should validate_uniqueness_of(:email) }
it "returns a contact's full name as a string" do
contact = build_stubbed(:contact,
first_name: "Jane", last_name: "Doe")
expect(contact.name).to eq "Jane Doe"
end
describe "filter last name by letter" do
let(:smith) { create(:contact,
last_name: 'Smith', email: 'jsmith@example.com') }
let(:jones) { create(:contact,
last_name: 'Jones', email: 'tjones@example.com') }
let(:johnson) { create(:contact,
last_name: 'Johnson', email: 'jjohnson@example.com') }
context "matching letters" do
it "returns a sorted array of results that match" do
expect(Contact.by_letter("J")).to eq [johnson, jones]
end
end
context "non-matching letters" do
it "returns a sorted array of results that match" do
expect(Contact.by_letter("J")).to_not include smith
end
end
end
end |
class RemoveCreateYearFromEvaluation < ActiveRecord::Migration[5.0]
def change
remove_column :evaluations, :create_year, :string
end
end
|
class Message < ActiveRecord::Base
belongs_to :project
belongs_to :sender, :class_name => 'User'
belongs_to :receiver, :class_name => 'User'
validates :subject, :body, :project_id, presence: true
end
|
class Home
attr_reader(:name, :city, :capacity, :price)
def initialize(name, city, capacity, price)
@name = name
@city = city
@capacity = capacity
@price = price
end
end
homes = [
Home.new("Nizar's place", "San Juan", 2, 42),
Home.new("Fernando's place", "Seville", 5, 47),
Home.new("Josh's place", "Pittsburgh", 3, 41),
Home.new("Gonzalo's place", "Málaga", 2, 45),
Home.new("Ariel's place", "San Juan", 4, 49)
]
# for pos in 0..100
# puts homes[pos].name
# end
# homes.each do |hm|
# puts hm.name
# end
#same code with curly braces
# homes.each { |hm|
# puts hm.name
# }
# hm = Home.new("Nizar's place", "San Juan", 2, 42)
# puts hm.name
def print_homes (array)
array.each do |hm|
puts "Name: #{hm.name} in #{hm.city}"
puts "Price: #{hm.price} a night"
end
end
print_homes(homes)
cities = homes.map do |hm|
hm.city
end
puts cities
puts homes
prices = homes.map do |hm|
hm.price
end
puts prices
def averagePrice (array)
sum = 0
array.each do |price|
sum += price
end
sum/array.length
end
puts averagePrice(prices)
total_prices = homes.reduce(0.0) do |sum, hm|
sum + hm.price
end
puts "The average price is"
puts total_prices / prices.length
total_capacities = 0.0
homes.each do |hm|
total_capacities = total_capacities + hm.capacity
end
puts "The average capacity is:"
puts total_capacities / homes.length
#better way to do this:
total_capacities = homes.reduce(0.0) do |sum, hm|
sum + hm.capacity
end
puts "The average capacity is:"
puts total_capacities/homes.length
homes.each_with_index do |hm, index|
puts "Home Number #{index + 1}: #{hm.name}"
end
#Homes is San Juan
san_juan_homes = homes.select do |hm|
hm.city == "San Juan"
end
high_capacity_homes = homes.select do |hm|
hm.capacity>=4
end
home_41_dollars = homes.find do |hm|
hm.price ==41
end
puts "The first home that costs $41 is:"
puts home.home_41_dollars.name
sorted = homes.sort do |home1, home2|
home1.capacity <=> home2.capacity
end
rng = 1..42
rng.each do |number|
puts "The next number in the range is #{number}"
end
double = rng.map do |number|
number*2
end
puts double
hellos = {
:english => "Hello",
:spanish => "Hola",
:french => "Bonjour"
}
hellos.each do |language, word|
puts "The word for Hello in #{language} is #{word}"
end
} |
module Kubik
class MetaTagDefaultsController < ApplicationController
layout :resolve_layout
def edit; end
def update
@meta_tag_defaults = Kubik::MetaTagDefaultsForm.new(meta_tag_defaults_params)
if @meta_tag_defaults.save
flash.now[:notice] = t('kubik_metatagable.defaults_saved')
render :edit
else
flash.now[:alert] = t('kubik_metatagable.defaults_not_saved')
render :edit, status: :unprocessable_entity
end
end
private
def meta_tag_defaults_params
params.require(:meta_tag_defaults).permit(Kubik::MetaTagDefaults::TAGS)
end
def resolve_layout
kubik_metatagable_layout
end
end
end
|
require_relative '../schema/permutation'
module Services
class PermutationMaker
def initialize(collection, value, options = {})
@collection = collection
@value = value
@options = options
end
def make
{}.tap do |hash|
@collection.each do |member|
dividend = @value / member
remainder = @value % member
hash[member] = Schema::Permutation.new(
value: member,
dividend: dividend,
remainder: remainder,
permutations: remainder.zero? ? [] : Services::PermutationMaker.new(possible_permutations(member), @value - (member * dividend)).make
)
end
end
end
private
def possible_permutations(value)
@collection.reject{ |x| x >= value }
end
end
end
|
=begin
* ****************************************************************************
* BRSE-SCHOOL
* HELPER - RegisstAdvisoriesHelper
*
* 処理概要 :
* 作成日 : 2017/09/15
* 作成者 : havv – havv@ans-asia.com
*
* 更新日 :
* 更新者 :
* 更新内容 :
*
* @package : HELPER
* @copyright : Copyright (c) ANS-ASIA
* @version : 1.0.0
* ****************************************************************************
=end
module Admin
module RegistadvisoriesHelper
class RegistAdvisoriesHlp
include ApplicationHelper #app/helpers/application_helper.rb
###
# get data of table register_advisories with search condition
# -----------------------------------------------
# @author : havv - 2017/09/18 - create
# @param : search - Hash - search condition
# @return : null
# @access : public
# @see : remark
###
def self.getListRegists(search)
result = Hash.new
result['status'] = true
lang = Helper.getLang
sql_joins = 'LEFT JOIN libraries AS lib_edu_level ' +
'ON (lib_edu_level.library_id = 6 AND lib_edu_level.number = register_advisories.education_level AND lib_edu_level.lang = \'' + lang + '\')' +
'LEFT JOIN libraries AS lib_course_type ' +
'ON (lib_course_type.library_id = 2 AND lib_course_type.number = register_advisories.course_type AND lib_course_type.lang = \'' + lang + '\')'
sql_select = 'register_advisories.id, '+
'register_advisories.name, '+
'register_advisories.address, '+
'register_advisories.email, '+
'register_advisories.phone, '+
'register_advisories.message, '+
'register_advisories.status, '+
'register_advisories.education_level, '+
'lib_edu_level.name AS education_level_nm, '+
'register_advisories.course_type, '+
'lib_course_type.name AS course_type_nm, '+
'register_advisories.created_at'
begin
search_result = RegisterAdvisory.joins(sql_joins).where(deleted_at: nil)
# search follow name
if search[:name].present?
search[:name] = Helper.sqlEscapeString(search[:name])
list_name = search[:name].split(' ')
sql = 'register_advisories.name LIKE \'%' + list_name[0] + '%\''
list_name.drop(1).each do |item|
sql += ' OR register_advisories.name LIKE \'%' + item +'%\''
end
search_result = search_result.where(sql)
end
# search follow education_level
if search[:education_level].present? && search[:education_level].to_i > -1
search_result = search_result.where(education_level: search[:education_level])
end
# search follow course_type
if search[:course_type].present? && search[:course_type].to_i > -1
search_result = search_result.where(course_type: search[:course_type])
end
# search follow status
if search[:status].present? && search[:status].to_i > -1
search_result = search_result.where(status: search[:status])
end
result['data'] = search_result.select(sql_select)
rescue # catch
result['status'] = false
result['error'] = "#{$!}"
ensure # finally
return result
end
end
###
# update a field of register_advisories follow id
# -----------------------------------------------
# @author : havv - 2017/09/18 - create
# @param : params - Hash
# @return : null
# @access : public
# @see : remark
###
def self.updateStatus(params)
result = Hash.new
result['status'] = true
begin # try
ActiveRecord::Base.transaction do
result['status'] = RegisterAdvisory.where(id: params[:id], deleted_at: nil)
.update_all(
status: params[:status],
updated_by: $user_id,
updated_at: Time.now
)
end
rescue # catch
result['status'] = false
result['error'] = "#{$!}"
# Roll back
raise ActiveRecord::Rollback
ensure # finally
return result
end
end
###
# delete a regist by id
# -----------------------------------------------
# @author : havv - 2017/09/18 - create
# @param : id - int - id of regist need to del
# @param : remove - boolean - if it is true then remove regist - default: false
# @return : null
# @access : public
# @see : remark
###
def self.delete(id, remove = false)
result = Hash.new
result['status'] = true
begin
ActiveRecord::Base.transaction do
if remove
# delete physical
result['status'] = RegisterAdvisory.where(id: id, deleted_at: nil).delete_all
else
# delete logic
result['status'] = RegisterAdvisory.where(id: id, deleted_at: nil)
.update_all(
deleted_at: Time.now,
deleted_by: $user_id
)
end
end
rescue # catch
result['status'] = false
result['error'] = "#{$!}"
# Roll back
raise ActiveRecord::Rollback
ensure # finally
return result
end
end
end
end
end |
require "spec_helper"
describe MatchDay do
it { should have_many(:matches) }
describe '.next' do
subject { MatchDay.next }
context 'with several futur match_days' do
let!(:match_day_0) { create :match_day, :finished }
let!(:match_day_1) { create :match_day, start_date: 1.days.ago, end_date: 1.days.from_now }
let!(:match_day_2) { create :match_day, start_date: 6.days.from_now, end_date: 7.days.from_now }
let!(:match_day_3) { create :match_day, start_date: 8.days.from_now, end_date: 9.days.from_now }
it { should eq match_day_1}
end
end
describe '.previous' do
subject { MatchDay.previous }
context 'with several previous match_days' do
let!(:match_day_0) { create :match_day, :futur }
let!(:match_day_1) { create :match_day, start_date: 1.days.ago, end_date: 1.days.from_now }
let!(:match_day_2) { create :match_day, start_date: 8.days.ago, end_date: 7.days.ago }
let!(:match_day_3) { create :match_day, start_date: 10.days.ago, end_date: 9.days.ago }
it { should eq match_day_1}
end
end
describe '.selected_players' do
let(:match_day) { create :match_day }
let!(:match_1) { create :match, match_day: match_day }
let!(:match_2) { create :match, match_day: match_day }
let!(:user_1) { create :user }
let!(:user_2) { create :user }
let!(:user_3) { create :user }
let!(:user_4) { create :user }
before do
match_1.selection.users << [user_1, user_3]
match_2.selection.users << [user_2, user_3]
end
subject { match_day.selected_players }
its(:count) { should eq 3 }
it { (subject - [user_1, user_2, user_3]).should eq []}
end
end |
class DataController < ApplicationController
layout false
before_action :check_minimum_files_required, only: :csv
def csv
files = Uploads.get_uploaded(params[:csv][:files])
concern = params[:csv][:concern]
csv_merged = CsvMerger.merge(*files)
models = DiscrepancyCsvParser.parse(csv_merged)
@discrepancies = DiscrepancyDetector.new(models).detect(concern: concern).discrepancies
end
private
def check_minimum_files_required
unless csv_params.permitted?
raise ActionController::ParameterMissing
end
unless params[:csv][:files].length > 1
raise NotEnoutFilesSubmitted
end
end
def csv_params
params.require(:csv).permit(:concern, :files => [])
end
end
|
# encoding: utf-8
control "V-92689" do
title "The Apache web server must generate a session ID using as much of the character set as possible to reduce the risk of brute force."
desc "Generating a session identifier (ID) that is not easily guessed through brute force is essential to deter several types of session attacks. By knowing the session ID, an attacker can hijack a user session that has already been user-authenticated by the hosted application. The attacker does not need to guess user identifiers and passwords or have a secure token since the user session has already been authenticated.
By generating session IDs that contain as much of the character set as possible, i.e., A-Z, a-z, and 0-9, the session ID becomes exponentially harder to guess.
"
impact 0.5
tag "check": "Determine the location of the 'HTTPD_ROOT' directory and the 'httpd.conf' file:
# httpd -V | egrep -i 'httpd_root|server_config_file'
-D HTTPD_ROOT='/etc/httpd'
-D SERVER_CONFIG_FILE='conf/httpd.conf'
Verify the 'unique_id_module' is loaded:
run httpd -M | grep unique_id
If no unique_id is returned, open finding.
"
tag "fix": "Determine the location of the 'HTTPD_ROOT' directory and the 'httpd.conf' file:
# httpd -V | egrep -i 'httpd_root|server_config_file'
-D HTTPD_ROOT='/etc/httpd'
-D SERVER_CONFIG_FILE='conf/httpd.conf'
Load the 'unique_id_module'.
Example: LoadModule unique_id_module modules/mod_unique_id.so
Restart Apache: apachectl restart"
# Write Check Logic Here
describe command('httpd -M | grep -i "unique_id_module"') do
its('stdout') { should eq ' unique_id_module (shared)' }
end
end
|
require 'deep_thought/deployer/deployer'
module DeepThought
module Deployer
class Shell < DeepThought::Deployer::Deployer
def execute?(deploy, config)
environment = deploy.environment || "development"
root = config['root'] || "script/deploy"
command = "#{root} #{environment} deploy"
if deploy.actions
actions = YAML.load(deploy.actions)
actions.each do |action|
command += ":#{action}"
end
end
command += " branch=#{deploy.branch}"
command += " box=#{deploy.box}" if deploy.box
if deploy.variables
variables = YAML.load(deploy.variables)
variables.each do |k, v|
command += " #{k}=#{v}"
end
end
commands = []
commands << "cd ./.projects/#{deploy.project.name}"
commands << "#{command} 2>&1"
executable = commands.join(" && ")
log = `#{executable}`
deploy.log = log
$?.success?
end
end
end
end
|
# Copyright (c) 2016 Nathan Currier
# This Source Code File is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
module Rideliner
VERSION = '0.3.6'.freeze
end
|
Factory.define :response, :class => Noodall::FormResponse do |response|
response.name "A User"
response.email "user@example.com"
response.ip "127.0.0.1"
response.created_at Time.zone.now
response.referrer "http://rac.local/the-college"
end
|
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.0.1"
gem "rails", "~> 6.1.4"
gem 'hotwire-rails'
# Use postgresql as the database for Active Record
gem "pg", ">= 0.18", "< 2.0"
# Use Puma as the app server
gem "puma", "~> 4.3.5"
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
# gem 'webpacker', git: 'https://github.com/rails/webpacker.git'
gem "webpacker", github: "rails/webpacker"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder", "~> 2.5"
# Use Redis adapter to run Action Cable in production
gem "redis", "~> 4.0"
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.3", require: false
# gem 'actiontext', github: 'rails/actiontext', require: 'action_text'
gem "image_processing", "~> 1.2" # for Active Storage variants
gem "sassc-rails"
gem "haml-rails"
gem "coffee-script"
gem "json", ">= 2.3.0"
gem "active_model_serializers"
gem "activerecord-import"
# gem 'administrate', '~> 0.8.1'
gem "geocoder"
gem "pagy"
gem "ldap_lookup"
gem "mini_magick"
gem 'ransack', github: 'activerecord-hackery/ransack'
gem "sidekiq", "~> 6.0"
gem "uglifier"
gem "foreman"
gem "draper"
gem "listen"
gem "pundit"
gem 'devise', github: 'heartcombo/devise'
# gem 'gravatar_image_tag', github: 'mdeering/gravatar_image_tag'
# gem 'omniauth-facebook', '~> 4.0'
# gem 'omniauth-twitter', '~> 1.4'
# gem 'omniauth-github', '~> 1.3'
gem "omniauth-google-oauth2"
gem "flamegraph"
gem "stackprof"
gem 'rack-mini-profiler'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
gem "factory_bot_rails"
gem "rspec-rails"
gem "rubocop-performance"
gem "standard"
end
group :development do
gem "annotate", "~> 2.7"
gem "bullet"
gem 'memory_profiler'
gem "capistrano", require: false
gem "capistrano-bundler", require: false
gem "capistrano-postgresql"
gem "capistrano-rails", require: false
gem "capistrano-rbenv", require: false
gem "capistrano3-puma", "~> 4.0", require: false
gem "erb2haml"
gem "guard-bundler", require: false
gem "guard-rails", require: false
gem "guard-rspec", require: false
gem "pry"
gem "pry-rails"
gem "terminal-notifier-guard", require: false
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen"
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem "web-console", ">= 3.3.0"
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem "capybara"
gem "webdrivers"
gem "shoulda-matchers"
gem "ffaker"
gem "database_cleaner"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'jsonapi-serializer'
|
class Constructor < ActiveRecord::Base
has_many :drivers
def pick_driver(driver)
drivers << driver
end
def increase_techfactor(tech_points)
self.tech_factor += tech_points
end
def after_driver_selection
drivers.each do |d|
Constructor.budget -= d.price
end
Constructor.budget
end
end
|
# puts 'I am a fortune-teller. Tell me your name: '
# name = gets.chomp
# if name == 'Chris'
#puts 'I see great things in your future. '
#else
# puts 'Your future is... oh my! Look at the time!'
# puts 'I really have to go, sorry!'
#end
#puts 'Hello and welcome to seventh grade English. '
#puts 'My name is Mrs. Gabbard. And your name is ...?'
#name = gets.chomp
#if name == name.capitalize
#puts 'Please take a seat,' + name + '.'
#else
#puts name + '? You mean ' + name.capitalize + ', right?'
#puts 'Don\'t you even know how to spell your name??'
#reply = gets.chomp
#if reply.downcase == 'yes'
#puts 'Hmmph! Well, sit down!'
#else
#puts 'GET OUT!!'
#end
#end
=begin
while true
puts 'What would you like to ask C to do?'
request = gets.chomp
puts 'You say, "C, please ' + request + '"'
puts 'C\'s response:'
puts '"C ' + request + '."'
puts '"Papa ' + request + ', too."'
puts '"Mama ' + request + ', too."'
puts '"Ruby ' + request + ', too."'
puts '"Nono ' + request + ', too."'
puts '"Emma ' + request + ', too."'
puts
if request == 'stop'
break
end
end
=end
=begin
num_at_start = 5
num_now = num_at_start
while num_now > 2
puts num_now.to_s + ' bottles of beer on the wall, ' +
num_now.to_s + 'bottles of bear on the wall!'
num_now = num_now - 1
puts 'Take one down, pass it around, ' +
num_now.to_s + 'bottles of beer on the wall!'
end
puts "2 bottles of beer on the wall, 2 bottles of beer!"
puts "Take one down, pass it around, 1 bottle of beer on the wall!"
puts "1 bottle of beer on the wall, 1 bottle of beer!"
puts "Take one down, pass it around, no more bottles of beer on the wall!"
=end
puts 'HET THERE, SONNY! GIVE GRANDMA A KISS!'
while true
said = gets.chomp
if said == "BYE"
puts 'BYE SWEETIE!'
break
end
if said != said.upcase
puts 'HUH?! SPEAK UP, SONNY!'
else
random_year = 1930 + rand(21)
puts 'NO, NOT SINCE ' + random_year.to_s + '!'
end
end
|
# frozen_string_literal: true
class RenamePostUserIdToBooks < ActiveRecord::Migration[6.0]
def change
rename_column :books, :post_user_id, :user_id
end
end
|
class EducationalRelationship < ApplicationRecord
belongs_to :education_program
belongs_to :educational, polymorphic: true
end
|
class User
include Mongoid::Document
has_many :sources
has_many :posts
def self.find_or_create_by_hash(auth_hash)
@user = nil
@source = Source.where(:provider => auth_hash["provider"], :identifier => auth_hash["uid"])
if @source.first
#assert only one source
@user = @source.first.user
else
if @user = User.create
@source = @user.sources.new(
provider: auth_hash["provider"],
identifier: auth_hash["username"],
token: auth_hash["credentials"]["token"],
secret: auth_hash["credentials"]["secret"],
expire_time: auth_hash["credentials"]["expires_at"]
)
@source.user = @user
if @source.save
@user
else
@user.destroy
#error saving source end
end
#couldnt create user, error
end
end
@user
end
end
|
# encoding: utf-8
require 'spec_helper'
describe "mail encoding" do
it "should allow you to assign a mail wide charset" do
mail = Mail.new
mail.charset = 'utf-8'
expect(mail.charset).to eq 'utf-8'
end
describe "using default encoding" do
it "should allow you to send in unencoded strings to fields and encode them" do
mail = Mail.new
mail.charset = 'utf-8'
mail.subject = "This is あ string"
result = "Subject: =?UTF-8?Q?This_is_=E3=81=82_string?=\r\n"
expect(mail[:subject].encoded).to eq result
end
it "should allow you to send in unencoded strings to address fields and encode them" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = "Mikel Lindsああr <mikel@test.lindsaar.net>"
result = "To: Mikel =?UTF-8?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>\r\n"
expect(mail[:to].encoded).to eq result
end
it "should allow you to send in unencoded strings to address fields and encode them" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = "あdあ <ada@test.lindsaar.net>"
result = "To: =?UTF-8?B?44GCZOOBgg==?= <ada@test.lindsaar.net>\r\n"
expect(mail[:to].encoded).to eq result
end
it "should allow you to send in multiple unencoded strings to address fields and encode them" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = ["Mikel Lindsああr <mikel@test.lindsaar.net>", "あdあ <ada@test.lindsaar.net>"]
result = "To: Mikel =?UTF-8?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>, \r\n\s=?UTF-8?B?44GCZOOBgg==?= <ada@test.lindsaar.net>\r\n"
expect(mail[:to].encoded).to eq result
end
it "should allow you to send unquoted non us-ascii strings, with spaces in them" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = ["Foo áëô îü <extended@example.net>"]
result = "To: Foo =?UTF-8?B?w6HDq8O0?= =?UTF-8?B?IMOuw7w=?= <extended@example.net>\r\n"
expect(mail[:to].encoded).to eq result
end
it "should allow you to send in multiple unencoded strings to any address field" do
mail = Mail.new
mail.charset = 'utf-8'
['To', 'From', 'Cc', 'Reply-To'].each do |field|
mail.send("#{field.downcase.gsub("-", '_')}=", ["Mikel Lindsああr <mikel@test.lindsaar.net>", "あdあ <ada@test.lindsaar.net>"])
result = "#{field}: Mikel =?UTF-8?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>, \r\n\s=?UTF-8?B?44GCZOOBgg==?= <ada@test.lindsaar.net>\r\n"
expect(mail[field].encoded).to eq result
end
end
it "should handle groups" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = "test1@lindsaar.net, group: test2@lindsaar.net, me@lindsaar.net;"
result = "To: test1@lindsaar.net, \r\n\sgroup: test2@lindsaar.net, \r\n\sme@lindsaar.net;\r\n"
expect(mail[:to].encoded).to eq result
end
it "should handle groups with funky characters" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = '"Mikel Lindsああr" <test1@lindsaar.net>, group: "あdあ" <test2@lindsaar.net>, me@lindsaar.net;'
result = "To: =?UTF-8?B?TWlrZWwgTGluZHPjgYLjgYJy?= <test1@lindsaar.net>, \r\n\sgroup: =?UTF-8?B?44GCZOOBgg==?= <test2@lindsaar.net>, \r\n\sme@lindsaar.net;\r\n"
expect(mail[:to].encoded).to eq result
end
describe "quoting token safe chars" do
it "should not quote the display name if unquoted" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = 'Mikel Lindsaar <mikel@test.lindsaar.net>'
expect(mail[:to].encoded).to eq %{To: Mikel Lindsaar <mikel@test.lindsaar.net>\r\n}
end
it "should not quote the display name if already quoted" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = '"Mikel Lindsaar" <mikel@test.lindsaar.net>'
expect(mail[:to].encoded).to eq %{To: Mikel Lindsaar <mikel@test.lindsaar.net>\r\n}
end
end
describe "quoting token unsafe chars" do
it "should quote the display name" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = "Mikel @ me Lindsaar <mikel@test.lindsaar.net>"
expect(mail[:to].encoded).to eq %{To: "Mikel @ me Lindsaar" <mikel@test.lindsaar.net>\r\n}
end
it "should preserve quotes needed from the user and not double quote" do
mail = Mail.new
mail.charset = 'utf-8'
mail.to = %{"Mikel @ me Lindsaar" <mikel@test.lindsaar.net>}
expect(mail[:to].encoded).to eq %{To: "Mikel @ me Lindsaar" <mikel@test.lindsaar.net>\r\n}
end
end
end
describe "specifying an email wide encoding" do
it "should allow you to send in unencoded strings to fields and encode them" do
mail = Mail.new
mail.charset = 'ISO-8859-1'
subject = "This is あ string"
subject.force_encoding('ISO8859-1') if RUBY_VERSION > '1.9'
mail.subject = subject
result = mail[:subject].encoded
string = "Subject: =?ISO-8859-1?Q?This_is_=E3=81=82_string?=\r\n"
if RUBY_VERSION > '1.9'
string.force_encoding('ISO8859-1')
result.force_encoding('ISO8859-1')
end
expect(result).to eq string
end
it "should allow you to send in unencoded strings to address fields and encode them" do
mail = Mail.new
mail.charset = 'ISO-8859-1'
string = "Mikel Lindsああr <mikel@test.lindsaar.net>"
string.force_encoding('ISO8859-1') if RUBY_VERSION > '1.9'
mail.to = string
result = mail[:to].encoded
string = "To: Mikel =?ISO-8859-1?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>\r\n"
if RUBY_VERSION > '1.9'
string.force_encoding('ISO8859-1')
result.force_encoding('ISO8859-1')
end
expect(result).to eq string
end
it "should allow you to send in multiple unencoded strings to address fields and encode them" do
mail = Mail.new
mail.charset = 'ISO-8859-1'
array = ["Mikel Lindsああr <mikel@test.lindsaar.net>", "あdあ <ada@test.lindsaar.net>"]
array.map! { |a| a.force_encoding('ISO8859-1') } if RUBY_VERSION > '1.9'
mail.to = array
result = mail[:to].encoded
string = "To: Mikel =?ISO-8859-1?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>, \r\n\s=?ISO-8859-1?B?44GCZOOBgg==?= <ada@test.lindsaar.net>\r\n"
if RUBY_VERSION > '1.9'
string.force_encoding('ISO8859-1')
result.force_encoding('ISO8859-1')
end
expect(result).to eq string
end
it "should allow you to send in multiple unencoded strings to any address field" do
mail = Mail.new
array = ["Mikel Lindsああr <mikel@test.lindsaar.net>", "あdあ <ada@test.lindsaar.net>"]
array.map! { |a| a.force_encoding('ISO8859-1') } if RUBY_VERSION > '1.9'
mail.charset = 'ISO-8859-1'
['To', 'From', 'Cc', 'Reply-To'].each do |field|
mail.send("#{field.downcase.gsub("-", '_')}=", array)
string = "#{field}: Mikel =?ISO-8859-1?B?TGluZHPjgYLjgYJy?= <mikel@test.lindsaar.net>, \r\n\s=?ISO-8859-1?B?44GCZOOBgg==?= <ada@test.lindsaar.net>\r\n"
result = mail[field].encoded
if RUBY_VERSION > '1.9'
string.force_encoding('ISO8859-1')
result.force_encoding('ISO8859-1')
end
expect(result).to eq string
end
end
end
it "should let you define a charset per part" do
mail = Mail.new
part = Mail::Part.new
part.content_type = "text/html"
part.charset = "ISO-8859-1"
part.body = "blah"
mail.add_part(part)
expect(mail.parts[0].content_type).to eq "text/html; charset=ISO-8859-1"
end
it "should skip invalid characters" do
m = Mail.new
m['Subject'] = Mail::SubjectField.new("=?utf-8?Q?Hello_=96_World?=")
if RUBY_VERSION > '1.9'
expect { expect(m.subject).to be_valid_encoding }.not_to raise_error
else
expect(m.subject).to eq "Hello World"
end
end
if RUBY_VERSION > '1.9'
describe "#pick_encoding" do
it "picks binary for nil" do
expect { ::Encoding.find(nil) }.to raise_error(TypeError)
expect(Mail::Ruby19.pick_encoding(nil)).to eq(Encoding::BINARY)
end
{
"latin2" => Encoding::ISO_8859_2,
"ISO_8859-1" => Encoding::ISO_8859_1,
"cp-850" => Encoding::CP850,
"" => Encoding::BINARY
}.each do |from, to|
it "should support #{from}" do
expect { ::Encoding.find(from) }.to raise_error(ArgumentError)
expect(Mail::Ruby19.pick_encoding(from)).to eq(to)
end
end
end
end
end
|
class Customer < ApplicationRecord
validates_presence_of :name, :email, :address, :city, :country, :creditcard
end
|
module WizardOfAwes
def self.frameworks
frameworks = ['rails']
frameworks
end
def self.load_framework!
show_warning if frameworks.empty?
frameworks.each do |framework|
begin
require framework
rescue NameError => e
raise "Failed to load framework #{framework.inspect}. Have you added it to Gemfile?"
end
end
end
def self.show_warning
$stderr.puts <<-EOC
warning: no framework detected.
would you check out if your Gemfile appropriately configured?
---- e.g. ----
when Rails:
gem 'rails'
gem 'wizard_of_awes'
EOC
end
def self.load_wizard_of_awes!
require "wizard_of_awes/version"
require 'wizard_of_awes/configuration'
require 'wizard_of_awes/helper_auth'
require 'wizard_of_awes/view_helpers'
end
def self.hook!
load_framework!
load_wizard_of_awes!
if rails?
require 'wizard_of_awes/railtie'
require 'wizard_of_awes/engine'
end
end
def self.load!
hook!
end
private
def self.rails?
defined?(::Rails)
end
end
WizardOfAwes.load!
|
# frozen_string_literal: true
class UsersController < ApplicationController
before_action :authenticate_user!
before_action :find_user, only: :show
def index
@orders = Order.active.sort_created_at
@customers = User.active.customer
@leeds = Leed.sort_created_at
@recents = @customers.sort_created_at.limit(10)
end
def show
@pets = @user.pets.sort_created_at
@orders = @user.orders.sort_created_at
end
def destroy; end
private
def find_user
@user = User.find_by!(id: current_user.id)
end
end
|
class AuditsController < ApplicationController
before_filter :authenticate_user!
before_filter :find_audit, except: [:clone, :create, :deleted, :index]
helper_method :current_audit
def index
respond_to do |format|
format.html do
@audits = current_user.available_audits
.active
.includes(:audit_type, :audit_structure, :user)
.order(performed_on: :desc)
end
format.json do
@audits = current_user.audits.active
render json: @audits
end
end
end
def clone
source_audit = current_user.available_audits.active.find(params[:source_audit_id])
new_audit_params = params.require(:audit).permit(:name, :performed_on)
AuditCloneService.execute!(params: new_audit_params,
source_audit: source_audit)
redirect_to audits_path
end
def create
respond_to do |format|
format.html do
AuditCreator.execute!(params: params, user: current_user)
redirect_to audits_path
end
format.json do
process_audit
end
end
end
def deleted
@audits = current_user.available_audits.destroyed
end
def immediate_delete
AuditDestroyer.execute(audit: @audit)
flash[:notice] = "Permanently deleted audit '#{@audit.name}'"
redirect_to deleted_audits_path
end
def update
respond_to do |format|
format.html do
end
format.json do
process_audit
end
end
end
def show
@substructure = AuditStructure.new(parent_structure: @audit.audit_structure)
@sample_group = SampleGroup.new(parent_structure: @audit.audit_structure)
end
def destroy
head 401 if mobile_device?
if @audit.is_locked?
flash[:error] = "'#{@audit.name}' cannot be deleted, it is locked by
#{@audit.locked_by_user.full_name}"
redirect_to audits_path
else
@audit.update_attribute(:destroy_attempt_on, Time.current)
flash[:notice] = "'#{@audit.name}' has been marked for deletion"
redirect_to audits_path
end
end
def lock
if @audit.is_locked? && @audit.locked_by_user != current_user
render json: @audit, status: :unauthorized
else
@audit.locked_by_user = current_user
@audit.save!
render json: @audit, status: :ok
end
end
def undelete
@audit.update_attribute(:destroy_attempt_on, nil)
redirect_to deleted_audits_path
end
def unlock
if @audit.is_locked? && @audit.locked_by_user != current_user
render json: @audit, status: :unauthorized
else
@audit.update_attribute(:locked_by, nil)
render json: @audit, status: :ok
end
end
private
def audit_params
params.require(:audit)
.permit(:id,
:name,
:is_archived,
:performed_on,
:user_id,
:audit_structure_id,
:upload_attempt_on,
:successful_upload_on,
:audit_type_id,
:created_at,
:updated_at,
:locked_by,
:organization_id)
end
def audit_strc_type
@audit_strc_type ||= AuditStrcType.find_by(name: 'Audit')
end
def process_audit
find_or_create
@audit.assign_attributes(audit_params)
@audit.locked_by = nil
if save_audit
render json: @audit, status: :ok
else
render json: @audit.errors, status: :bad_request
end
end
def save_audit
if @audit.save
@audit.update_attribute(:successful_upload_on, @audit.upload_attempt_on)
return true
end
false
end
def find_or_create
@audit = Audit.where(id: params[:id]).first
return if @audit
@audit = Audit.new
@audit.id = params[:id]
end
def find_audit
@audit = current_user.available_audits.find_by_id(params[:id])
head :not_found unless @audit
end
def current_audit
return nil unless params[:id]
@audit ||= current_user.available_audits.find(params[:id])
end
end
|
class Product < ActiveRecord::Base
has_many :reviews
validates :name, :presence => true
validates :cost, :presence => true, numericality: true
# validates :country, :presence => true
scope :sort_date, -> {order(created_at: :desc).limit(3)}
scope :sort_cost, -> {order(cost: :asc).limit(5)}
end
|
require 'test_helper'
class ProfissionalsControllerTest < ActionDispatch::IntegrationTest
setup do
@profissional = profissionals(:one)
end
test "should get index" do
get profissionals_url
assert_response :success
end
test "should get new" do
get new_profissional_url
assert_response :success
end
test "should create profissional" do
assert_difference('Profissional.count') do
post profissionals_url, params: { profissional: { } }
end
assert_redirected_to profissional_url(Profissional.last)
end
test "should show profissional" do
get profissional_url(@profissional)
assert_response :success
end
test "should get edit" do
get edit_profissional_url(@profissional)
assert_response :success
end
test "should update profissional" do
patch profissional_url(@profissional), params: { profissional: { } }
assert_redirected_to profissional_url(@profissional)
end
test "should destroy profissional" do
assert_difference('Profissional.count', -1) do
delete profissional_url(@profissional)
end
assert_redirected_to profissionals_url
end
end
|
class AddView3AttribsToApps < ActiveRecord::Migration[5.2]
def change
add_column :apps, :available_since, :date
add_column :apps, :mydata_membership, :string
add_column :apps, :license, :string
add_column :apps, :user_id, :integer
end
end
|
class UserStatistic < ApplicationRecord
belongs_to :user
def total_questions
self.right_questions + self.wrong_questions
end
end
|
# frozen_string_literal: true
namespace :dev do
desc "Configure development environment"
task setup: :environment do
unless Rails.env.production?
# show_spinner("Migrating DB...") { %x(rails db:migrate) }
# show_spinner("Creating Default User...") { %x(rails dev:add_users) }
show_spinner("Creating Collected Coins Trophies...") { %x(rails dev:add_collected_coints_trophies) }
show_spinner("Creating Killed Monsters Trophies...") { %x(rails dev:add_killed_monsters_trophies) }
show_spinner("Creating Times of Death Trophies...") { %x(rails dev:add_times_of_death_trophies) }
else
puts "You are not in development environment."
end
end
desc "Creating Users"
task add_users: :environment do
User.create(
email: "user@user.com",
password: "user123",
password_confirmation: "user123"
)
end
desc "Creating Collected Coins Trophies"
task add_collected_coints_trophies: :environment do
[1, 100, 1000, 10_000, 100_000].each do |value|
Trophy.find_or_create_by!(trophy_category: 0, value: value)
end
end
desc "Creating Killed Monsters Trophies"
task add_killed_monsters_trophies: :environment do
[1, 100, 1000, 10_000, 100_000].each do |value|
Trophy.find_or_create_by!(trophy_category: 1, value: value)
end
end
desc "Creating Times of Death Trophies"
task add_times_of_death_trophies: :environment do
[1, 10, 25, 50, 100].each do |value|
Trophy.find_or_create_by!(trophy_category: 2, value: value)
end
end
desc "Creating Turtle Trophies"
task add_bowser_trophies: :environment do
[1, 100, 1000, 10_000, 100_000].each do |value|
Trophy.find_or_create_by!(trophy_category: 3, value: value)
end
end
desc "Creating Bowser Trophies"
task add_bowser_trophies: :environment do
[1, 100, 1000, 10_000, 100_000].each do |value|
Trophy.find_or_create_by!(trophy_category: 4, value: value)
end
end
private
def show_spinner(msg_start, msg_end = "Concluído!")
spinner = TTY::Spinner.new("[:spinner] #{msg_start}")
spinner.auto_spin
yield
spinner.success("(#{msg_end})")
end
end
|
# Write a method that takes a block and calls it once for
# each hour that has passed today.
# Hint: You can use Time.new.hour to get the current hour.
# However, this returns a number between 0 and 23, so you
# will have to alter those numbers in order to get ordinary
# clock-face numbers (1 to 12).
def grandfather_clock &block
hours_passed = Time.new.hour%12
hours_passed.times do
block.call
end
end
grandfather_clock {puts 'DONG!'}
|
class Role
include Mongoid::Document
field :name, type: String
belongs_to :app
belongs_to :permissions
has_many :assignments
end
|
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
class Climb < AbstractPhpPhar
init
desc "Composer version manager tool"
homepage "https://github.com/vinkla/climb"
url "https://github.com/vinkla/climb/releases/download/0.8.0/climb.phar"
sha256 "72c7dfa15d86b8c09bd0628bc11bed79ce00c9c03ce77fbbfed8f347cb6d96d9"
bottle do
cellar :any_skip_relocation
sha256 "e712bee279c51ebea7cac962e5a61bb3dc6986424a54ed528be694d325406eef" => :el_capitan
sha256 "cc6ded14b67effe3bd916b9037be10198fb30fb843076d6598b7d24cbc0765ef" => :yosemite
sha256 "a5646d7ae4751c0097162197901486c9ad6460f4054f5f29158c307e4713d13f" => :mavericks
end
test do
system "climb", "--version"
end
end
|
class Ball
@@image = Rubygame::Surface.load_image("resources/ball.png")
def initialize(x, y, moving_left, moving_up, min_x, max_x, min_y, max_y)
@step = 12
@x = x
@y = y
@x_start = x
@y_start = y
@moving_left = moving_left
@moving_up = moving_up
@min_x = min_x
@max_x = max_x
@min_y = min_y
@max_y = max_y
end
attr_reader :x, :y
def update
update_x_y
update_directions
end
def update_x_y
if @moving_left
@x -= @step
else
@x += @step
end
if @moving_up
@y -= @step
else
@y += @step
end
end
# x axis 0 --> max
# y axis 0
# |
# --> max
def update_directions
if @x <= @min_x
@moving_left = false
elsif @x >= (@max_x - width)
@moving_left = true
end
if @y <= @min_y
@moving_up = false
elsif @y >= (@max_y - height)
@moving_up = true
end
end
def blit(surface)
@@image.blit(surface,[@x,@y])
end
def collide(x, y)
# Is the point within the ball?
result_x = ( (x >= @x) and (x <= (@x + width)) )
result_y = ( ( y >= @y) and (y <= (@y + height)) )
result_x and result_y
end
def width
@@image.width
end
def height
@@image.height
end
def switch_x
@moving_left = !@moving_left
end
def switch_y
@moving_up = !@moving_up
end
end
|
Rails.application.routes.draw do
resources :candidate_profile, only: [:new, :create]
devise_for :users
namespace :admin do
resources :candidate_profiles, only: [:index, :show]
root 'candidate_profiles#index'
end
get '/guides' => 'guides#index'
root 'home#index'
end
|
class MealsController < ApplicationController
before_action :set_meal, only: [:show, :edit, :update, :destroy]
def index
@meals = Meal.all
end
def show
end
def new
@meal = Meal.new
end
def create
@meal = Meal.new(meals_params)
if @meal.save
redirect_to meals_path, notice: 'Your meal was created'
else
render :new
end
end
def edit
end
def update
if @meal.update(meals_params)
redirect_to meal_path(@meal)
else
render :edit
end
end
def destroy
@meal.destroy
redirect_to meals_path, notice: 'This meal was destroyed'
end
private
def set_meal
@meal = Meal.find(params[:id])
end
def meals_params
params.require(:meal).permit!
end
end
|
# $LICENSE
# Copyright 2013-2014 Spotify AB. All rights reserved.
#
# The contents of this file are licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
require_relative 'serializer/protocol0'
module FFWD::Plugin::Protobuf::Serializer
VERSIONS = {
0 => Protocol0
}
LATEST_VERSION = 0
def self.dump_frame string
[LATEST_VERSION, string.length + 8].pack("NN") + string
end
def self.load_frame string
if string.length < 8
raise "Frame too small, expected at least 8 bytes but got #{string.length}"
end
version = string[0..3].unpack("N")[0]
length = string[4..7].unpack("N")[0]
unless impl = VERSIONS[version]
raise "Unsupported protocol version #{version}, latest is #{LATEST_VERSION}"
end
if length != string.length
raise "Message length invalid, expected #{length} but got #{string.length}"
end
[impl, string[8..length]]
end
def self.dump_event event
unless impl = VERSIONS[LATEST_VERSION]
raise "No implementation for latest version: #{LATEST_VERSION}"
end
dump_frame impl.dump_event event
end
def self.dump_metric metric
unless impl = VERSIONS[LATEST_VERSION]
raise "No implementation for latest version: #{LATEST_VERSION}"
end
dump_frame impl.dump_metric metric
end
def self.load string
impl, string = load_frame string
impl.load string do |type, data|
yield type, data
end
end
end
|
require_relative './node'
require_relative './doubly_linked_list_errors'
class DoublyLinkedList
include DoublyLinkedListErrors
attr_reader :head, :tail, :length
def initialize
@head = nil
@tail = nil
@length = 0
end
def insert(data)
# O(1)
node = Node.new(data)
if @head
node.prev = @tail
@tail.next = node
else
@head = node
end
@tail = node
@length += 1
node
end
def delete(node)
# Ordinarily an O(1) operation, but the need to verify that the node is part
# of the list makes it an O(n) operation
raise NodeNotFound unless find { |existing_node| existing_node == node }
node == @head ? delete_head : delete_from_body(node)
@length -= 1
rescue NodeNotFound => message
puts message
end
private def delete_head
if @head.next
@head = @head.next
else
@head = @tail = nil
end
end
private def delete_from_body(node)
preceding_node = node.prev
next_node = node.next
preceding_node.next = next_node
next_node.prev = preceding_node if next_node
end
def concat(list)
# O(1)
unless list.is_a?(DoublyLinkedList)
raise ArgumentError.new("Expected a linked list, received #{list.class.name}")
end
@tail.next = list.head
list.head.prev = @tail
@tail = list.tail
@length += list.length
end
def clear
# O(n)
while @length > 0
delete(head)
end
end
def find(&predicate)
# O(n)
current = @head
while current
return current if yield(current)
current = current.next
end
end
def find_last(&predicate)
# O(n)
current = @tail
while current
return current if yield(current)
current = current.prev
end
end
def each(&block)
# O(n)
current = @head
while current
yield(current)
current = current.next
end
self
end
def reverse_each(&block)
# O(n)
current = @tail
while current
yield(current)
current = current.prev
end
self
end
def to_a
# O(n)
array = []
each { |node| array << node.data }
array
end
def map(reverse: false, &block)
# O(n)
mapped = DoublyLinkedList.new
mapper = Proc.new do |node|
value = block_given? ? yield(node.data) : node.data
mapped.insert(value)
end
reverse ? reverse_each(&mapper) : each(&mapper)
mapped
end
end
|
Rails.application.routes.draw do
devise_for :installs
devise_for :users, controllers: {sessions: 'sessions'}
root 'pages#home', id: 'home'
# Other Pages
get '/list', to: 'pages#list'
get '/terms', to: 'boilerplate#terms'
get '/home', to: redirect('/')
get '/admin', to: 'admin#index'
get '/users/:id/edit', to: redirect('/users')
get "/health_check", to: 'system_monitoring#health_check'
resources :deployment_info, :only => [:index]
scope :admin do
resources :users, :states, :groupings, :notices, :regions, :institutions
end
# Catch-all, redirect to root
get '*path', :to => redirect(path: '/', status: 302)
end
|
class Station
attr_reader :name, :trains
def initialize(name)
@name = name
@trains= []
end
#Принимает поезда
def take_train(train)
@trains << train
end
#Отправляет поезда
def send_train(train)
@trains.delete(train)
train.stations = nil
end
#Возращает список грузовых и пассажирских поездов
def list_trains_type (type)
@trains.each { |train| puts train if train.type == type}
end
end
class Route
attr_reader :start_station, :end_station, :stations
def initialize (start_station, end_station)
@start_station = start_station
@end_station = end_station
@stations = [start_station, end_station]
end
#Добавляет промежуточную станцию
def add_station (station)
@stations.insert(1, station)
end
#Удаляет промежуточную станцию
def delete_station(station)
@stations.delete(station)
end
end
class Train
TYPE = [:passenger, :cargo]
attr_reader :speed, :quantity_car, :type, :route, :number_train
def initialize(number_train, type, quantity_car)
@number_train = number_train
@type = type
@quantity_car = quantity_car
@speed = 0
end
#Возвращает текущую скорость
def current_speed
@speed
end
#Тормозит
def stop
@speed = 0
end
#Прицепляет вагоны
def add_car
if @speed == 0
@quantity_car +=1
end
end
#Отцепляет вагоны
def delete_car
if @speed == 0
@quantity_car -=1
end
end
#Принимает маршрут следования и поезд автоматически помещается на первую станцию
def train_route=(route)
route.stations.first.take_train(self)
@route = route
@index_stations = 0
end
#Поезд движется на одну станцию вперед
def move_forward
@index_stations += 1 if @index_stations != route.stations.length - 1
route.stations[@index_stations].name
end
#Поезд движется на одну станцию назад
def move_back
@index_stations -= 1 if @index_stations != 0
route.stations[@index_stations].name
end
#текущую
def current_station
current_station = route.stations[@index_stations]
current_station.name
end
#следующую
def next_station
route.stations[@index_stations + 1].name if @index_stations != route.stations.length - 1
end
#Возвращает предыдущую станцию
def previous_station
route.stations[@index_stations - 1].name if @index_stations != 0
end
end
station = Station.new("Саранск")
station_1 = Station.new("Москва")
station_2 = Station.new("Калининград")
station_3 = Station.new("Прекрасноедалеко")
station_4 = Station.new("Казань")
station_5 = Station.new("Саров")
route_1 = Route.new(station_1, station_3)
route_1.add_station(station_2)
route_1.add_station(station_4)
route_1.add_station(station_5)
route_1.stations
route_1.delete_station(station_4)
route_1.stations
train = Train.new(154, "passenger", 15)
train_1 = Train.new(2, "passenger", 5)
train_2 = Train.new(158, "cargo", 65)
train_3 = Train.new(10, "cargo", 7)
p train.add_car
p train.delete_car
train.train_route=(route_1)
station_2.trains
station_3.trains
station_3.trains
station_2.take_train(train_1)
station_2.take_train(train_2)
station_2.take_train(train_3)
station_2.trains
p train.current_station
p train.move_forward
p train.move_forward
p train.move_forward
p train.move_back
p train.move_back
p train.move_back
|
puts "Hello! What is your name?"
user_name = gets.chomp
again = "yes"
while again != "no"
puts "Welcome to the Love Letter Mad Lib " + user_name + "!"
puts " "
puts "Tell me a name:"
name_1 = gets.chomp
puts "Tell me an adjective:"
adjective_1 = gets.chomp
puts "Tell me a verb:"
verb_1 = gets.chomp
puts "Tell me a body part:"
bodypart_1 = gets.chomp
puts "Tell me a number:"
number_1 = gets.chomp
puts "Tell me a noun:"
noun_1 = gets.chomp
puts "Tell me an adverb:"
adverb_1 = gets.chomp
puts "Tell me a verb:"
verb_1 = gets.chomp
puts "Tell me a plural pronoun:"
plural_pronoun = gets.chomp
puts "Tell me a name:"
name_2 = gets.chomp
puts " "
puts "Thanks" + user_name + "! Here is your own Love Letter Mad Lib..."
puts " "
puts "Dear " + name_1 + ","
puts " "
puts "You are extremely " + adjective_1 + " and I " + verb_1 + " you!"
puts "I want to kiss your " + bodypart_1 + " " + number_1 + " times."
puts "You make my " + noun_1 + " burn with desire. When I first saw you, I " + adverb_1 + " stared at you and fell in love. Will you " + verb_1 + " out with me? Do not let your parents discourage you, " + plural_pronoun + " are just jealous."
puts " "
puts "Yours forever, "
puts " "
puts + name_2
puts " "
puts "That was great, wasn't it? Would you like to play again?"
again = gets.chomp
end
|
class LostsController < ApplicationController
load_and_authorize_resource
before_action :set_lost, only: [:show, :edit, :update, :destroy]
respond_to :html, :js
# GET /losts
def index
if params[:name]
@losts = Lost.search("%#{params[:name]}%")
flash[:notice] = "No search result found".html_safe if @losts.empty?
elsif params[:category_id]
@losts = Lost.where(:category_id => params[:category_id]).paginate(:page => params[:page], :per_page => 3).order('id DESC')
flash[:notice] = "No ad posted in this category".html_safe if @losts.empty?
else
@losts = Lost.paginate(:page => params[:page], :per_page => 3).order('id DESC')
end
if request.xhr?
render :js, :partial => "index"
end
end
# GET /losts/1
def show
@commentable = @lost
@comments = @commentable.comments
@comment = Comment.new
end
# GET /losts/new
def new
@lost = Lost.new
end
# GET /losts/1/edit
def edit
end
# POST /losts
def create
@lost = Lost.new(lost_params)
respond_to do |format|
if @lost.save
format.html { redirect_to @lost, notice: 'Lost was successfully created.' }
else
format.html { render :new }
end
end
end
# PATCH/PUT /losts/1
def update
respond_to do |format|
if @lost.update(lost_params)
format.html { redirect_to @lost, notice: 'Lost was successfully updated.' }
else
format.html { render :edit }
end
end
end
# DELETE /losts/1
def destroy
@lost.destroy
respond_to do |format|
format.html { redirect_to losts_url, notice: 'Lost was successfully destroyed.' }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_lost
@lost = Lost.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def lost_params
params.require(:lost).permit(:lost_img, :title, :lost_date, :location, :description, :reward, :user_id, :contact_info, :category_id, comments_attributes: :content)
end
end
|
=begin
@File Name : galleries_controller.rb
@Company Name : Mindfire Solutions Private Limited
@Creator Name : Vikram Kumar Mishra
@Date Created : 2013-03-03
@Date Modified :
@Last Modification Details :
@Purpose : To handle communication between gallery's data layer and presentation layer
=end
class GalleriesController < ApplicationController
before_filter :authenticate_user!
before_filter :fetch_user, :load_assets
# GET /galleries
# GET /galleries.json
def index
@galleries = @user.galleries
respond_to do |format|
format.html # index.html.erb
format.json { render json: @galleries }
end
end
# GET /galleries/1
# GET /galleries/1.json
def show
@gallery = @user.galleries.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @gallery }
end
end
# GET /galleries/new
# GET /galleries/new.json
def new
@gallery = @user.galleries.build
respond_to do |format|
format.html # new.html.erb
format.json { render json: @gallery }
end
end
# GET /galleries/1/edit
def edit
@gallery = @user.galleries.find(params[:id])
end
# POST /galleries
# POST /galleries.json
def create
@gallery = @user.galleries.build(params[:gallery])
respond_to do |format|
if @gallery.save
format.html { redirect_to user_galleries_path(current_user), notice: 'Gallery was successfully created.' }
format.json { render json: @gallery, status: :created, location: @user.galleries }
else
format.html { render action: "new" }
format.json { render json: @gallery.errors, status: :unprocessable_entity }
end
end
end
# PUT /galleries/1
# PUT /galleries/1.json
def update
@gallery = @user.galleries.find(params[:id])
respond_to do |format|
if @gallery.update_attributes(params[:gallery])
format.html { redirect_to user_galleries_path(current_user), notice: 'Gallery was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @gallery.errors, status: :unprocessable_entity }
end
end
end
# DELETE /galleries/1
# DELETE /galleries/1.json
def destroy
@gallery = @user.galleries.find(params[:id])
@gallery.destroy
respond_to do |format|
format.html { redirect_to user_galleries_path(current_user) }
format.json { head :no_content }
end
end
private
def fetch_user
@user = User.find(params[:user_id])
end
def load_assets
#AssetManager.include_local_library [:application]
AssetManager.include_css [:galleries]
end
end
|
require 'rubygems'
require 'rake'
require 'echoe'
require './lib/syslog_logger.rb'
Echoe.new('SyslogLogger', SyslogLogger::VERSION) do |p|
p.author = 'Eric Hodel; Chris Powell'
p.email = 'drbrain@segment7.net; cpowell@prylis.com'
p.description = "An improved Logger replacement that logs to syslog. It is almost drop-in with a few caveats."
p.url = "http://github.com/cpowell/sysloglogger"
p.ignore_pattern = ["tmp/*", "script/*"]
p.development_dependencies = []
end
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
# class for table departments
class StoreDepartment < ApplicationRecord
include Stats::Efficiency
include Defaults
include CommercialCalendar::Period
PERIODS = Settings.productivity_periods_keys
WEEK_PERIODS = Settings.productivity_week_periods_keys
belongs_to :store, dependent: :destroy
belongs_to :department, dependent: :destroy
belongs_to :world, dependent: :destroy
has_many :achievements
has_many :real_staffs
has_many :plan_staffs
has_many :real_sales
has_many :user_shifts
has_many :users
has_many :employees, class_name: 'Employee'
has_many :cashiers, -> { joins(:roles).where(roles: { name: 'cashier' }) }, class_name: 'Employee'
has_many :sales_assistants, -> { joins(:roles).where(roles: { name: 'sales_assistant' }) },
class_name: 'Employee'
has_many :sellers, -> { joins(:roles).where(roles: { name: 'seller' }) }, class_name: 'Employee'
has_many :target_productivities, dependent: :destroy
has_many :optimized_productivities, dependent: :destroy
has_many :target_sales, dependent: :destroy
has_and_belongs_to_many :categories, association_foreign_key: 'category_cod', dependent: :destroy
enum staff: {
asisted: 1,
selfasisted: 2,
personalized: 3
}
def categories_plan_sales_between_dates(period)
categories.joins(:sales_plans).merge(CategorySalesPlan.between(period, store.id))
end
def year_month_target_productivity(period = default_period)
year = year_by_date(period[:start])
month = month_by_date(period[:start])
target_productivities = self.target_productivities.
where(year: year, month: month).pluck(:amount)
target_productivities.sum / target_productivities.size
end
def categories_sales(period = default_period)
categories.joins(:sales).
where('category_sales.date between ? AND ?', period[:start], period[:end]).
where('category_sales.store_id = ?', store.id).sum('category_sales.amount')
end
def categories_rate_sales(period = default_period)
old_period = old_period(period)
sales = categories_sales_by_dates(old_period)
sales.each_with_object({}) do |(date, value), hash|
month_period = month_period(year_by_date(date), month_by_date(date))
date = equivalent_date_next_year(date)
month_sales = sales.select do |key, _|
(month_period[:start]..month_period[:end]).to_a.include? key
end.values.sum
hash[date] = value / month_sales
end
end
def categories_sales_by_dates(period = default_period)
categories.joins(:sales).order('category_sales.date').
where('category_sales.date between ? AND ?', period[:start], period[:end]).
where('category_sales.store_id = ?', store.id).
group(:date).sum('category_sales.amount')
end
def categories_sales_plan_by_dates(period = default_period)
daily_sales_plan = categories_plan_sales_between_dates(period).
pluck('category_sales_plans.daily')
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
hash[date] = daily_sales_plan.map { |sales_plan| sales_plan[date.to_s].to_i }.sum
end
end
def categories_plan_sales(period = default_period)
categories_plan_sales_between_dates(period).
group(:year, :month).sum('category_sales_plans.monthly')
end
def categories_sales_by_date_hour(date)
hourly_sales = categories.joins(:sales).where(category_sales: { store_id: store, date: date }).
pluck('category_sales.hourly')
PERIODS.each_with_object({}) do |key, hash|
hash[key] = hourly_sales.map { |sale| sale[key].to_i }.sum
end
end
def hourly_planned_staff_by_date(period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
employees = self.employees.count_planned_employees_by_hour(date)
hash[date] = employees.values.sum
end
end
def categories_sales_plan_by_date_hour(period)
sales_plan = categories.joins(:sales_plans).merge(CategorySalesPlan.between(period, store)).
pluck('category_sales_plans.daily')
sales_plans_by_date = sales_plan.each_with_object({}) do |daily_sale, hash|
(period[:start]..period[:end]).each do |date|
hash[date] ||= 0
hash[date] += daily_sale[date.to_s].to_i
end
end
(period[:start]..period[:end]).each_with_object({}).each do |date, hash|
past_sale = categories_sales_by_date_hour(equivalent_date_past_year(date))
employees = self.employees.working_on_date(date).count_employees_by_hour(date)
day_past_sale = past_sale.values.sum
hash[date] = PERIODS.each_with_object({}) do |hour, h|
h[hour] = sales_plans_by_date[date] * (past_sale[hour].to_f / day_past_sale) / (employees[hour] || 1)
end
end
end
def efficiency(period = default_period)
efficiencies = efficiency_by_date(period)
efficiencies.values.sum / efficiencies.size
end
def productivity(period = default_period)
productivities = productivity_by_date_hour(period).values.flat_map { |k, _| k.values }
return 0 unless productivities.size.positive?
productivities.sum / productivities.size
end
def efficiency_by_date(period = default_period)
prods = productivity_by_date_hour(period)
targets = target_productivities.by_date_hour(period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
abs_desviation = abs_desviation(prods[date], targets[date])
hash[date] = day_efficiency(abs_desviation, targets[date])
end
end
def hour_analysis_by_date(period = default_period)
prods = productivity_by_date_hour(period)
targets = target_productivities.by_date_hour(period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
hash[date] = hours_excess_and_deficit(prods[date], targets[date])
end
end
def plan_hour_analysis_by_date(period = default_period)
prods = productivity_plan_by_date_hour(period)
targets = target_productivities.by_date_hour(period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
hash[date] = hours_excess_and_deficit(prods[date], targets[date])
end
end
def productivity_by_date_hour(period = default_period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
employees = self.employees.working_on_date(date).count_employees_by_hour(date)
sales = categories_sales_by_date_hour(date)
productivity = employees.keys.map { |hour| (sales[hour] / employees[hour].to_f).round(2) }
hash[date] = employees.keys.zip(productivity).to_h
end
end
def productivity_plan_by_date_hour(period = default_period)
(period[:start]..period[:end]).each_with_object({}) do |date, hash|
employees = self.employees.count_planned_employees_by_hour(date)
sales = categories_sales_by_date_hour(date)
productivity = employees.keys.map { |hour| (sales[hour] / employees[hour].to_f).round(2) }
hash[date] = employees.keys.zip(productivity).to_h
end
end
def productivity_by_date(period = default_period)
productivity_by_date_hour(period).each_with_object({}) do |(k, v), hash|
hash[k] = v.values.sum / v.values.size
end
end
def optimized_productivity_by_date(period = default_period)
optimized_productivities.by_date_hour(period)
end
def no_optimized_productivity_by_date(period = default_period)
categories_sales_plan_by_date_hour(period).each_with_object({}) do |(date, periods), hash|
hash[date] = periods.values.sum / periods.values.count
end
end
def target_productivity_by_date(period = default_period)
productivities = target_productivities.by_date_hour(period)
productivity_filter_week_periods(productivities)
end
private
def productivity_filter_week_periods(productivities)
productivities.keys.each_with_object({}) do |date, hash|
WEEK_PERIODS.keys.each do |p|
hash[date] ||= 0
productivity = productivities[date]
period_productivity = if date_included_on_productivity_period?(p, date)
period = productivity.slice(*WEEK_PERIODS[p]).values
weight = (WEEK_PERIODS[p].size / productivity.size.to_f)
period.present? ? (period.sum / period.size) * weight : 0
else
0
end
hash[date] += period_productivity
end
end
end
end
|
class TagsController < ApplicationController
def index
render json: ActsAsTaggableOn::Tag.where('taggings_count > 0').pluck(:name).to_json
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.