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 |
|---|---|---|---|---|---|
7a52aea71ede5efe0d3771a7884a4fe058009dea | 6,627 | require "rails_helper"
require "transition/import/site_yaml_file"
describe Transition::Import::SiteYamlFile do
context "A site YAML file" do
subject(:yaml_file) do
Transition::Import::SiteYamlFile.load("spec/fixtures/sites/someyaml/ago.yml")
end
describe "#abbr" do
subject { super().abbr }
... | 32.806931 | 111 | 0.624415 |
ff56f501f812603c22f67cb69e6d5d3699fbd62e | 1,728 | require 'test_helper'
require 'turbomode'
include Turbomode
include Turbomode::Systems
include Turbomode::Components
describe PositionAggregatorSystem do
let(:aggregated_entity1) { Entity.new PositionComponent.new }
let(:aggregated_entity2) { Entity.new PositionComponent.new }
let(:entity) { Entity.new Position... | 37.565217 | 182 | 0.736111 |
e86c6ee91f344ed4dc0f0e23123cccc2582574b8 | 1,554 | require 'tempfile'
require_relative '../../lib/migrate'
describe Migrate::Migrator do
subject do
Migrate::Migrator.new(db)
end
let(:db) do
double('db').tap do |db|
allow(db).to receive(:transaction) { |&b| b.call }
allow(db).to receive(:uri) { ':double:' }
end
end
describe '#execut... | 23.19403 | 67 | 0.582368 |
ac418eda8530eeae422c69e23712435c9901943f | 5,107 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.798246 | 114 | 0.765812 |
1c31e0119ca229607c1ce9c1805485a228672236 | 293 | class CreateDiscountTables < ActiveRecord::Migration
def self.up
create_table :discount_tables do |t|
t.column "qty", :integer
t.column "discount_applied", :float
t.column "discount_id", :integer
end
end
def self.down
drop_table :discount_tables
end
end
| 20.928571 | 52 | 0.692833 |
f850b9eceedfdfe1a208cbb1e8102d1c6b02b951 | 1,259 | Pod::Spec.new do |s|
s.name = 'OneMobileSDK-Beta-Xcode9.3'
s.version = '2.28.2599
'
s.summary = 'Beta version of OATH O2/Vidible Mobile SDK'
s.license = {
type: 'Internal',
text: 'Copyright 2018, Oath Inc.'
}
s.description = <<-DESC
SDK provides possibility ... | 34.027027 | 119 | 0.656871 |
ab460594e6ca53e052eaabc74450fbe37734bae4 | 1,412 | module Amorail # :nodoc: all
class Entity
class << self
# Find AMO entity by id
def find(id)
new.load_record(id)
end
# Find AMO entity by id
# and raise RecordNotFound if nothing was found
def find!(id)
rec = find(id)
fail RecordNotFound unless rec
... | 21.723077 | 66 | 0.543201 |
1c5d2517777255279a394265f2c60044cb43f89b | 3,761 | # 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.
require 'uri'
require 'cgi'
require 'date'
require 'json'
require 'base64'
require 'erb'
require 'securerandom'
require 'time'
require 'timeliness'
require ... | 78.354167 | 159 | 0.693698 |
ff14c7078181f7c1d33bbcaceba893244ef26ef1 | 1,040 | #
# Copyright (c) 2013-2017 SKYARCH NETWORKS INC.
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
require_relative '../spec_helper'
describe RootController, type: :controller do
let(:klass) { RootController }
let(:request) { get :root }
describe '#root'... | 21.22449 | 61 | 0.624038 |
e98e024fde832524223ecee0972e6ea8b2ad45f5 | 5,076 | #
# Copyright 2011-2013, Dell
# Copyright 2013-2014, SUSE LINUX Products GmbH
#
# 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 requi... | 37.323529 | 113 | 0.68814 |
876b28c0e0ee420fbcbfbdaab37f47d41a16864d | 2,700 | # frozen_string_literal: false
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic ... | 31.764706 | 123 | 0.63 |
e8153825d2251aaf423aeb270ebc023a5121e96e | 1,727 | class Freeglut < Formula
desc "Open-source alternative to the OpenGL Utility Toolkit (GLUT) library"
homepage "https://freeglut.sourceforge.io/"
url "https://downloads.sourceforge.net/project/freeglut/freeglut/3.2.2/freeglut-3.2.2.tar.gz"
sha256 "c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50"... | 34.54 | 165 | 0.738854 |
5dbeef994f9c0f2c788aed7106cdfd15ba1df49c | 10,698 | class Student < User
has_many :accepted_groupings, :class_name => 'Grouping', :through => :memberships, :conditions => {'memberships.membership_status' => [StudentMembership::STATUSES[:accepted], StudentMembership::STATUSES[:inviter]]}, :source => :grouping
has_many :pending_groupings, :class_name => 'Grouping', ... | 36.264407 | 238 | 0.698635 |
33b100f29b44026c0d0f525c33bd48d93171b781 | 261 | require 'digest/sha2'
module Grably # :nodoc:
def digest(src, buff_len: 4096)
src = src.src if src.is_a?(Product)
sha = ::Digest::SHA2.new
File.open(src, 'rb') do |f|
sha << f.read(buff_len) until f.eof?
end
sha.hexdigest
end
end
| 20.076923 | 42 | 0.616858 |
39a694b251112c64feb44993e198a5daf3d11baf | 193 | module Debug
@enabled = false
def self.enable(value)
@enabled = !!value
end
def self.debug(topic)
lambda do |msg|
puts "[#{topic}] #{msg}" if @enabled
end
end
end
| 13.785714 | 42 | 0.590674 |
eda4ef6b7854c40d4ad2f4c8cc1320526f5c9bf6 | 45 | class DeliveryPolicy < ApplicationPolicy
end | 15 | 40 | 0.866667 |
6a46a589b456bf0e64cf9e4521536215112c2987 | 1,604 | module Maple::MapleTA
module Page
class RestrictedAssignment < Base
# Returns true if the given page looks like a page this class can parse
def self.detect(page)
!!(page.parser.xpath('.//title').text() =~ /Restricted Assignment/)
end
def html
reason_node.children.map { |x| x.to_xhtml }... | 24.676923 | 96 | 0.613466 |
ac7ee01dd222a7433bcf59aff0e02bc346f1dc17 | 828 | require 'aws-sdk'
module Vidzygo
class CloudStorage
def initialize(token)
@token = token
# make an API call to vidzygo and set the cloud storage provider
storage = Vidzygo::Api.new(@token,'storages').get
@provider = storage['provider']
@access_key_id = storage['access_key_id']
... | 27.6 | 99 | 0.631643 |
1c07c252fc41b2dd37945c8716e2b06fd1f4d95c | 623 | Rails.application.routes.draw do
get 'sessions/new'
get 'products' => 'products#index'
get 'products/create' => 'products#create'
post 'products/store' => 'products#store'
get 'products/:id/remove' => 'products#remove'
get 'products/:id/edit' => 'products#edit'
patch 'products/update' => 'products#upd... | 25.958333 | 66 | 0.658106 |
b92b38bd31c2915bd3d3934326e052e4c067cc40 | 1,446 | require "rails_helper"
RSpec.describe Integrated::DoYouHavePregnancyExpensesController do
describe "#skip?" do
context "when household has one member" do
it "returns false" do
application = create(:common_application, members: build_list(:household_member, 1))
skip_step = Integrated::DoYou... | 30.125 | 92 | 0.689488 |
ac34fb55f168f7d27bf31fc401d3e866cecf1bb7 | 16,885 | describe StudentTask do
# Write your mocked object here!
let(:participant) { build(:participant, id: 1, user_id: user.id, parent_id: assignment.id) }
let(:participant2) { build(:participant, id: 2, user_id: user2.id, parent_id: assignment.id) }
let(:user) { create(:student) }
let(:user2) { create(:student, na... | 46.387363 | 156 | 0.700503 |
b91f4ef1371a504aa8898f7a309cf060219e3420 | 5,029 | # frozen_string_literal: true
require "cases/helper"
require "support/schema_dumping_helper"
class Mysql2TableOptionsTest < ActiveRecord::Mysql2TestCase
include SchemaDumpingHelper
def setup
@connection = ActiveRecord::Base.connection
end
def teardown
@connection.drop_table "mysql_table_options", if... | 36.708029 | 155 | 0.740903 |
f7a0b93c7071318fac233247641926d13f15682d | 11,491 | # frozen_string_literal: true
require 'spec_helper'
describe Grape::JSONAPI::API do
fixtures :people, :posts, :sections
def app
Class.new(Grape::API) do
mount People
mount Posts
end
end
describe 'GET' do
it 'returns an entity listing' do
get 'people'
expect(last_response)... | 29.091139 | 79 | 0.602646 |
1c5796fbf88f3926bf90de9a1eaa5c822b3b5a5c | 143 | class DataSourceCollectionAssociation < ActiveRecord::Base
nilify_blanks
belongs_to :data_source_collection
belongs_to :data_source
end
| 20.428571 | 58 | 0.846154 |
bf268e656468b37d68611957b4e7fefa03660199 | 1,036 | module TD::Types
# Represents the results of the inline query.
# Use sendInlineQueryResultMessage to send the result of the query.
#
# @attr inline_query_id [Integer] Unique identifier of the inline query.
# @attr next_offset [TD::Types::String] The offset for the next request.
# If empty, there are no mo... | 51.8 | 113 | 0.743243 |
28965cc17d419bbe081234ebd529353b86b807ac | 7,995 | module RBS
class Writer
attr_reader :out
attr_reader :indentation
def initialize(out:)
@out = out
@indentation = []
end
def indent(size = 2)
indentation.push(" " * size)
yield
ensure
indentation.pop
end
def prefix
indentation.join()
end
d... | 24.984375 | 82 | 0.545341 |
79ecc1f9d2030ce6ace24cb13a225e6371a25017 | 1,204 | class Ceylon < Formula
desc "Programming language for writing large programs in teams"
homepage "https://ceylon-lang.org/"
url "https://ceylon-lang.org/download/dist/1_3_3"
sha256 "4ec1f1781043ee369c3e225576787ce5518685f2206eafa7d2fd5cfe6ac9923d"
revision 1
bottle :unneeded
depends_on java: "1.8"
def... | 35.411765 | 80 | 0.55897 |
acf7b27312a19a7aeae32740b62fd6d695e789b8 | 63 | int = gets.to_i
1.upto(int) { |x| puts x if (int % x).zero? }
| 15.75 | 45 | 0.555556 |
5d596ec5ddd546439388bccddea139b077d6b05e | 4,181 | require 'teststrap'
require 'contributions/string_utils'
context "StringUtils" do
helper(:string) { "1b90c5e CONTRIBUTIONS_SEPARATOR 2011-09-13 07:49:43 -0500 CONTRIBUTIONS_SEPARATOR remove mention of deprecated exists from README CONTRIBUTIONS_SEPARATOR CONTRIBUTIONS_ENDING \n1620141 CONTRIBUTIONS_SEPARATOR 201... | 66.365079 | 684 | 0.676872 |
1d5c268910c6b1ae07895cdd2a4b96b22745c029 | 5,335 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 28.37766 | 119 | 0.576382 |
e832644fc71aa9bfd1451c3c21739a5c7cde1dd4 | 344 | class IntelXdk < Cask
version '0769'
sha256 '365a1850ccbf52fb3f1946bb569c454ccd6ea1a72d43074a9e92d9a646881489'
url "https://d2bnc8freht07j.cloudfront.net/xdk_web_mac_master_#{version}.dmg"
homepage 'http://xdk-software.intel.com/'
license :unknown
pkg "xdk_full_#{version}.pkg"
uninstall :pkgutil => 'com... | 28.666667 | 79 | 0.773256 |
b9c642598e4947b8ea6de4cbc4e8af186b214a8b | 1,726 | class PersonasController < ApplicationController
before_filter :login_required
before_filter :find_account
before_filter :find_persona, :only => [:show, :edit, :update, :destroy]
before_filter :store_return_url, :only => [:new, :edit]
def index
@personas = @account.personas.all
respond_to do |format|
f... | 21.848101 | 83 | 0.72248 |
2880b1c19f7bc9cf933bf379db963535ec0fb07e | 111,237 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins... | 44.76338 | 165 | 0.662208 |
5d21eba1f89b49253077e5ee2fbba0e2850305c5 | 4,567 | # SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Begley Brothers Inc.
#
# See details in LICENSE.
# We're going to need some SSL certificates for testing.
caroot = '/tmp/registry/tls'
directory caroot.to_s do
recursive true
action :create
end
# Self signed CA
bash 'generating CA private and public key... | 23.065657 | 75 | 0.643311 |
015a5fd64bda48b88b54ae6d1879a2fdb9725bf9 | 1,179 | # encoding: utf-8
#
# This client is automatically generated from a template and JSON schema definition.
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
#
require 'uri'
module GoCardlessPro
# A module containing classes for each of the resources in the GC Api
module Resources... | 27.418605 | 90 | 0.697201 |
7a90fc1885074083a73e67f52edb393db7579969 | 1,662 | class UserInvitePresenter
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
include ActiveModel::MassAssignmentSecurity
attr_accessor :user_first_name, :user_email, :organisation
validates :user_first_name, :user_email, presence: true
validates :user_email, fo... | 25.96875 | 103 | 0.720217 |
01eb3f020a46449a36fb845524610ea75ecd7db2 | 118,208 | require 'stackbuilder/stacks/factory'
require 'test_classes'
require 'spec_helper'
describe 'kubernetes' do
let(:app_deployer) { TestAppDeployer.new('1.2.3') }
let(:failing_app_deployer) { TestAppDeployer.new(nil) }
let(:dns_resolver) do
MyTestDnsResolver.new('e1-x-vip.space.net.local' => '3.1.4.1',
... | 40.691222 | 149 | 0.514238 |
38e70fe78a6c2ffdc83735dafe7ca6eb92a2a178 | 303 | name "rsyncd"
maintainer "OpenStreetMap Administrators"
maintainer_email "admins@openstreetmap.org"
license "Apache-2.0"
description "Configures rsyncd"
version "1.0.0"
supports "ubuntu"
depends "networking"
depends "systemd"
| 27.545455 | 48 | 0.60066 |
283c03168928fec434dc498d7204851a6773eb58 | 1,510 | # frozen_string_literal: true
#
# Copyright:: 2019, Chef Software Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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/licens... | 30.2 | 98 | 0.621192 |
ed63b5a9709a4d374379a16cb405399c92920183 | 1,203 | require 'rails_helper'
RSpec.describe Event::PhoneCall do
let(:eventable_factory) { :phone_call }
it_behaves_like("resource_event") do
let(:event) { "queue" }
let(:asserted_current_status) { PhoneCall::STATE_CREATED }
let(:asserted_new_status) { PhoneCall::STATE_QUEUED }
end
describe "validations... | 27.340909 | 79 | 0.664173 |
399b3606cd23ca91cfcc1d3cfa9fe3bbc07065ad | 2,728 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup'
require 'vedeu'
# This example application shows how interface focus works.
#
# If you have cloned this repository from GitHub, you can run this example:
#
# ./test/support/examples/focus_app.rb
#
# First, we set up the interfaces, noting ... | 19.768116 | 78 | 0.58871 |
79bc1a227ad6430adfad539c5bb8c77c2f830af6 | 801 | # iis_version.rb
Facter.add("iis_version") do
confine :kernel => :windows
setcode do
begin
psexec = if File.exists?("#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe")
"#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe"
elsif Fi... | 36.409091 | 170 | 0.617978 |
e94a162be6fd712f3b36ced1ba334650ddae75c6 | 4,420 | require 'sinatra/base'
require 'sinatra/respond_with'
require 'sinatra/json'
require 'sinatra/namespace'
require 'sinatra/reloader'
require 'sinatra/streaming'
require 'pagy'
require_relative 'helpers'
module Kimurai
module Dashboard
class App < Sinatra::Base
include Pagy::Backend
register Sinatra::... | 26.153846 | 100 | 0.549548 |
38a12bd65df95ed64f07a44709ed31bff71e402e | 158 | require File.expand_path('../../../spec_helper', __FILE__)
require 'date'
describe "Date.jd_to_ajd" do
it "needs to be reviewed for spec completeness"
end
| 22.571429 | 58 | 0.734177 |
f7502b068aed42d1c2a2461f4443eb143d75faa9 | 4,678 | require 'rails_helper'
module Ecm
module Cms
describe NavigationItem do
subject { FactoryBot.create :ecm_cms_navigation_item }
context 'associations' do
it { should belong_to :ecm_cms_navigation }
it { should belong_to :ecm_cms_page }
end
context '#to_s' do
it 's... | 37.126984 | 152 | 0.607311 |
bf51a2bf113be5811f6544a38189fc0d9b1fc1d6 | 301 | # Don't forget! This file needs to be 'required' in its spec file
# See README.md for instructions on how to do this
def fizzbuzz(int)
if int % 3 == 0 && int % 5 == 0
return "FizzBuzz"
elsif int % 3 == 0
return "Fizz"
elsif int % 5 == 0
return "Buzz"
else
nil
end
end
| 20.066667 | 65 | 0.598007 |
b9ae895a1359d026385d7e1763043162942330fa | 4,635 | # frozen_string_literal: true
# BridgeContentsController
class BridgeContentsController < UserBaseController
before_action :set_regular_inspection
before_action :set_bridge_content, only: %i[show edit update destroy]
# GET /regular_inspections/1/bridge_contents
# GET /regular_inspections/1/bridge_contents.jso... | 43.317757 | 119 | 0.642503 |
5d4ba493be9549cdc9af9de8cd648903acc34da2 | 993 | module OpenXml
module Docx
module Elements
class AbstractNumbering < OpenXml::Docx::Element
include HasChildren, HasProperties
tag :abstractNum
def initialize(id)
super()
self.id = id
end
# TODO: child levels is limited to a max of 9
with... | 28.371429 | 88 | 0.620342 |
01dab29b8950cfd0e278de815e674b65a23b8341 | 221 | class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :provider
t.string :uid
t.string :name
t.string :email
t.timestamps
end
end
end
| 14.733333 | 48 | 0.615385 |
4abdc4677e3fcf6ce7eec303c5469483168cdefc | 9,853 | # Copyright 2018 OpenCensus Authors
#
# 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 wr... | 36.628253 | 80 | 0.611692 |
e25d853ffd1d375618ebf5477ac3d04df40e346d | 42 | module AppleShove
VERSION = "2.0.4"
end
| 10.5 | 19 | 0.690476 |
184dd908d0bf61a03e63f3e91048dbe7da51fbf8 | 656 | # frozen_string_literal: true
DB.create_table :sync_test do
column :count, :integer, default: 0
end
DB[:sync_test].insert(count: 0)
RSpec.describe "syncronize" do
def locks_count
DB[:pg_locks].where(locktype: "advisory", objid: "315964566").count
end
def update!
DB.synchronize_with(:increase_lock) d... | 21.866667 | 71 | 0.66311 |
282e439b9f1804b6f4fb2aeb0942e4260861d95a | 3,526 | require 'spec_helper'
describe Jubjub::Jid do
describe "creating" do
describe "from a string" do
it("should understand 'foo.bar'") do
j = Jubjub::Jid.new('foo.bar')
j.node.should be_nil
j.domain.should eql('foo.bar')
j.resource.should be_nil
end
it("should u... | 24.830986 | 68 | 0.568349 |
08fa052ae10ad50a905be0b3abefc47a7527aa78 | 1,416 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "afiper/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "afiper"
s.version = Afiper::VERSION
s.authors = ["Martín Rosso"]
s.email = ["mrosso10@gmail.com"]
... | 41.647059 | 326 | 0.710452 |
18e5327045a04b5bdeb7b2d571034ccecc07a82f | 209 | $:.unshift File.expand_path('../../lib', __FILE__)
require 'omniture_client'
access_token = "<GIMME SOME>"
client = OmnitureClient::Client.new(access_token, :san_jose, :log => true)
client.get_report_suites
| 26.125 | 74 | 0.741627 |
2195f784792a4a069c8a551ea542f251e7fffa3e | 821 | cask "kap" do
version "3.4.1"
sha256 "10b48adb80514077992d85fb1b0ddf34911a8d717fdc917f7435c942ee2ffbdb"
url "https://github.com/wulkano/kap/releases/download/v#{version.major_minor_patch}/Kap-#{version}.dmg",
verified: "github.com/wulkano/kap/"
name "Kap"
desc "Open-source screen recorder built with we... | 31.576923 | 106 | 0.714982 |
265ff75d6600dedae7880ac8ddc8672a3e36ae82 | 567 | require 'rails_helper'
describe "the add a product process" do
it "adds a product" do
visit products_path
click_link 'Create new product'
fill_in 'Name', :with => 'Apple'
fill_in 'Cost', :with => 10
fill_in 'Origin', :with => 'USA'
click_on 'Create Product'
expect(page).to have_content 'P... | 27 | 62 | 0.687831 |
e8d273893c0cd08491d1c32e2865b27d01fe9f4f | 1,457 | require "auth_dns_check"
RSpec.describe AuthDnsCheck do
it "has a version number" do
expect(described_class::VERSION).not_to be nil
end
describe ".client" do
it "is deprecated" do
pending "pending removal"
expect { described_class.client }.to raise(NoMethodError)
end
it "returns a... | 30.354167 | 98 | 0.713795 |
1c0c08cf253f719103edd13a10d1ece4f5b95589 | 1,249 | # frozen_string_literal: true
module Multidapter
module Operations
module Services
# Create a {Service} instance
class Create
send(:include, Dry::Monads[:result, :do])
def self.call(params)
new(params)
end
# @param [Hash] params Values to use to create the... | 26.020833 | 138 | 0.577262 |
01ae8ed06a70ca7a06cfa68a73ea575997c5d692 | 581 | cask 'activitywatch' do
version '0.8.3'
sha256 'adea375f0eb2dcf27dbd5b1707ff002f230663dd425664006f7e82427229768e'
# github.com/ActivityWatch/activitywatch was verified as official when first introduced to the cask
url "https://github.com/ActivityWatch/activitywatch/releases/download/v#{version}/activitywatch-v... | 38.733333 | 127 | 0.795181 |
26e93327d494d310f00061ca45481b514924c7b0 | 123 | class ImageSerializer
include FastJsonapi::ObjectSerializer
attributes :location, :image_url, :dimensions, :credit
end
| 24.6 | 56 | 0.813008 |
010b1dddda5e97515bb5a46f9d384beacf172d55 | 2,727 | require './config/environment'
require 'rack-flash'
require 'chartkick'
# require 'chart.js'
# require 'Chart.bundle'
class ApplicationController < Sinatra::Base
use Rack::Flash, :sweep => true
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions
set :session_secret... | 19.340426 | 108 | 0.584892 |
1a2e09a6a4502aacc5d9c13e7059b89cacefa440 | 15,512 | # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 43.819209 | 245 | 0.696429 |
ffdedd4898c7e3ac401e92b4db0401d794794f25 | 1,546 | require 'erb'
require 'dsc_utils'
test_name 'MODULES-2398 - C68692 - Apply DSC WindowsProcess Resource that Kills a Long Running Process'
confine(:to, :platform => 'windows')
# Init
local_files_root_path = ENV['MANIFESTS'] || 'tests/manifests'
# ERB Manifest
dsc_type = 'windowsprocess'
dsc_module = 'PSDesiredStateCo... | 32.208333 | 114 | 0.71216 |
33c358117bcf8dfb13f5f84375a90ad1287e8884 | 924 | require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../shared/instantiation'
describe "Void Void delegate instantiation" do
it_behaves_like :delegate_instantiation, DelegateHolder::VoidVoidDelegate
end
describe "Void Reference delegate instantiation" do
it_behaves_like :dele... | 33 | 89 | 0.833333 |
e9d1005647c60105e656ca91f27b13bbcc321652 | 6,266 | require_relative 'helper'
require 'fluent/config'
require 'fluent/config/parser'
require 'fluent/supervisor'
require 'fluent/load'
require 'fileutils'
class ConfigTest < Test::Unit::TestCase
include Fluent
TMP_DIR = File.dirname(__FILE__) + "/tmp/config#{ENV['TEST_ENV_NUMBER']}"
def read_config(path)
path ... | 30.866995 | 116 | 0.657836 |
91383e652cc4ae9075120141a60c8044b571311c | 1,724 | # Copyright © 2011 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of c... | 63.851852 | 145 | 0.798724 |
e9d5f23b2c65dfd58f959e1ba96016890d525aef | 888 | # frozen_string_literal: true
require_relative '../../../step/special_track'
require_relative '../../../step/track_lay_when_company_sold'
module Engine
module Game
module G1889
module Step
class SpecialTrack < Engine::Step::SpecialTrack
include Engine::Step::TrackLayWhenCompanySold
... | 27.75 | 98 | 0.614865 |
b98cdc9d1d61395a336e79e65f5cefc38983cd37 | 448 | cask 'catlight' do
version '2.31.0'
sha256 'd06c54aed7e0c10f51245a039c64cb26e5006db8b8b0e8bb0a588384bdf04c5e'
# de2nac35bcll0.cloudfront.net/ was verified as official when first introduced to the cask
url "https://de2nac35bcll0.cloudfront.net/dl/mac/beta/CatLightSetup-#{version}.zip"
appcast 'https://catligh... | 29.866667 | 92 | 0.758929 |
e260a17d5494b97153353a64574b6a7495f315c6 | 413 | # Be sure to restart your server when you modify this file.
Railsdiff::Application.config.session_store :cookie_store, :key => '_railsdiff_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "... | 45.888889 | 87 | 0.801453 |
b90e79647a77657a2cb97161a3185c3d51fd8f20 | 384 | require 'rails_helper'
RSpec.describe "messages/new.html.erb", type: :view do
it "shows a form" do
assign(:message, Message.new)
render
expect(response).to have_text 'New Message'
end
it 'shows form errors' do
message = Message.new
message.valid?
assign(:message, message)
render
... | 17.454545 | 54 | 0.679688 |
5d79e2445a30467a918f643c4b0ee64377ba4d6b | 370 | require 'twitter/creatable'
require 'twitter/entities'
require 'twitter/identity'
module Twitter
class DirectMessage < Twitter::Identity
include Twitter::Creatable
include Twitter::Entities
# @return [String]
attr_reader :text
alias_method :full_text, :text
object_attr_reader :User, :recipien... | 23.125 | 41 | 0.743243 |
ffe8372b45203cefd4081702c249a866a3255a51 | 1,539 | # encoding: utf-8
module Rubocop
module Cop
# Handles `EnforcedStyle` configuration parameters.
module ConfigurableEnforcedStyle
def opposite_style_detected
self.config_to_allow_offenses ||=
{ parameter_name => alternative_style.to_s }
both_styles_detected if config_to_allow_o... | 28.5 | 77 | 0.632878 |
acb3dce257c9f46ff09a69a53aa3269cdf514493 | 468 | require_relative './test_helper.rb'
require 'tree_node.rb'
module ToyGit
class TestTreeNode < Minitest::Test
def setup
@tree_node = TreeNode.new(name: "ABC", hash_id: "ASVSDSD")
end
def test_tree_node_can_be_created
assert TreeNode.new(name: "", hash_id: "")
end
def test_tree_node_... | 18.72 | 64 | 0.696581 |
d5f364fdb422ded2085171b0be055abce6ca22f0 | 9,818 | # frozen_string_literal: true
require_relative '../../../step/buy_train'
module Engine
module Game
module G18WE
module Step
class BuyTrain < Engine::Step::BuyTrain
WARRANTY_COST = 50
def round_state
super.merge(
{
emergency_buy: false,... | 33.972318 | 119 | 0.545732 |
035989c65d163f43ef1c9142c698624b0ad0af7a | 1,323 | require "test_helper"
class ApplicationControllerSearchParametersTest < ActionController::TestCase
class TestController < ApplicationController
Organisation = Struct.new(:slug, :"has_scoped_search?", :acronym)
def test_scoped
org = Organisation.new("org1", true, "o1")
set_slimmer_page_owner_head... | 31.5 | 103 | 0.719577 |
7994b2ebafceebf71073b55d7f608181d633c3cc | 690 | require 'rails_helper'
RSpec.describe CheckoutController, type: :controller do
describe "POST #shipment" do
it "returns http success" do
post :shipment
expect(response).to have_http_status(:success)
end
end
describe "POST #address" do
it "returns http success" do
post :shipment
... | 20.294118 | 55 | 0.675362 |
21c3ac69c7c534fcf1ba9456fb31ab3afed80122 | 4,533 | # frozen_string_literal: true
require 'xcassetscop/linter'
RSpec.describe XCAssetsCop::Linter, '#get_file_name' do
it 'should return the file name' do
contents_json = { 'images' => [{ 'filename' => 'image.pdf' }] }
subject = XCAssetsCop::Linter.get_file_name contents_json
expect(subject).to eq 'image.pd... | 44.441176 | 133 | 0.69358 |
bbad6d1f7f9c1d13ad9e10ba54e0fc0b4111eb03 | 3,594 | class JobProfileSearch # rubocop:disable Metrics/ClassLength
include ActiveModel::Validations
EXACT_MATCH_RANK = {
name: { weight: 'A', score: '4|1' },
alternative_titles: { weight: 'AB', score: '4|32' },
specialism: { weight: 'ABC', score: '4|1|32' },
hidden_titles: { weight: 'ABC', score: '4|1|32... | 26.622222 | 102 | 0.638564 |
e8d753cd056fcdf8666677d3cb083cf35cf555b7 | 621 | module Locomotive
module ViewCounter
class Middleware
def initialize(app)
@app = app
end
def call(env)
if !env['steam.live_editing'] && entry = env['steam.content_entry']
increment_view_counter(entry, env.fetch('steam.services'))
end
@app.call(env)
... | 18.818182 | 75 | 0.603865 |
2141ff123d897091afb5e24d4590fc32096aa6ea | 5,434 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.909091 | 114 | 0.76647 |
38c362f9342211c68d1beaba60dc661e020b73a3 | 4,309 |
# If the Kinetic Task version is under 4, load the openssl and json libraries
# because they are not included in the ruby version
if KineticTask::VERSION.split('.').first.to_i < 4
# Load the JRuby Open SSL library unless it has already been loaded. This
# prevents multiple handlers using the same library from cau... | 41.834951 | 109 | 0.749594 |
6216cc676c782458761987bb7f9fdb6fa8801d9f | 441 | class Shellshare < Formula
desc "Live Terminal Broadcast"
homepage "https://shellshare.net"
url "https://github.com/vitorbaptista/shellshare/archive/v1.0.3.tar.gz"
sha256 "d984a413c3b1f785265430519e9b1eecc6e47b96d63f5b207f82872dab0a0765"
bottle :unneeded
depends_on :python if MacOS.version <= :snow_leopar... | 23.210526 | 75 | 0.746032 |
624d6a81c3ad521bb4d9fd88d0b5c1b040506ab4 | 715 | # frozen_string_literal: true
module AcaEntities
module Medicaid
module Curam
module Programs
# entity for EligibilityDetermination
class EligibilityDetermination < Dry::Struct
attribute :id, Curam::Identifiers::Id.optional.meta(omittable: true)
attribute :d... | 35.75 | 104 | 0.685315 |
bb6aa1cd02fa5cdb52ab6054767295e4a845827d | 212 | require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "OpenmsxBuilderSite" do
it "fails" do
fail "hey buddy, you should probably rename this file and start specing for real"
end
end
| 26.5 | 85 | 0.754717 |
4a150d8ada1b060a5b889f77a068728e64588764 | 293 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
end
def log_out
session.delete(:user_id)
@current_user = nil
end
def current_user
current_user ||= User.find_by(id: session[:user_id])
end
def logged_in?
!current_user.nil?
end
end
| 15.421053 | 56 | 0.662116 |
e20ea8d972d241a2e9b26fbf8ef2d84bbef1a93f | 355 | require 'rails_helper'
RSpec.describe "inventory_types/show", type: :view do
before(:each) do
@inventory_type = create(:inventory_type,
:name => "Name",
:description => "Description"
)
end
it "renders attributes in <p>" do
render
expect(rendered).to match(/Name/)
expect(rendered)... | 20.882353 | 53 | 0.656338 |
f701bf8c62fdf2b55a2ddfbe913f21bb06444790 | 1,491 | require_relative "boot"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
# require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action... | 30.428571 | 79 | 0.735748 |
26e735f527a5d2b48c24d8a335ee73c58bfaed84 | 949 | class Kompose < Formula
desc "Tool to move from `docker-compose` to Kubernetes"
homepage "http://kompose.io"
url "https://github.com/kubernetes-incubator/kompose/archive/v0.5.0.tar.gz"
sha256 "542828b5b5a231596bc50536322975fab3b49259052de4ad6115b099c01f2627"
bottle do
cellar :any_skip_relocation
sha2... | 33.892857 | 92 | 0.770285 |
bbe737ccfdacb1dd7da4f54a93779e9fb44e1e7e | 25,927 | require 'spec_helper'
describe 'Bookable model' do
describe 'InstanceMethods' do
it 'should add a method #check_availability! in instance-side' do
@bookable = Bookable.new
expect(@bookable).to respond_to :check_availability!
end
it 'should add a method #check_availability in instance-side' d... | 43.648148 | 161 | 0.655494 |
268b6e0b943706a16680bd1517a6ae5e0810d516 | 3,222 | class DbBackup
# here we mimic some of the ActiveRecord actions, but with the filesystem instead of a database table
# DbBackup objects have a single attribute, filename, and use the global BACKUP_DIR constant
attr_accessor :file
# either returns all backup files (for index action) or the single file whose f... | 28.263158 | 159 | 0.671322 |
4ace2d6cc7ec965f91d5c73d5816cb9ee5effacc | 1,179 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
# https://www.cookieshq.co.uk/posts/easy-seo-metatags-with-rails-4#a-word-about-turbolinks
before_action :prepare_meta_tags, if: "request.get?"
def prepare_meta_tags(options={})
site_name = "4dCity.Com"
title ... | 28.071429 | 92 | 0.614928 |
ab348ea2b870911284d6abac58282a630f790946 | 68,809 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::EC2
class Instance
extend Aws::Deprecations
# @overload ... | 36.484093 | 918 | 0.630368 |
4afdbf4fa51532440ef343ba4270737d036a6cdd | 3,046 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
#
# 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,... | 40.078947 | 95 | 0.686474 |
1de40643ab41723dfd5fd9d08681b324a3b778e9 | 5,660 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
#
# License:: 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
#
# ... | 34.30303 | 80 | 0.65265 |
ab9d8badda9e1d6a2ed7ecc28960ada4b39ccc79 | 1,143 | # encoding: UTF-8
require 'test_helper'
describe Vines::TokenBucket do
subject { Vines::TokenBucket.new(10, 1) }
it 'raises with invalid capacity and rate values' do
-> { Vines::TokenBucket.new(0, 1) }.must_raise ArgumentError
-> { Vines::TokenBucket.new(1, 0) }.must_raise ArgumentError
-> { Vines::T... | 25.4 | 65 | 0.671041 |
ac4d7796e17d8972aebc3c56cd55d510e16b1d59 | 238 | # frozen_string_literal: true
class AlterPricePoliciesAddChargeFor < ActiveRecord::Migration[4.2]
def up
add_column :price_policies, :charge_for, :string
end
def down
remove_column :price_policies, :charge_for
end
end
| 17 | 67 | 0.760504 |
38a5573ff444e988823c45fbc5f43ded297de5f8 | 3,403 | def fft(digits)
sum = 0
sum_left = digits.map { |d| sum += d }
sum_left.unshift(0)
digits.each_index { |i|
n = i + 1
sign = 1
base = i
total = 0
while base < digits.size
total += ((sum_left[base + n] || sum_left[-1]) - sum_left[base]) * sign
base += n * 2
sign *= -1
en... | 32.721154 | 103 | 0.630914 |
089933e26da73b20860da42e60aeac2b2dd9c1aa | 1,070 | module Praxis
module Responses
class ValidationError < BadRequest
def initialize(errors: nil, exception: nil, message: nil, **opts)
super(**opts)
@headers['Content-Type'] = 'application/json' #TODO: might want an error mediatype
@errors = errors
@exception = exception
... | 26.097561 | 139 | 0.628037 |
eda8d8cc9f4a19cbfc1b0702c3a741e39f579dbd | 1,965 | class Biosig < Formula
desc "Tools for biomedical signal processing and data conversion"
homepage "https://biosig.sourceforge.io"
url "https://downloads.sourceforge.net/project/biosig/BioSig%20for%20C_C%2B%2B/src/biosig-2.2.1.src.tar.gz"
sha256 "4371eeaa92dca9069ab0ceea7ae48d41ad047e7c2e2674813c6678b88848c797"
... | 38.529412 | 109 | 0.720611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.