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 |
|---|---|---|---|---|---|
038207e9d9f9b4e7211b7ce849b8a5bb8ce5984a | 6,552 | require 'httparty'
require 'cgi'
require 'json'
class FCM
include HTTParty
base_uri 'https://fcm.googleapis.com/fcm/send'
default_timeout 30
format :json
# constants
GROUP_NOTIFICATION_BASE_URI = 'https://android.googleapis.com/gcm'
attr_accessor :timeout, :api_key
def initialize(api_key, client_opt... | 29.12 | 154 | 0.65293 |
1d4d64f1ba1ea63356859002f4f040e26e6f6138 | 495 | # 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::V2018_07_01
module Models
#
# Defines values for PcError
#
module PcError
InternalError = "InternalErro... | 24.75 | 70 | 0.70101 |
1ad5644b03cb0d26483e93e48ff3bbd51486f7bf | 876 | # encoding: utf-8
require 'rubygems'
require 'bundler'
Bundler.setup
require 'rack/cors'
require 'dotenv'
Dotenv.load('.env.development')
# The actual server code is in src/server.rb
require './server'
# The server can run in two modes, 'production' and 'development'
# the mode is set in the RACK_ENV or RAILS_ENV env... | 25.028571 | 68 | 0.704338 |
bf650eab6decd4128f108e311a363c131a30aa8f | 155 | require "bootstrap/datepicker/enhanced/version"
module Bootstrap
module Datepicker
module Enhanced
# Your code goes here...
end
end
end
| 15.5 | 47 | 0.716129 |
219fe09ee40f1d2044cee269895a0a1eff62e95e | 835 | Rails.application.routes.draw do
root 'home_pages#home'
get '/help', to: 'home_pages#help'
get '/about', to: 'home_pages#about'
get '/contact', to: 'home_pages#contact'
get '/signup', to: 'users#new'
# post '/signup', to: 'users#create'
get '/login', to: 'sessions#new'
post '/login', ... | 36.304348 | 101 | 0.652695 |
91147ca2e60332df4637052cbe7b28684a1cac43 | 102 | Administrator.create!(
email: 'hanako@example.com',
password: 'foobar'
) | 25.5 | 43 | 0.529412 |
08a123ed18268adbc5cc5795be0c451eb16034ab | 6,191 | require 'net/http'
module Fae
class NetlifyApi
def initialize()
@netlify_api_user = Fae.netlify[:api_user]
@netlify_api_token = Fae.netlify[:api_token]
@site = Fae.netlify[:site]
@site_id = Fae.netlify[:site_id]
@endpoint_base = Fae.netlify[:api_bas... | 31.426396 | 130 | 0.518818 |
1102c67818b2c5fa358b339bef69dba59fa8cbb0 | 1,290 | module BandwidthIris
SIP_CREDENTIAL_PATH = 'sipcredentials'
class SipCredential
extend ClientWrapper
include ApiItem
def self.list(client, query = nil)
list = client.make_request(:get, client.concat_account_path(SIP_CREDENTIAL_PATH), query)[0][:sip_credential]
list = if list.is_a?(Array) t... | 30 | 126 | 0.681395 |
e849f6382bff9968acc6eadf0e0d432f60d1205a | 1,637 | #-- 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 ... | 32.74 | 91 | 0.728772 |
878b6eb830e163ca12faed7cf363e10b6a2d04fe | 27,983 | require 'ascii_charts'
require 'gruff'
require 'zlib'
require_relative 'models.rb'
LEVEL_PATTERN = /S[ILU]?-[ABCDEX]-[0-9][0-9]?-[0-9][0-9]?|[?!]-[ABCDE]-[0-9][0-9]?/i
EPISODE_PATTERN = /S[ILU]?-[ABCDEX]-[0-9][0-9]?/i
NAME_PATTERN = /(for|of) (.*)[\.\?]?/i
def parse_type(msg)
(msg[/level/i] ? Level : (msg[/episode/... | 33.155213 | 244 | 0.624093 |
4a20746f8ea18c1916cca56b34726fc35266abc5 | 7,955 | class FitsDatastream < ActiveFedora::OmDatastream
include OM::XML::Document
set_terminology do |t|
t.root(:path => "fits",
:xmlns => "http://hul.harvard.edu/ois/xml/ns/fits/fits_output",
:schema => "http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd")
t.identification {
t... | 45.457143 | 84 | 0.591703 |
289964916609cbcffa712ea46135fc26cb07a674 | 268,643 | # 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,... | 42.662061 | 142 | 0.640296 |
21f474cd76e033f2f2aa7405283fe5a407502b6d | 1,705 | #
# Be sure to run `pod lib lint AVCompositionDebugView.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name ... | 39.651163 | 121 | 0.660411 |
267a49d4d8552acd2ce16ce6f09f09ea33ad71a5 | 10,006 | # bandwidth
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).
module Bandwidth
# API utility class
class APIHelper
# Serializes an array parameter (creates key value pairs).
# @param [String] The name of the parameter.
# @param [Array] The value of the para... | 35.108772 | 80 | 0.539476 |
6a3d56a6e2db1cbb7f03bad2d7752a1cb4d304e2 | 347 | FactoryBot.define do
factory :category do
resume
name { Faker::Lorem.word }
factory :category_with_items do
transient do
item_count { 5 }
end
after_create do |category, evaluator|
create_list(:list_item, evaluator.item_count, category: category)
category.reload
... | 20.411765 | 73 | 0.645533 |
1cb3b4fb21e3f61f827149cbcf06be58eb3fa638 | 18,248 | # frozen_string_literal: true
require "bundler/compatibility_guard"
require "bundler/vendored_fileutils"
require "pathname"
require "rbconfig"
require "thread"
require "bundler/errors"
require "bundler/environment_preserver"
require "bundler/plugin"
require "bundler/rubygems_ext"
require "bundler/rubygems_integratio... | 32.126761 | 136 | 0.638262 |
3302c7a6ae74ceb987e100275d1e95ac28e6ecfc | 8,744 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.3.1-SNAPSHOT
=en... | 29.049834 | 193 | 0.609446 |
2835e8c9e2eb24a784850dd7b51a086f2e206a95 | 5,828 | # === COPYRIGHT:
# Copyright (c) North Carolina State University
# Developed with funding for the National eXtension Initiative.
# === LICENSE:
# see LICENSE file
module ApplicationHelper
def bootstrap_alert_class(type)
baseclass = "alert"
case type
when :alert
"#{baseclass} alert-warning"
whe... | 36.425 | 192 | 0.687028 |
f8dcd8fd12668b00910325a3c726b04b321b6047 | 4,386 | # This file was automatically generated for SMASH by SMASH v2.0
# ( https://smashlabs.io ).
module Smash
# UserRegistrationModel Model.
class UserRegistrationModel < BaseModel
# TODO: Write general description for this method
# @return [String]
attr_accessor :key
# TODO: Write general description ... | 26.907975 | 64 | 0.49886 |
bb9d8d0977cb91cdb6132621cdfd8afcd93ed04b | 885 | # The enum of premissions
# We can turn this into a database model later if we need the flexibility
# It's possible to make these IDs instead of strings. I like the legibility of the strings, and given the likely size of the dataset, the additional performance of IDs feels unecessary at the moment. That said, it may st... | 44.25 | 290 | 0.760452 |
62c2753d8b8ad00cb170ac31f978214575390302 | 2,354 | # frozen_string_literal: true
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... | 35.134328 | 87 | 0.763381 |
f8837242b556f845ff7221035a61288a1831cbed | 621 |
class Name
Delimiter = '.'
def self.split *args
args
.flatten
.map{ _1.to_s.split Delimiter }
.flatten
.reject &:empty?
end
def set!(...)
@me = self.class.split(...)
end
def initialize(...)
set!(...)
end
# left-hand match
# (empty object matches everything)
d... | 14.113636 | 48 | 0.568438 |
edc2d87b5afaf6f5414a4e280017c560e1273d66 | 214 | s = gets.chomp
k = gets.to_i
if s.size%k != 0
puts "NO"
exit
end
len = s.size/k
(0...s.size).step(len).each do |i|
if s[i,len] != s[i,len].reverse
puts "NO"
exit
end
end
puts "YES"
| 14.266667 | 35 | 0.523364 |
ac23110e6c30fc3c197a07702c31cb6e3e459bee | 6,323 | # ------------------------------------------------------------------------------------
# <copyright company="Aspose" file="get_document_hyperlinks_request.rb">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of t... | 39.030864 | 188 | 0.671991 |
0887591fc9c5c61f3c108c837bea318de653e5da | 1,755 | require 'forwardable'
module ButtonDeployInterface
class Client
extend Forwardable
def_delegators :steps_manager, :step
def_delegators :connector, :connection_state
def initialize(certificate_path, private_key_path)
@connector = ButtonDeployInterface::AwsIot::Connector.new(certificate_path, p... | 30.789474 | 110 | 0.752137 |
7a01aae32ce4dc1fe8bdb2ce03daa029780844a1 | 3,460 | RSpec.describe MetadataRevision::ChangeHistoryValidator do
describe "#validate_each" do
let(:record) { build :metadata_revision }
let(:attribute) { :change_history }
let(:validator) { described_class.new(attributes: [attribute]) }
def change_history_item(id: SecureRandom.uuid,
... | 40.705882 | 86 | 0.681792 |
399c1999519fa7c6a152a54d618f167f183a862e | 78 | module Forum
class ApplicationController < ActionController::Base
end
end
| 15.6 | 54 | 0.807692 |
087f2c8eefdbfc23cbb3909dca188eb2c392f900 | 423 | require 'formula'
class Yaz < Formula
homepage 'http://www.indexdata.com/yaz'
url 'http://ftp.indexdata.dk/pub/yaz/yaz-5.0.7.tar.gz'
sha1 '72585ba2cb3e9bc30846bac473a8113433d69758'
depends_on 'pkg-config' => :build
def install
system "./configure", "--disable-dependency-tracking",
... | 24.882353 | 58 | 0.609929 |
f7024f45c10e5ec5f4543e79c811176e532d05f2 | 1,213 | #
# Author:: Ryan Cragun (<ryan@chef.io>)
# Copyright:: Copyright (c) 2019 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 31.102564 | 74 | 0.73042 |
61535b1b7588e1204c2e39a69c9ca9d873ece8b3 | 130 | require 'active_record'
require 'template'
require 'template_attribute'
require 'fiona/setting_template'
require 'fiona/settings'
| 21.666667 | 32 | 0.830769 |
e8fac4371dd523456a77e315691936ceff61e29e | 2,186 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../config/environment', __dir__)
require_relative '../lib/lastfm.rb'
# Prevent database truncation if the environment is production
abort("The Rails environment is runni... | 37.689655 | 86 | 0.752516 |
e9e84bf4bd05c31634554ab1a0b18230776c985b | 672 | class TodoList < ActiveRecord::Base
unloadable
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
belongs_to :project, :class_name => "Project", :foreign_key => "project_id"
has_many :todo_items,
-> { order 'position' },
:dependent => :delete_all,
... | 25.846154 | 81 | 0.610119 |
ede330b2d2e550209c964c70b2bf5dd90b730648 | 3,432 | require 'rest_client'
require 'uri'
module HealthDataStandards
module Util
class VSNotFoundError < StandardError
end
class VSApi
attr_accessor :api_url, :ticket_url, :username, :password
def initialize(ticket_url, api_url, username, password, ticket_granting_ticket = nil)
@api_url = ... | 35.75 | 122 | 0.65676 |
03578df0a987322c997bcd1962b4172d6a13a040 | 19,377 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Ci::Build do
let_it_be(:group) { create(:group_with_plan, plan: :bronze_plan) }
let(:project) { create(:project, :repository, group: group) }
let(:pipeline) do
create(:ci_pipeline, project: project,
sha: project.com... | 32.028099 | 165 | 0.661816 |
bb3f3deeb6b38727d9d9b583a923732a77808ec6 | 2,033 | require 'nokogiri/xml/parse_options'
require 'nokogiri/xml/sax'
require 'nokogiri/xml/fragment_handler'
require 'nokogiri/xml/node'
require 'nokogiri/xml/namespace'
require 'nokogiri/xml/attr'
require 'nokogiri/xml/dtd'
require 'nokogiri/xml/cdata'
require 'nokogiri/xml/document'
require 'nokogiri/xml/document_fragment... | 32.269841 | 94 | 0.70487 |
bfcde7945cb36656e490ea6a8ce5ed7b6189f6f7 | 1,142 | module FontAwesome5Rails
module Parsers
module ParseMethods
def icon_type(type)
return 'fas' if type.nil?
case type.to_sym
when :far, :regular
'far'
when :fal, :light
'fal'
when :fab, :brand
'fab'
when :fad, :duotone
'f... | 18.419355 | 50 | 0.476357 |
184be5c2c5a8250537f279620a56020c573315d9 | 256 | # Dsl or Erb
module Lono::Builder::Configset
class Evaluator < Lono::CLI::Base
def evaluate
Registration.new(@blueprint).evaluate
combiner = Combiner.new(@options.merge(metas: Registration.metas))
combiner.combine
end
end
end
| 23.272727 | 72 | 0.699219 |
1dcbc3692e61e2556f48c904a6153af19a5b2f8a | 2,164 | require 'rails_helper'
describe Agents::SchedulerAgent do
let(:valid_params) {
{
name: 'Example',
options: {
'action' => 'run',
'schedule' => '0 * * * *'
},
}
}
let(:agent) {
described_class.create!(valid_params) { |agent|
agent.user = users(:bob)
}
}
... | 24.590909 | 82 | 0.577634 |
615e9faf777546044df821a697ff0fa8d09b0c04 | 1,298 | class SearchController < ApplicationController
before_action :validate_q!, only: %i[results]
def results
# hand off to Enhancer chain
@enhanced_query = Enhancer.new(params).enhanced_query
# hand off enhanced query to builder
query = QueryBuilder.new(@enhanced_query).query
# builder hands off ... | 27.041667 | 116 | 0.718028 |
ed05a150f8b01e718445c5575b5a822d19f0ff07 | 2,298 | # frozen_string_literal: true
RSpec.shared_examples 'items list service' do
it 'avoids N+1' do
params = { board_id: board.id }
control = ActiveRecord::QueryRecorder.new { list_service(params).execute }
new_list
expect { list_service(params).execute }.not_to exceed_query_limit(control)
end
it '... | 27.357143 | 101 | 0.710183 |
285d89d028298d9ab246d34350717451cb05428d | 907 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint carbonvoice_audio.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'carbonvoice_audio'
s.version = '1.0.6'
s.summary = 'Flutter audio plugin'
s.descript... | 39.434783 | 105 | 0.619625 |
bbf8db8a777e70e338195e59ce10239b6005db2a | 533 | class PasswordResetsController < ApplicationController
def new
end
def edit
@user = User.find_by_password_reset_token!(params[:id])
end
def update
@user = User.find_by_password_reset_token!(params[:id])
if @user.password_reset_sent_at < 2.hours.ago
redirect_to new_password_reset_path, :ale... | 25.380952 | 70 | 0.701689 |
d59b70dec9042d0d1d80982e7fc94a24fe3c9320 | 1,579 | class Rubberband < Formula
desc "Audio time stretcher tool and library"
homepage "https://breakfastquay.com/rubberband/"
url "https://breakfastquay.com/files/releases/rubberband-1.8.2.tar.bz2"
sha256 "86bed06b7115b64441d32ae53634fcc0539a50b9b648ef87443f936782f6c3ca"
license "GPL-2.0"
revision 1
head "http... | 37.595238 | 93 | 0.737175 |
ac6606e77d72b0087e035a61f127dbf91071d352 | 815 | require 'cairo'
require_relative 'arg_loader'
require_relative 'color_validator'
module Squib::Args
module_function def extract_paint(opts, deck)
Paint.new(deck.custom_colors).extract!(opts, deck)
end
class Paint
include ArgLoader
include ColorValidator
def initialize(custom_colors)
@cu... | 18.522727 | 69 | 0.662577 |
ac14bfaeb97dac68530ea7f2dcf577133712c0c9 | 645 | require 'rails_helper'
RSpec.describe "newsletters/edit", :type => :view do
before(:each) do
@newsletter = assign(:newsletter, Newsletter.create!(
:name => "MyString",
:url => "MyString",
:description => "MyText"
))
end
it "renders the edit newsletter form" do
render
assert_se... | 25.8 | 88 | 0.665116 |
6288351c6406227d3cb2d0b68a41c761a9d48247 | 232 | require 'colorizable/color'
require 'colorizable/model_extensions'
module Colorizable
end
if defined?(ActiveRecord::Base)
ActiveRecord::Base.send(:include, Colorizable::ModelExtensions)
end
require 'colorizable/version_number'
| 19.333333 | 65 | 0.818966 |
b92b700b819b869f19f7e6d3944d533711e0d367 | 39 | json.partial! "mgmts/mgmt", mgmt: @mgmt | 39 | 39 | 0.717949 |
bb5cc7a431b8276e24195ebac7ae2d3ae3e43622 | 3,023 | require_relative './formulario_test'
require_relative './respuestafor_test'
require_relative './campo_test'
require_relative '../../test_helper'
module Mr519Gen
class ValorcampoTest < ActiveSupport::TestCase
PRUEBA_VALORCAMPO = {
valor: 1
}
setup do
Rails.application.config.x.formato_fecha =... | 34.352273 | 89 | 0.665564 |
ab8bc4df4583ac57c4849f7c4b418efb678eef95 | 1,121 | 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 AimFullProject
class Application < Rails::Application
# Settings in config/environments/* tak... | 41.518519 | 99 | 0.735058 |
1a2559a8d6584238c8ca34bbc995eb404d6de67d | 477 | class Boot2docker < Cask
version '1.1.0'
sha256 '6a98e0311557199a71b23d596a0547e3a7902a1a04f42905c6141a08f2a1bb7d'
url 'https://github.com/boot2docker/osx-installer/releases/download/v1.1.0/Boot2Docker-1.1.0.pkg'
homepage 'https://github.com/boot2docker/osx-installer'
install 'Boot2Docker-1.1.0.pkg'
unins... | 43.363636 | 159 | 0.779874 |
26726b8bb359656a8e7500dc5c8962c153393934 | 259 | require 'rails_helper'
RSpec.describe User, :type => :model do
it 'is subscribed if there is a subscription with same email address' do
u = create(:user)
sub = create(:subscription,email: u.email)
expect(u).to be_subscribed
end
end
| 18.5 | 74 | 0.679537 |
6ac881dfbe515b08c5c2813a071e01a7d5ab600c | 1,138 | module Fastlane
module Actions
class LaneContextAction < Action
def self.run(params)
Actions.lane_context
end
#####################################################
# @!group Documentation
#####################################################
def self.description
... | 19.964912 | 113 | 0.502636 |
335c196f60b403e76cb3648ffc86275383a8476c | 564 | =begin
There was a test in your class and you passed it. Congratulations!
But you're an ambitious person. You want to know if you're better than the average student in your class.
You got an array with your colleges' points. Now calculate the average to your points!
Return True if you're better, else False!
Note:
You... | 37.6 | 142 | 0.764184 |
6a37b2633007f335cc86e7d2ac035864cc2cedd5 | 4,058 | module ApiBanking
class AccountStatement < JsonClient
SERVICE_VERSION = 1
CODE_NO_TXN_FOUND = '8504'
attr_accessor :request, :result
ReqHeader = Struct.new(:corpID, :approverID)
ReqBody = Struct.new(:accountNo, :transactionType, :fromDate, :toDate)
Request = Struct.new(:header, :body)
... | 38.283019 | 136 | 0.614096 |
79da0980e86751b4f09e970b26f60045b0e521d3 | 565 | require_relative "boot"
require "rails/all"
Bundler.require(*Rails.groups)
require "segmentation"
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# Settings in config/environments/* take precedence... | 29.736842 | 82 | 0.768142 |
9112536a010ad1ae8b9b5835a3fb7e6b759ff1d2 | 867 | # Add our main menu override
copy_file "overrides/main_menu.rb", "app/overrides/main_menu.rb"
# Fix uninitialized constant Spree::User::DestroyWithOrdersError
template "initializers/spree_user_error_fix.rb", "config/initializers/spree_user_error_fix.rb"
# remove all stylesheets except core
%w(admin store).each do ... | 48.166667 | 101 | 0.767013 |
ed2aa3e170919651f0c28cbe00a1040238e862e3 | 83 | require 'rails_helper'
describe Version do
it { should belong_to(:project)}
end
| 13.833333 | 34 | 0.759036 |
3888ff87c8ae3e7a6b51e911d72831a002536558 | 196 | namespace :index_posts do
task default: :environment do
start = Time.now.utc.to_f
ESIndexAllPostsWorker.new.perform
puts "ESIndexAllPostsWorker took #{Time.now.utc.to_f - start}"
end
end
| 24.5 | 64 | 0.765306 |
e978a836cd137d4feb630379f93e090161c7aaea | 1,028 | {
matrix_id: '1391',
name: 'net50',
group: 'Andrianov',
description: 'net50 matrix from Alexander Andrianov, SAS Institute Inc.',
author: 'A. Andrianov',
editor: 'T. Davis',
date: '2006',
kind: 'optimization problem',
problem_2D_or_3D: '0',
num_rows: '16320',
num_cols: '16320... | 29.371429 | 77 | 0.654669 |
f82721c77ae834ef3f87e9e616adc5364afcd507 | 3,319 | # frozen_string_literal: true
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
require 'database_cleaner'
require 'simplecov'
SimpleCov.start
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the envi... | 42.012658 | 141 | 0.756252 |
e2dacece8d46b57eec9eae4f9bebbe4856297ba7 | 572 | # frozen_string_literal: true
module Persistence
module Store
module Operations
# Responsible of building a DELETE Directive.
class Delete < Operation
include Capabilities::Filter
include Capabilities::Retriever
include Capabilities::Requirer
include Capabilities::Disc... | 21.185185 | 51 | 0.636364 |
1d831c8819de54e945339aa2931dfe5aec548589 | 1,019 | require_relative './../../spec_helper'
describe 'ilo_test::computer_system_set' do
let(:resource_name) { 'computer_system' }
include_context 'chef context'
it 'set asset tag and indicator led' do
expect_any_instance_of(ILO_SDK::Client).to receive(:get_asset_tag).and_return('HP002')
expect_any_instance_o... | 48.52381 | 103 | 0.773307 |
abae64521b7befeaa53441cc86aee1101c70ff33 | 2,522 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2014 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 ... | 34.547945 | 93 | 0.715702 |
1a251baefd3efa174abc48d5a47d2b38c205ec7f | 936 | class TenantPhonesController < ApplicationController
before_filter :manager_authorized?, :find_tenant
def create
begin
@tenant.contact.phones.create!(params[:phone])
rescue Exception => e
flash[:notice] = e.message
redirect_to m([@company, @property, @unit, @rental_agreement, @tenant, 't... | 27.529412 | 98 | 0.685897 |
e27eb1f1dc4a6ef983bb54d1e2dafd77f5cece57 | 2,068 | # Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class NotificationsController < ApplicationController
include NotificationsHelper
def update
note = Notification.where(:recipient_id => current_user.id... | 33.354839 | 123 | 0.588975 |
5d174d70f01c283ab23ee315e6730a755e2616d1 | 879 | Pod::Spec.new do |s|
s.name = 'AmazonChimeSDK-Bitcode'
s.version = '0.19.2'
s.summary = 'Amazon Chime SDK for iOS with Bitcode support.'
s.description = 'An iOS client library for integrating multi-party communications powered by the Amazon Chime service.'
s.homepage ... | 54.9375 | 126 | 0.650739 |
1a982c226dae4aba583a78615c2496b9e9b5d2ab | 1,467 | begin
require 'puppet_x/sensu/to_type'
rescue LoadError => e
libdir = Pathname.new(__FILE__).parent.parent.parent
require File.join(libdir, 'puppet_x/sensu/to_type')
end
Puppet::Type.newtype(:sensu_client_subscription) do
@doc = ""
def initialize(*args)
super
self[:notify] = [
"Service[sensu-c... | 18.56962 | 68 | 0.599864 |
2179420f9699391c78a1fc006bcdcc70f2e92c16 | 716 | require 'test_helper'
class ConversationsControllerTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
setup do
sign_in users(:alice)
end
test 'should get index' do
get conversations_url
assert_response :success
end
test 'should create conversation' do
assert_... | 21.69697 | 67 | 0.705307 |
2885bc23b682f0db8a406c8e5b1f8c1c50e80b6b | 2,457 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: "Selma", email: "selmandi@yahoo.com",
password: "foobar", password_confirmation: "foobar")
end
test "should be valid" do
assert @user.valid?
end
test "name should be present" do
... | 28.241379 | 78 | 0.671144 |
7903c2059524d757c94ec8955d57aabd458efed6 | 1,781 | # Frozen-string-literal: true
# Copyright: 2012 - 2018 - MIT License
# Encoding: utf-8
require "liquid/drop"
require "fastimage"
module Jekyll
module Assets
class Drop < Liquid::Drop
extend Forwardable::Extended
def initialize(path, jekyll:)
@path = path.to_s
@sprockets = jekyll.spro... | 23.746667 | 61 | 0.542953 |
e9010bbb3a59168b2c5716edc955c1a405566bdf | 605 | git_plugin = self
namespace :puma do
desc 'Setup nginx configuration'
task :nginx_config do
on roles(fetch(:puma_nginx, :web)) do |role|
git_plugin.puma_switch_user(role) do
git_plugin.template_puma('nginx_conf', "/tmp/nginx_#{fetch(:nginx_config_name)}", role)
execute :mv, "/tmp/nginx_#{... | 40.333333 | 161 | 0.702479 |
87a3e15e0a15bd9b65ead8fe7f70e6a86f3bab3b | 867 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
test "index as admin including pagination and delete links" do
log_in_as @admin
get users_path
assert_template 'users/index'
assert_select 'div.pagination'
... | 21.675 | 71 | 0.717416 |
6a3223f013de651524b666c3bd36692e8b37e714 | 694 | cask "chia" do
version "1.1.7"
sha256 "0413ebeba010b922bb21ff4630cadfa86096a107cce6ecb37f8902969340e6ba"
url "https://github.com/Chia-Network/chia-blockchain/releases/download/#{version}/Chia-#{version}.dmg",
verified: "github.com/Chia-Network/chia-blockchain/"
name "Chia Blockchain"
desc "GUI Python i... | 27.76 | 105 | 0.71902 |
f8672bec5668b6d1cb089ecc18df6b66af8dcdab | 3,969 | # frozen_string_literal: true
class User < ApplicationRecord
DELETED = "[deleted]"
INVITES_PER_DAY = 10
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :remem... | 27.5625 | 109 | 0.637692 |
b9ede241e0ddb57f6def491eb90d32c86aa9f72b | 2,572 | require "json"
require "date"
require "afip_bill/check_digit"
require "pdfkit"
require "rqrcode"
module AfipBill
class Generator
attr_reader :afip_bill, :bill_type, :user, :line_items, :header_text
AFIP_QR_URL = 'https://www.afip.gob.ar/fe/qr/'
HEADER_PATH = File.dirname(__FILE__) + '/views/shared/_fact... | 29.227273 | 94 | 0.639969 |
b98a9bb89fdeeed3f5cdaf67f218881cdabb9af7 | 1,903 | require 'rspec'
require 'krypt'
require 'stringio'
describe Krypt::Hex::Encoder do
let(:klass) { Krypt::Hex::Encoder }
def write_string(s)
io = StringIO.new
hex = klass.new(io)
hex << s
hex.close
io.string
end
def read_string(s)
io = StringIO.new(s)
hex = klass.new(io)
begin... | 20.031579 | 69 | 0.57278 |
61984c378d16fecd4deac5f34aa9fe8ce959509f | 1,167 | require File.expand_path("#{File.dirname(__FILE__)}/../../../spec_helper.rb")
require 'ghost/cli'
describe Ghost::Cli, :type => :cli do
describe "help" do
let(:overview) do
<<-EOF.unindent
USAGE: ghost <task> [<args>]
The ghost tasks are:
add Add a host
bust ... | 30.710526 | 77 | 0.605827 |
0820b79894adb5c70a457b01a19070f1144c4bab | 2,137 | # frozen_string_literal: true
require "noun_project_api/retriever"
module NounProjectApi
# Retrieve icons.
class IconsRetriever < Retriever
API_PATH = "/icons/"
# Finds multiple icons based on the term
# * term - search term
# * limit - limit the amount of results
# * offset - offset the resu... | 31.895522 | 99 | 0.592887 |
3304cfe11132ef106369291e5be3845108a553fd | 381 | module Sipity
RSpec.describe WorkflowAction, type: :model, no_clean: true do
context 'database configuration' do
subject { described_class }
its(:column_names) { is_expected.to include('workflow_id') }
its(:column_names) { is_expected.to include('resulting_workflow_state_id') }
its(:column... | 34.636364 | 82 | 0.708661 |
4aae0e9f3554897ec57f9c542e1912546b975016 | 2,933 | # frozen_string_literal: true
module RuboCop
module Cop
# Common functionality for modifier cops.
module StatementModifier
include LineLengthHelp
private
def single_line_as_modifier?(node)
return false if non_eligible_node?(node) ||
non_eligible_body?(node.... | 31.880435 | 83 | 0.642687 |
0367426794931064ff5370ebbb997c305689b85c | 26,422 | # frozen_string_literal: true
require 'spec_helper'
describe "Stealth::Controller replies" do
Stealth::Controller._replies_path = File.expand_path("../replies", __dir__)
let(:facebook_message) { SampleMessage.new(service: 'facebook') }
let(:controller) { MessagesController.new(service_message: facebook_messag... | 38.017266 | 120 | 0.705738 |
116178eb87ee34f8d72e174ccaa466b8cadb0be8 | 177 | module DP
module ForceErrors
def self.included(base)
base.alias_method_chain :raise_errors?, :dp
end
def raise_errors_with_dp?
true
end
end
end | 14.75 | 49 | 0.672316 |
01cbe01dc6a6fc5f8621f6e6a9971fa0edc4105c | 1,861 | # -*- encoding: utf-8 -*-
# stub: activerecord 5.0.7.2 ruby lib
Gem::Specification.new do |s|
s.name = "activerecord".freeze
s.version = "5.0.7.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Dav... | 43.27907 | 225 | 0.679205 |
08bbe4cb9c5cfa7fe27fd9e6829664c23a09716b | 609 | require "benchmark"
class Foo
def ping
end
end
block = Proc.new {
ping
}
Foo.send(:define_method, "pong", &block)
object = Foo.new
method = object.method("pong")
TESTS = 100_000
Benchmark.bmbm do |results|
results.report("noop:") { TESTS.times { } }
results.report("method:") { TESTS.times { object.ping ... | 22.555556 | 82 | 0.671593 |
79e3f3f05474cb5d1412e50a7f0d6caf01f7a8d3 | 2,269 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.513889 | 91 | 0.690613 |
b9a7cd09327e4d7932d22c735811b6f0f33b5647 | 1,588 | #
# Author:: Matthew Kent (<mkent@magoazul.com>)
# Copyright:: Copyright (c) 2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 30.538462 | 74 | 0.639798 |
919c34947018e1a7932d6abb5a7b48dae4614ad9 | 893 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "<%= name %>/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "<%= name %>"
s.version = <%= camelized %>::VERSION
s.authors = ["<%= author %>"]
s.email = ["... | 31.892857 | 107 | 0.585666 |
384e3481ab4145adf384a6a9d34bbc3f37366b2c | 69 | require_relative '../test_init'
include Metrics::Stream::Divergence
| 17.25 | 35 | 0.797101 |
18e985564752c1a0725b9f14d29855d72be5220f | 11,192 |
module Logging
# A Mapped Diagnostic Context, or MDC in short, is an instrument used to
# distinguish interleaved log output from different sources. Log output is
# typically interleaved when a server handles multiple clients
# near-simultaneously.
#
# Interleaved log output can still be meaningful if eac... | 33.812689 | 94 | 0.693174 |
610e07594424f0b0c3cc6f1ef993be408f5b893d | 866 | module Paymill
class Base
include Paymill::Operations::All
include Paymill::Operations::Create
include Paymill::Operations::Find
attr_accessor :created_at, :updated_at
# Initializes the object using the given attributes
#
# @param [Hash] attributes The attributes to use for initializatio... | 26.242424 | 71 | 0.692841 |
e819873a1bf2c08367fc0214c56c7cfc8bbc7a3a | 317 | with_driver "azure"
machine_options = {
bootstrap_options: {
cloud_service_name: "jkeisercloudtest",
storage_account_name: "jkeiserstorage",
#:vm_size => "A7"
location: "West US",
},
#:image_id => 'foobar'
password: 'chefm3t4l\m/',
}
machine "koopa" do
machine_options machine_options
end
| 18.647059 | 43 | 0.687697 |
acb7905a232cc2d68abdb55b70bc9b1d1a3cb892 | 5,141 | # typed: false
# frozen_string_literal: true
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 ... | 43.940171 | 114 | 0.766582 |
91c9c3e6810158bb725860f144dbebd809322b63 | 1,133 | # frozen_string_literal: true
require 'forwardable'
require 'dopp/document/context'
require 'dopp/document/structure'
module Dopp
# PDF document.
class Document
extend Forwardable
def_delegators(
:@context,
:page_size=, :landscape=, :rotate=,
:page_size, :landscape, :rotate,
:page... | 20.232143 | 49 | 0.603707 |
7a3fb5e5a414683a60e634640d5cefd01f147697 | 50 | module CertificateFactory
VERSION = "0.1.0"
end
| 12.5 | 25 | 0.74 |
5d5646f2d62d720d1592d0962bd5d53e720c3dda | 922 | Pod::Spec.new do |s|
s.name = "TeamupKit"
s.platform = :ios, "9.0"
s.requires_arc = true
s.version = "0.2.3"
s.summary = "Swift framework for Teamup services."
s.description = <<-DESC
Swift framework for communicating with Teamup, a service to super charge your fitness busine... | 30.733333 | 102 | 0.591106 |
395c43a40adac3523665a582d6735d726e873905 | 1,253 | class EmacsClangCompleteAsync < Formula
desc "Emacs plugin using libclang to complete C/C++ code"
homepage "https://github.com/Golevka/emacs-clang-complete-async"
url "https://github.com/Golevka/emacs-clang-complete-async/archive/v0.5.tar.gz"
sha256 "151a81ae8dd9181116e564abafdef8e81d1e0085a1e85e81158d722a14f55... | 29.833333 | 115 | 0.750998 |
62c70038a36566881cb80f6757da6b77097b2803 | 404 | # Be sure to restart your server when you modify this file.
Revs::Application.config.session_store :cookie_store, key: '_revs_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 "rails generat... | 44.888889 | 74 | 0.806931 |
edb3a2484cf332220e4bf144e3729b9a6f57d2a7 | 3,096 | class Protobuf < Formula
desc "Protocol buffers (Google's data interchange format)"
homepage "https://github.com/protocolbuffers/protobuf/"
url "https://github.com/protocolbuffers/protobuf.git",
:tag => "v3.6.1.3",
:revision => "66dc42d891a4fc8e9190c524fd67961688a37bbe"
head "https://github.com... | 34.021978 | 134 | 0.684755 |
b9dbc0844384d5f69ffad732a7a45204b024656b | 272 | module SignInSupport
def sign_in(user)
visit root_path
click_on('ログイン')
sleep 0.1
fill_in 'メールアドレス', with: user.email
sleep 0.1
fill_in 'パスワード', with: user.password
find('.login__hover').hover
find('input[name="commit"]').click
end
end
| 20.923077 | 40 | 0.658088 |
7ab5215867834398ec70c2b5c3fd047040b5382f | 1,234 | require_relative 'lib/tweetbot/version'
Gem::Specification.new do |spec|
spec.name = "tweetbot"
spec.version = Tweetbot::VERSION
spec.authors = ["Corey Haines"]
spec.email = ["coreyhaines@gmail.com"]
spec.summary = %q{Tweetbot makes writing twitter bots twivial!}
spec.desc... | 42.551724 | 135 | 0.675041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.