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 |
|---|---|---|---|---|---|
019dea0bbce705873a4b722afd61ee73723e866e | 367 | #!/usr/bin/env ruby
require '../example'
example %q{
class Report
def initialize
@title = 'MonthlyReport'
@text = ['Things are going', 'really, really well.']
end
def output_report
puts('<html>')
puts(' <head>')
puts(' <title>#{@title}</title>')
# output the rest of the report ...... | 14.115385 | 57 | 0.59673 |
62e3e8d15dc9fdf328df4988c99cf6940817795f | 162 | class CreatePaymentTypes < ActiveRecord::Migration
def change
create_table :payment_types do |t|
t.string :name
t.timestamps
end
end
end
| 16.2 | 50 | 0.691358 |
5db08cd3e1cfaba6b8734d5cf33af384699c3118 | 206 | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :username
t.string :token
t.string :name
t.timestamps null: false
end
end
end
| 17.166667 | 43 | 0.645631 |
799a788fa6fa23bbb651cc53cf4f1dcdf1c7dd31 | 5,897 | RSpec.describe Hyrax::Forms::CollectionForm do
describe "#terms" do
subject { described_class.terms }
it do
is_expected.to eq [:alt_title,
:resource_type,
:title,
:creator,
:contributor,
... | 29.485 | 107 | 0.556893 |
6a9e197ca390da645d4ef8afbd1cc9ac8b6f16c4 | 606 | module Platforms
module Yammer
module Api
# Networks on Yammer
# @author Benjamin Elias
# @since 0.1.0
class Networks < Base
# Get the user's current Network
# @param options [Hash] Options for the request
# @param headers [Hash] Additional headers to send with the... | 26.347826 | 75 | 0.625413 |
e8f82b78c07a40ab23727dd06c02ba1b7f46d5ea | 1,300 | # frozen_string_literal: true
require "mini_magick"
class ImageUploader
def initialize(file)
@file = file
end
def upload(document)
blob = ActiveStorage::Blob.create_after_upload!(
io: image_normaliser.normalised_file,
filename: filename,
content_type: mime_type,
)
image_attri... | 24.074074 | 87 | 0.643846 |
5d45b174fe52027e02643c6eaefb4282f7b7d87f | 23 | module ScaleHelper
end
| 7.666667 | 18 | 0.869565 |
1cf8b436dd67b8afbd5320db05510a369a5ba3e8 | 819 | class Confuse < Formula
desc "Configuration file parser library written in C"
homepage "http://www.nongnu.org/confuse/"
url "http://download.savannah.nongnu.org/releases/confuse/confuse-2.7.tar.gz"
sha256 "e32574fd837e950778dac7ade40787dd2259ef8e28acd6ede6847ca895c88778"
bottle do
cellar :any_skip_reloca... | 35.608696 | 92 | 0.752137 |
91f983fdca6f9cd6615863c3d9e63a35cf92639d | 37 | module Zerbo
VERSION = "0.1.0"
end
| 9.25 | 19 | 0.648649 |
0303fa83e9c4f168fd7c918b1c5fa71015313d15 | 1,815 | #!/usr/bin/env ruby
require 'socket'
require 'openssl'
require 'base64'
require 'open3'
require 'shellwords'
def encrypt(command)
@aes.encrypt
@aes.key = @key
#aes.iv = iv
encrypted_data = @aes.update(command) + @aes.final
encoded_command = Base64.strict_encode64(encrypted_data)
return encoded_command
end
d... | 29.754098 | 82 | 0.709642 |
e2ab947f6688133d2c14b1cd4883bce8b02e5cfa | 233 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure::DataMigration::Mgmt
VERSION = '0.17.1'
end
| 29.125 | 94 | 0.759657 |
2103be8eaa218a47094601c16b3820b806dc4c81 | 312 | class CreateTransactions < ActiveRecord::Migration
def change
create_table :transactions do |t|
t.integer :user_id
t.integer :amount
t.integer :fee
t.string :reference
t.string :description
t.datetime :created_at
end
add_index :transactions, :user_id
end
end
| 20.8 | 50 | 0.673077 |
ffa263d8b73c39bacc5d0dbf726ea840b08b5f44 | 736 | # Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is 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
#
# http://aws.amazon.com/apache2.0/
#
# This file is d... | 33.454545 | 93 | 0.751359 |
b915f5be95a1f489900ebc38b036b62799e613b7 | 1,145 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module DummyApp
class Application < Rails::Application
# Settings in config/environments/* take prec... | 40.892857 | 99 | 0.732751 |
1cc9a2b06c08d469ec02c8b8d581b988e0c2eaae | 796 | require 'fibril/loop'
[*0...10].tick(:result_one).map do |i|
print "Item-1-#{i}, "
i * 3
end
[*10...20].tick(:result_two).map do |i|
print "Item-2-#{i}, "
i * 11
end
fibril(:result_three){
async.sleep 0.5
puts "Three finished"
}
await(guard.result_one, guard.result_two){
puts "\nSum guard one & two:"... | 16.93617 | 77 | 0.65201 |
038962a3e3cab62e9949320f08275118240be96a | 776 | module Fog
module Compute
class Google
class Mock
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart)
Fog::Mock.not_implemented
end
end
class Real
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart)
... | 25.866667 | 89 | 0.579897 |
4a0fb6ccef8a0d55941da3af735013348ed3469d | 305 | class Seed
def self.begin
seed = Seed.new
seed.generate_businesses
end
def generate_businesses
500.times do |i|
shop = Business.create!(name: Faker::Company.name, business_type: Faker::Commerce.department, address: Faker::Address.street_address)
end
end
end
Seed.begin
| 17.941176 | 141 | 0.708197 |
26dbd9994338b742d78f87bd9dc5dae14992cc42 | 2,338 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'date'
require_relative 'lib/sensu-plugins-messagemedia'
Gem::Specification.new do |s|
s.authors = ['Sensu-Plugins and contributors']
s.date = Date.today.to_s
s.description... | 54.372093 | 112 | 0.55047 |
5d881f441e4d1c0661a5ff8b6943779e66c4bf65 | 440 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'items/set_governing_apo_ui.html.erb' do
it 'renders the JS template' do
stub_template 'items/_set_governing_apo_ui.html.erb' => 'stubbed_set_governing_apo_ui'
render
expect(rendered)
.to have_css '.modal-header h3.modal-title', t... | 31.428571 | 90 | 0.754545 |
386769e181d4174c7ed98842d3a0fc7f101e303a | 2,628 | class UserAuthentication < ActiveRecord::Base
# EXTENSIONS ----------------------------------------------------------------
# UUID
include Uuidable
# ENUMS ---------------------------------------------------------------------
enum status: [:active, :inactive]
# enum provider: {
# developer: 0,
... | 29.863636 | 128 | 0.530441 |
bf8b826831a5e6e6a1da81bbccc301bd9ff858a8 | 2,260 | require 'active_record'
require 'active_record/connection_adapters/mysql2_adapter'
# Setups the test database with the schema_migrations table that ActiveRecord
# requires for the migrations, plus a table for the Comment model used throught
# the tests.
#
class TestDatabase
# Constructor
#
# @param config [Has... | 26.904762 | 199 | 0.720796 |
1c6935a6ba0462dbf746f4950b5823a22e9537be | 739 | cask 'min' do
version '1.5.0'
sha256 'b143004d34f2d1f22b3e1bffc38fa5a53fce491e5ffe6639bceeaeaf5f04ede2'
# github.com/minbrowser/min was verified as official when first introduced to the cask
url "https://github.com/minbrowser/min/releases/download/v#{version}/Min-v#{version}-darwin-x64.zip"
appcast 'https://... | 36.95 | 102 | 0.696888 |
38360ff0c513e9b4202fb3b94eaf118004b752d3 | 19,708 | # 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, ... | 35.574007 | 216 | 0.646337 |
089d4568435630cb2c5d2e5bc08fd0cf01dee2f6 | 1,209 | # -*- encoding: utf-8 -*-
require File.expand_path('lib/version.rb', File.dirname(__FILE__))
Gem::Specification.new do |s|
s.name = "mongoid_query_string_interface"
s.version = Mongoid::QueryStringInterface::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Vicente Mundim"]
s.email = ["vicente.mundim@gm... | 43.178571 | 184 | 0.727047 |
ff8df6107862e27e4f08fd7a2130b8ebee08e422 | 511 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Notifications::RabbitChannel do
let(:bunny) { instance_double(Bunny::Session, start: true, create_channel: channel) }
let(:channel) { instance_double(Bunny::Channel, topic: topic) }
let(:topic) { instance_double(Bunny::Exchange) }
before do
... | 25.55 | 87 | 0.72407 |
e2458d6be7abd362a685d9b794cef0d476cda070 | 777 | @version = "1.0.0"
Pod::Spec.new do |s|
s.name = "SpecialInteractionTextField"
s.version = @version
s.summary = "增强交互的TextField."
s.description = <<-DESC
First upload
*Hope to succeed
DESC
s.homepage = "h... | 35.318182 | 119 | 0.544402 |
87b6ce370fb791f161a9d2f938275ed1e37ca10e | 19,497 | require 'spec_helper'
describe 'RailsAdmin Config DSL List Section', type: :request do
subject { page }
describe 'css hooks' do
it 'is present' do
RailsAdmin.config Team do
list do
field :name
end
end
FactoryBot.create :team
visit index_path(model_name: 'team'... | 32.120264 | 270 | 0.598502 |
f8f9eec7758309ac5352bc6b48f92c6046cfd396 | 1,952 | #! /usr/bin/env ruby
require 'spec_helper'
require 'yaml'
require 'rspec/expectations'
require 'rspec/mocks'
require 'puppet/provider'
require 'fixtures/unit/puppet/provider/import_system_conf_fixture'
describe "import system configuration" do
before(:each) do
@fixture=Import_system_conf_fixture.new
end
context ... | 44.363636 | 107 | 0.779713 |
33cc71938349f116aefce1526a1542190c091948 | 1,751 | # frozen_string_literal: true
# no doc
class ParticipantCallbacks
DEFAULT_GROUP_ID = 1
attr_reader :participant
def after_save(participant)
@participant = participant
create_pushable_resources
create_pullable_resources
end
def allow_pushable_resource_types(types)
@pushable_resource_types =... | 22.74026 | 75 | 0.73044 |
e9057d46c774ff02cfb221c117cf4986475cba66 | 7,515 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_12_01
module Models
#
# ExpressRouteCrossConnection resource.
#
class ExpressRouteCrossConnection < Res... | 32.673913 | 87 | 0.480506 |
38403b9af73bf80983f61b534fc9b8940e2ba2b2 | 4,346 | require 'fog'
require 'pmap'
require 'digest/md5'
require 'middleman/s3_sync/version'
require 'middleman/s3_sync/options'
require 'middleman-s3_sync/commands'
require 'middleman/s3_sync/status'
require 'middleman/s3_sync/resource'
require 'middleman-s3_sync/extension'
require 'ruby-progressbar'
module Middleman
modu... | 27.681529 | 115 | 0.544409 |
79d3f377719994d7632d1a9073cf7c9c59e4feed | 1,184 | # frozen_string_literal: true
require_relative 'base_inheritable'
module Grape
module Util
class StackableValues < BaseInheritable
attr_reader :frozen_values
def initialize(*_args)
super
@frozen_values = {}
end
# Even if there is no value, an empty array will be return... | 21.527273 | 67 | 0.608108 |
011aa66d555a6481f6a60026d9bb308221ad4edc | 5,499 | class Csound < Formula
desc "Sound and music computing system"
homepage "https://csound.com"
url "https://github.com/csound/csound.git",
tag: "6.14.0",
revision: "1073b4d1bc2304a1e06defd266781a9c441a5be0"
license "LGPL-2.1"
revision 5
head "https://github.com/csound/csound.git", branch: "develo... | 32.928144 | 102 | 0.679033 |
e9a5bb15c1857a8a1b5a746ef86f046d1f5dd76c | 948 | $LOAD_PATH.unshift( File.join( File.dirname(__FILE__), './' ) )
module SemanticModel
begin :exceptions
# meta exception
class ImpossibleMerge < Exception; end
class InvalidObject < Exception; end
# exceptions for specific objects
class InvalidFieldType < Exception; end
class UnknownRightRule... | 33.857143 | 63 | 0.763713 |
bb44f9bb4d9b02b714571fc4a02ddaf61aa4f589 | 7,916 | COVERAGE_FILE_PATH = "./coverage_fe/index.html"
THRESHOLD = 0.001
REPO_URL = "https://api.github.com/repos/Farmbot/Farmbot-Web-App"
LATEST_COV_URL = "https://coveralls.io/github/FarmBot/Farmbot-Web-App.json"
PULL_REQUEST = ENV.fetch("CIRCLE_PULL_REQUEST", "/0")
CURRENT_BRANCH = ENV.fetch("CIRCLE_BRANCH", "... | 34.719298 | 85 | 0.691637 |
285f23867c80f61cc979700fad826c0824120a0b | 368 | # == Schema Information
#
# Table name: areas
#
# id :integer not null, primary key
# code :integer
# area_type_id :integer
# name :string(255)
# state :string(255)
# created_at :datetime
# updated_at :datetime
#
require 'spec_helper'
describe Area do
pending "ad... | 19.368421 | 56 | 0.611413 |
62d8f0b79c0c8031fd795cf62ba1815c2e7cbe57 | 566 | cask "anki" do
version "2.1.42"
sha256 "4f0cb48aae5a55aa7f7abd04d152a8487361267e8002d8f965df445f07128c24"
url "https://github.com/ankitects/anki/releases/download/#{version}/anki-#{version}-mac.dmg",
verified: "github.com/ankitects/anki/"
name "Anki"
desc "Memory training application"
homepage "https... | 22.64 | 95 | 0.701413 |
ffae1de89d04e368e0d1b7bf0b9f56187c5096f5 | 79,340 | class BindingGen
def initialize
@bindings = {}
@undefine_methods = []
@undefine_singleton_methods = []
end
# define a method on the Ruby class and link it to a method on the C++ class
def binding(*args, **kwargs)
b = Binding.new(*args, **kwargs)
b.increment_name while @bindings[b.name]
... | 87.475193 | 168 | 0.693232 |
ffa3c2ef279a75362008a45a611037906116d217 | 335 | name 'deploy_wrapper_test'
maintainer 'Cameron Johnston'
maintainer_email 'cameron@rootdown.net'
license 'Apache 2.0'
description 'Exerts deploy_wrapper definition'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
depends 'git'
depends 'd... | 30.454545 | 72 | 0.704478 |
e95edad2132161fe1ab15048aa05ecd6109d3cff | 985 | #
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Cookbook:: iis
# Recipe:: mod_isapi
#
# Copyright:: 2011-2016, Chef Software, 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
#
# h... | 28.970588 | 74 | 0.714721 |
387966f34c575e611e9b0d37c30e1de07562f99d | 1,817 | class Circleci < Formula
desc "Enables you to reproduce the CircleCI environment locally"
homepage "https://circleci.com/docs/2.0/local-cli/"
# Updates should be pushed no more frequently than once per week.
url "https://github.com/CircleCI-Public/circleci-cli.git",
:tag => "v0.1.2061",
:revision =>... | 39.5 | 93 | 0.709411 |
28f543db70efc83aa92b2363873859864594e4ef | 2,172 | class Lammps < Formula
desc "Molecular Dynamics Simulator"
homepage "https://lammps.sandia.gov/"
url "https://github.com/lammps/lammps/archive/stable_3Mar2020.tar.gz"
# lammps releases are named after their release date. We transform it to
# YYYY-MM-DD (year-month-day) so that we get a sane version numbering.... | 36.813559 | 94 | 0.645948 |
b9e5843cecee9fe88583c4468d0e4b9ea753030b | 14 | puts 'inner1'
| 7 | 13 | 0.714286 |
acfb156b2aa461f27622f7e7912091c8c31113b9 | 255 | Rails.application.routes.draw do
devise_for :users, :controllers => {registrations:'registrations'}
resources :tweets
root to: 'tweets#index'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
| 36.428571 | 102 | 0.764706 |
38bf3bb4d1386767d08f5b43a1d0740c40c861c1 | 1,051 | class SponsorsViewController < GenericTableScreen
stylesheet :sponsors
title 'Our Sponsors'
def table_data
[{
title: "Thanks to our generous sponsors:",
cells: build_cells
}]
end
def build_cells
cells = []
sponsors.each_with_index do |sponsor, index|
cells << {
cell... | 23.355556 | 77 | 0.669838 |
0108ab8afce3d222b8adc2076f3cd82cbcdeff80 | 1,056 | #
# Cookbook:: apache
# Spec:: default
#
# Copyright:: 2018, The Authors, All Rights Reserved.
require 'spec_helper'
describe 'apache::default' do
context 'When all attributes are default, on Ubuntu 16.04' do
let(:chef_run) do
# for a complete list of available platforms and versions see:
# https://... | 29.333333 | 82 | 0.696023 |
793d686d489d74b1ce2afeeb470aa7180d66b8e7 | 230 | require_relative 'nw_loader/nw_plugins/initial_load'
require_relative 'nw_loader/nw_plugins/finalize_install'
module NwPluginGeolocationPoint
class Engine < ::Rails::Engine
puts "NwPluginGeolocationPoint::Engine"
end
end
| 25.555556 | 56 | 0.826087 |
bf7456aebd1566fc89f686d8a2bb2b8faf1e150e | 137 | require "test_helper"
class Auth0ControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 17.125 | 59 | 0.737226 |
39cb129d5cc7cb923cb93acfc336dd8d708572a7 | 438 | # frozen_string_literal: true
require "spec_helper"
describe Geo::EventWorker, :geo do
describe "#perform" do
it "calls Geo::EventService" do
args = ["package_file", "created", { "model_record_id" => 1 }]
service = double(:service)
expect(service).to receive(:execute)
expect(::Geo::Event... | 25.764706 | 82 | 0.673516 |
33086c896d8866b805c9ce5e3ecc0d0f6f02cbe0 | 1,151 | Gem::Specification.new do |s|
s.name = 'logstash-input-heartbeat'
s.version = '0.1.6'
s.licenses = ['Apache License (2.0)']
s.summary = "This input generates a heartbeat pattern to aid in monitoring Logstash performance & availability"
s.description = "This gem is a logs... | 38.366667 | 196 | 0.669852 |
79e998e151d0f1843f4fe6b754d6eda033cb12f1 | 2,621 | describe 'YAML reports' do
let(:report_dirs) { [REPORTS_FOLDER, "#{TIMELINES_FOLDER}/miq_reports"] }
let(:report_yamls) { report_dirs.collect { |dir| Dir.glob(File.join(dir, "**", "*.yaml")) }.flatten }
let(:chart_dirs) { [CHARTS_REPORTS_FOLDER] }
let(:chart_yamls) { chart_dirs.collect { |dir| Dir.glob(File.joi... | 35.418919 | 103 | 0.65662 |
38e3554fea0ae78ca1a0089bd6531836cce4b978 | 339 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'messages/show', type: :view do
before { @message = create :message }
it 'renders attributes in <p>' do
render
expect(rendered).to include(@message.from)
expect(rendered).to include(@message.to)
expect(rendered).to include(@messa... | 22.6 | 46 | 0.710914 |
0838a4c50b565960b727c3221a61924cbd0b3b5a | 210 | class CreateClimbs < ActiveRecord::Migration
def change
create_table :climbs do |t|
t.string :color
t.integer :grade
t.string :modifier
t.timestamps null: false
end
end
end
| 17.5 | 44 | 0.652381 |
18848287e431f9ef68ab8cf9b19086ab2feed23c | 1,834 | #!/usr/bin/env ruby
# -*- coding: binary -*-
require 'rex/post/meterpreter/channels/pool'
require 'rex/post/meterpreter/extensions/stdapi/tlv'
module Rex
module Post
module Meterpreter
module Channels
module Pools
###
#
# StreamPool
# ----------
#
# This class represents a channel that is associated with a
# streami... | 17.466667 | 63 | 0.679935 |
5d35d329d35656add45c2e1c2d399ec29eae0faf | 41 | require 'cocoapods-repo-ram/gem_version'
| 20.5 | 40 | 0.829268 |
f7a60221711e0d7e8c4f47d6534dfeca8c6b7295 | 331 | $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'webmock/rspec'
require 'ncs_analytics'
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each {|f| require f } # rubocop:disable Lint/NonDeterministicRequireOrder
RSpec.configure do |config|
config.include Configuration... | 30.090909 | 155 | 0.755287 |
28c7939230f67a5aebf712c2ef83c56ea982835b | 115 | class AddPowerToTools < ActiveRecord::Migration[5.0]
def change
add_column :tools, :power, :string
end
end
| 19.166667 | 52 | 0.730435 |
61be21bf651dcfd121f9cd0a7cebbfeba83b64b5 | 591 | # frozen_string_literal: true
class AgedBrie < Item
QUALITY_MAX = 50
QUALITY_MIN = 0
CHANGE_OF_QUALITY = 1
CHANGE_OF_SELL_IN = 1
def initialize(name = 'Aged Brie', sell_in, quality)
super(name, sell_in, quality)
end
def update
update_quality
update_days_to_sell
end
private
def updat... | 19.7 | 90 | 0.725888 |
bf471b0d26b14ac22812466cfbe685270a5aebb2 | 10,414 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 32.54375 | 154 | 0.616574 |
4a4c5f8328fa658f0e99147930fb1a56878257f2 | 61,532 | # 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,... | 40.749669 | 136 | 0.622424 |
e95b17eeeb788b21ab44bc990221d73cbbe27c7b | 1,077 |
describe 'data_objects/edit' do
let(:data_object) { stub_model(DataObject) }
before(:each) do
@taxon_concept = build_stubbed(TaxonConcept)
@user = build_stubbed(User)
@data_object = build_stubbed(DataObject, language_id: 1, license_id: 1)
@data_object.stub(:is_text?) { true }
@data_o... | 38.464286 | 96 | 0.641597 |
d5d77c69de5f04471ef4459c95c13d1d41bc3a4f | 72 | module Ecm
module Translations
VERSION = '4.1.2'.freeze
end
end
| 12 | 28 | 0.680556 |
26ade67700c8af2cf2022ea0d50695666be14cf9 | 903 | require 'spec_helper'
RSpec.describe '9Coin integration specs' do
let(:client) { Cryptoexchange::Client.new }
let(:eth_btc_pair) { Cryptoexchange::Models::MarketPair.new(base: 'eth', target: 'btc', market: 'ninecoin') }
it 'fetch pairs' do
pairs = client.pairs('ninecoin')
expect(pairs).not_to be_empty
... | 28.21875 | 111 | 0.69546 |
212de312bea12b7504cbd72372631a9469cf30a7 | 304 | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (http://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module UCT
include TimezoneDefinition
linked_timezone 'UCT', 'Etc/UTC'
end
end
end
end
| 17.882353 | 66 | 0.651316 |
33f0b05d9b88fe576d6973c4bf5466f35743ca8f | 362 | class FontNotoSansSharada < Formula
head "https://github.com/google/fonts/raw/main/ofl/notosanssharada/NotoSansSharada-Regular.ttf", verified: "github.com/google/fonts/"
desc "Noto Sans Sharada"
homepage "https://fonts.google.com/specimen/Noto+Sans+Sharada"
def install
(share/"fonts").install "NotoSansShara... | 32.909091 | 135 | 0.756906 |
e803bf42c02e0f81b48947addcd4dab2de6552a2 | 635 | require 'oauth/request_proxy/typhoeus_request'
require 'json'
require 'yaml'
CONFIG = YAML.load_file("config.yml")
def api_call(access_token, realm_id)
url = CONFIG['accounting_base_url'] + 'v3/company/' + realm_id + '/companyinfo/' + realm_id+'?minorversion=12'
options = {
method: :get,
headers: {
'Conten... | 25.4 | 112 | 0.703937 |
edc01a4991208ebaac09705955f2dd02cdc93e1f | 235 | module SubscriptionsHelper
def paypal_return_url
return "#{root_url}#{subscriptions_path}"
end
def action_text
@sponsorship ? 'Sponsor' : 'Get'
end
def type
@sponsorship ? 'Sponsorship' : 'Membership'
end
end
| 16.785714 | 47 | 0.693617 |
08335d2b1e16cd5cdafdd72133e82590c59ad7c9 | 504 | require_relative '../lib/desmoservice'
require 'minitest/autorun'
require 'json'
class TestTerm < Minitest::Test
def setup
@json = %q@{"iddesc":"E","code":5361,"libelles":[{"lang":"fr","lib":"Domaines de la gouvernance territoriale"}],"attrs":{"atlas:ventilationnaturelle":["ventilation:contexte:complete/E"]}}... | 28 | 192 | 0.688492 |
1a1620c5392fd58b3b520c0550b69ce9da43e844 | 150 | load File.expand_path('../regular/donation_user.rb', __FILE__)
load File.expand_path('../scheduled/update_category_donation_statistics.rb', __FILE__)
| 50 | 86 | 0.813333 |
ed9ef656c8e25477ec70f136bfecfc9f02481897 | 504 | ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'webmock/minitest'
WebMock.disable_net_connect! allow_localhost: true
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures... | 31.5 | 154 | 0.740079 |
b9b70d427af2c96b59e7abc2227be19d5703aa0b | 881 | cask 'kitty' do
version '0.17.4'
sha256 '9be739b3c7c5ae051cd3140d235f7a5a9958059abdfa53607a6b3985a65476f0'
url "https://github.com/kovidgoyal/kitty/releases/download/v#{version}/kitty-#{version}.dmg"
appcast 'https://github.com/kovidgoyal/kitty/releases.atom'
name 'kitty'
homepage 'https://github.com/kovid... | 29.366667 | 94 | 0.664018 |
87287f6e202ecde852be52bf81e764ff919a6f81 | 2,254 | require 'spec_helper'
describe 'logstash::output::sqs', :type => 'define' do
let(:facts) { {:operatingsystem => 'CentOS' }}
let(:pre_condition) { 'class {"logstash": }'}
let(:title) { 'test' }
context "Input test" do
let :params do {
:access_key_id => 'value1',
:aws_credentials_file => 'valu... | 31.305556 | 394 | 0.56921 |
336981bb7ea0bc36e85171866f13bd03cb3f22ac | 84,977 | # 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/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::GreengrassV2
# @api private
module ClientApi
include Seah... | 78.901578 | 204 | 0.785189 |
4a9725721b291258656b3fa41e58a547ec1c9e04 | 974 | # frozen_string_literal: true
class RubyObjectRepository
include Elasticsearch::Persistence::Repository
include Elasticsearch::Persistence::Repository::DSL
klass RubyObject
settings number_of_shards: Rails.configuration.elasticsearch_shards, number_of_replicas: Rails.configuration.elasticsearch_replicas do
... | 28.647059 | 136 | 0.726899 |
26a7504f888322009cf520673e3a305119e88e8b | 936 | require 'formula'
class Aqbanking < Formula
homepage 'http://www.aqbanking.de/'
url 'http://www2.aquamaniac.de/sites/download/download.php?package=03&release=95&file=01&dummy=aqbanking-5.0.25.tar.gz'
sha1 '80314a6f6114a0a3f0062161bb38effc0f1f4b62'
head 'http://devel.aqbanking.de/svn/aqbanking/trunk'
devel d... | 32.275862 | 127 | 0.649573 |
bbe260f1026333f977e87e89ff3bb3ff158b87f7 | 3,916 | 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 application in memory, allowing both threaded web serve... | 40.791667 | 102 | 0.756129 |
1a55afe491a66ad401e1dd75bf170923f53fcb2e | 1,198 | #####################################################################
# tc_asinh.rb
#
# Test cases for the Math.asinh method.
#####################################################################
require 'test/unit'
class TC_Math_Asinh_Class < Test::Unit::TestCase
def test_asinh_basic
assert_respond_to(Math, ... | 28.52381 | 69 | 0.602671 |
26d63160e2651319d3b0117fffa388d6f30f953e | 3,062 | maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs and configures chef client and server"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.10"
recipe "chef::client", "Sets up a ... | 34.795455 | 111 | 0.704442 |
ac3efc321a1bf2545a39d6ffee27a5cc1a5658ae | 750 | class GutentagTables < ActiveRecord::Migration
def up
create_table :gutentag_taggings do |t|
t.integer :tag_id, :null => false
t.integer :taggable_id, :null => false
t.string :taggable_type, :null => false
t.timestamps
end
add_index :gutentag_taggings, :tag_id
add_in... | 26.785714 | 74 | 0.669333 |
abdb0f9b0fa41e91dbc5ad7ea23edc00d00ddbfc | 801 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "minima-bootstrap"
spec.version = "0.0.1"
spec.authors = ["Sohair Ahmad"]
spec.email = ["sohair1991@gmail.com"]
spec.summary = "A bootstrap based theme for Jekyll."
spec.homepage = "https://g... | 32.04 | 95 | 0.646692 |
ac5278f1a252b00945191d59835f1602b7ab1a82 | 1,129 | class Crystal < Formula
desc "Code generator for every language, library and framework"
homepage "http://crystal.sh"
url "https://github.com/crystal/crystal/archive/v0.5.1.tar.gz"
sha256 "6c022ad59a10cec58856dba858a030b745333909108c08bd326c20ac0cb144fb"
bottle do
cellar :any
sha256 "5586dc0d8f07d3b81... | 29.710526 | 95 | 0.711249 |
e95131cb1ae7f8ebafed07bfb9b994efb69d0cd4 | 2,809 | # 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 'faraday'
require ... | 68.512195 | 173 | 0.708793 |
01f0047d4038a0107fe41df78f1338a3f1f8b336 | 953 | require_relative('version')
Pod::Spec.new do |s|
s.name = 'WorkflowTesting'
s.version = WORKFLOW_VERSION
s.summary = 'Reactive application architecture'
s.homepage = 'https://www.github.com/square/workflow-swift'
s.license = 'Apache License, Version 2.0'
s.author = 'Square'... | 30.741935 | 102 | 0.654774 |
184afebf1ebe08da184b56a992ab0f76a8c12ee5 | 47 | module UrbanDictionary
VERSION = "0.1.0"
end
| 11.75 | 22 | 0.723404 |
1844893a00a38c48edf020fcc80ee7fa2716b0e9 | 100 | class ManageIQ::Providers::Openstack::CloudManager::CloudVolumeSnapshot < ::CloudVolumeSnapshot
end
| 33.333333 | 95 | 0.84 |
abcbb0f8a3d3e8fbd85adbb988d1e3704412e232 | 4,470 | module DataMigrate
module Tasks
module DataMigrateTasks
extend self
def schema_migrations_path
File.join('db', 'migrate')
end
def migrations_paths
@migrations_paths ||= DataMigrate.config.data_migrations_path
end
def dump
if dump_schema_after_migratio... | 35.19685 | 125 | 0.614989 |
f86cd6c76e53d004b9cb8b364116533c7da66c6d | 1,397 | # ARCHĪVUM: _plugins/hapi/drops/xschemam_drop.rb
# DESCRIPTIONEM:
#
# rubocop:disable RubocopIsRacistAndIcanProveIt/AsciiComments
# @see https://github.com/rubocop/ruby-style-guide/issues/301
# @see https://github.com/rubocop/ruby-style-guide/issues/137
# frozen_string_literal: true
require_relative './comm... | 29.723404 | 76 | 0.672155 |
1d657b9af4bed2d2f5a951b9476e275226a16674 | 388 | require 'formula'
VERSION = "2.0.0"
class Lookup < Formula
homepage "https://github.com/sekimura/lookup"
url "https://github.com/sekimura/lookup/archive/v#{VERSION}.zip"
sha1 "ecc46536e737d9db00bc3076ecfac0edda57c93b"
version VERSION
def install
system "install", "lookup", "#{prefix}/lookup"
system... | 24.25 | 67 | 0.698454 |
61ed40967a4d4dfc142bb3a8c22a0512557809da | 1,942 | require 'savon'
require 'nokogiri'
# Parametros para la conexión al Webservice
wsdl_url = "https://staging.ws.timbox.com.mx/cancelacion/wsdl"
usuario = ""
contrasena = ""
# Parametros para la cancelación de documentos relacionados
rfc_receptor = "AAA010101AAA"
uuid = "8D4B79A4-B17A-4B4B-9220-9225F73B8945"
file_cer_p... | 39.632653 | 213 | 0.737899 |
ff66fc67945d441ae037bf06e27407ab98580d14 | 726 | ENV['RAILS_ENV'] ||= 'test'
require 'pry'
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
... | 20.166667 | 76 | 0.731405 |
ab3b3b617c4e1351557583d2ff691c53ec980b3b | 22,662 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProje... | 34.545732 | 121 | 0.710264 |
6108a85d20823285c80eac774fb99eb86f95a06f | 445 | #---
# Excerpted from "Programming Ruby 1.9",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http:/... | 31.785714 | 82 | 0.734831 |
333354d0d8b31d16db33ee815ef48ab251352f04 | 2,862 | # frozen_string_literal: true
require "inst-jobs"
module Sentry
module InstJobs
class Plugin < ::Delayed::Plugin
# need to symbolize strings as keyword arguments in Ruby 2.4~2.6
INST_JOBS_CONTEXT_KEY = :"Inst-Jobs"
callbacks do |lifecycle|
lifecycle.around(:invoke_job) do |job, *args, ... | 31.450549 | 116 | 0.624389 |
03e027ed8cb4d82b674a4f89be9978cc4354b528 | 3,018 |
class BookingsController < ApplicationController
include FareEstimate
include FindDriver
include ErrorMessage
before_action :authenticate_user!
before_action :check_active_bookings, only: :new
def new
@cab_types = CabType.all
@driver = Driver.new
end
def create
source = params[:source_lo... | 27.436364 | 126 | 0.654738 |
180985b8bda2e1bb6320873eaeb2e2c3d2bf52d4 | 4,851 | module Strategies
class Strategy32058 < Strategy
INSTRUMENT = INSTRUMENTS['EUR_USD']['instrument'].freeze
PIP_SIZE = INSTRUMENTS['EUR_USD']['pip_size'].freeze
CANDLES_REQUIRED = 120.freeze
# Open 2 buy and 2 sell orders at 06:00 if trend is favourable.
# Set TP on first buy and sell... | 27.5625 | 111 | 0.614306 |
1cd61eb9457f447a8730bef8ae6acede239f25f6 | 3,977 | require 'nokogiri'
require 'active_support/core_ext'
require 'scorm2004/manifest/visitor_pattern'
require 'scorm2004/manifest/attributes'
require 'scorm2004/manifest/children'
require 'scorm2004/manifest/xml_base'
require 'scorm2004/manifest/error'
require 'scorm2004/manifest/text_node'
require 'scorm2004/manifest/deci... | 40.581633 | 88 | 0.777722 |
3969e5bb00ba1233cfb73c0a4d925394199928db | 369 | class QuoteGeneratorService
def initialize(dob, **args)
@dob = dob
@rate = nil
@valid_date = nil
end
def quote
@quotes = {}
InsuranceCompany.find_each do |company|
service = eval(company.name.camelcase + "Service.new(#{@dob})")
@quotes[company.name.underscore] = service.get_rate(c... | 21.705882 | 69 | 0.650407 |
4afd1cd6703b017d7a520472132e8cf10a1c6255 | 1,701 | require 'formula'
class Gpkgtools < Formula
homepage 'https://launchpad.net/gpkgtools'
head "lp:gpkgtools", :using => :bzr
depends_on 'libspatialite'
depends_on "python@2"
resource "Pillow" do
url "https://files.pythonhosted.org/packages/0f/57/25be1a4c2d487942c3ed360f6eee7f41c5b9196a09ca71c54d1a33c968d... | 34.02 | 136 | 0.678424 |
bb675adeae3170f57f35772e60076e373e5b0349 | 473 | cask 'fcs-remover' do
version '3.1.5.0'
sha256 'c0d0526f3d7a9b48ae130cda6faed3f3393ea1c08a78850c9f71efa6e04b5e91'
url "https://www.digitalrebellion.com/download/fcsremover?version=#{version.no_dots}"
appcast 'https://www.digitalrebellion.com/rss/appcasts/fcs_remover_appcast.xml'
name 'FCS Remover'
homepage... | 33.785714 | 87 | 0.784355 |
f764b37db3f1040590676271dc6c0ca1f7e5a73d | 904 | class Cdiff < Formula
desc "View colored diff with side by side and auto pager support"
homepage "https://github.com/ymattw/cdiff"
url "https://github.com/ymattw/cdiff/archive/0.9.8.tar.gz"
sha256 "676f025b385c40bdf784aabf8381b2006f5e3befc2768c4d454a276f759221f1"
head "https://github.com/ymattw/cdiff.git"
... | 33.481481 | 79 | 0.743363 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.