hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
bf0d3df4edb87bbaa4be02237b654afc34b78a3b | 278 | {
'info' => {
'api_server' => 'https://test.kineticdata.com/kinetic',
'api_username' => 'admin',
'api_password' => '',
'enable_debug_logging'=>'yes'
},
'parameters' => {
'error_handling' => 'Error Message',
'space_slug' => 'test'
}
}
| 21.384615 | 60 | 0.52518 |
bba9246c1127957fb0f3518180085b3329e7d50d | 1,255 | class Sentencepiece < Formula
desc "Unsupervised text tokenizer and detokenizer"
homepage "https://github.com/google/sentencepiece"
url "https://github.com/google/sentencepiece/archive/v0.1.94.tar.gz"
sha256 "a23133caa67c38c3bf7f978fcea07947072783b32554a034cbbe99a8cf776192"
license "Apache-2.0"
head "https:... | 33.918919 | 94 | 0.732271 |
391b60150f4ba52f2dd34154646365cfa18df9f0 | 1,085 | require_relative 'module'
require 'spaceship'
module Deliver
# Set the app's pricing
class UploadPriceTier
def upload(options)
return unless options[:price_tier]
price_tier = options[:price_tier].to_s
legacy_app = options[:app]
app_id = legacy_app.apple_id
app = Spaceship::Conne... | 28.552632 | 101 | 0.677419 |
d597b3d8174651f614a84cfc88d8e13fcee540ca | 1,200 | class OrganisationDefaultStringValues < ActiveRecord::Migration[4.2]
ATTRS = %i[
name
address
postcode
email
description
website
telephone
donation_info
]
def up
ATTRS.each do |attr|
Organisation.table_name = "organisations"
Organisation.with_deleted.where(attr =>... | 31.578947 | 85 | 0.71 |
1cace66f35eb454d1852fbe030755fcfe8ac913b | 1,395 | require 'oauth/request_proxy/base'
require 'curb'
require 'uri'
require 'cgi'
module OAuth::RequestProxy::Curl
class Easy < OAuth::RequestProxy::Base
# Proxy for signing Curl::Easy requests
# Usage example:
# oauth_params = {:consumer => oauth_consumer, :token => access_token}
# req = Curl::Easy.ne... | 24.910714 | 140 | 0.632258 |
088ac3ac190b14845376bef04d11b72f4c2ce2d0 | 846 | require 'spec_helper'
describe "project_products/new" do
before(:each) do
assign(:project_product, stub_model(ProjectProduct,
:project => nil,
:product => nil,
:quantity => 1,
:subtotal => 1
).as_new_record)
end
it "renders new project_product form" do
render
# Run the g... | 33.84 | 89 | 0.708038 |
394568ad3fb0fb0a88e7985868c032a8dd52e6cd | 21 | class PlayerHand
end
| 7 | 16 | 0.857143 |
aca18c903b104fcc38d87fb398d5e6c39ecad911 | 3,070 |
require './vtparse_tables.rb'
class String
def pad(len)
self << (" " * (len - self.length))
end
end
File.open("vtparse_table.h", "w") { |f|
f.puts "typedef enum {"
$states_in_order.each_with_index { |state, i|
f.puts " VTPARSE_STATE_#{state.to_s.upcase} = #{i+1},"
}
f.puts "... | 31.649485 | 99 | 0.558958 |
61e6426c57d82b73b9f29118608c9b8ae623858b | 588 | require "europa_rates/version"
require "europa_rates/configuration"
require "europa_rates/exchange_rate"
require "europa_rates/store"
require "europa_rates/stores/file_store"
require "europa_rates/stores/redis_store"
require "europa_rates/errors/invalid_store_error"
require "europa_rates/errors/no_data_available_error... | 21 | 53 | 0.792517 |
08e23015dcff608f9b7ac5b27241f9eb82c9917b | 25,739 | require 'test/unit'
require 'date'
class TestSH < Test::Unit::TestCase
def test_new
[Date.new,
Date.civil,
DateTime.new,
DateTime.civil
].each do |d|
assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday])
end
[Date.new(2001),
Date.civil(2001),
DateTime.new(2001),
Date... | 38.705263 | 181 | 0.604025 |
8759ad8026768f9c47abd6537669dfd069e9ba27 | 2,368 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'methodic'
class Template
attr_reader :list_token
attr_reader :template_file
attr_reader :content
def initialize(_options)
options = Methodic.get_options(_options)
options.specify_classes_of({:list_token => Array, :template_... | 31.573333 | 173 | 0.680743 |
bbddaa55e3187661ab0d00bcdbe405676e6c6bca | 330 | require 'strings2conf/version'
require 'json'
require 'erb'
include ERB::Util
module Strings2conf
def self.convert(json)
@data = JSON.parse json
template_path = File.dirname(File.expand_path(__FILE__)) + '/templates/confluence.html.erb'
ERB.new(File.read(template_path), nil, '-').result(binding)
... | 25.384615 | 95 | 0.715152 |
38dab0a70f72a415f22f07b1407203a8190533f2 | 5,259 | module Axlsx
# The SheetProtection object manages worksheet protection options per sheet.
class SheetProtection
include Axlsx::OptionsParser
include Axlsx::SerializedAttributes
include Axlsx::Accessors
# Creates a new SheetProtection instance
# @option options [Boolean] sheet @see SheetProtecti... | 44.567797 | 194 | 0.686442 |
79a7762c0f54c39da6d10d54661a0edab023b05a | 959 | require "test_helper"
describe "bin/vanity" do
before do
not_collecting!
end
it "responds to version" do
assert_output(nil) do
proc {
ARGV.clear
ARGV << '--version'
load "bin/vanity"
}.must_raise SystemExit
end
end
it "responds to help" do
assert_output(... | 18.09434 | 50 | 0.601668 |
61e4a03a31b1c206e37300e3747f7ba11acc4ab9 | 33,581 | require 'cucumber/messages.dtos'
require 'json'
# The code was auto-generated by {this script}[https://github.com/cucumber/common/blob/main/messages/jsonschema/scripts/codegen.rb]
#
module Cucumber
module Messages
class Attachment
##
# Returns a new Attachment from the given hash.
# If the h... | 28.410321 | 131 | 0.591227 |
bb77186eb887a61a1761058936647c9beeaab339 | 156 | require 'test_helper'
class RegistrationRequestorPortTypeControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| 19.5 | 78 | 0.769231 |
87436d46bca4e46c5063afaa302acafb692ecf38 | 1,495 | class Qjackctl < Formula
desc "Simple Qt application to control the JACK sound server daemon"
homepage "https://qjackctl.sourceforge.io/"
url "https://downloads.sourceforge.net/project/qjackctl/qjackctl/0.6.3/qjackctl-0.6.3.tar.gz"
sha256 "9db46376cfacb2e2ee051312245f5f7c383c9f5a958c0e3d661b9bd2a9246b7d"
lice... | 34.767442 | 95 | 0.646823 |
79695064c225474acf5095b92d707513fd1ab69e | 28 | module CoreStuffsHelper
end
| 9.333333 | 23 | 0.892857 |
b9c401572a6bde2eae742809a5baf3235dbe0de4 | 3,421 | # require 'erubis'
require 'fileutils'
# require 'forwardable'
require 'rake'
# require 'json'
# def load_gems
# gem_paths.each do |gem_path|
# esruby_spec_path = "#{gem_path}/esruby_gem"
# load(esruby_spec_path) if File.file?(esruby_spec_path)
# end
# nil
# end
# def gem_paths
# JSON.parse(Fi... | 34.21 | 201 | 0.715288 |
0313c28c2799431311544bded6b990d8b4246988 | 988 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ApplicationHelper, type: :helper do
describe '#action_in_bem_format' do
context 'the controller is in the root namespace' do
before do
expect(helper)
.to(receive(:params))
.at_least(:once)
.and_return... | 29.058824 | 87 | 0.634615 |
186509c04e27f4d72a57d696939fd0089bddcb92 | 2,362 | require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/hash/slice'
module Mushroom
class Subscriber
attr_reader :event
delegate :payload, :name, :time, :transaction_id, :duration, :to => :event
def initialize(event)
@event = event
end
# The endpoint for ... | 25.12766 | 109 | 0.596952 |
87a2b6aa94de79be10b7999ca17d230733dafd4d | 1,466 | require "administrate/base_dashboard"
class DataSourceDashboard < Administrate::BaseDashboard
# ATTRIBUTE_TYPES
# a hash that describes the type of each of the model's fields.
#
# Each different type represents an Administrate::Field object,
# which determines how the attribute is displayed
# on pages thro... | 26.654545 | 76 | 0.70191 |
18cdc1577a1bbdf9b3781072a7c3fbce35014fdf | 2,603 | require 'credentials_manager/appfile_config'
require 'fastlane_core/print_table'
require 'spaceship'
require 'spaceship/tunes/tunes'
require 'spaceship/tunes/members'
require 'spaceship/test_flight'
require 'fastlane_core/ipa_file_analyser'
require_relative 'module'
module Pilot
class Manager
def start(options,... | 32.135802 | 146 | 0.667307 |
e94a97ec744cdf88fe75904111a7d240b1343742 | 32,210 | #!/usr/bin/env ruby
require 'spec_helper'
describe Puppet::Type.type(:dsc_xrdsessioncollectionconfiguration) do
let :dsc_xrdsessioncollectionconfiguration do
Puppet::Type.type(:dsc_xrdsessioncollectionconfiguration).new(
:name => 'foo',
:dsc_collectionname => 'foo',
)
end
it 'should all... | 49.937984 | 149 | 0.804067 |
e2ff488a7540ec323d664fa1dca12efad8d66f38 | 235 | module Licenses
class UsageReportDecorator < ApplicationDecorator
delegate_all
def to_s
if object.end_date > Time.zone.today
"#{object.to_s} (Current)"
else
object.to_s
end
end
end
end | 18.076923 | 51 | 0.638298 |
1d73b3974db51db9efddcd8182ba2ff0cc48a556 | 613 | unless ENV['MSPEC_RUNNER']
begin
require 'mspec/helpers'
require 'mspec/guards'
require 'mspec/runner/shared'
require 'mspec/matchers/be_ancestor_of'
require 'mspec/matchers/output'
require 'mspec/matchers/output_to_fd'
require 'mspec/matchers/complain'
TOLERANCE = 0.00003 unless Obje... | 20.433333 | 64 | 0.7031 |
ff0b3c527ddd6c6e7fb81fff7bfdc776dc90f925 | 1,524 | # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Eatech CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require File.expand_path(File.di... | 36.285714 | 129 | 0.7021 |
1c51c8cdf10e7b3e0a758a5d0b7422975ec90995 | 1,736 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork ... | 34.039216 | 91 | 0.732719 |
1844f3484e3f4382070284c9dfe3186fa576c2ca | 2,180 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/durban-whois.registry.net.za/durban/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec... | 23.191489 | 91 | 0.675688 |
b94148b0f85b66c5666ee9453d6dd5a9070ed5e2 | 688 | module PapersHelper
def selected_class(tab_name)
if controller.action_name == tab_name
"selected"
end
end
def badge_link(paper)
if paper.accepted?
return paper.cross_ref_doi_url
else
return paper.review_url
end
end
def formatted_body(paper, length=nil)
pipeline = HT... | 19.111111 | 57 | 0.668605 |
21b231278a436df9280e700d495b5acce908fe7d | 519 | module TokyoMetro::Factory::Seed::Reference::TrainTypeInApi
private
def in_api_in_db( whole = nil , search_by: @train_type )
if whole.present?
whole.find_by_same_as( search_by )
else
::Train::Type::InApi.find_by_same_as( search_by )
end
end
def in_api_id( whole = nil , search_by: @tra... | 25.95 | 91 | 0.693642 |
61569947ad1120380fbc10567de7c24cb5047ef9 | 6,625 | # frozen_string_literal: true
require 'forwardable'
require 'evolvable/version'
require 'evolvable/error/undefined_method'
require 'evolvable/gene'
require 'evolvable/search_space'
require 'evolvable/genome'
require 'evolvable/goal'
require 'evolvable/equalize_goal'
require 'evolvable/maximize_goal'
require 'evolvable... | 28.804348 | 136 | 0.661887 |
874faf920d06e11a8fb62b2f0f6a1b05cd981283 | 784 | class PublicKeyResource < ApplicationResource
attributes :name, :fingerprint, :key, :last_used_at
has_one :group
has_one :person
before_create do
@model.group = context[:group]
@model.person = context[:current_user]
end
def fingerprint
@model.fingerprint
end
def last_used_at
@model.b... | 20.631579 | 74 | 0.693878 |
1a910b90873a898382f3ced2af3c80c9fd2f3422 | 583 | # frozen_string_literal: true
module Correios
module CEP
module Config
WEB_SERVICE_URL = 'https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente'
DEFAULT_REQUEST_TIMEOUT = 5 # seconds
attr_accessor :logger, :proxy_url
attr_writer :request_timeout, :web_service_url
... | 23.32 | 104 | 0.692967 |
f7c2932242d6c535779c02ca89f44d3057ad7f59 | 82 | class Garden < ApplicationRecord
has_many :plants, :dependent => :destroy
end
| 20.5 | 44 | 0.743902 |
e90312cf5739cdd3b6f135fce718d69e82de2544 | 1,054 | class ModalPage
include PageObject
button(:launch_modal, :id => 'launch_modal_button')
end
class ModalDialog
include PageObject
button(:close_window, :id => 'close_window')
button(:close_window_with_delay, :id => 'delayed_close')
button(:launch_another_modal, :id => 'launch_modal_button')
end
class Anot... | 22.425532 | 61 | 0.737192 |
28687f26977fcc0033db32661edac3caa96d4d85 | 3,207 | require 'fastimage'
module MetaInspector
module Parsers
class ImagesParser < Base
delegate [:parsed, :meta, :base_url] => :@main_parser
delegate [:each, :length, :size, :[], :last] => :images_collection
include Enumerable
def initialize(main_parser, options = {})
@downlo... | 32.07 | 138 | 0.600873 |
625232a3c27e29fffd855aed5acbc131594caf90 | 1,087 | #! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'efl'
require 'efl/native/elm/elm_store'
#
module Efl
#
module Elm
#
class ElmStore
#
include Efl::ClassHelper
search_prefixes 'elm_store_'
#
def initialize o=nil, &block
... | 24.704545 | 103 | 0.431463 |
798b949d54ec6aedd4787c62e9dfceb69df50e39 | 667 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module GomiSellersAdmin
class Application < Rails::Application
# Initialize configuration defaults for originally generate... | 33.35 | 82 | 0.767616 |
1a31a429bef50063b2eabc9144b3840fb7a5bafa | 2,630 | class ApplicationController < ActionController::Base
protect_from_forgery
before_action :cache_most_used_page_information
before_action :cache_forums_unread_counts
# todo name all these methods
before_action do
if params[:universe].present? && user_signed_in?
if params[:universe] == 'all'
... | 36.027397 | 164 | 0.738783 |
1a5a45a7b050c4ea0f1f07996039e625ed62c336 | 5,533 | class AnimeDownloader < Formula
include Language::Python::Virtualenv
desc "Download your favourite anime"
homepage "https://github.com/vn-ki/anime-downloader"
url "https://files.pythonhosted.org/packages/f5/61/feb32904b5fa1d1e36908bb781f722e924402e329dbb538ce5cb5eb8c44c/anime-downloader-4.3.0.tar.gz"
sha256 ... | 44.620968 | 144 | 0.813483 |
bfeece6e5a3a8741cdd1014388fd2c2f2d372732 | 443 | # @class NodeSerializer
# 节点
#
# == attributes
# - *id* [Integer] 编号
# - *name* [String] 节点名称
# - *summary* [String] 简介, Markdown 格式
# - *section_id* [Integer] 大类别编号
# - *section_name* [String] 大类别名称
# - *topics_count* [Integer] 话题数量
# - *sort* {Integer} 排序优先级
# - *updated_at* [DateTime] 更新时间
if node
json.cache! ["v1... | 24.611111 | 100 | 0.643341 |
282bdf744d2c74119903873abef25835a55134cf | 811 | module MilestonesHelper
def milestones_filter_path(opts = {})
if @project
namespace_project_milestones_path(@project.namespace, @project, opts)
elsif @group
group_milestones_path(@group, opts)
else
dashboard_milestones_path(opts)
end
end
def milestone_progress_bar(milestone)
... | 23.852941 | 88 | 0.683107 |
08da65c949ab356d353bd325fd17373038883225 | 1,172 | require "charlock_holmes"
require "gifts/grit_ext/actor"
require "gifts/grit_ext/blob"
require "gifts/grit_ext/commit"
require "gifts/grit_ext/tree"
require "gifts/grit_ext/diff"
require "gifts/grit_ext/version"
module Gifts::GritExt
extend self
def encode!(message)
return nil unless message.respond_to? :forc... | 27.904762 | 88 | 0.692833 |
f70c1e56fc056204242ebcd0ea5b60817300dd5f | 829 | require 'support/parser_helpers'
describe "The not keyword" do
it "returns a call sexp" do
parsed("not self").should == [:call, [:self], '!'.to_sym, [:arglist]]
parsed("not 42").should == [:call, [:int, 42], '!'.to_sym, [:arglist]]
end
end
describe "The '!' expression" do
it "returns a call sexp" do
... | 29.607143 | 110 | 0.557298 |
03410532870e3ab8acd25f3d82eb4d3eebd744b4 | 650 | class Quicktree < Formula
desc "Phylogenetic neighbor-joining tree builder"
homepage "https://www.sanger.ac.uk/resources/software/quicktree/"
# tag origin homebrew-science
# tag derived
url "https://github.com/khowe/quicktree/archive/v2.2.tar.gz"
sha256 "e44d9147a81888d6bfed5e538367ecd4e5d373ae882d5eb9649... | 27.083333 | 75 | 0.727692 |
aba65a9ca4bd327c4c4e4e0bdcabec0a23b942d7 | 77 | class Track < ActiveRecord::Base
belongs_to :project
has_many :stems
end
| 15.4 | 32 | 0.766234 |
7abd5aa55f296311012e412177c26921b72be1d9 | 1,249 | # frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake
desc 'Pins methods.'
command 'pins' do |g|
g.desc 'Pins an item to a channel.'
g.long_desc %( Pins an item to a channel. )
g.command 'add' do |c|
c.flag 'channel', desc: 'Channel to pin the item in.'
c.flag 'timestamp', de... | 33.756757 | 67 | 0.668535 |
621fc229735a244933f28177524c085abd0d1542 | 672 | require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descri... | 29.217391 | 100 | 0.723214 |
18e3bbb058064c00d8de51cb0038b7374769a04d | 9,153 | #
# Copyright:: Copyright (c) 2015 Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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.... | 34.026022 | 114 | 0.609636 |
91697e5218a93811c94fcde8a30c98da8206a28e | 7,502 | # typed: false
# frozen_string_literal: true
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
formatters = [SimpleCov::Formatter::HTMLFormatter]
if ENV["HOMEBREW_CODECOV_TOKEN"] && RUBY_PLATFORM[/darwin/]
require "codecov"
formatters << SimpleCov::Formatter::Codecov
if ENV["TEST_ENV_NUMBER"]
... | 27.785185 | 96 | 0.696081 |
1d5644960fadc9c6364926ad505d4339f00d62dd | 7,879 | # -*- coding: utf-8 -*-
class AwardYears::V2018::QAEForms
class << self
def trade_step2
@trade_step2 ||= proc do
header :your_internation_trade_header, "" do
context %(
<p>
This section gives you the opportunity to present the detail of your products or services t... | 37.165094 | 557 | 0.594492 |
7a758c5e34f0d2870c53feeaf0c62b207a03aed2 | 559 | module StatlyHelper
def stat(controller, action, message)
stat_counter = Stat.where("date(created_at) = date(:today) and controller = :controller and action = :action and message = :message", {today: Date.today, controller: controller, action: action, message: message}).first
if stat_counter.nil?
stat_counter... | 27.95 | 220 | 0.735242 |
f75d90c4d6647618d8b4a578bfc25497a877f8f3 | 969 | require 'spec_helper'
describe 'omnibus::_yaml' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
context 'on debian' do
let(:chef_run) do
ChefSpec::Runner.new(platform: 'debian', version: '7.4')
.converge(described_recipe)
end
it 'installs the correct development pa... | 24.846154 | 68 | 0.672859 |
7a2efb3dec7ee2a27da05d48262823208b23a9c7 | 119 | class AddUserIdToPlays < ActiveRecord::Migration[6.0]
def change
add_column :plays, :user_id, :integer
end
end
| 19.833333 | 53 | 0.739496 |
79917b2193b37727f9cb6e4cc763b8f0bbd6cfb6 | 1,806 | require 'spec_helper'
describe SimpleNavigation::ItemsProvider do
before(:each) do
@provider = stub(:provider)
@items_provider = SimpleNavigation::ItemsProvider.new(@provider)
end
describe 'initialize' do
it "should set the provider" do
@items_provider.provider.should == @provider
end
e... | 30.1 | 76 | 0.662237 |
bff027b26e720fdbfde6512a6ed5efb9bafe51dc | 205 | require 'eventmachine'
module AsakusaSatellite
class AsyncRunner
def self.run(&block)
if EM.reactor_running?
EM.defer(block)
else
block.call
end
end
end
end
| 13.666667 | 28 | 0.62439 |
1cb3b40656bfea9deaa89240f6f9a0071b28c3e7 | 3,232 | require 'eventbrite/api_objects/organizer'
require 'eventbrite/api_objects/venue'
require 'eventbrite/api_objects/ticket'
require 'eventbrite/api_objects/organizer'
require 'eventbrite/api_objects/discount'
require 'eventbrite/api_objects/attendee'
module Eventbrite
# The Event class is the main point of interaction... | 32 | 85 | 0.688119 |
1af4266ab43d83a184c424d6f9fc145ddee5f553 | 82 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'belugas/java'
| 27.333333 | 58 | 0.731707 |
f8086af284ac3790c4f66fc21cfbf39ee5a1b046 | 96 | class ApplicationMailer < ActionMailer::Base
default from: @admin_email
layout 'mailer'
end
| 19.2 | 44 | 0.78125 |
87d6bb4ced2b0ca81955729c8dc7e59c796ee219 | 145 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_photo_gallery_session'
| 36.25 | 83 | 0.813793 |
2806fe2ef9e6cb0f5f3c364fe6f764b1038ff244 | 1,095 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/google_ads/v1/enums/income_range_type.proto
require 'google/protobuf'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "google.ads.googleads.v1.enums.IncomeRangeTypeEnum" do
end
... | 40.555556 | 175 | 0.800913 |
e9fae810410eb43e815e4feb6d329d4b84ebb998 | 3,054 | # frozen_string_literal: true
require 'singleton'
require 'spree/core/class_constantizer'
module Spree
# A class responsible for associating {Spree::Role} with a list of permission sets.
#
# @see Spree::PermissionSets
#
# @example Adding order, product, and user display to customer service users.
# Spre... | 34.314607 | 135 | 0.696464 |
2849ddc1d4f219ea91378123039a0fbf00f8271f | 4,319 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_08_01
module Models
#
# Backend Address Pool of an application gateway.
#
class ApplicationGatewayBacke... | 32.473684 | 85 | 0.50081 |
4a1b4570a265bd6c8756773b33c9767a6d63dbde | 83 | module Tailwindcss
end
require "tailwindcss/version"
require "tailwindcss/engine"
| 13.833333 | 29 | 0.831325 |
ed0c25618818445e5a2c7c500ff7c2f99ea828d2 | 636 | require 'spec_helper'
describe YARD::Cov::ReportOutput, '#write' do
subject do
described_class.new(target).write do |io|
io.puts 'content'
end
end
let(:target) { double('Pathname', dirname: dirname) }
let(:dirname) { double }
before do
allow(dirname).to rece... | 21.2 | 60 | 0.624214 |
f8b091b05a8ce6cca9863eb1346bc2a3df48e4aa | 2,811 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.requi... | 44.619048 | 100 | 0.734258 |
ed9c3246cd1e300c5578338f57cbb46392ecf194 | 1,716 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::KubernetesConfiguration::Mgmt::V2021_03_01
module Models
#
# Proxy Resource
# The resource model definition for a Azure Resourc... | 26 | 70 | 0.482517 |
393fa4ce6c803c51eef93d3214f66e2fc7795313 | 211 | require 'mxx_ru/binary_unittest'
path = 'test/so_5/env_infrastructure/simple_not_mtsafe_st/stop_in_init_fn'
MxxRu::setup_target(
MxxRu::BinaryUnittestTarget.new(
"#{path}/prj.ut.rb",
"#{path}/prj.rb" )
)
| 21.1 | 74 | 0.748815 |
330a796ad1544e86a3b900e6a3595321f297bb5a | 656 | Pod::Spec.new do |s|
s.name = "Artsy+UILabels"
s.version = "1.0.0"
s.summary = "UILabels subclasses and related categories."
s.homepage = "https://github.com/artsy/Artsy-UILabels"
s.license = 'MIT'
s.author = { "Orta" => "orta.therox@gmail.com" }
s.... | 32.8 | 80 | 0.585366 |
ab682dac7c56b264811ff10453676ecebccc5674 | 77 | require 'test_helper'
class SimulationHelperTest < ActionView::TestCase
end
| 15.4 | 49 | 0.831169 |
6ac8466b887bcb45570e45a28373048ac00f601b | 5,189 | # frozen_string_literal: true
require 'json'
require 'base64'
require 'open3'
require 'krane/kubectl'
module Krane
class EjsonSecretError < FatalDeploymentError
def initialize(msg)
super("Generation of Kubernetes secrets from ejson failed: #{msg}")
end
end
class EjsonSecretProvisioner
EJSON_SE... | 32.841772 | 113 | 0.663326 |
61616a5a9d41fc4e314458dee6adc7ede7b972ae | 18,752 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Reservations::Mgmt::V2019_07_19_preview
#
# Microsoft Azure Quota Resource Provider.
#
class QuotaRequestStatus
include MsRestAzur... | 47.115578 | 162 | 0.69134 |
6ac81460292e407f7a93741d1e3644a46673846e | 261 | require_relative 'test_helper'
class TestFakerSuperhero < Test::Unit::TestCase
def setup
@tester = Faker::Superhero
end
def test_power
assert @tester.power.match(/\w+\.?/)
end
def test_name
assert @tester.name.match(/\w+\.?/)
end
end
| 16.3125 | 47 | 0.67433 |
6ac86b6524c9b9fff02d245fda1ad06a0ce43540 | 10,055 | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 47.206573 | 110 | 0.588463 |
1c81bd5af0bdac3a168d1223d99c1990f251e570 | 1,418 | require 'spec_helper'
RSpec.describe Steps::Check::KindForm do
let(:arguments) { {
disclosure_check: disclosure_check,
kind: kind
} }
let(:disclosure_check) { instance_double(DisclosureCheck, kind: nil) }
let(:kind) { nil }
subject { described_class.new(arguments) }
describe '.choices' do
it ... | 26.259259 | 90 | 0.624824 |
b970b6eb9848525bf44d3617744937ba0b95cf20 | 46 | module ColoradoTrails
VERSION = "0.1.2"
end
| 11.5 | 21 | 0.717391 |
6af88e881d7820c485f4d9fb81dc0e87c2a1380e | 2,291 | require 'rspec/core'
module RSpec
module Interactive
class Runner
def initialize(args)
::RSpec.world.wants_to_quit = false
@options = ::RSpec::Core::ConfigurationOptions.new(args)
end
def run()
begin
@options.configure(::RSpec.configuration)
return i... | 32.728571 | 141 | 0.647752 |
e8dcf684f46abecbb4f75e38bd659ca4c8e433d5 | 643 | #
# Use bundler to load dependencies
#
GEMFILE_EXTENSIONS = [
'.local',
''
]
unless ENV['BUNDLE_GEMFILE']
require 'pathname'
msfenv_real_pathname = Pathname.new(__FILE__).realpath
root = msfenv_real_pathname.parent.parent
GEMFILE_EXTENSIONS.each do |extension|
extension_pathname = root.join("Gemfile... | 19.484848 | 72 | 0.713841 |
397c01d89521667975409636f4b02cb467b92900 | 1,823 | class TreeBuilderDatastores < TreeBuilder
has_kids_for Hash, [:x_get_tree_hash_kids]
def initialize(name, type, sandbox, build = true, root = nil)
@root = root
@data = Storage.all.inject({}) { |h, st| h[st.id] = st; h }
super(name, type, sandbox, build)
end
private
def tree_init_options(_tree_n... | 29.403226 | 98 | 0.536478 |
1100445352f17f391c994be0a74c1cb978c52167 | 3,463 | require 'alchemy/shell'
namespace :alchemy do
namespace :tidy do
desc "Tidy up Alchemy database."
task :up do
Rake::Task['alchemy:tidy:cells'].invoke
Rake::Task['alchemy:tidy:element_positions'].invoke
Rake::Task['alchemy:tidy:content_positions'].invoke
end
desc "Creates missing c... | 33.621359 | 114 | 0.61132 |
28cf55f74861434d48f836abf89c65bef5f9f611 | 3,449 | # frozen_string_literal: true
#
# A Namespace::TraversalHierarchy is the collection of namespaces that descend
# from a root Namespace as defined by the Namespace#traversal_ids attributes.
#
# This class provides operations to be performed on the hierarchy itself,
# rather than individual namespaces.
#
# This includes ... | 34.838384 | 102 | 0.698463 |
ff640d9927644bd41cadb5a3d9df8f45e8ea8dda | 634 | # frozen_string_literal: true
module MasterfilesApp
class RmtDeliveryDestinationRepo < BaseRepo
build_for_select :rmt_delivery_destinations,
label: :delivery_destination_code,
value: :id,
order_by: :delivery_destination_code
build_inactive_select... | 37.294118 | 111 | 0.65142 |
18a7f021fdd10cd75c073c0a561bac64b5937412 | 1,872 | require 'rubygems'
require 'sinatra'
require 'sinatra/reloader'
def new_user
new_user = File.open "./public/users_list.txt","a"
if @barber == "Не важно"
new_user.write "Клиент #{@new_user_name} записан на #{@new_user_datetime}. К любому специалисту. Телефон для связи #{@new_user_phone}. \n"
... | 17.333333 | 144 | 0.644231 |
ab9b7c602b5dc728f206b05a2f8edac8face4b50 | 2,811 | module API
class GroupMembers < Grape::API
before { authenticate! }
resource :groups do
# Get a list of group members viewable by the authenticated user.
#
# Example Request:
# GET /groups/:id/members
get ":id/members" do
group = find_group(params[:id])
users = ... | 31.943182 | 114 | 0.611526 |
03b058edcf76991549c982107ee88d5be8090510 | 5,481 | #
# Author:: Stuart Preston (<stuart@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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
#
# h... | 43.15748 | 82 | 0.722861 |
8766e0f96e99d7d7c5bf75e0b547a3775e7b6b4a | 12,222 | class Employers::CensusEmployeesController < ApplicationController
before_action :find_employer
before_action :find_census_employee, only: [:edit, :update, :show, :delink, :terminate, :rehire, :benefit_group, :cobra ,:cobra_reinstate, :confirm_effective_date]
before_action :updateable?, except: [:edit, :show, :up... | 39.681818 | 204 | 0.728195 |
1c12d313c8aa4bcd519eac0fc4795985dd8fab49 | 3,899 | #
# Copyright:: Copyright (c) 2017 GitLab Inc.
# License:: Apache License, Version 2.0
#
# 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
#
# U... | 39.383838 | 121 | 0.700692 |
1c58e1353af4ac2eec9bd49db59c98ded2c67c4f | 323 | class FileUploader < CarrierWave::Uploader::Base
storage :file
def store_dir
"uploads/#{model.class.to_s.underscore}_#{mounted_as}"
end
def extension_white_list
%w(doc docx xls xlsx ppt htm html txt zip rar gz bz2)
end
def filename
"#{cache_id}.#{file.extension}" if original_filename
end
... | 19 | 58 | 0.712074 |
1aa654a5ac61f888e3ed96672712f8354c69e4c1 | 1,777 | class TopicUpdator
def initialize(topic, update_topics_with_links = false)
@topic = topic
@update_topics_with_links = update_topics_with_links
@original_content = topic.content
end
def update(args)
args[:slug] = Topic::ContentSlugGenerator.new(args[:content]).generate if args[:content].present? &... | 32.309091 | 129 | 0.687676 |
7a23984c39975b939e1d3f970d43eb93f2897ef0 | 548 | module Forms
class Dependent < Base
attribute :children, Boolean
attribute :children_number, Integer
validates :children, inclusion: { in: [true, false] }
validates :children_number,
presence: true, numericality: { allow_blank: true, less_than: 100 }, if: :children?
private
de... | 18.896552 | 97 | 0.609489 |
28989acbc41746262aaa272b6457c7597200a7dc | 384 | require "spec_helper"
RSpec.describe "Scraper" do
let(:scraper) { Scraper.new("https://player.fm/series/the-ezra-klein-show") }
describe "#fetch_episodes" do
it "instantiates some episodes" do
expect(Episode.all).not_to be_empty
end
end
describe "#write_books" do
it "instantiates some books... | 21.333333 | 79 | 0.690104 |
117aa8c4b9481c850febfea967f6d7e36455a305 | 1,485 | Pod::Spec.new do |s|
s.name = "LCAuthManager"
s.version = "1.0.0"
s.summary = "A comprehensive, efficient and easy-to-use rights verification library, including Gesture Password, Touch ID and Face ID."
s.description = <<-DESC
LCAuthManager has the following advantages:
... | 67.5 | 186 | 0.668687 |
79447349cd2b55f4e674cdca28101128e3d8422f | 129 | require 'rails_helper'
RSpec.describe Facility, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 21.5 | 56 | 0.728682 |
628283fb1be810c136f941b020adad606d4da7d4 | 1,092 | require 'bismuth'
class ActionExample < Bi::Scene
def initialize
super
add_timer(1000){ Bi::Window.title = "FPS:#{Bi::RunLoop.fps}" }
@invaders = 8.times.map{|x|
i = Bi::Sprite.new("invader_white.png")
i.x = 16 + x*32
i.y = 120
i.angle = 90
i.anchor_x = i.anchor_y = 0.5
... | 27.3 | 70 | 0.587912 |
87cf9e61f0346854c69a6edbd210bd042e81be31 | 260 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :address, :class => 'Customerx::Address' do
province "my prov"
city_county_district "city county"
add_line "123 road"
customer_id 1
end
end
| 23.636364 | 68 | 0.726923 |
79687d591043d53bf89fdbf667fe09c853cfda60 | 972 | module IntacctRuby
# methods to avoid duplication when creating and updating contact records
module ContactsHelper
def contact_params(attributes, id, person_type)
xml = Builder::XmlMarkup.new
name = full_name(attributes)
xml.contact do
xml.contactname contactname(name, id, person_typ... | 29.454545 | 75 | 0.650206 |
1c4ea6369f60cc754b16497a3be551966e0e875a | 636 | ##
## $Rev: 77 $
## $Release: 2.6.2 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
unless defined?(TESTDIR)
TESTDIR = File.dirname(__FILE__)
LIBDIR = TESTDIR == '.' ? '../lib' : File.dirname(TESTDIR) + '/lib'
$: << TESTDIR
$: << LIBDIR
end
require 'test/unit'
#require 'test/unit/ui/cons... | 20.516129 | 70 | 0.66195 |
6a6c6c1f2a2845b5aabed44dbbbf50d063b8a875 | 113 | require "#{Rails.root}/lib/base/base_image.rb"
class BaseLib
def self.img
@img = BaseImage.new
end
end | 12.555556 | 46 | 0.690265 |
bbc0e63b808fe47b5abd156b73e6c9ff3def455f | 1,730 | require File.dirname(__FILE__) + '/../spec_helper'
require 'token'
describe "A token" do
before(:each) do
@token = Token.new(:my_type,"my value")
end
it "should have a name" do
@token.should respond_to(:type)
@token.name.should == :my_type
end
it "should have a value" do
@token.should re... | 24.366197 | 83 | 0.64104 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.