repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
ipublic/marketplace | spec/factories/determinations_ui_write_off_eligibility_determinations.rb | <filename>spec/factories/determinations_ui_write_off_eligibility_determinations.rb<gh_stars>0
FactoryBot.define do
factory :determinations_ui_write_off_eligibility_determination, class: 'Determinations::UiWriteOffEligibilityDetermination' do
end
end
|
ipublic/marketplace | spec/factories/wages_wages.rb | <gh_stars>0
FactoryBot.define do
factory :wages_wage, class: 'Wages::Wage' do
association :person_party
state_qtr_ui_total_wages { 40_125.32 }
state_qtr_ui_excess_wages { 5_125.11 }
state_qtr_ui_taxable_wages { state_qtr_ui_total_wages - state_qtr_ui_excess_wages }
end
end
|
ipublic/marketplace | spec/factories/quanta_time_periods.rb | <gh_stars>0
FactoryBot.define do
factory :quanta_time_period, class: 'Quanta::TimePeriod' do
end
end
|
ipublic/marketplace | spec/factories/determinations_individual_ui_liability_determinations.rb | FactoryBot.define do
factory :determinations_individual_ui_liability_determination, class: 'Determinations::IndividualUiLiabilityDetermination' do
end
end
|
ipublic/marketplace | app/models/parties/party_relationship_kind.rb | <gh_stars>0
module Parties
class PartyRelationshipKind
include Mongoid::Document
include Mongoid::Timestamps
field :key, type: Symbol
field :title, type: String
field :description, type: String
# List of PartyRoleKind roles that can be played between the Party... |
ipublic/marketplace | spec/factories/parties_naics_classifications.rb | <reponame>ipublic/marketplace
FactoryBot.define do
factory :parties_naics_classification, class: 'Parties::NaicsClassification' do
end
end
|
ipublic/marketplace | app/models/sagas/activities/activity.rb | <reponame>ipublic/marketplace
class Sagas::Activities::Activity
def do_work(work_item)
# logfile: activity title
# perform activity work
# logfile: activity success
# return value
end
def compensate(item, routing_slip)
item.result
# logfile: canceled instance
end
def work_item_queue_address
Uri.n... |
ipublic/marketplace | spec/factories/quanta_cycles.rb | FactoryBot.define do
factory :quanta_cycle, class: 'Quanta::Cycle' do
end
end
|
ipublic/marketplace | app/models/roles/role_factory.rb | <filename>app/models/roles/role_factory.rb
module Roles
class RoleFactory
attr_accessor :party_role
def self.call(party, party_role_kind_key)
build(party, args).party_role
end
# look up party_role_kind
# validate role isn't already active for this party
def initialize(party, party_role_k... |
ipublic/marketplace | spec/factories/financial_accounts_group_insurance_financial_accounts.rb | <gh_stars>0
FactoryBot.define do
factory :financial_accounts_group_insurance_financial_account, class: 'FinancialAccounts::GroupInsuranceFinancialAccount' do
end
end
|
ipublic/marketplace | app/models/fees/administrative_fee.rb | <reponame>ipublic/marketplace
class Fees::AdministrativeFee
include Mongoid::Document
end
|
ipublic/marketplace | app/models/determinations/individual_health_insurance_eligibility_determination.rb | class Determinations::IndividualHealthInsuranceEligibilityDetermination
include Mongoid::Document
end
|
ipublic/marketplace | spec/factories/roles_relationship_role_factories.rb | FactoryBot.define do
factory :roles_relationship_role_factory, class: 'Roles::RelationshipRoleFactory' do
end
end
|
ipublic/marketplace | spec/models/employers/employer_form_spec.rb | require 'rails_helper'
RSpec.describe Employers::EmployerForm, dbclean: true do
describe Employers::EmployerForm do
describe "##for_create" do
let(:contact_info) do
{ :first_name => 'Silky',
:last_name => 'Johnston',
:dob => '09/22/1981',
:email => '<EMAIL>',
... |
ipublic/marketplace | app/models/timespans/timespan.rb | module Timespans
YEAR_MAXIMUM = 2099
YEAR_MINIMUM = 1980
class Timespan
include Mongoid::Document
include Mongoid::Timestamps
field :title, type: String
field :begin_on, type: Date
field :end_on, type: Date
field :type, type: String
has_many :wage_reports,
... |
ipublic/marketplace | app/controllers/tpas_controller.rb | <reponame>ipublic/marketplace<filename>app/controllers/tpas_controller.rb<gh_stars>0
class TpasController < ApplicationController
layout 'two_column'
before_action :authenticate_user!
def index
end
def get_tpas
@tpas = []
Parties::Party.each do |party|
if party.present?
kind = party.pa... |
ipublic/marketplace | app/models/quanta/timespan.rb | <filename>app/models/quanta/timespan.rb
# frozen_string_literal: true
module Quanta
# Length of time for which something lasts
class Timespan
include Mongoid::Document
include Mongoid::Timestamps
embeds_one :duration
has_many :sub_timespans
end
end
|
ipublic/marketplace | spec/models/parties/organization_party_spec.rb | require 'rails_helper'
module Parties
RSpec.describe OrganizationParty, type: :model, dbclean: :after_each do
it { is_expected.to have_many(:wage_reports)}
it { is_expected.to embed_many(:naics_classifications)}
let(:legal_name) { "<NAME>, Inc" }
let(:fein) ... |
ipublic/marketplace | app/models/determinations/ui_write_off_eligibility_determination.rb | class Determinations::UiWriteOffEligibilityDetermination
include Mongoid::Document
end
|
ipublic/marketplace | spec/factories/wages_wage_report_services.rb | <filename>spec/factories/wages_wage_report_services.rb
FactoryBot.define do
factory :wages_wage_report_service, class: 'Wages::WageReportService' do
end
end
|
ipublic/marketplace | app/models/parties/party_role.rb | # A Person or Organization may play different roles on the system. A Role may be declarative, stating a fact
# about the subject, for example: :employer, :s_corporation. Roles may include a relationship, which includes
# a specific role pair that references two object instances, for example: an :employment relation... |
ipublic/marketplace | app/models/sagas/saga.rb | # The Saga pattern solves for long-lived, distributed transactions without using two-pase commit.
# Each activity in a workflow must succeed in order for the overarching transaction
# to succeed. If a component-level activity fails, any preceding activities are reversed
class Sagas::Saga
RESERVATION_ROUTING_SLIP =... |
ipublic/marketplace | spec/factories/wages_wage_report_factories.rb | <reponame>ipublic/marketplace
FactoryBot.define do
factory :wages_wage_report_factory, class: 'Wages::WageReportFactory' do
end
end
|
ipublic/marketplace | app/models/current.rb | <reponame>ipublic/marketplace
class Current < ActiveSupport::CurrentAttributes
attribute :account, :user
attribute :request_id, :user_agent, :ip_address
resets { Time.zone = nil }
end
|
ipublic/marketplace | app/jobs/sell_cupcake_job.rb | class SellCupcakeJob < ApplicationJob
queue_as :default
def perform(cupcakes = [])
json_api_opts = {}
json_api_opts[is_collection: true]
json_api_opts[:meta] = {total: cupcakes.length }
serializer = CupcakeSerializer.new(cupcakes, json_api_opts)
message = serializer.serialized_json
Activ... |
ipublic/marketplace | app/models/notices/ui_blocked_claim_eligible_notice.rb | <filename>app/models/notices/ui_blocked_claim_eligible_notice.rb
class Notices::UiBlockedClaimEligibleNotice
include Mongoid::Document
end
|
ipublic/marketplace | app/models/parties/person_party.rb | module Parties
class PersonParty < Party
GENDER_KINDS = %W(male female)
field :business_title, type: String
field :current_first_name, type: String
field :current_middle_name, type: String
field :current_last_name, type: String
field :current_name_pfx, type: String
field :current_name_sfx... |
ipublic/marketplace | app/models/cases/ui_blocked_claim_case.rb | module Cases
class UiBlockedClaimCase
include Mongoid::Document
end
end
|
ipublic/marketplace | app/models/fees/tax.rb | class Fees::Tax
include Mongoid::Document
end
|
ipublic/marketplace | app/models/cases/case.rb | module Cases
class Case
include Mongoid::Document
belongs_to :party,
class_name: 'Parties;:Party'
end
end
|
ipublic/marketplace | spec/factories/integrations_get_offers_in_compromises.rb | <reponame>ipublic/marketplace
FactoryBot.define do
factory :integrations_get_offers_in_compromise, class: 'Integrations::GetOffersInCompromise' do
end
end
|
ipublic/marketplace | spec/factories/financial_accounts_pfl_financial_accounts.rb | <gh_stars>0
FactoryBot.define do
factory :financial_accounts_pfl_financial_account, class: 'FinancialAccounts::PflFinancialAccount' do
end
end
|
ipublic/marketplace | spec/factories/fees_fees.rb | <gh_stars>0
FactoryBot.define do
factory :fees_fee, class: 'Fees::Fee' do
end
end
|
ipublic/marketplace | app/controllers/api/v3/echo_controller.rb | class Api::V3::EchoController < ApplicationController
before_action :shout_out
def show
# render json: @echo
end
private
def shout_out
@echo =
{
id: 54321,
message: "Hello World!",
}
end
end
|
ipublic/marketplace | app/models/taxes/tax.rb | <filename>app/models/taxes/tax.rb
class Taxes::Tax
include Mongoid::Document
end
|
ipublic/marketplace | app/models/dispatcher/job.rb | module Dispatcher
class Job
include Mongoid::Document
include Mongoid::Timestamps
# embedded_in
end
end
|
ipublic/marketplace | app/models/financial_accounts/financial_account_factory.rb | module FinancialAccounts
class FinancialAccountFactory
UI_FINANCIAL_ACCOUNT_KIND = :ui_financial_account
PFL_FINANCIAL_ACCOUNT_KIND = :pfl_financial_account
attr_accessor :financial_account
def self.call(party, args)
new(party, args).financial_account
end
def initialize(party, args)
... |
ipublic/marketplace | app/models/parties/party_role_kind.rb | <reponame>ipublic/marketplace
# Actor roles or categories that a Party entity plays in the context of the enterprise.
module Parties
class PartyRoleKind
include Mongoid::Document
include Mongoid::Timestamps
field :key, type: Symbol
field :title, type: String
field :description, ... |
ipublic/marketplace | lib/account_middleware.rb | <filename>lib/account_middleware.rb
# Rack Middleware extension that inspects the request string for an account value and populates
# CurrentAttributes with information based on the account
# Application URL includes the Account identifier as the first value
# in the request string. For example a request formatted as... |
ipublic/marketplace | spec/factories/dispatcher_tasks_tasks.rb | FactoryBot.define do
factory :dispatcher_tasks_task, class: 'Dispatcher::Tasks::Task' do
end
end
|
ipublic/marketplace | spec/factories/sagas_activities_activity_hosts.rb | <reponame>ipublic/marketplace
FactoryBot.define do
factory :sagas_activities_activity_host, class: 'Sagas::Activities::ActivityHost' do
end
end
|
ipublic/marketplace | spec/models/parties/party_role_kind_spec.rb | <reponame>ipublic/marketplace
require 'rails_helper'
RSpec.describe Parties::PartyRoleKind, type: :model, dbclean: :after_each do
it { is_expected.to be_mongoid_document }
it { is_expected.to have_timestamps }
it { is_expected.to have_fields(:key, :title, :description, :is_published, :start_date, :end_date)... |
ipublic/marketplace | app/models/wages/nonexempt_wage_entry.rb | module Wages
class NonexemptWageEntry < Wage
field :hours_worked, type: Integer
end
end
|
ipublic/marketplace | spec/factories/timespans_calendar_year_timespans.rb | <filename>spec/factories/timespans_calendar_year_timespans.rb
FactoryBot.define do
factory :timespans_calendar_year_timespan, class: 'Timespans::CalendarYearTimespan' do
year { TimeKeeper.date_of_record.year }
end
end
|
ipublic/marketplace | app/controllers/notifications_controller.rb | <gh_stars>0
class NotificationsController < ApplicationController
layout 'two_column'
before_action :authenticate_user!
end
|
ipublic/marketplace | spec/factories/dispatcher_activities_group_reinstate_activities.rb | <filename>spec/factories/dispatcher_activities_group_reinstate_activities.rb<gh_stars>0
FactoryBot.define do
factory :dispatcher_activities_group_reinstate_activity, class: 'Dispatcher::Activities::GroupReinstateActivity' do
end
end
|
ipublic/marketplace | app/models/financial_accounts/liability_ledger_account_balance.rb | <reponame>ipublic/marketplace<gh_stars>0
module FinancialAccounts
class LiabilityLedgerAccountBalance
include Mongoid::Document
end
end
|
ipublic/marketplace | app/models/notices/ui_delinquency_notice.rb | <filename>app/models/notices/ui_delinquency_notice.rb
class Notices::UiDelinquencyNotice
include Mongoid::Document
end
|
ipublic/marketplace | app/models/bakery/cupcake.rb | # frozen_string_literal: true
module Bakery
class Cupcake
include Mongoid::Document
include Mongoid::Timestamps
CAKE_KINDS = %w[ white chocolate yellow ].freeze
FROSTING_KINDS = %w[ vanilla chocolate strawberry banana grape cherry coconut ].freeze
field :cc_id, type: Integer
field :ca... |
ipublic/marketplace | spec/factories/financial_accounts_contribution_rates.rb | <filename>spec/factories/financial_accounts_contribution_rates.rb<gh_stars>0
FactoryBot.define do
factory :financial_accounts_contribution_rate, class: 'FinancialAccounts::ContributionRate' do
end
end
|
swt2-intro-exercise/rails-exercise-18-JonasZim | spec/features/author/list_authors_spec.rb | require 'rails_helper'
describe 'authors page', type: :feature do
it 'should render without error' do
visit '/authors'
end
it 'should have a table with the authors name' do
visit '/authors'
expect(page).to have_selector('table tr')
expect(page).to have_link 'New', href: n... |
swt2-intro-exercise/rails-exercise-18-JonasZim | spec/features/author/new_author_spec.rb | require 'rails_helper'
describe "New author page", type: :feature do
it "should render withour error" do
visit new_author_path
end
it "should have text inputs for an author's first name, last name, and homepage" do
visit new_author_path
# these are the standard names given to inputs by the f... |
swt2-intro-exercise/rails-exercise-18-JonasZim | spec/models/author_spec.rb | require 'rails_helper'
RSpec.describe Author, type: :model do
it "should do sth" do
author = Author.new('first_name' => 'Alan', 'last_name'=>'Turing', 'homepage'=>'http://wikipedia.org/Alan_Turing')
expect(author.name).to eq('<NAME>')
expect(author.homepage).to eq('http://wikipedia.org/Alan_Turing')
e... |
iwat/codejam | case20201ac/gen.rb | 100000.times do
puts 1000000
end
|
matti/kbe | lib/kbe/cli/version_command.rb | # frozen_string_literal: true
module KBE
module CLI
class VersionCommand < Clamp::Command
def execute
puts KBE::VERSION
end
end
end
end
|
matti/kbe | lib/kbe/cli/logs_command.rb | <gh_stars>0
# frozen_string_literal: true
module KBE
module CLI
class LogsCommand < Clamp::Command
option ['-h', '--help'], :flag, "help" do
puts "kbe delete selector"
exit 0
end
parameter "SELECTOR_OR_POD", "selector or pod name"
parameter "[CONTAINER]", "container"
... |
matti/kbe | lib/kbe/cli/root_command.rb | # frozen_string_literal: true
require_relative "version_command"
require_relative "help_command"
require_relative "enter_command"
require_relative "list_command"
require_relative "delete_command"
require_relative "logs_command"
require_relative "attach_command"
module KBE
module CLI
class RootCommand < Clamp::Co... |
matti/kbe | lib/kbe/cli/help_command.rb | <filename>lib/kbe/cli/help_command.rb
# frozen_string_literal: true
module KBE
module CLI
class HelpCommand < Clamp::Command
def execute
exec "kbe -h"
end
end
end
end
|
matti/kbe | lib/kbe/cli.rb | <gh_stars>0
require 'clamp'
Clamp.allow_options_after_parameters = true
module KBE
module CLI
end
end
require_relative 'cli/root_command'
|
matti/kbe | lib/kbe/cli/attach_command.rb | <reponame>matti/kbe
# frozen_string_literal: true
module KBE
module CLI
class AttachCommand < Clamp::Command
option ['-h', '--help'], :flag, "help" do
puts "kbe attach myapp"
exit 0
end
option ['-c', '--container'], 'CONTAINER', 'container', default: :first
parameter "SE... |
matti/kbe | lib/kbe.rb | <reponame>matti/kbe<gh_stars>0
require "colorize"
module KBE
class Error < StandardError; end
def self.kubectl(*args)
cmd = []
cmd << "kubectl"
cmd << args
cmd_string = cmd.join " "
STDERR.puts cmd_string.colorize(:light_black)
exec cmd_string
end
def self.pod_by(name_or_selector, onl... |
matti/kbe | lib/kbe/cli/delete_command.rb | # frozen_string_literal: true
require "json"
module KBE
module CLI
class DeleteCommand < Clamp::Command
option ['-h', '--help'], :flag, "help" do
puts "kbe delete selector"
exit 0
end
parameter "SELECTOR_OR_POD", "selector or pod name"
def execute
pod = KBE.pod_b... |
matti/kbe | lib/kbe/cli/list_command.rb | <filename>lib/kbe/cli/list_command.rb
# frozen_string_literal: true
require "json"
module KBE
module CLI
class ListCommand < Clamp::Command
option ['-h', '--help'], :flag, "help" do
puts "kbe list"
puts "kbe list pod"
exit 0
end
parameter "[POD]", "list containers from ... |
mediamonks/MMMocking | MMMocking.podspec | <gh_stars>0
#
# MMMocking. Part of MMMTemple.
# Copyright (C) 2015-2020 MediaMonks. All rights reserved.
#
Pod::Spec.new do |s|
s.name = "MMMocking"
s.version = "0.1.4"
s.summary = "Mock data using hip lorem ipsum and pseudo random numbers"
s.description = s.summary
s.homepage = "https://github.com/mediamonks/#... |
nhayes-roth/sample_app | test/models/user_test.rb | <filename>test/models/user_test.rb
require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = users(:user1)
end
test "should be valid" do
user = User.new(name: "Example User", email: "<EMAIL>", password: "password", password_confirmation: "password")
assert user.valid?
end
... |
nhayes-roth/sample_app | app/models/user.rb | class User < ApplicationRecord
attr_accessor(:remember_token)
before_save { self.email = email.downcase }
validates(
:name,
{
presence: true,
length: { maximum: 99 }
})
validates(
:email,
{
presence: true,
length: { maximum: 99 },
format: { with: /\A[\w+\-.]+@... |
nhayes-roth/sample_app | test/integration/users_edit_account_settings_test.rb | <filename>test/integration/users_edit_account_settings_test.rb
require 'test_helper'
class UsersEditAccountSettingsTest < ActionDispatch::IntegrationTest
def setup
@user1 = users(:user1)
@user2 = users(:user2)
end
test "update success same password" do
login()
get edit_user_path(@user1)
... |
nhayes-roth/sample_app | test/controllers/users_controller_test.rb | <reponame>nhayes-roth/sample_app<filename>test/controllers/users_controller_test.rb
require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
def setup
@user1 = users(:user1)
@user2 = users(:user2)
@admin = users(:admin)
end
################ Basic route tests ###############... |
nhayes-roth/sample_app | app/helpers/sessions_helper.rb | <gh_stars>0
module SessionsHelper
LOGIN_SUCCESS = 'Successfully logged in!'
# Logs the specified user in and updates the session's user.id and cookies.
def login(user, remember_me='1')
session[:user_id] = user.id
remember_via_cookies(user) if remember_me == '1'
return @user = current_user()
end
... |
nhayes-roth/sample_app | app/controllers/users_controller.rb | class UsersController < ApplicationController
before_action :check_logged_in, only: [:index, :edit, :update, :destroy]
before_action :check_authorized, only: [:edit, :update, :destroy]
DEFAULT_PAGE_SIZE = 25
MAX_PAGE_SIZE = 100
SIGNUP_SUCCESS = "Successfully signed up! Welcome!"
DESTROY_SUCCESS = "Succe... |
nhayes-roth/sample_app | config/environment.rb | <filename>config/environment.rb
# Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
# Configure logger
Rails.logger = ActiveSupport::Logger.new(STDOUT)
Rails.logger.level = Logger::INFO |
nhayes-roth/sample_app | app/helpers/application_helper.rb | <filename>app/helpers/application_helper.rb
module ApplicationHelper
BASE_TITLE = "Ruby on Rails Tutorial Sample App"
# Returns an html page title, optionally adding a page-specific prefix
def full_title(page_title = "")
page_title.empty? ?
BASE_TITLE :
"#{page_title} | #{BASE_TITLE}"
end
... |
nhayes-roth/sample_app | test/integration/users_authorization_redirect_test.rb | require 'test_helper'
class UsersAuthorizationRedirectTest < ActionDispatch::IntegrationTest
class Operation
attr_accessor(:description, :url, :operation)
def set_description(description)
@description = description
end
def set_url(url)
@url = url
end
def set_operation(lambda)
... |
nhayes-roth/sample_app | test/integration/users_show_test.rb | <reponame>nhayes-roth/sample_app
require 'test_helper'
class UsersShowTest < ActionDispatch::IntegrationTest
def setup
@user1 = users(:user1)
@user2 = users(:user2)
end
test "get my profile logged in" do
login
get(user_path(@user1))
assert_select("a[href=?]", edit_user_path(@user1))
end... |
nhayes-roth/sample_app | app/controllers/sessions_controller.rb | class SessionsController < ApplicationController
def new
end
def create
# Fail fast if either param is empty.
if params[:session][:email].empty? or params[:session][:password].empty?
flash.now[:danger] = 'Please enter your email and password.'
render 'new'
return
end
# Check if ... |
nhayes-roth/sample_app | test/integration/users_login_test.rb | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:user1)
end
test "empty params" do
params1 = {session: {email: "", password: ""}}
params2 = {session: {email: "", password: "<PASSWORD>"}}
params3 = {session: {email: @user.email, password: ""}}... |
nhayes-roth/sample_app | test/integration/users_index_test.rb | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@user1 = users(:user1)
@user2 = users(:user2)
@admin = users(:admin)
@users = [@user1, @user2, @admin].sort_by(&:id)
end
################ Basic route tests ################
test "get first page no params" ... |
nhayes-roth/sample_app | config/routes.rb | Rails.application.routes.draw do
root 'static_pages#home'
# StaticPages
get '/about', to: 'static_pages#about'
get '/help', to: 'static_pages#help'
get '/home', to: 'static_pages#home'
get '/contact', to: 'static_pages#contact'
# Users
get '/signup', to: 'users#new'
post '/signup', to: 'u... |
nhayes-roth/sample_app | test/integration/users_destroy_test_test.rb | <reponame>nhayes-roth/sample_app<filename>test/integration/users_destroy_test_test.rb
require 'test_helper'
class UsersDestroyTestTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:admin)
@user1 = users(:user1)
@user2 = users(:user2)
end
test "delete my own account should succeed" do
... |
nhayes-roth/sample_app | test/helpers/sessions_helper_test.rb | <gh_stars>0
require 'test_helper'
class SessionsHelperTest < ActionView::TestCase
def setup
@user = users(:user1)
end
test "current user returns nil when not logged in" do
assert_nil current_user
end
test "current user returns user when logged in without cookies" do
login(@user, remember_me=... |
nhayes-roth/sample_app | test/test_helper.rb | <filename>test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
include ApplicationHelper
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests... |
nhayes-roth/sample_app | test/controllers/sessions_controller_test.rb | require 'test_helper'
class SessionsControllerTest < ActionDispatch::IntegrationTest
test "should get login" do
get login_path
assert_response :success
end
# test "should create new session" do
# post login_path
# assert_response :success
# end
# test "should delete session" do
# delete... |
djireland/ASDReviews | apple-store-web-crawler.ruby | #!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'httparty'
require 'sqlite3'
class String
def string_between_markers marker1, marker2
self[/#{Regexp.escape(marker1)}(.*?)#{Regexp.escape(marker2)}/m, 1]
end
end
# MODIFY YOUR NATIVE LANGUAGE
NATIVE_LANGUAGE = 'en'
# MODIFY THIS HA... |
SupportBee/omniauth-asana | lib/omniauth/strategies/asana.rb | <filename>lib/omniauth/strategies/asana.rb
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Asana < OmniAuth::Strategies::OAuth2
option :client_options, {
:site => 'https://app.asana.com',
:authorize_url => 'https://app.asana.com/-/oauth_authorize',
:token_url => 'h... |
pre-sniff/pre-sniff-objc | PreDemCocoa.podspec | <filename>PreDemCocoa.podspec
Pod::Spec.new do |s|
s.name = "PreDemCocoa"
s.version = `sh utils.sh get-release-version`
s.summary = "A short description of PreDemCocoa."
s.homepage = "https://github.com/pre-dem/pre-dem-cocoa"
s.license = "MIT"
s.author = { "qiniu" => "<EMAIL... |
shinwang1/sms-twilio-test | app/controllers/notifications_controller.rb | class NotificationsController < ApplicationController
rescue_from StandardError do |exception|
trigger_sms_alerts(exception)
end
def trigger_sms_alerts(e)
@alert_message = "
[This is a test] ALERT!
It appears the server is having issues.
Exception: #{e}.
Go to: http://newrelic... |
krisf/refinerycms-inquiries | spec/factories/inquiry.rb | <gh_stars>0
FactoryGirl.define do
factory :inquiry, class: Refinery::Inquiries::Inquiry do
name "Refinery"
email "<EMAIL>"
message "Hello..."
end
end
|
krisf/refinerycms-inquiries | app/controllers/refinery/inquiries/admin/inquiries_controller.rb | module Refinery
module Inquiries
module Admin
class InquiriesController < ::Refinery::AdminController
crudify :'refinery/inquiries/inquiry',
:title_attribute => "name",
:order => "created_at DESC"
helper_method :group_by_date
before_filter :find_all... |
krisf/refinerycms-inquiries | app/controllers/refinery/inquiries/inquiries_controller.rb | module Refinery
module Inquiries
class InquiriesController < ::ApplicationController
before_filter :find_page, only: [:create, :new]
before_filter :find_thank_you_page, only: :thank_you
def thank_you
end
def new
@inquiry = Inquiry.new
end
def create
@i... |
krisf/refinerycms-inquiries | app/models/refinery/inquiries/setting.rb | <gh_stars>0
require 'refinery/setting'
module Refinery
module Inquiries
class Setting < ::Refinery::Setting
class << self
def confirmation_body
find_or_set(:inquiry_confirmation_body,
"Thank you for your inquiry %name%,\n\nThis email is a receipt to confirm we have received y... |
krisf/refinerycms-inquiries | app/models/refinery/inquiries/inquiry.rb | <reponame>krisf/refinerycms-inquiries
require 'refinery/core/base_model'
require 'filters_spam'
module Refinery
module Inquiries
class Inquiry < Refinery::Core::BaseModel
filters_spam message_field: :message,
email_field: :email,
author_field: :name,
... |
krisf/refinerycms-inquiries | spec/models/refinery/inquiries/setting_spec.rb | <reponame>krisf/refinerycms-inquiries<gh_stars>0
require 'spec_helper'
module Refinery
module Inquiries
describe Setting do
describe ".notification_recipients=" do
it "delegates to Refinery::Setting#set" do
expect(Refinery::Setting).to receive(:set).
with(:inquiry_notification... |
krisf/refinerycms-inquiries | spec/features/refinery/inquiries/inquiries_spec.rb | <gh_stars>0
require "spec_helper"
module Refinery
module Inquiries
describe "inquiries" do
before(:each) do
# load in seeds we use in migration
Refinery::Inquiries::Engine.load_seed
end
context "when valid data" do
it "is successful" do
visit refinery.inquirie... |
SmallTwoInn/XZTest | XZTest.podspec | <reponame>SmallTwoInn/XZTest<gh_stars>0
#
# Be sure to run `pod spec lint XZTest.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in th... |
jirokun/csvutil | csvutil.rb | <gh_stars>0
require 'csv'
require 'optparse'
require 'fileutils'
require './lib/postgres.rb'
require './lib/oracle.rb'
opt = OptionParser.new
opt.version = '0.0.1'
options = {}
opt.on('-t DATABASE', '--target=DATABASE', 'Target database, postgres | oracle', ['postgres', 'oracle']) {|v| options[:target] = v }
opt.on('... |
jirokun/csvutil | lib/oracle.rb | <reponame>jirokun/csvutil
class Oracle
def initialize(options, headers)
@options = options
@headers = headers
end
def create_table
create_sql = "create table #{@options[:table_name]} ("
create_sql += @headers.map {|c| "#{c} varchar2(1000)"}.join(',')
create_sql += ");"
open(@options[:tabl... |
frostdot/net-ldap-auth | lib/net/ldap/auth.rb | <reponame>frostdot/net-ldap-auth
# coding: utf-8
require 'net/ldap'
module Net
class LDAP
module Auth
module_function
def auth(param)
return false unless param
return false unless param[:host] && param[:host] != ""
return false unless param[:userdn] && param[:userdn] != ""
... |
deivid-rodriguez/activeadmin_addons | lib/activeadmin_addons/addons/tag_builder.rb | <reponame>deivid-rodriguez/activeadmin_addons
module ActiveAdminAddons
class TagBuilder < CustomBuilder
def render
@enum_attr = if enumerize_attr?
:enumerize
elsif rails_enum_attr?
:enum
end
raise "you need to pass an enu... |
deivid-rodriguez/activeadmin_addons | spec/features/tag_builder_spec.rb | require 'rails_helper'
describe "Tag Builder", type: :feature do
context "using Enumerize" do
context "changing state value" do
before do
register_index(Invoice) do
tag_column :state
end
create_invoice(state: :approved)
visit admin_invoices_path
end
i... |
deivid-rodriguez/activeadmin_addons | spec/features/state_builder_spec.rb | require 'rails_helper'
describe "State Builder", type: :feature do
context "changing state value" do
before do
register_index(Invoice) do
state_column :aasm_state
end
create_invoice
visit admin_invoices_path
end
it "shows set label" do
expect(page).to have_content(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.