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 |
|---|---|---|---|---|---|
38e3bdf22e7679968aba2682f8542a9f625c05e3 | 453 | # frozen_string_literal: true
# Used constants:
# none
if File.file?('Package.swift')
namespace :spm do
desc 'Build using SPM'
task :build do |task|
Utils.print_header 'Compile using SPM'
Utils.run('swift build', task, xcrun: true)
end
desc 'Run SPM Unit Tests'
task :test => :build ... | 21.571429 | 55 | 0.646799 |
5d1586dbe1eb4e3f9895e896939f6a5f60dfa794 | 3,046 | # frozen_string_literal: true
require 'spec_helper'
require 'image_optim/pack'
describe ImageOptim::Pack do
before do
stub_const('Pack', ImageOptim::Pack)
stub_const('Path', Pack::Path)
end
describe :path do
it 'returns path' do
expect(Pack.path).to be
end
it 'returns instance of Pat... | 26.034188 | 77 | 0.60998 |
e9528f096b834bd345e8a144df372a2c7f347692 | 1,890 | require 'rails_helper'
describe Admin::GeneralUserNotificationsController do
render_views
let!(:general_user_notification) { FactoryBot.create :general_user_notification }
before do
login_as(FactoryBot.create(:admin))
end
describe "GET new" do
let(:response) { get(:new) }
it { expect(response)... | 27.391304 | 87 | 0.709524 |
391d321eedc0e3755b69a5e946a0aeec7616fa12 | 6,136 | # -*- coding: utf-8 -*-
require 'sinatra/json'
require_relative '../app'
require_relative '../ssha'
require_relative '../ntlm_hash'
require_relative '../base'
module GuildBook
class App
class PasswordRestrictionError < StandardError; end
class UidRestrictionError < StandardError; end
configure do
... | 28.807512 | 118 | 0.606095 |
e8d2644e392d6bbc68f0f35d3f8f129d27237237 | 1,026 | require File.expand_path '../../test_helper.rb', __FILE__
class ArgonautFixtureTest < MiniTest::Unit::TestCase
def setup
@bundle = FHIR::DSTU2.from_contents(load_fixture('sample_record'))
@invalid = FHIR::DSTU2.from_contents(load_fixture('sample_invalid_record'))
end
def test_argonaut_fixture_valid... | 32.0625 | 117 | 0.718324 |
d597d4edbe0ba2269faf16a023bc087c48cfb7d6 | 650 | require "spec_helper"
describe Answer do
it_behaves_like "has a uuid"
describe "#media_object_id=" do
context "with existing media object" do
let(:object) { create(:media_image) }
let(:answer) { Answer.new(media_object_id: object.id) }
it "should find and associate with media object" do
... | 27.083333 | 61 | 0.689231 |
b9b52d888aa56629cc64a9f816836e381ec98e31 | 310 | class Anagram
def initialize(anagram)
@anagram = anagram.downcase
end
def match(words)
anagrams = []
words.each do |word|
if word.downcase.split("").sort == @anagram.split("").sort
anagrams << word unless word.downcase == @anagram
end
end
anagrams
end
end
| 18.235294 | 64 | 0.609677 |
4a3ce47a923c9cad89a51cfd8e19ea7aeb04b1a0 | 2,544 | # -*- encoding: utf-8 -*-
# stub: jekyll 3.2.1 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll"
s.version = "3.2.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Tom Preston-Werner"]
s.bindir = "exe"
... | 40.380952 | 105 | 0.612028 |
798a17798f326be6b9b3a08ed2ffc0cdca7b8efd | 115 | ## for directory
default['subversion']['working_dir'] = ::File.join(Chef::Config[:file_cache_path], 'subversion')
| 28.75 | 96 | 0.721739 |
4a13384fbad79d1aba7caebf61af9280af5c264e | 138 | class AddTrustedAppRefToConsumer < ActiveRecord::Migration
def change
add_reference :consumers, :trusted_app, index: true
end
end
| 23 | 58 | 0.789855 |
ff56b77f55d89d800db124cf24ef09e62288b87a | 2,246 | # encoding: utf-8
require 'spec_helper'
module Adhearsion
class Router
describe UnacceptingRoute do
let(:name) { 'catchall' }
subject { Route.new name }
before { subject.extend described_class }
it { is_expected.not_to be_accepting }
describe "dispatching a call" do
let... | 30.351351 | 122 | 0.58415 |
6add1b4d6dcb013a6fa37cead3a04c9d829c3db1 | 832 | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
require 'test_helper'
module Elasticsearch
module Test
class XPackWatcherGetWatchTest < Minitest::Test
... | 26.83871 | 79 | 0.657452 |
f79721ac25569db21c534110f7383fa26f525509 | 1,107 | name "memcached"
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs memcached and provides a define to set up an instance of memcache via runit"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
vers... | 31.628571 | 104 | 0.690154 |
e85b2f397b3aa39f08c0416170b0414bccda058c | 1,613 | class FuseEmulator < Formula
desc "Free Unix Spectrum Emulator"
homepage "https://fuse-emulator.sourceforge.io/"
url "https://downloads.sourceforge.net/project/fuse-emulator/fuse/1.5.7/fuse-1.5.7.tar.gz"
sha256 "f0e2583f2642cdc3b2a737910d24e289d46e4f7e151805e3b0827024b2b45e4d"
license "GPL-2.0"
livecheck d... | 34.319149 | 92 | 0.696218 |
d5ce8276b471832736ddc1983f905b2df5cbcd3c | 10,133 | # 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... | 38.823755 | 245 | 0.781111 |
ab169c676df3e7d38dbad593671219d78b7abb0a | 310 | # frozen_string_literal: true
module YouPlot
# Command line options that are not Plot parameters
Options = Struct.new(
:delimiter,
:transpose,
:headers,
:pass,
:output,
:fmt,
:progressive,
:encoding,
:reverse, # count
:color_names, # color
:debug
)
end
| 16.315789 | 53 | 0.609677 |
e2e9a2fe2783ad004c873cfc6a2cb3497822ac05 | 2,212 | require 'active_support/concern'
require 'base64'
module Mongoid
module EncryptedField
extend ActiveSupport::Concern
def encrypted
if frozen?
@encrypted ||= self.class.encrypt(raw_value)
else
# We are mutable - need to encrypt whenever asked
self.class.encrypt(raw_value)
... | 26.97561 | 106 | 0.631103 |
ff35474dc7e3c759b66b718f1d7d5d71ab312dc7 | 225 | json.extract! fund, :id, :title, :description, :allocation_code, :campus, :keywords, :interest,
:suggested_amount, :marketing_content, :created_at, :updated_at, :fund_type
json.url fund_url(fund, format: :json)
| 56.25 | 95 | 0.715556 |
87e4bc0845f2231f197ab69f340bd7b7fa7ea4ab | 2,345 | =begin
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License ... | 30.064103 | 87 | 0.679744 |
87dbe729f5262695a6e5ce4e479aa6c9b3f4d092 | 631 | #! /QOpenSys/pkgs/bin/ruby
require_relative 'riby_qsqcli'
require 'pp'
raise "Usage: invoke_SQLGetConnectAttrW.rb <user> <password>" if ARGV.length != 2
h = Env.new
h.attrs=({:SQL_ATTR_DATE_FMT => :SQL_FMT_EUR,
:SQL_ATTR_ESCAPE_CHAR => '@',
:SQL_ATTR_DEFAULT_LIB => 'INTELLIGEN'
})
d = ... | 27.434783 | 81 | 0.641838 |
7afae40f5f7533729540d73afba6b639f721ec6a | 310 | class StaticController < ApplicationController
def index
@beers = Beer.where(active: true).includes(:tier).order(:position)
@tiers = Tier.where(hide: false).order(:id)
respond_to do |format|
format.html
format.json { render json: { beers: @beers, tiers: @tiers } }
end
end
end
| 25.833333 | 70 | 0.664516 |
6217de467ed911985d67c66c65f990d711af4ec4 | 9,143 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Git HTTP requests' do
include GitHttpHelpers
include WorkhorseHelpers
shared_examples_for 'pulls are allowed' do
specify do
download(path, **env) do |response|
expect(response).to have_gitlab_http_status(:ok)
expect(r... | 35.854902 | 147 | 0.639724 |
e82e72196dd661797be4f75d6f110b84bc04d187 | 4,148 | require 'test_helper'
class ActiveRecord::Associations::BelongsToTest < ActiveSupport::TestCase
schema do
create_table "ships" do |t|
t.string "name", limit: 255
t.integer "fleet_id"
end
create_table "fleets" do |t|
t.string "name", limit: 25... | 25.447853 | 121 | 0.569431 |
e9c16d633665f24e25d48c45e4870a1047ee054e | 71 | class App
module Views
class Partial < Mustache
end
end
end | 11.833333 | 28 | 0.676056 |
01d14f4840a079f667e3937a3c1880dedb27475b | 2,867 | class Erlang < Formula
desc "Programming language for highly scalable real-time systems"
homepage "https://www.erlang.org/"
# Download tarball from GitHub; it is served faster than the official tarball.
url "https://github.com/erlang/otp/archive/OTP-22.1.4.tar.gz"
sha256 "982e940c8c3313b1af27938655b4e90991d54... | 33.729412 | 93 | 0.70143 |
6237663c088f6a47fb044566f9779fbc19ec730d | 3,273 | #!/usr/bin/env ruby
require 'rubygems'
require 'erb'
require 'optparse'
require 'yaml'
require 'fileutils'
require 'pathname'
require '../lib/local-config.rb'
class CopyRes
def initialize
puts "in Class.initialize..."
extend LocalConfig
init()
@here = FileUtils.pwd()
end
def finalize
... | 27.737288 | 188 | 0.508708 |
ed636c64fdda32e9e9794e19da22cc14e99294ff | 2,661 | Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.name = "cloudkit"
s.version = "0.11.0"
s.date = "2008-03-09"
s.summ... | 31.305882 | 105 | 0.680571 |
bb3e7aeb6cb54acb58a77a7031eed6ac44f57073 | 221 | module Specinfra
class HostInventory
class Base
def initialize(host_inventory)
@host_inventory = host_inventory
end
def backend
@host_inventory.backend
end
end
end
end
| 15.785714 | 40 | 0.647059 |
1df29970b47fba6cedea053781ca39c58db1810f | 5,807 | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold... | 36.29375 | 93 | 0.683485 |
21dd078df2268f662f6d38352414edfd42f5f0b5 | 473 | module Saxerator
module Latches
class Within < ::Saxerator::SaxHandler
def initialize(name)
@name = name
@depth_within_element = 0
end
def start_element(name, _)
@depth_within_element += 1 if name == @name || @depth_within_element > 0
end
def end_element(_)
... | 20.565217 | 80 | 0.602537 |
62ca8bbfa74623010050ece911f684ca60a7ca9b | 410 | cask 'font-nokora' do
version :latest
sha256 :no_check
# github.com/google/fonts was verified as official when first introduced to the cask
url 'https://github.com/google/fonts/trunk/apache/nokora',
using: :svn,
revision: '50',
trust_cert: true
name 'Nokora'
homepage 'http://www.go... | 25.625 | 86 | 0.687805 |
917b961f3cd90e02831f9d968d99a87fa6bea0df | 850 | cask 'blueharvest' do
version '7.1.0'
sha256 'bd1df0cf86f444a990ec8451d4efd7bb8a16ba045aea9c0502b6b7c571329a87'
url "https://zeroonetwenty.com/downloads/BlueHarvest#{version.no_dots}.dmg"
appcast 'https://cp37.ezyreg.com/~zeroonet/downloads/versioninfo/sparkle/blueharvest6.xml'
name 'BlueHarvest'
homepage ... | 38.636364 | 109 | 0.709412 |
ab0d888b1681f716355fbb104d4b1ea028158fdd | 8,067 | require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/inclusion'
module ActiveRecord
module Associations
# = Active Record Associations
#
# This is the root class of all associations ('+ Foo' signifies an included module Foo):
#
# Association
# SingularAss... | 33.334711 | 138 | 0.631957 |
e903d179e4d185bd27a7c5d8edf0aafd450f79ae | 695 | # go through projects and clean and update
require 'yaml'
$basedir = Dir.pwd
config = YAML.load_file("_config.yml")
config["projects"].each do |repo|
name = repo.split('/').drop(1).join('')
Dir.chdir($basedir + "/projects")
if !Dir.exists?(name) # clone project repo
`git clone https://github.c... | 30.217391 | 71 | 0.656115 |
1d2ef731d9c6ca1d6c3dab7a19059e9be1c492bc | 164 | class AddDisableUserEmailsToAppConfigs < ActiveRecord::Migration
def change
add_column :app_configs, :disable_user_emails, :boolean, default: false
end
end
| 27.333333 | 75 | 0.804878 |
87ccaa67fcee45b48432da07ca61b37c2bfb2ae7 | 2,174 | require File.dirname(__FILE__) + '/../test_helper'
class <%= class_name %>Test < Test::Unit::TestCase
# Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead.
# Then, you can remove it from this and the functional test.
include AuthenticatedTestHelper
fixtures :<%= table_name %>
def test... | 35.064516 | 154 | 0.687213 |
aca984a68614b91c2c613b40492b463065079036 | 1,520 | # carrierwave set up
require 'carrierwave/storage/fog'
#Excon.defaults[:write_timeout] = 1000
# Excon.defaults = Excon.defaults.mere(:write_timeout => 10.minutes.to_i)
if Rails.env.development? || Rails.env.test?
CarrierWave.configure do |config|
# config.storage = :file
# config.root = "#{Rails.root}/tmp"
# ... | 34.545455 | 85 | 0.621711 |
082d7b05fd2001d7a17238b63cbf64bf11d7c72c | 868 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint integrated_routing.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'integrated_routing'
s.version = '0.0.1'
s.summary = 'A new Flutter project.'
s.desc... | 36.166667 | 105 | 0.58871 |
0341e43e8070851672cc6e838df931f859ea3aca | 804 | # frozen_string_literal: true
# == Schema Information
#
# Table name: alerts
#
# id :integer not null, primary key
# course_id :integer
# user_id :integer
# article_id :integer
# revision_id :integer
# type :string(255)
# email_sent_at :datetime
# created_at ... | 21.72973 | 80 | 0.624378 |
5d8be9a8ac57e59e2f308e837697b4bfa8afca8b | 255 | # @author Mike Bland (michael.bland@gsa.gov)
require 'guides_style_18f/assets'
require 'guides_style_18f/generator'
require 'guides_style_18f/includes'
require 'guides_style_18f/layouts'
require 'guides_style_18f/sass'
require 'guides_style_18f/version'
| 28.333333 | 44 | 0.831373 |
ab559e9fef99fa1cf349702760b818cc89007e79 | 2,929 | #MIT License
#http://www.github.com/amirrajan/rake-dot-net
#Copyright (c) 2011 Amir Rajan
require './RakeDotNet/command_shell.rb'
require './RakeDotNet/web_deploy.rb'
require './RakeDotNet/iis_express.rb'
require './RakeDotNet/sln_builder.rb'
require './RakeDotNet/file_sync.rb'
require 'net/http'
require 'yaml'
task ... | 35.289157 | 177 | 0.746671 |
79766123f6a857776cffa4a8af3c8ebf1dc40b4d | 980 | #!/bin/env ruby
#
#
#
require 'seapig-client'
require 'eventmachine'
require 'awesome_print'
EM.run {
workers = SeapigClient.new('http://127.0.0.1:3001/seapig', name: 'zabbix-monitor').slave('workers')
EM.add_periodic_timer(30) {
workers['workers'].each { |worker|
if not worker['resources'].nil?
worker['re... | 28.823529 | 130 | 0.554082 |
4ae7058f34ce969004f27def109bbb97e768a2a2 | 34,252 | # frozen_string_literal: true
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 52.213415 | 166 | 0.574711 |
e9588ec3bd1fc37cde61a44c9706f71b18b33540 | 1,619 | # Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module AspectsHelper
def remove_link(aspect)
if aspect.contacts.size == 0
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete, :confirm =... | 33.040816 | 124 | 0.646078 |
7a8c32a5f6b1eb9be048995d377c46b544a43d00 | 872 | require './config/environment'
class ApplicationController < Sinatra::Base
before do
unless logged_in?
if (request.path_info != "/login") && (request.path_info != "/register")
redirect "/login"
end
else
if request.path_info == "/login"
redirect "/albums"
end
end
... | 17.795918 | 82 | 0.597477 |
ed72b4ccaf67f4ef651625fa313464cb9292844b | 1,320 | #
# run this with bundle exec rspec spec/remove_all_items_spec.rb -fd
require 'spec_helper'
RSpec.describe "Remove all items from the shopping cart" do
home_page = nil
checkout_cart_page = nil
before(:all) do
@browser = Watir::Browser.new :firefox
end
after(:all) do... | 25.882353 | 68 | 0.593182 |
ace1dc5162b5ad1995d256f15ef1affba75586c9 | 2,896 | # frozen_string_literal: true
require 'thor'
module LicenseFinder
module CLI
class Base < Thor
class_option :project_path,
desc: 'Path to the project. Defaults to current working directory.'
class_option :decisions_file,
desc: 'Where decisions are saved. Default... | 26.814815 | 111 | 0.571823 |
d50a05c38643c37bba4c62b8f9557f0cabbcc302 | 101 | # frozen_string_literal: true
module Spina
module Articles
VERSION = "0.1.0".freeze
end
end
| 12.625 | 29 | 0.712871 |
01fe6eda7f8ee5b88de03772dfae89bf947042f9 | 2,034 | Мать шестилетнего с Микроцефалия: "Станет лучше".
Как и большинство шестилетних детей, Эдмунд Пиккиуто любит петь, игрушки и, конечно, его мать.
Но в отличие от большинства его сверстников, Эдмунд, Микроцефалия, результатом генетического расстройства его мама Елизавета не знала о Пиккиуто во время беременности.
Когда о... | 65.612903 | 167 | 0.803835 |
1abc24ff2abce858c62ef5466636622c6ab2a777 | 48 | class CrimeSceneReport < ActiveRecord::Base
end
| 16 | 43 | 0.833333 |
08d6860b26e93b1916f08dc72a295a9df0513b44 | 368 | class AssertionError < StandardError
end
def assert_raise(type)
begin
yield
raise AssertionError, "Didn't raise #{type}"
rescue type
end
end
class << Object
alias_method :new_, :new
end
[Symbol, Integer, Float, NilClass, TrueClass, FalseClass].each do |klass|
assert_raise(NoMethodError) { klass.new... | 18.4 | 73 | 0.728261 |
1a3a8e56bab0a7ee9ad88db1bd1b8a964cbde877 | 1,969 | 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... | 33.948276 | 85 | 0.76384 |
bbe0e16566b7a3ee4eae2e605f2e0fb5c4d6baa5 | 2,251 | Pod::Spec.new do |s|
s.name = 'SwiftCurrent'
s.version = '4.5.20'
s.summary = 'A library for complex workflows in Swift'
s.description = <<-DESC
SwiftCurrent is a library that lets you easily manage journeys through your Swift application.
DESC
s.ho... | 38.810345 | 147 | 0.646824 |
18d96f0030dc80cc97cd678ab84fe580b0552200 | 1,614 | # coding: utf-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'activerecord'
require 'yaml'
require 'csv'
require File.join(File.dirname(__FILE__), 'lib', 'models')
module Subjectr
class Application < Sinatra::Base
set :logging, true
set :public, File.join(File.dirname(__FILE__), 'public')
... | 26.032258 | 82 | 0.615242 |
e23f53504f15b260d073fdb7be10f2eb85eb50aa | 1,557 | class Webp < Formula
desc "Image format providing lossless and lossy compression for web images"
homepage "https://developers.google.com/speed/webp/"
url "http://downloads.webmproject.org/releases/webp/libwebp-0.4.3.tar.gz"
sha256 "efbe0d58fda936f2ed99d0b837ed7087d064d6838931f282c4618d2a3f7390c4"
bottle do
... | 33.847826 | 95 | 0.679512 |
1a8088c20728d9f5b67c9ca53b857ac67dbe9141 | 1,316 | # frozen_string_literal: true
require 'tempfile'
require 'open-uri'
module FFaker
module Image
extend ModuleUtils
extend self
SUPPORTED_FORMATS = %w[png jpg jpeg gif].freeze
def url(size = '300x300', format = 'png', bg_color = :random, text_color = :random, text = nil)
check_size!(size)
... | 25.307692 | 100 | 0.651216 |
262de875cbf1345b4c4af9939f003bbccde365ff | 1,280 | # 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
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-workmailmessage... | 40 | 122 | 0.678125 |
1da17f9e3ed784ff584c2040cf82a1936690f732 | 384 | class CreateForumWatches < ActiveRecord::Migration
def self.up
create_table :forum_watches, :id => false do |t|
t.column :forum_topic_id, :int, :null => false
t.column :user_id, :int, :null => false
t.timestamps
end
add_index(:forum_watches, [:forum_topic_id, :user_id], :unique => true)... | 24 | 75 | 0.669271 |
08d866d6175c27131f10d383c6bcbc8adecd92b9 | 641 | require 'raven'
require 'rake/clean'
task 'default' => 'brewery.war'
dependency 'deps' do |t|
t.libs = Dir.glob('lib/**/*.*')
end
javac 'compile' => 'deps' do |t|
printf 'in the COMPILE task'
t.build_path << "src"
end
lib_dir 'prepare_lib' do |t|
CLEAN.include('*/target')
FileUtils.rm_r... | 20.677419 | 61 | 0.574103 |
1ad09622d0aacca47754314cdef30cd50c511885 | 68 | # frozen_string_literal: true
module Shrek
VERSION = '0.2.2'
end
| 11.333333 | 29 | 0.720588 |
1c62a68cf9cbd5876320ffcb6426760103453743 | 2,340 | # frozen_string_literal: true
require "cases/helper"
module ActiveRecord
class Migration
class ColumnPositioningTest < ActiveRecord::TestCase
attr_reader :connection
alias :conn :connection
def setup
super
@connection = ActiveRecord::Base.connection
connection.create... | 33.913043 | 98 | 0.664103 |
3903550fee24877aed5c3008529b9ae14be14ec1 | 2,825 | # frozen_string_literal: true
RSpec.describe YnabConvert do
it 'has a version number' do
expect(YnabConvert::VERSION).not_to be nil
end
context 'when run from the command line' do
it 'converts the csv file', :writes_csv do
system('bin/ynab_convert -f spec/fixtures/example/valid.csv -i example')
... | 31.741573 | 79 | 0.583717 |
4adef37268e470af519a212f96d330303da1d5cb | 110 | # frozen_string_literal: true
json.extract! @liquid_partial, :id, :title, :content, :created_at, :updated_at
| 27.5 | 78 | 0.763636 |
87afa9f949130578dca5574625295f7a8c6d7adc | 16,423 | # frozen_string_literal: true
module Clusters
class Cluster < ApplicationRecord
prepend HasEnvironmentScope
include Presentable
include Gitlab::Utils::StrongMemoize
include FromUnion
include ReactiveCaching
include AfterCommitQueue
self.table_name = 'clusters'
APPLICATIONS = {
... | 34.647679 | 138 | 0.725994 |
1d5f3f02104450b5bcaa7ab09990e164a13dbbda | 111 | class StaticPagesController < ApplicationController
def index
render file: "public/client.html"
end
end | 22.2 | 51 | 0.783784 |
7a947014fcf01d782766545265712176b44a74f6 | 2,001 | require_relative './spec_helper.rb'
require_relative '../lib/command_line_interface.rb'
require 'set'
describe CommandLineInterface do
describe '.run' do
before(:example) do
@cli = CommandLineInterface.new
end
describe 'handles edge cases' do
it 'with missing or empty product_type argument' ... | 37.055556 | 95 | 0.635682 |
1124c1e65e6fd9cc86e282d4069089c9ba88fdfe | 1,680 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'easy_post/version'
Gem::Specification.new do |spec|
spec.name = 'easy_post'
spec.version = EasyPost::VERSION
spec.authors = ['bartlomiejh']
spec.email = ['bho... | 39.069767 | 108 | 0.707738 |
bb8031f72a22c97378418cf381b4d3df1c7ad101 | 226 | require 'sinatra/base'
require 'haml'
module Counterfeit
module Info
ENDPOINT = '0.0.0.0:4567'.freeze
class App < Sinatra::Base
get '/' do
@var = 'yup'
haml :index
end
end
end
end
| 14.125 | 36 | 0.570796 |
b91b68c35aedbf08aacc45ad70b58235d749755b | 2,206 | # this is a generated file, to avoid over-writing it just delete this comment
begin
require 'jar_dependencies'
rescue LoadError
require 'org/jsoup/jsoup/1.13.1/jsoup-1.13.1.jar'
require 'commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar'
require 'com/eventswarm/eventswarm/2.0-SNAPSHOT/events... | 53.804878 | 92 | 0.736174 |
62f89e34915d7496f4cff2cdfcf18b49e98c4222 | 773 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed ... | 24.935484 | 107 | 0.760673 |
5dcf9fadd38dd5d00fd232341541e52e13144814 | 4,914 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 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, which is a fork of ... | 30.90566 | 108 | 0.660155 |
26af1c58718b1aaabbdcb3eafc01a206fc99cddf | 223 | class Admin::AdminApplicationController < ApplicationController
before_action :authenticate_user!
before_action :only_admins!
private
def only_admins!
user_not_authorized unless current_user.admin?
end
end
| 18.583333 | 63 | 0.807175 |
b963c8e5c57fca12452e49aec0aa3cdac2a6cab8 | 240 | #!/usr/bin/ruby
# -*- coding: utf-8 -*-
module Practis
VERSION = "0.0.1"
VERSION_ARRAY = VERSION.split(/\./).map {|x| x.to_i}
VERSION_MAJOR = VERSION_ARRAY[0]
VERSION_MINER = VERSION_ARRAY[1]
VERSION_BUILD = VERSION_ARRAY[2]
end
| 21.818182 | 54 | 0.670833 |
183e04aeeab9b73d94dd6aa87ac089965513fe56 | 635 | # frozen_string_literal: true
# To deliver this notification:
#
# ExportNotification.with(post: @post).deliver_later(current_user)
# ExportNotification.with(post: @post).deliver(current_user)
# ExportNotification
class ExportNotification < Noticed::Base
# Add your delivery methods
#
deliver_by :database
# del... | 20.483871 | 66 | 0.708661 |
08538eecf310dd63fcac3a53e6ef1f7eb0824a46 | 1,336 | # frozen_string_literal: true
class Comfy::Blog::PostsController < Comfy::Cms::BaseController
helper Comfy::Blog::PostsHelper
include Comfy::Paginate
def index
scope = if params[:year]
scope = @cms_site.blog_posts.published.for_year(params[:year])
params[:month] ? scope.for_month(params[:month])... | 24.740741 | 82 | 0.696108 |
18ecc87b6e3a6c1cf65a37f55dc38f9a0fbd00a0 | 1,378 | class Wemux < Formula
desc "Enhances tmux's to provide multiuser terminal multiplexing"
homepage "https://github.com/zolrath/wemux"
url "https://github.com/zolrath/wemux/archive/v3.2.0.tar.gz"
sha256 "8de6607df116b86e2efddfe3740fc5eef002674e551668e5dde23e21b469b06c"
head "https://github.com/zolrath/wemux.git"... | 32.046512 | 93 | 0.741655 |
1accafa2e8506b99fe0325402ee29cc5f609f187 | 6,038 | #!/opt/elasticbeanstalk/lib/ruby/bin/ruby
#encoding: utf-8
# Copyright 2015-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# ht... | 33.921348 | 109 | 0.667936 |
abc01c09a08bc90e3e002d06b82834b1bfe02bc6 | 1,010 | require 'json'
require 'myjdrb/request/request'
module Myjdrb
module Requests
# Represents a HTTP Post Request.
# Similar to GET but with additional payload
# in the body.
# @see Get
class Post < Request
attr_reader :post_parameter
attr_accessor :rid, :api_version, :action, :paramete... | 19.803922 | 59 | 0.566337 |
bb9c4aeef9a8c39b9185b35ca06bfe2874a534a3 | 149 | class PageController < ApplicationController
def index
redirect_to reports_url and return if current_user
render layout: false
end
end
| 16.555556 | 54 | 0.778523 |
38aba141f4eb5310e6162152985fa1244f68c1c3 | 942 | class CreateRefinerycmsCoreSchema < ActiveRecord::Migration
def self.up
unless ::Slug.table_exists?
create_table ::Slug.table_name, :force => true do |t|
t.string "name"
t.integer "sluggable_id"
t.integer "sequence", :default => 1, :null => false
t.str... | 36.230769 | 180 | 0.619958 |
9179c5d37aecb9710ad7cdbea6144c9f028ee591 | 208 | class AddInitiallyIndexedToVacancies < ActiveRecord::Migration[5.2]
def change
add_column :vacancies, :initially_indexed, :boolean, default: false
add_index :vacancies, :initially_indexed
end
end
| 29.714286 | 71 | 0.783654 |
019e71eb014f0d44a684bd13a7365c39c0fee5ae | 11,010 | require 'rspec'
require_relative '../lib/opulent'
RSpec.describe Opulent do
describe '#render' do
it 'renders blank input' do
opulent = Opulent.new <<-OPULENT
OPULENT
result = opulent.render Object.new, {} {}
expect(result).to eq('')
end
it 'renders a node with id' do
opul... | 27.873418 | 79 | 0.573842 |
d5b3e22f3ebcb5ae82eca1dad165a63a13fb2928 | 558 | require('rspec')
require('ping_pong')
describe('#ping_pong') do
it("print array from 1 to the given number") do
expect(ping_pong(2)).to(eq([1,2]))
end
it("if number is divisible by 3 change to ping") do
expect(ping_pong(3)).to(eq([1,2,'ping']))
end
it("if number is divisible by 5 change to pong") do
... | 31 | 107 | 0.643369 |
87de9b8f5cc3552bf7841ef3ba6336670028121e | 407 | # Re-open ExportEmailController to because out local implementation of a Holding
# has a #call_number method that is a class which deliver_later raises as an error
# when trying to serialize the arguments
ActiveSupport.on_load(:after_initialize) do
ExportEmailController.class_eval do
def call_number(id)
ret... | 37 | 82 | 0.786241 |
6225dd7e80f1db7c247cc6ca68383e13583167a5 | 1,115 | class LittleCms2 < Formula
desc "Color management engine supporting ICC profiles"
homepage "http://www.littlecms.com/"
url "https://downloads.sourceforge.net/project/lcms/lcms/2.7/lcms2-2.7.tar.gz"
sha256 "4524234ae7de185e6b6da5d31d6875085b2198bc63b1211f7dde6e2d197d6a53"
bottle do
cellar :any
sha256 ... | 31.857143 | 95 | 0.73722 |
5d5418a8de0fb1b00e3342308d71c74a97760b90 | 3,768 | require 'spec_helper'
describe "Query Rewriter" do
context "when bulk updating" do
let!(:account) { Account.create!(name: "Test Account") }
let!(:project) { Project.create(name: "Project 1", account: account) }
let!(:manager) { Manager.create(name: "Manager", project: project, account: account) }
i... | 31.663866 | 94 | 0.624204 |
2125c4c719fa90913650eed8b67175d91b596448 | 419 | cask "font-enriqueta" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/trunk/ofl/enriqueta",
verified: "github.com/google/fonts/",
using: :svn,
trust_cert: true
name "Enriqueta"
homepage "https://fonts.google.com/specimen/Enriqueta"
font "Enriqueta-Bold.ttf... | 24.647059 | 60 | 0.692124 |
b9a684715cb30a80b8fcd8d96bfc5a5934eefd6c | 1,562 | ANewHope::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 ... | 42.216216 | 85 | 0.774648 |
bbee32adc9dfd9f60fd7adbf5bdd1003e6564bee | 88 | # frozen_string_literal: true
class Vehicle < ApplicationRecord
belongs_to :line
end
| 14.666667 | 33 | 0.806818 |
183709905d6faf4847c164d57282d0806076fd90 | 641 | # frozen_string_literal: true
require 'dry/types/constructor'
module Dry
module Types
# @api public
class Array < Nominal
# @api private
class Constructor < ::Dry::Types::Constructor
# @api private
def constructor_type
::Dry::Types::Array::Constructor
end
... | 19.424242 | 55 | 0.538222 |
ab7b240119f2ebe52a24b63f7b8fa5616237604f | 1,712 | module ManageIQ::Providers::Vmware::InfraManager::ProvisionViaPxe::StateMachine
def customize_destination
_log.info("Post-processing #{destination_type} id: [#{destination.id}], name: [#{dest_name}]")
update_and_notify_parent(:message => "Starting New #{destination_type} Customization")
set_cpu_and_memor... | 32.301887 | 98 | 0.723131 |
390da833838644268a7bbe03b20a343f145adf8c | 510 | # frozen_string_literal: true
RSpec.describe TJSON::DataType::String do
context "valid UTF-8 string" do
let(:example_string) { "Hello, world!".encode(Encoding::UTF_8) }
it "parses successfully" do
expect(subject.decode(example_string)).to eq example_string
end
end
context "non-UTF-8 string" d... | 25.5 | 84 | 0.698039 |
f827a4f2322e91437458fce8f99a886e08a6b55a | 109 | # section_11/part_1/answer.rb
# 11-1-require.rb
require_relative 'for-def-read'
name = ARGV[0]
hello(name)
| 13.625 | 31 | 0.733945 |
ffd756b98fe7874cb8de74f00914fb450f968a25 | 2,032 | #--
# Copyright (c) 2010-2012 Michael Berkovich
#
# 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, copy, modify, me... | 37.62963 | 108 | 0.708661 |
e8f044a596d03264643df153aca407282caf8228 | 102 | class LocationSerializer < ActiveModel::Serializer
attributes :id, :latitude, :longitude, :name
end
| 25.5 | 50 | 0.784314 |
62073cb3fd8a5b70f088d7885330605640f45cd0 | 101 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "r_proxy"
require "minitest/autorun"
| 20.2 | 54 | 0.762376 |
ff85841d6dafca1ac89cffdb2739105297108cdf | 871 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'runfile-exec/version'
Gem::Specification.new do |s|
s.name = 'runfile-exec'
s.version = RunfileExec::VERSION
s.date = Time.now.strftime "%Y-%m-%d"
s.summary = "Runfile metho... | 39.590909 | 86 | 0.644087 |
9109a4eac1a1cb3ddc2cdea0fc814d76f8291280 | 1,153 | # frozen_string_literal: true
describe 'Asserting everything was touched when the only present section was not touched' do
it 'raises the expected ValidationError' do
input = '# section'
begin
Enolib.parse(input).assert_all_touched
rescue Enolib::ValidationError => error
text = 'This element... | 30.342105 | 131 | 0.658283 |
79d6b55f398e5ceb4558333ac112a7a4c3f25763 | 8,188 | # frozen_string_literal: true
RSpec.describe Faraday::Options do
SubOptions = Class.new(Faraday::Options.new(:sub_a, :sub_b))
class ParentOptions < Faraday::Options.new(:a, :b, :c)
options c: SubOptions
end
describe '#merge' do
it 'merges options with hashes' do
options = ParentOptions.new(1)
... | 28.629371 | 93 | 0.589766 |
ac1aed96609ce9fdb98fc49c7b7379e491b13e30 | 243 | # encoding: UTF-8
require 'json'
require_relative 'required'
begin
File.open(DATA_PREFS_PATH,'wb'){|f| f.write Ajax.param(:prefs_data).to_json}
Ajax << { message: "Préférences enregistrées."}
rescue Exception => e
Ajax.error(e)
end
| 16.2 | 78 | 0.711934 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.