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 |
|---|---|---|---|---|---|
28cdb898f8a1ab4211c4cdd1e77d34da24080dbb | 1,154 | class Ascii < Formula
desc "List ASCII idiomatic names and octal/decimal code-point forms"
homepage "http://www.catb.org/~esr/ascii/"
url "http://www.catb.org/~esr/ascii/ascii-3.18.tar.gz"
sha256 "728422d5f4da61a37a17b4364d06708e543297de0a5f70305243236d80df072d"
bottle do
cellar :any_skip_relocation
... | 34.969697 | 93 | 0.760832 |
114a124d43a132c575b9edaaafa19a7c38087ca0 | 1,925 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | 42.777778 | 119 | 0.769351 |
ab064986317144f0edff3e03bf2cb3b00215414b | 1,370 | module Admin
class BaseAdminController < ApplicationController
include AdminSessionTimeout
layout "admin"
before_action :end_expired_admin_sessions, :ensure_authenticated_user
after_action :update_last_seen_at
helper_method :admin_signed_in?, :admin_timeout_in_minutes, :service_operator_signed_i... | 25.849057 | 119 | 0.745985 |
f83be87616aad35b32344b1810ac10e6f0b0da6a | 2,432 | # encoding: UTF-8
#
# Author:: Xabier de Zuazo (<xabier@zuazo.org>)
# Copyright:: Copyright (c) 2015 Onddo Labs, SL.
# 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 t... | 36.298507 | 80 | 0.765214 |
87793a24ee646410789b360055a3d64ed1180ccd | 44 | module ArduinoStrip
VERSION = '0.1.0'
end
| 11 | 19 | 0.704545 |
18a30cd97a0b5c2ffc5ab5ac421b8f0699440355 | 1,449 | require 'pry'
=begin
Multiply All Pairs
Write a method that takes two Array arguments in which each Array contains a
list of numbers, and returns a new Array that contains the product of every
pair of numbers that can be formed between the elements of the two Arrays. The
results should be sorted by increasing value.
... | 25.421053 | 78 | 0.708075 |
39bf0d93f7a37a1fd9b9a1f5fef8a6c5b8ff9631 | 853 | module VolumesHelpers
def parse_volume(vol)
elements = vol.split(':')
if elements.size >= 2 # Bind mount or volume used
if elements[0].start_with?('/') && elements[1] && elements[1].start_with?('/') # Bind mount
{bind_mount: elements[0], path: elements[1], flags: elements[2..-1].join(',')}
... | 40.619048 | 97 | 0.622509 |
b9c32bc51be5c8b6578e46643c3c270454841f8a | 14,049 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Ci::Config::Entry::Root do
let(:user) {}
let(:project) {}
let(:root) { described_class.new(hash, user: user, project: project) }
describe '.nodes' do
it 'returns a hash' do
expect(described_class.nodes).to be_a(Hash)
end... | 32.148741 | 125 | 0.509218 |
acbda46ee2458b262d51395c15ccb492117a3355 | 1,614 | #! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'
describe 'parseyaml function' do
describe 'success' do
it 'parses valid yaml' do
pp = <<-EOS
$a = "---\nhunter: washere\ntests: passing\n"
$o = parseyaml($a)
$tests = $o['tests']
notice(inline_template('tests are <%= @te... | 27.355932 | 77 | 0.586121 |
03a9b10aba73a7cef6bf82e362545a3876a42def | 769 | class AdminProduct < Upmin::Model
# The attributes method overwrites default attributes shown for a model, and replaces them with the provided attributes. These don't all need to be editable, but as long as there is an :attr_name= method available upmin assumes that the attribute should be editable.
attributes :na... | 48.0625 | 269 | 0.762029 |
bf73483b5d8afcf0a3c80c55df870f84ae8fd95c | 461 | class Board < ApplicationRecord
has_many :board_replies, dependent: :destroy
validates :title, presence: true, length: {maximum: 100}
validates :name, presence: true, length: {maximum: 50}
validates :content, length: {maximum: 200}, if: "content.present?"
# search boards by title
# @param [String] title ... | 28.8125 | 68 | 0.700651 |
abe93d10e9d2d92f3364a2bbd0fbd4862e35a9dd | 1,298 | require "language/node"
class NowCli < Formula
desc "The command-line interface for Now"
homepage "https://zeit.co/now"
url "https://registry.npmjs.org/now/-/now-20.0.0.tgz"
sha256 "471d4fb8507b64d1caefa5a5a1433432ccf26b1a2965d9c47e88da3934320b96"
license "Apache-2.0"
livecheck do
url :stable
end
... | 32.45 | 93 | 0.718028 |
ab1e583d195401043ecc43ab0fdb08daadcb5618 | 196 | require 'coderay'
class Out::Handlers::Yaml < Out::Handler
match /^.*(eslintrc|yaml|yml)$/
def execute(*arguments)
puts CodeRay.scan(File.read(arguments.last), :yaml).terminal
end
end
| 19.6 | 64 | 0.69898 |
bb5be64cd3fd66545f04944e926b405ab0dc1fd3 | 215 | class CreateChannels < ActiveRecord::Migration[5.0]
def change
create_table :channels do |t|
t.string :name, null: false
t.timestamps
end
add_index :channels, :name, unique: true
end
end
| 21.5 | 51 | 0.674419 |
e918f60dd2fbd2ed2a509d69919f555b69880d46 | 467 | class CoreIndicatorTranslation < ActiveRecord::Base
attr_accessible :core_indicator_id, :name, :name_abbrv, :description, :locale, :summary
belongs_to :core_indicator
validates :name, :name_abbrv, :locale, :presence => true
# this will always call validation to fail due to the translations being
# created w... | 38.916667 | 89 | 0.75803 |
628507add89386e02e48d04ab8d00a6dd7bf78fa | 3,152 | require 'daddy/git'
require 'nokogiri'
namespace :dad do
task :publish do
fail('設定「cucumber.title」がありません。') unless Daddy.config.cucumber.title?
if File.exist?("db/schema.rb")
fail unless system('rake db:schema:load RAILS_ENV=test')
end
system("mkdir -p features/reports")
system("rm -Rf fe... | 30.019048 | 110 | 0.643401 |
625610358ea5f92528b1ba97371187623cb27dc1 | 1,925 | require 'mysql-statsd'
describe Mysql::Statsd::Runner do
let(:config_path) { "spec/config.yml" }
subject { Mysql::Statsd::Runner.new config_path }
before :each do
Mysql2::Client.any_instance.stub :connect
end
it "should set the statsd namespace as mysql" do
subject.statsd.namespace.should == 'ns'
... | 32.083333 | 164 | 0.672727 |
91e300584f35fb2ff69e9269a991a970a6802c35 | 2,041 | # Author:: Dheeraj Dubey(dheeraj.dubey@msystechnologies.com)
# Copyright:: Copyright 2008-2016, 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 th... | 38.509434 | 326 | 0.702597 |
7a91314e16a880aa5506655cebd5db95f7252b41 | 5,549 | require 'fog/core'
require 'fog/json'
require 'fog/rackspace/mock_data'
require 'fog/rackspace/service'
require 'fog/rackspace/errors'
module Fog
module Rackspace
extend Fog::Provider
US_AUTH_ENDPOINT = 'https://identity.api.rackspacecloud.com/v2.0' unless defined? US_AUTH_ENDPOINT
UK_AUTH_ENDPOINT = 'h... | 36.993333 | 138 | 0.620112 |
e8a184b4045256c39136ff040ac20d4b21a60f1d | 278 | require "sleepr/version"
module Sleepr
def initialize
end
def self.session_timing(hour,min)
if hour == 14 && min == 30
puts "Time to Session! Come Come Come!!"
else
puts "Please dont come late!!!!!!"
end
end
end
| 18.533333 | 52 | 0.55036 |
1c9bbc391c727709aa82be7dea99d62b612e06b2 | 3,976 | # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | 28.811594 | 119 | 0.689889 |
03065c2d69e418477aa1cc29b2c12efe11edfeae | 835 | # frozen_string_literal: true
module Parsers
module LastFm
class UpdateUnknown
def self.call
Album.where(:last_fm_url => nil).each_unchecked("last.fm") do |album|
new(album).call
end
end
def initialize(album)
@album = album
end
def call
ha... | 20.875 | 77 | 0.559281 |
edde487582c945acb6928ab4e2a3adf827be5193 | 374 | FactoryBot.define do
factory :library_entry do
association :media, factory: :anime
association :user, strategy: :build
status { 'planned' }
progress { 0 }
time_spent { progress * 24 }
trait :nsfw do
association :media, :nsfw, factory: :anime, strategy: :build
end
trait :with_rat... | 22 | 66 | 0.63369 |
ac6b8d3e1b11a85c82975c0db08b5633ecee99e1 | 2,291 | require "ffi" unless defined?(FFI)
class Statfs
#
# Statfs provides a simple interface to the statvfs system call.
# Since the statvfs struct varies a bit across platforms, this
# likely only works on Linux and OSX at the moment.
#
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function(:statvf... | 28.6375 | 84 | 0.612833 |
3342852261e690e50801c9874ca87608df309f89 | 3,148 | class SplashMultiListCustomizableJournals < ActiveRecord::Migration[6.0]
def up
# First get all customizable_journals entries that belong to a multi list custom field and that have more than one
# value (a comma separated list). Return the values, splashed using unnest(string_to_array(...)). E.g. `1,2,3` wil... | 31.48 | 119 | 0.623888 |
f8f2e35a977ebf99d364309e1478821d71ed62cc | 2,307 | require "active_support/core_ext/integer/time"
Rails.application.routes.default_url_options[:host] = "localhost:3000"
Rails.application.routes.default_url_options[:protocol] = "http"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the de... | 35.492308 | 85 | 0.76723 |
87c978baf24b3f59159239c17acbc84a4643596f | 10,413 | require_relative 'test_helper'
# Unit Test for SemanticLogger::Logger
class LoggerTest < Minitest::Test
describe SemanticLogger::Logger do
include InMemoryAppenderHelper
let :dimensions do
{action: 'hit', user: 'jbloggs', state: 'FL'}
end
# Ensure that any log level can be logged
Semantic... | 33.482315 | 152 | 0.581293 |
613b6b65800f83fd4b0c29cab9abc664784db03c | 2,301 | # frozen_string_literal: true
require 'spec_helper'
if defined?(Rails)
enabled = true
else
puts '[INFO] Skipping Rails spec'
end
if enabled
require 'action_controller/railtie'
RSpec.describe 'Rails integration', :allow_running_agent, :spec_logger do
include Rack::Test::Methods
include_context 'event... | 24.478723 | 75 | 0.629292 |
4ae2e0b8835b5eea91908cfae57ae7d1d1e9a2fb | 7,012 | require "hangman"
describe "Hangman" do
let(:hangman) { Hangman.new }
describe "PART 2" do
describe "#try_guess" do
it "should accept a char as an arg" do
hangman.try_guess("o")
end
it "should call Hangman#already_attempted?" do
expect(hangman).to receive(:already_attempted?... | 34.885572 | 86 | 0.622647 |
ff13c1427f6e6690329800332acd5c9796e087de | 813 | # frozen_string_literal: true
RSpec.describe ZohoHub::WithAttributes do
class TestClass
include ZohoHub::WithAttributes
attributes :one, :two, :three
end
describe '.attributes' do
context 'when attributes are passed' do
it 'adds the attributes to the list of attr_accessors' do
test = ... | 22.583333 | 63 | 0.644526 |
4a1527e41e9a4779d55ef30de090d31aae3ef55e | 407 | # frozen_string_literal: true
require 'dry/struct'
module Httpc
module Structs
class HttpResponse < Dry::Struct
attribute :content, Types::Strict::String
attribute :status_code, Types::Strict::Int
attribute :url_after_redirects, Types::String.optional
attribute :content_type, Types::Stri... | 21.421053 | 60 | 0.690418 |
3327211ea0f171405184edc0d808c8112116fd51 | 189 | class ExerciseSerializer < ActiveModel::Serializer
attributes :id, :name,:description,:reps,:author_id,:rest_period,:equipment_needed,:weight,:sets,:rating
has_many :target_muscles
end
| 37.8 | 106 | 0.804233 |
26b5c450eb98d51392731d0cb9484382ba510a1e | 9,976 | require 'rails_helper'
RSpec.describe TestTrack::ConfigUpdater do
let(:schema_file_path) { Rails.root.join('tmp', 'test_track_schema.yml') }
let(:errors) { double(full_messages: ["this is wrong"]) }
subject { described_class.new(schema_file_path) }
before do
File.delete(schema_file_path) if File.exist?(s... | 28.502857 | 127 | 0.558641 |
1d4bbe2a0ec9e8719b8685cd6abcaaef319c984a | 1,182 | # encoding: UTF-8
#= ruby-hl7.rb
# Ruby HL7 is designed to provide a simple, easy to use library for
# parsing and generating HL7 (2.x) messages.
#
#
# Author: Mark Guzman (mailto:segfault@hasno.info)
#
# Copyright: (c) 2006-2009 Mark Guzman
#
# License: BSD
#
# $Id$
#
# == License
# see the LICENSE file
#
requ... | 19.377049 | 67 | 0.744501 |
03ec6d6e54563e9e34f853168a2660d0d9fbe871 | 368 | require "bundler/setup"
require "elite_trader"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with... | 24.533333 | 66 | 0.755435 |
bbd02021afe5c3e7cf77a5705dbc35215b3c9df5 | 1,213 | class Odpi < Formula
desc "Oracle Database Programming Interface for Drivers and Applications"
homepage "https://oracle.github.io/odpi/"
url "https://github.com/oracle/odpi/archive/v3.3.0.tar.gz"
sha256 "113349161c95e6a896fafed6f1f4160547435848b8fe06fce9659738a7c5e8f5"
bottle do
cellar :any
sha256 "7... | 28.880952 | 94 | 0.704864 |
7955097a7176eb362077a5434b86871d7361a61d | 189 | # frozen_string_literal: true
module Daitai
module SortWith
def sort_with
lambda do |comparator, sortable|
sortable.sort(&comparator)
end.curry
end
end
end
| 15.75 | 38 | 0.677249 |
d55a00bf4fba8e977fe28dbf7843a610e6256685 | 1,310 | require './lib/brakeman/version'
require './gem_common'
gem_priv_key = File.expand_path("~/.ssh/gem-private_key.pem")
Gem::Specification.new do |s|
s.name = %q{brakeman}
s.version = Brakeman::Version
s.authors = ["Justin Collins"]
s.email = "gem@brakeman.org"
s.summary = "Security vulnerability scanner for R... | 39.69697 | 112 | 0.694656 |
2886e3d87eb0bf0dc0afd5957e3695a4248eee21 | 1,422 | # +-------------------------------------------------------------------------
# | Copyright (C) 2016 Yunify, Inc.
# +-------------------------------------------------------------------------
# | Licensed under the Apache License, Version 2.0 (the "License");
# | you may not use this work except in compliance with t... | 37.421053 | 78 | 0.528129 |
1ac78070daeceea874c8d7b2e0fe9d7b7601c9ee | 1,553 | require 'rails_helper'
require_relative 'shared_examples'
RSpec.describe DeliverPetitionEmailJob, type: :job do
let(:requested_at) { Time.current.change(usec: 0) }
let(:requested_at_as_string) { requested_at.getutc.iso8601(6) }
let(:petition) { FactoryBot.create(:debated_petition) }
let(:signature) { FactoryB... | 29.301887 | 91 | 0.717321 |
7aff8be2a86addcd57dd7e4e6e49f06a7c28a860 | 164 | class AddThumbToSong < ActiveRecord::Migration
def self.up
add_column :songs, :thumb, :text
end
def self.down
remove_column :songs, :thumb
end
end
| 16.4 | 46 | 0.707317 |
e23a9829d9f27b0978073ca0a85b342cb96f042f | 1,475 | # -*- encoding: utf-8 -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#upcase" do
it "returns a copy of self with all lowercase letters upcased" do
"Hello".upcase.should == "HELLO"
"hello".upcase.should == "HELLO"
e... | 27.314815 | 94 | 0.64678 |
87e81a4642a3da9649b0b4b5cffe0b9f46e31c34 | 1,844 | require 'spec_helper'
describe 'plugin install' do
step_into :node_build_plugin_install
platform 'ubuntu'
context 'with default attributes' do
recipe do
node_build_plugin_install '/tmp/plugins/default-attributes'
end
it { is_expected.to install_node_build_plugin_install('/tmp/plugins/default-... | 35.461538 | 150 | 0.698482 |
28c7a50bfb4d9faedfdbe94cf530b07dafc95667 | 649 | # == Schema Information
#
# Table name: diagnosticos
#
# id :integer not null, primary key
# historia_clinica_id :integer
# cie10_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Diagnostico < ActiveRecord::B... | 32.45 | 136 | 0.647149 |
395b1f5b08ee96d895d7fad4870cabbe5b89d96a | 669 | cask 'chatty' do
version '0.9.3'
sha256 'f99c14bc5914e9c623652f5f834c93c5982724739964f7039218c2d6adeaf8f5'
# github.com/chatty/chatty was verified as official when first introduced to the cask
url "https://github.com/chatty/chatty/releases/download/v#{version}/Chatty_#{version}.zip"
appcast 'https://github.c... | 27.875 | 92 | 0.729447 |
d58e6a2607a3039f47ae9af4a3c8204d50cb0596 | 1,306 | class Rclone < Formula
desc "Rsync for cloud storage"
homepage "https://rclone.org/"
url "https://github.com/ncw/rclone/archive/v1.50.0.tar.gz"
sha256 "d428befa998f08f0767d8dff66641e497de4d7e834ed5a3347453938d886b26b"
head "https://github.com/ncw/rclone.git"
bottle do
cellar :any_skip_relocation
sh... | 37.314286 | 93 | 0.728943 |
1d117fb3034b76593b07c769c7fde533f5a858ce | 886 | # Copyright (C) 2015-2017 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 ... | 42.190476 | 74 | 0.786682 |
e2d114db089b9f5a81aa4846a044af0d5da150cb | 565 | #!/usr/bin/env ruby
require 'kramdown'
require_relative 'configuration'
=begin
This file contains utility functions several different files may
want access to, like markdown rendering.
=end
def getMarkdown(filename)
begin
t = File.read(Configuration::Private + "/" + filename)
return Kramdown::Document.new(t).... | 19.482759 | 65 | 0.709735 |
ed8fcc77e28f5291cb7b563c645cdc340b78e915 | 459 | class NabesController < ApplicationController
before_action :force_compression
def index
data =
Place
.where.not(post_published_at: nil) # skip places missing posts
.pluck(:cached_nabes) # aggregate cached nabes data
.flatten # dedupe and sort
.uniq { |n| n["identifier"] ... | 19.956522 | 70 | 0.586057 |
3984659a8d295b54ab647ddd4f6b2eb49259c5a0 | 347 | ENV['RACK_ENV'] = 'test'
require "sinatra/activerecord"
require "division"
require "employee"
require "rspec"
require "pry"
require "pg"
RSpec.configure do |config|
config.after(:each) do
Division.all().each() do |division|
division.destroy()
end
Employee.all().each() do |employee|
employee.d... | 18.263158 | 39 | 0.67147 |
e8b33b48b296dee4456c61c63e6a33c1b5a4cdc5 | 12,062 | class OrdersController < ApplicationController
before_action :logged_in_user, only: [:list_orders, :show, :destroy,
:add_one_item_to_order,
:add_items_in_shopping_cart_to_order,
:month_income, :... | 33.692737 | 239 | 0.567153 |
79db51beff1a19457c8e099cb571732f1bfa6932 | 865 |
require 'rake'
Gem::Specification.new do |s|
s.name = 'firefox-data'
s.version = '1.0.2'
s.date = '2017-04-30'
s.summary = 'A library to extract data from firefox profiles.'
s.description = 'The firefox-data library extracts various types of ' + \
'data from firefox profiles.'
s.homepage = 'https://gi... | 32.037037 | 75 | 0.624277 |
e20ce9e10236c0e6282d98c203ea2b069760f523 | 1,172 | # frozen_string_literal: true
module PgRls
# Tenant Controller
module Tenant
class << self
def switch(resource)
connection_adapter = PgRls.connection_class
find_tenant(resource)
connection_adapter.connection.execute(format('SET rls.tenant_id = %s',
... | 27.255814 | 108 | 0.587884 |
e97f69e6dbce436a82006373a83b5d793a79c99f | 5,666 | # frozen_string_literal: true
module RuboCop
module Cop
module Layout
# Checks that braces used for hash literals have or don't have
# surrounding space depending on configuration.
#
# @example EnforcedStyle: space (default)
# # The `space` style enforces that hash literals have
... | 30.961749 | 99 | 0.545711 |
1af5448e98c288d46b303bc031e2e6e3dcd94d2b | 650 | require_relative 'spec_helper'
describe DressCode::Generator do
before :each do
doc = DressCode::Document.new({
:component => 'button',
:prose => "```html\n<button>I am a button</button>\n```",
:path => '/whever/button.css',
:relative_path => 'button.css'
})
@docs = [doc]
end
... | 21.666667 | 63 | 0.613846 |
187f4c223defc083b71c441281497f5a7cf0cdf1 | 2,829 | RSpec.describe Owners do
describe ".for" do
subject { described_class.for(*paths) }
context "with one path" do
let(:paths) { ["example/app/controllers/users_controller.rb"] }
it "parses owners correctly" do
expect(subject).to eq(["@org/auth", "@org/blog"])
end
end
context ... | 25.486486 | 88 | 0.588194 |
e8c275acae195523f620174041ce6fa79f0079b9 | 1,228 | module Scrapbox2markdown
module Converters
class Heading
# [pattern, replace]
PATTERNS = [
[/\[\*\*\*\*\*\s(.*?)\]/, '# '],
[/\[\*\*\*\*\s(.*?)\]/, '## '],
[/\[\*\*\*\s(.*?)\]/, '### '],
[/\[\*\*\s(.*?)\]/, '##### '],
[/\[\*\s(.*?)\]/, '##### '],
... | 25.583333 | 90 | 0.444625 |
380f942e9a4d426d0f8a4958f7c4242ab8d9b7cb | 13,817 | # frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render inv... | 48.651408 | 154 | 0.751393 |
289e45807838f6a27fa9932f7c3f846027b87816 | 5,431 | module ActiveAdmin
# This is the class where all the register blocks are evaluated.
class ResourceDSL < DSL
def initialize(config, resource_class)
@resource = resource_class
super(config)
end
private
def belongs_to(target, options = {})
config.belongs_to(target, options)
end
... | 28.434555 | 87 | 0.62088 |
623ef8a71007224a73eb5f894b15fbecd34f1833 | 1,867 | Pod::Spec.new do |s|
s.name = "Zee5PlayerPlugin"
s.version = '1.1.15'
s.summary = "Zee5PlayerPlugin"
s.description = <<-DESC
Zee5PlayerPlugin.
DESC
s.homepage = "https://github.com/applicaster/Zee5PlayerPlugin-iOS"
s.l... | 34.574074 | 120 | 0.635244 |
ac59fce1a0fedf78d49b62aad655d8b82249280d | 2,644 | module Metro
class Model
#
# A song property maintains a Gosu::Song.
#
# A song is stored in the properties as the path in the assets folder and is converted into
# a Gosu::Song when it is retrieved within the system. When retrieving a song the Song
# Property will attempt to use a song that ... | 29.707865 | 98 | 0.627458 |
1cc5777cd151a551b6a598a3dc7a3c86950d6dfd | 1,860 | # frozen_string_literal: true
FactoryBot.define do
factory :meal, class: "Meals::Meal" do
transient do
communities { [] }
no_calendars { false }
head_cook { nil }
head_cook_role_title { nil }
asst_cooks { [] }
cleaners { [] }
end
served_at { Time.current + 7.days }
... | 25.833333 | 89 | 0.631183 |
f7a271eef12f05225bb9fafa036a401dd0f95d3a | 1,222 | # frozen_string_literal: true
module ApplicationHelper
def google_maps_api_source
if APP_CONFIG.google_maps_api_key
"https://maps.googleapis.com/maps/api/js?libraries=geometry&key=#{APP_CONFIG.google_maps_api_key}"
else
'https://maps.googleapis.com/maps/api/js?libraries=geometry'
end
end
... | 26.565217 | 122 | 0.700491 |
b9173265f234c9a3d37bbcda3185b0de23ae23ad | 1,354 | cask "logitech-unifying" do
if MacOS.version <= :yosemite
version "1.2.359"
sha256 "e6fd9c1b536033f3346b32c391bd58587ea9f549cab7839cf8a1dbc62a739825"
else
version "1.3.375"
sha256 "82fe3df612e775ec8789fa821f4f62d4b3a55278276d03474580fee668ee50b7"
end
url "https://download01.logi.com/web/ftp/pub... | 37.611111 | 161 | 0.742245 |
f80cb824d5804bccfad276cdab2f8af9ce6769b1 | 5,399 | # 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::DataFactory::Mgmt::V2018_06_01
module Models
#
# A copy activity source for a CosmosDB (MongoDB API) database.
#
class Cosmo... | 32.721212 | 79 | 0.487868 |
28a3ecc16958cd84773fb7d6257701ab7279ac1b | 2,450 | # 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::Compute::Mgmt::V2019_07_01
module Models
#
# This is the regional replication status.
#
class RegionalReplicationStatus
... | 28.16092 | 79 | 0.508163 |
6a351aafb14cfb781f6b4b6e9d7862d87b746061 | 1,039 | require 'pry'
=begin
Right Triangles
Write a method that takes a positive integer, n, as an argument, and displays a
right triangle whose sides each have n stars. The hypotenuse of the triangle
(the diagonal side in the images below) should have one end at the lower-left of
the triangle, and the other end at the uppe... | 16.234375 | 80 | 0.640038 |
d5f24dd4dd784b51157f00512a6ae8bb10c74aae | 190 | require 'pact/matchers/expected_type'
module Pact
class ActualType < Pact::ExpectedType
def initialize value
@value = value
end
def to_s
type
end
end
end | 11.875 | 39 | 0.652632 |
2699de53b18c5b89ca798e5bd1c0371502004e26 | 1,765 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
module NewRelic
module Agent
class SamplerCollection
include Enumerable
def initialize(event_listener)
@samplers = []
event_li... | 30.431034 | 121 | 0.617564 |
5d6695102bec1964525f93d58f97596568605823 | 1,464 | require 'helper'
require 'thor/core_ext/hash_with_indifferent_access'
describe Thor::CoreExt::HashWithIndifferentAccess do
before do
@hash = Thor::CoreExt::HashWithIndifferentAccess.new :foo => 'bar', 'baz' => 'bee', :force => true
end
it "has values accessible by either strings or symbols" do
expect(@h... | 29.877551 | 102 | 0.645492 |
e2ac4983a3614db0826cedc6a217e4ad443ae5ed | 3,944 | # frozen_string_literal: true
class Course::Forum::PostsController < Course::Forum::ComponentController
before_action :load_topic
authorize_resource :topic
skip_authorize_resource :post, only: :toggle_answer
before_action :authorize_locked_topic, only: [:create]
before_action :add_topic_breadcrumb
include ... | 29.432836 | 112 | 0.698783 |
4a59aa0df7e5d69a3c0ea2fc15fb396c30a6831a | 558 | require_relative 'boot'
require 'rails'
Bundler.require(*Rails.groups)
require 'nfg_ui'
module TestApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
# Settings in config/environments/* take precedence over those specified here.
config... | 27.9 | 82 | 0.765233 |
b97bf9bc804cd8f835fdef55dde70b779a6362bb | 45 | module Hashie
VERSION = '4.1.0'.freeze
end
| 11.25 | 26 | 0.688889 |
b9c0ad4b72827c9e0633dace283f32f081570e5d | 882 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'the_comments/version'
Gem::Specification.new do |gem|
gem.name = "the_comments"
gem.version = TheComments::VERSION
gem.authors = ["Ilya N. Zykin"]
gem.email... | 35.28 | 75 | 0.646259 |
219702935cf1aca44aa17914fb38db06d2ad2b5d | 314 | # frozen_string_literal: true
# Demonstrates a "custom versions association name". Instead of the association
# being named `versions`, it will be named `paper_trail_versions`.
class Document < ActiveRecord::Base
has_paper_trail(
versions: { name: :paper_trail_versions },
on: %i[create update]
)
end
| 28.545455 | 79 | 0.748408 |
1a42f6a01a52de5c053e1175c924db4c4cec67ba | 10,841 | require 'spec_helper'
describe AjaxDatatablesRails::Base do
params = {
:draw => '5',
:columns => {
"0" => {
:data => '0',
:name => '',
:searchable => true,
:orderable => true,
:search => { :value => '', :regex => false }
},
"1" => {
:data => ... | 30.798295 | 100 | 0.589982 |
1a7c3d43f068d824879c846dff24fbdb058845df | 1,540 | {
matrix_id: '1475',
name: 'GD00_a',
group: 'Pajek',
description: 'Pajek network: Graph Drawing contest 2000',
author: 'Graph Drawing Contest',
editor: 'V. Batagelj',
date: '2000',
kind: 'directed graph',
problem_2D_or_3D: '0',
num_rows: '352',
num_cols: '352',
nonzeros: ... | 37.560976 | 120 | 0.590909 |
ed51611f2a7e5bc191c245df33de18f7087b85d3 | 198 | require "spec_helper"
RSpec.describe Helix do
it "has a version number" do
expect(Helix::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 16.5 | 40 | 0.70202 |
e82c2db2b2cf765fed82a7e1928ae98266f7a3a8 | 535 | class DropSpreeIdFromSalesforceContacts < ActiveRecord::Migration
def up
return if ENV["DEPLOYMENT"] == "production"
HerokuConnect.change_schema("salesforce") do
remove_column :contact, :spree_id__c
remove_column :order__c, :contact__r__spree_id__c
end
end
def down
return if ENV["DEPL... | 29.722222 | 67 | 0.721495 |
acb58058074ca8177a5fcbf7a977fcdf775462e2 | 658 | module BandwidthIris
INSERVICE_NUMBER_PATH = 'inserviceNumbers'
class InServiceNumber
extend ClientWrapper
def self.list(client, query = nil)
list = client.make_request(:get, client.concat_account_path(INSERVICE_NUMBER_PATH), query)
return list
end
wrap_client_arg :list
def self.g... | 27.416667 | 112 | 0.724924 |
61cf16fec754837876d18040e95191ec45caf0a7 | 1,310 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.473684 | 82 | 0.738168 |
edb07c649936994d7b4db440ed6859ffe833e769 | 2,342 | # Copyright 2014 Bob Aman
#
# 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 ... | 32.082192 | 81 | 0.658839 |
1dbce179b53402d446ed8c831e167b9a425427a6 | 1,086 |
Pod::Spec.new do |s|
s.name = "YLLXfyun"
s.version = "0.0.2"
s.summary = "A short description of YLLXfyun."
s.description = "xunfei"
s.homepage = "https://github.com/yuliang6/YLLXfyun"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.a... | 25.255814 | 161 | 0.612339 |
264895955917df34d7de2f65a2a45f550ba81f16 | 461 | module Mastercard
module Common
class OAuthParameters
attr_accessor :params
def initialize()
self.params = Hash.new
end
# add a parameter to the hash and as an instance variable to the class
def add_parameter(key, value)
self.params[key... | 20.954545 | 77 | 0.550976 |
0385d7c05ae5f9b3bec6261c9645e121be0897c0 | 2,277 | # Copyright 2011-2018, The Trustees of Indiana University and Northwestern
# University. 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
#
# ... | 36.725806 | 85 | 0.72859 |
bf7889e38f28e5e94bacaaacb1abf6381d1e58bb | 66 | class PageController < ApplicationController
def home
end
end
| 13.2 | 44 | 0.80303 |
f7fef35cf602653cb791267aa3c0d6dac7740255 | 2,348 | # frozen_string_literal: true
require 'date'
require 'schema_dot_org'
require 'schema_dot_org/aggregate_offer'
# Model the Schema.org `Thing > Place`. See https://schema.org/Product
#
module SchemaDotOrg
class SportsEvent < SchemaType
attr_accessor :name,
:start_date,
:end_d... | 28.634146 | 120 | 0.546422 |
bb519c22b5591541c482047a4c6d606ce16cfe12 | 1,992 | # The game loop.
#
class Loop
class Break < StandardError; end
def self.shared_instance
@shared_instance ||= Loop.new
end
def initialize
@frame_count = 0
@time_count = 0
end
# Root game object instance.
#
attr_reader :root
def root=(set)
@root = set
@renderer = Renderer.new(root... | 26.918919 | 80 | 0.697289 |
87de64a798cb83c21ef9dafe045c43ff32d9cfc7 | 569 | cask "zeplin" do
version "3.23.1,1238"
sha256 :no_check
url "https://api.zeplin.io/urls/download-mac"
name "Zeplin"
desc "Share, organize and collaborate on designs"
homepage "https://zeplin.io/"
livecheck do
url "https://api.appcenter.ms/v0.1/public/sparkle/apps/8926efff-e734-b6d3-03d0-9f41d90c34fc... | 21.884615 | 96 | 0.683656 |
1af72ab83142757ca0a7453e19fe3fc3be88e6a7 | 833 | module ProcSpecs
def self.new_proc_in_method
Proc.new
end
class SourceLocation
def self.my_proc
proc { true }
end
def self.my_lambda
lambda { true }
end
def self.my_proc_new
Proc.new { true }
end
def self.my_multiline_proc
proc do
'a'.upcase
... | 15.145455 | 34 | 0.557023 |
7abf575359c3d5bea90085564ead11a82255fd7f | 4,799 | require 'net/http'
require 'uri'
require 'digest/sha1'
require 'rack/file'
module DAV4Rack
class RemoteFile < Rack::File
attr_accessor :path
alias :to_path :path
# path:: path to file (Actual path, preferably a URL since this is a *REMOTE* file)
# args:: Hash of arguments:
# ... | 32.208054 | 134 | 0.585747 |
6170b8ebbc5103c3cfede8529b3b45c9a07c82d2 | 160 | module Cryptozoologist
module Addresses
def self.list
["Street", "Lane", "Avenue", "Boulevard", "Circle", "Court", "Way", "Drive"]
end
end
end | 22.857143 | 82 | 0.625 |
f737808b4cd0323b2785e20a6e2116db23e51c59 | 1,461 | module Spree
# Tax calculation is broken out at this level to allow easy integration with 3rd party
# taxation systems. Those systems are usually geared toward calculating all items at once
# rather than one at a time.
#
# To use an alternative tax calculator do this:
# Spree::ReturnAuthorization.reimbu... | 38.447368 | 101 | 0.680356 |
39dbfb54527edebbb9db23f175705307f06bbade | 1,108 | require 'rake'
Gem::Specification.new do |s|
s.name = 'json_rpc_client_2'
s.homepage = 'https://github.com/reinerRubin/json_rpc_client_ruby_2'
s.license = 'MIT'
s.authors = ['Fredrik Liljegren', 'Lars Olsson', 'Denis Dervisevic', 'Reiner Rubin']
s.ver... | 38.206897 | 100 | 0.606498 |
1dfb4672c9f26e5972ef21ebbd132e22ae81b560 | 241 | module Puppet::Parser::Functions
newfunction(
:myfirstfunction,
:type => :rvalue,
:doc => "Testing the first function. ") do |args|
value = args[0]
result = "Hello World Function: " + value
return result
end
end
| 21.909091 | 53 | 0.630705 |
5d8e15b4c36fe0c5337825f4caedad76d21bb9b2 | 435 | # frozen_string_literal: true
module WasteCarriersEngine
class CompanyPostcodeFormsController < PostcodeFormsController
def new
super(CompanyPostcodeForm, "company_postcode_form")
end
def create
super(CompanyPostcodeForm, "company_postcode_form")
end
private
def transient_regis... | 21.75 | 77 | 0.758621 |
08d6e2cafe22ee962772dbf7ef91564059f39bcb | 25 | module SettingHelper
end
| 8.333333 | 20 | 0.88 |
115dfb516431e10306274e6b87ceb8e4ff0c5bfe | 1,945 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 34.122807 | 85 | 0.761954 |
398b345de980cdd5f87e0c4a9076bafd9166064b | 396 | shared_examples_for :hash_values_at do |method|
before { @method = method }
it "returns an array of values for the given keys" do
h = new_hash(:a => 9, :b => 'a', :c => -10, :d => nil)
h.send(@method).should be_kind_of(Array)
h.send(@method).should == []
h.send(@method, :a, :d, :b).should be_kind_o... | 30.461538 | 58 | 0.593434 |
ac39ebfdc101c3d3edd0327e3d906bdaa123eafc | 386 | require 'nokogiri'
require 'open-uri'
require 'pry'
require_relative "../lib/beer_presenter/version"
require_relative "../lib/beer_presenter/common"
require_relative "../lib/beer_presenter/cli"
require_relative "../lib/beer_presenter/beer"
require_relative "../lib/beer_presenter/brewery"
require_relative "../lib/beer_... | 32.166667 | 48 | 0.800518 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.