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 |
|---|---|---|---|---|---|
e8b78e170cab32ab1fab0d942d63d3fd9945af7b | 905 | require 'restforce'
require 'dotenv'
Dotenv.load
# Takes in a connected Restforce client
Salesforce = Struct.new(:client) do
def destroy(id)
account = client.find('Account', id)
puts "Deleting #{account.Name}"
client.destroy('Account', id)
end
end
# Create Restforce client
def create_client()
clien... | 28.28125 | 74 | 0.637569 |
1d1fc7fe8a650be7be59cf79a7dfc480ccb2bd04 | 2,751 | module Member
class Initializer
# login node
Cms::Node.plugin "member/login"
# registration node
Cms::Node.plugin "member/registration"
# mypage nodes
Cms::Node.plugin "member/mypage"
Cms::Node.plugin "member/my_profile"
Cms::Node.plugin "member/my_blog"
Cms::Node.plugin "member/... | 38.746479 | 70 | 0.754635 |
ffad6e3806535802fac6666fd0e3bccf92cd7e24 | 408 | require File.expand_path('../lib/active_file/version', __FILE__)
Gem::Specification.new do |gem|
gem.name = "active_file"
gem.version = ActiveFile::VERSION
gem.description = "Just a file system database"
gem.summary = "Just a file system database"
gem.author = "Lucas Souza"
gem.files ... | 34 | 96 | 0.671569 |
910a4124ebe64d7abdf196065359fa497ffcfc68 | 158 | class CreateEntities < ActiveRecord::Migration[6.1]
def change
create_table :entities do |t|
t.string :name
t.timestamps
end
end
end
| 15.8 | 51 | 0.664557 |
7a189cd36acfe22d781f51810407a24bfe9e06ab | 11,754 |
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use y... | 48.570248 | 152 | 0.748511 |
e8144ac44891109dddb91c5265651d3f364a1f6a | 720 | module FHIR
# fhir/sort_direction.rb
class SortDirection < PrimitiveCode
include Mongoid::Document
def as_json(*args)
result = super
result.delete('id')
unless self.fhirId.nil?
result['id'] = self.fhirId
result.delete('fhirId')
end
result
end
... | 25.714286 | 101 | 0.626389 |
f7c8b5ef614107d8842b94fc2c47ff11e97297b4 | 438 | class UsersController < ApplicationController
def index
@users = User.all
render json: @users, include:[:recipes]
end
def show
@user = User.find params[:id]
render json: @user, include:[:recipes]
end
def create
@user = User.create(
name: params[:na... | 24.333333 | 60 | 0.568493 |
913b7c8cfc4c4411a06a1b4490cf77694336ef30 | 27,896 | require "abstract_unit"
module CallbacksTest
class Record
include ActiveSupport::Callbacks
define_callbacks :save
def self.before_save(*filters, &blk)
set_callback(:save, :before, *filters, &blk)
end
def self.after_save(*filters, &blk)
set_callback(:save, :after, *filters, &blk)
... | 24.929401 | 112 | 0.632707 |
91b05698465a68c762cf44d89fb6dc630dafd7e1 | 21,214 | require "bundler"
require "bundler/vendored_thor"
module Bundler
class CLI < Thor
include Thor::Actions
AUTO_INSTALL_CMDS = %w(show binstubs outdated exec open console licenses clean)
def self.start(*)
super
rescue Exception => e
Bundler.ui = UI::Shell.new
raise e
end
def ... | 46.117391 | 167 | 0.659659 |
38d3c828cddd2cbac1999b8c6b362e9942555e1b | 1,744 | # 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... | 34.196078 | 79 | 0.690367 |
62442e88488e5dfc9bdb2bf045043f3cd1ad6c62 | 2,938 | module Faraday
class Adapter
class Typhoeus < Faraday::Adapter
self.supports_parallel = true
def self.setup_parallel_manager(options = {})
options.empty? ? ::Typhoeus::Hydra.hydra : ::Typhoeus::Hydra.new(options)
end
dependency 'typhoeus'
def call(env)
super
... | 29.089109 | 96 | 0.582029 |
7a613a757fce34ce9c073c3470f8ba46255d0ef8 | 971 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../shared/path', __FILE__)
describe "File#path" do
it_behaves_like :file_path, :path
end
describe "File.path" do
before :each do
@name = tmp("file_path")
end
after :each do
rm_r @name
end
it "returns the string ... | 23.682927 | 67 | 0.631308 |
d5569a25aefb5ea3cd6ca5655f4e7d3f2546c5c3 | 1,266 | # -*- encoding: utf-8 -*-
# stub: mini_backtrace 0.1.3 ruby lib
Gem::Specification.new do |s|
s.name = "mini_backtrace"
s.version = "0.1.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Ken Collins"]
s.date =... | 36.171429 | 166 | 0.669826 |
911ee5eaa5a375a43981a7e93c619571a2d71cae | 3,083 | require 'spec_helper'
require 'puppet/util/package/version/debian'
describe Puppet::Util::Package::Version::Debian do
context "when creating new version should fail" do
it "if is parsing symbols" do
expect { described_class.parse(:absent) }.to raise_error(described_class::ValidationFailure)
end
end
... | 36.702381 | 98 | 0.667207 |
e9697a1997af7aca0da931cec89083e329e73533 | 414 | module Puppet::Scheduler
require 'puppet/scheduler/job'
require 'puppet/scheduler/splay_job'
require 'puppet/scheduler/scheduler'
require 'puppet/scheduler/timer'
module_function
def create_job(interval, splay=false, splay_limit=0, &block)
if splay
Puppet::Scheduler::SplayJob.new(interval, splay... | 24.352941 | 68 | 0.729469 |
f75b94c14488a82240989c6b99bb928339e6967b | 9,146 | describe Docker::Compose::Session do
let(:shell) { double('shell', :interactive => false, :"interactive=" => true, :"chdir=" => true) }
subject(:session) { described_class.new(shell) }
let(:exitstatus) { 0 }
let(:status) { double('exit status', to_s: "pid 12345 exit #{exitstatus}", to_i: exitstatus) }
let(:o... | 39.593074 | 142 | 0.623879 |
282f97a4a994a028fa31c0f79a3f02eb83c621e8 | 40,522 | # 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,... | 46.684332 | 124 | 0.64824 |
8775cf1ab71e2bd333535b7206574b11183edb46 | 416 | require 'rails_helper'
RSpec.describe User, type: :model do
# Association test
# ensure User model has a 1:m relationship with the Todo model
it { should have_one(:step) }
# Validation tests
# ensure name, email and password_digest are present before save
it { should validate_presence_of(:name) }
it { s... | 32 | 66 | 0.745192 |
f8fc1058f1eb778a028a8d33dae0f9794f4ec5c7 | 2,720 | module Travis::API::V3
class Renderer::Repository < ModelRenderer
representation(:minimal, :id, :name, :slug)
representation(:standard, :id, :name, :slug, :description, :github_id, :github_language, :active, :private, :owner, :default_branch, :starred, :managed_by_installation, :active_on_org)
representa... | 34.871795 | 207 | 0.672794 |
4a6f58454cfe359054da0474a370cc7277db23dd | 3,478 | describe Travis::Yml, 'accept deploy', slow: true do
subject { described_class.schema }
xit { puts JSON.pretty_generate(subject[:definitions][:engineyard]) }
describe 'engineyard' do
describe 'username' do
it { should validate deploy: { provider: :engineyard, username: 'str' } }
it { should_not ... | 56.096774 | 96 | 0.641461 |
39a0e30de21f0c45b2d62de5a0eb8f0353c8f4e2 | 1,108 | def get_randomness(args)
args.state.upper_height ||= rand(310)
args.state.lower_height ||= 720 - args.state.upper_height
end
def jump(args)
args.state.player_accel = 10
end
def gravity(args)
args.state.player_accel = args.state.player_accel - args.state.gravity_coeff
end
def move_player(args)
args.state.pla... | 25.181818 | 78 | 0.716606 |
1aa54703324e6d8e4132577f5774ec0cb48f5274 | 1,856 | module RequestLogAnalyzer::Spec::Matchers
class HasLineDefinition
def initialize(line_type)
@line_type = line_type.to_sym
@captures = []
end
def capturing(*captures)
@captures += captures
return self
end
def matches?(file_format)
file_format = file_format.create ... | 24.103896 | 168 | 0.62069 |
3937ba4e35dde955990a07187e5e1a2f776f64fb | 348 | module Steps
module Abduction
class ChildrenHavePassportController < Steps::AbductionStepController
def edit
@form_object = ChildrenHavePassportForm.build(
c100_application: current_c100_application
)
end
def update
update_and_advance(ChildrenHavePassportForm)
... | 21.75 | 73 | 0.695402 |
2687deb831c989d3ce6b1afc6627b365f703b38c | 18,193 | $LOAD_PATH.unshift '/srv/whimsy/lib'
require 'weakref'
require 'whimsy/asf/config'
module ASF
module MLIST
# utility methods for handling mailing list attributes:
# - subscriptions
# - moderation
# whilst the source files are not particularly difficult to parse, it makes
# sense to centralise ... | 39.124731 | 141 | 0.643544 |
bff4f6aa00450900654fdd83d083f3411b9c7ccf | 76 | # typed: true
a&.x, = 0 # error: &. inside multiple assignment destination
| 19 | 60 | 0.684211 |
6237345bf2549c06a498fb8b680eeb4d2f154f8d | 268 | require "spec_helper"
describe Mogli::Client do
let :client do
Mogli::Client.new
end
it "fetches a user by id" do
client.should_receive(:get_and_map).with(12451752,Mogli::User).and_return("user")
client.user(12451752).should == "user"
end
end | 22.333333 | 85 | 0.697761 |
1c1f921914e3486f8fd9968dd334b057bc58d7eb | 849 | module SpreeeedBackend
require 'devise'
require 'bootstrap-will_paginate'
require 'simple_form'
require 'cocoon'
require 'spreeeed_backend/active_record_extend'
require 'spreeeed_backend/acts_as_option_tree'
class << self
mattr_accessor :name_space, :devise_auth_resource
self.name_space ... | 24.970588 | 74 | 0.706714 |
61e3b59fd7ee610abab3c2b67dff72c93ab7a80d | 5,197 | require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
require 'rubygems/source_info_cache'
class Gem::Commands::DependencyCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
def initialize
super 'dependency',
'Show the d... | 26.78866 | 79 | 0.612661 |
79a45532ed6ce28c7e1e750bc23761aec5fd0e7e | 652 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.6 | 74 | 0.754601 |
ed3f567d8a35f8d545a4749509aa1f7168e9a97e | 370 | #!/usr/bin/env ruby18
# Copyright:
# (c) 2006 syncPEOPLE, LLC.
# Visit us at http://syncpeople.com/
# Author: Duane Johnson (duane.johnson@gmail.com)
# Description:
# Makes an intelligent decision on which file to go to based on the current line or current context.
require 'rails_bundle_tools'
require 'rails/co... | 28.461538 | 102 | 0.756757 |
1a66a627bb3bf24d6664348ab381310b460c6013 | 1,159 | =begin
#Accounting API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 2.3.2
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module... | 27.595238 | 107 | 0.710958 |
bbce9bd98f434465f49c978b111b2227c4c2a67b | 587 | # frozen_string_literal: true
RSpec.describe ViewComponent::Storybook::Controls::ColorConfig do
subject { described_class.new(default_value, param: param, name: name) }
let(:type) { :color }
it_behaves_like "a simple controls config"
context "with :preset_color array" do
subject { described_class.new(de... | 29.35 | 106 | 0.734242 |
28c95edc40e5f8b9084720842f642234db649395 | 6,230 | =begin
#SCORM Cloud Rest API
#REST API used for SCORM Cloud integrations.
OpenAPI spec version: 2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'date'
module RusticiSoftwareCloudV2
# https://github.com/adlnet/xAPI-Spec/blob/1.0.2/xAPI.md#4162-contextactivities-property
class ... | 27.93722 | 107 | 0.605778 |
ab7fffa82bdf33672f2873e399b95c53644cc2bf | 1,621 | #
# Be sure to run `pod lib lint TestPod2.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 http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'TestPod2'
... | 38.595238 | 118 | 0.649599 |
1cb0e377b51c96003034925defd1950dda8cd851 | 7,189 | # -*- frozen_string_literal: true -*-
require "spec_helper"
describe RSplit do
it "has a version number" do
expect(RSplit::VERSION).not_to be_nil
end
describe String do
describe "#rsplit" do
it "throws a TypeError if the separator is Regexp" do
expect { "str".rsplit(/\w/) }.to raise_error... | 39.718232 | 96 | 0.484351 |
acd42b777bfe229843513709fd5a6dfcc63f20da | 8,342 | require 'digest'
RSpec.describe Percy::Cli::SnapshotRunner do
subject(:runner) { Percy::Cli::SnapshotRunner.new }
let(:root_dir) { File.expand_path('../testdata/', __FILE__) }
# Used for testing that paths are collapsed before use.r
let(:root_dir_relative) { root_dir + '/../testdata' }
describe '#initiali... | 34.614108 | 91 | 0.669384 |
2697876446cc070c5be76465f2664d1dd47361a6 | 2,419 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(
update_info(
... | 25.734043 | 88 | 0.529558 |
5dff5c91215b361736def028ac588d0143adef67 | 430 | When(/^I get help for "([^"]*)"$/) do |app_name|
@app_name = app_name
step %(I run `#{app_name} --help`)
end
# Add more step definitions here
Given(/^docker is installed$/) do
step %(I run `docker --version`)
step %(the output should contain "Docker version")
end
Given(/^curl is installed$/) do
step %(I ru... | 25.294118 | 95 | 0.653488 |
1a878eb23fe91318172046a7cc3df74f58069305 | 1,192 | require 'net/http'
require 'open-uri'
module Crawler
class NetHttp
def initialize
init_proxy
end
def request_response(url, limit = 10)
begin
http = Net::HTTP::Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass)
result = http.get_response(URI.parse(url))
case res... | 20.912281 | 83 | 0.564597 |
21bfc6b31a3914c51f03c13fbde9486734b5953b | 286 | rule "FC027", "Resource sets internal attribute" do
tags %w{correctness}
recipe do |ast|
find_resources(ast, type: :service).map do |service|
service unless (resource_attributes(service).keys &
%w{enabled running}).empty?
end.compact
end
end
| 28.6 | 57 | 0.65035 |
b95e019bb8cf71a5bf470c89c880c7f968c7fe16 | 576 | module DC
# The canonical server root, including SSL, if requested.
def self.server_root(options={:ssl => true, :agnostic => false })
url_for('server_root', options)
end
def self.cdn_root(options={:ssl => true, :agnostic => false })
url_for('asset_root', options)
end
def self.url_for(config, opti... | 25.043478 | 94 | 0.595486 |
1d1354c23ec20a3ee730c565158c56e3c03b957e | 3,423 | require "active_support/notifications"
module ActiveSupport
# Raised when <tt>ActiveSupport::Deprecation::Behavior#behavior</tt> is set with <tt>:raise</tt>.
# You would set <tt>:raise</tt>, as a behavior to raise errors and proactively report exceptions from deprecations.
class DeprecationException < StandardEr... | 37.615385 | 117 | 0.630733 |
e970ed2861a2a258c293dd8f193f4f528d56208f | 84 | move 'southwest'
move 'southeast'
move 'northwest'
move 'southwest'
move 'northwest' | 16.8 | 16 | 0.77381 |
f815bb44f25867ded60e0c1285ef995004a81a59 | 9,002 | require 'spec_helper'
describe 'cassandra-dse::default' do
shared_examples_for 'cassandra' do
context 'all_platforms' do
it 'enables cassandra service' do
expect(chef_run).to enable_service('cassandra')
expect(chef_run).to start_service('cassandra')
end
it 'creates the cassandr... | 31.921986 | 132 | 0.634081 |
21c3f1120139f101417a0d1d1efc92fc82d5409b | 186 | # frozen_string_literal: true
module FlexInfiniteScroll
class Engine < ::Rails::Engine; end
end
require 'flex_infinite_scroll/activerecord'
require 'flex_infinite_scroll/actionview'
| 20.666667 | 43 | 0.822581 |
e8262fd544c485f9dec757135d66515a75317b66 | 3,060 | #-- 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 ChiliProject, which is a fork ... | 34.382022 | 91 | 0.702288 |
3361ff426eaabe236c4b076176a3b817391a2686 | 436 | module Praxis
class MultipartPart
attr_accessor :body
attr_accessor :headers
attr_accessor :filename
def initialize(body, headers={}, filename: nil)
@body = body
@headers = headers
@filename = filename
end
def status
@headers['Status'].to_i
end
def encod... | 16.148148 | 51 | 0.600917 |
ede2596d951c902d7c7e11a1c42f50c12d19e70e | 456 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'simplecov'
# SimpleCov.minimum_coverage 95
SimpleCov.start
# This module is only used to check the environment is currently a testing env
module SpecHelper
end
require 'fastlane' # to import the Action super class
require 'fastlane/plugin/lock_keyc... | 28.5 | 101 | 0.791667 |
033b6e69673e75f128255279618fbbe71c631928 | 1,474 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "vcloud/walker/version"
Gem::Specification.new do |s|
s.name = 'vcloud-walker'
s.version = Vcloud::Walker::VERSION
s.authors = ['Government Digital Service']
s.homepage = 'https://github.com/gds-operations/vcloud-w... | 42.114286 | 102 | 0.660787 |
e8453b7899f693013fbfaa32850304053c4afe64 | 1,404 | # Equivalent to a header guard in C/C++
# Used to prevent the spec helper from being loaded more than once
unless defined? WEBBY_SPEC_HELPER
WEBBY_SPEC_HELPER = true
require 'rubygems'
require 'spec'
require 'fileutils'
require 'stringio'
begin
require 'fake_web'
$test_externals = true
rescue LoadError
$test_ex... | 23.4 | 79 | 0.717949 |
ff3bf6d6e9311530cf1c995ce7eb1f7cc3de4ad3 | 621 | cask 'paye-tools' do
version '17.2.17125.433'
sha256 'e8d2f9d27d873c120cd11343753fc23a917b27d8ddfbf32f65590409019f20b8'
url "https://www.gov.uk/government/uploads/uploaded/hmrc/payetools-rti-#{version}-osx.zip"
name 'Basic PAYE Tools'
homepage 'https://www.gov.uk/basic-paye-tools'
installer script: {
... | 34.5 | 94 | 0.605475 |
e29ab7aa9382a8c4204fba2318a43ce621aca519 | 715 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'proceso/version'
Gem::Specification.new do |spec|
spec.name = "proceso-rails"
spec.version = Proceso::VERSION
spec.authors = ["Bryan Goines"]
spec.email = ["bryann83@gmail.com"]... | 31.086957 | 56 | 0.634965 |
61024a7770a79a5e054fae6e28b42e40c52e8aee | 663 | # frozen_string_literal: true
class Comment::AfterUpdateCallback
def after_update(comment)
return unless comment.commentable.instance_of?(Product)
update_last_commented_at(comment)
update_commented_at(comment)
end
private
def update_last_commented_at(comment)
product = Product.find(comment.c... | 24.555556 | 65 | 0.769231 |
f837eabc128ea4d491506083cfceea90c6131735 | 1,156 | class Mighttpd2 < Formula
desc "HTTP server"
homepage "https://www.mew.org/~kazu/proj/mighttpd/en/"
url "https://hackage.haskell.org/package/mighttpd2-3.4.6/mighttpd2-3.4.6.tar.gz"
sha256 "fe14264ea0e45281591c86030cad2b349480f16540ad1d9e3a29657ddf62e471"
license "BSD-3-Clause"
revision 1
livecheck do
... | 31.243243 | 94 | 0.763841 |
e9c40096c28c718def63b88613b094450d16c0f1 | 599 | class Flow::Base
attr_reader :list, :account
def initialize(account, flow, unknown, list, previous_flow)
@account = account
@list = list
@account_name = account.name
@flow = flow
@previous_flow = previous_flow
@unknown = unknown
end
def percentage
return nil if flow < 0
plus_sum ... | 19.966667 | 61 | 0.652755 |
e20389d3cc7332fa7d778304067cbf3ba3fdf625 | 4,221 | require "json"
require "open3"
def hcl2json(tf)
stdout, stderr, exit_status = Open3.capture3("hcl2json", { stdin_data: tf })
unless exit_status.success?
warn stderr
end
JSON.parse(stdout)
end
def get_lbs(tf)
tf.dig("resource", "aws_lb").values
end
def get_tgs(tf)
tf.dig("resource", "aws_lb_target_g... | 27.588235 | 90 | 0.613599 |
38bda84464fca22bcc40d75409e6160695264b8f | 193 | module Libcouchbase::Ext
# (Not documented)
#
# ## Fields:
# :v0 ::
# (DURABILITYOPTSv0)
class DurabilityOptsStV < FFI::Union
layout :v0, DURABILITYOPTSv0.by_value
end
end
| 16.083333 | 41 | 0.65285 |
6acc9bcab0c6a7e481694360068e949068bee20d | 367 | $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
require 'rubystats/binomial_distribution'
t = 100
f = 7
p = 0.05
bin = Rubystats::BinomialDistribution.new(t,p)
f = f - 1
mean = bin.mean
puts mean
for i in 1..12
pdf = bin.pdf(i)
cdf = bin.cdf(i)
inv = bin.icdf(cdf)
pval = 1 - cdf
# puts inv
pu... | 15.956522 | 57 | 0.604905 |
e8b9a7d5dcbf19bdadec836e3b03138e557d0e12 | 876 | Gem::Specification.new do |spec|
spec.name = "lita-slack-actions"
spec.version = "0.1.0"
spec.authors = ["Guillermo Moreno"]
spec.email = ["gmq@guillermomoreno.cl"]
spec.summary = "Handle Slack's interactive message payloads"
spec.license = "MIT"
spec.metadata ... | 38.086957 | 74 | 0.65411 |
799ce82271a1c112a2501688c4abc99e1b88d4fa | 1,724 | # Represents objects where permissions should be based on ownership.
#
# Implementations that have a `perms_ident` method, that will be used to generate the location in the permissions hash
# If this is not present, the class name downcased and pluralized will be used.
#
# Implementations that have the `handle_ids` met... | 43.1 | 143 | 0.711137 |
4a3b349c8b37470b97b8f0e7cc2202050cd97c4c | 85 | json.extract! @account, :id, :description, :top_account_id, :created_at, :updated_at
| 42.5 | 84 | 0.764706 |
bbb56c76f0cacb0ad79b88dce4b202fb94648e5a | 41 | # placeholder to make this a rails plugin | 41 | 41 | 0.804878 |
ac93d71632867d2d22c68238e66cd60d8ee179a1 | 175,951 | # 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::Proton
module Types
# @note When making an API call, you ma... | 32.771652 | 135 | 0.628857 |
87c8dd82a082c4fad9d3272366289196be595497 | 230 | require_dependency "sudo_mode/application_controller"
module SudoMode
class ConfirmationController < ApplicationController
def new
@submit_path = params[:redirect_to]
@method = params[:method]
end
end
end
| 20.909091 | 54 | 0.747826 |
0377daa7d3bcfc71efeecc29f9ed258eee6215e8 | 128 | require "minitest/autorun"
require "octicons"
def octicon(symbol, options = {})
::Octicons::Octicon.new(symbol, options)
end
| 18.285714 | 42 | 0.734375 |
38fb32de920fa4065cd48b39a4b70ff9ae6c5a57 | 72 | module Administrador
class ApplicationJob < ActiveJob::Base
end
end
| 14.4 | 40 | 0.791667 |
6a1fee109941eb4f617c6ebe641d72963b3fabeb | 418 | FactoryGirl.define do
factory :comic do
ISBN13 "9781845764944"
ISBN10 "1845764943"
title "The Boys #1"
release_date 2007
edition 1
language "EN"
format "Colour comic strip"
shape "258 x 170mm"
pages 152
price 9.95
description "Meet Billy Butcher. He’s not a nice man, an... | 24.588235 | 129 | 0.672249 |
1d837293d1009c5192162ab6f13366c9b368d6cb | 185 | require 'minitest/autorun'
require 'minitest/rg'
require './lib/codemark.rb'
INTRO_RMD = File.read("./spec/fixtures/sem-intro.Rmd")
INTRO_R = File.read("./spec/fixtures/sem-intro.R")
| 23.125 | 54 | 0.72973 |
ed31ea18cd2f01d65c6f68fce05ba20f4ddf0949 | 494 | class Backend::Framework::Adapters::HttpController < ApplicationController
def index
@game = Game.where('team_id_home=? OR team_id_away=?', params[:team_id])
end
def details
end
def start_match
cmd = Framework::Commands::StartNewMatch.new(game_params)
execute(cmd)
head :ok
end
def... | 14.969697 | 93 | 0.678138 |
1d9be44a2c42269439744d398ea92b95e09c66f9 | 490 | # == Schema Information
#
# Table name: contacts
#
# id :integer not null, primary key
# date_on :date
# content :text
# means :string
# owner :string
# lead_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_con... | 18.846154 | 53 | 0.630612 |
ac3b71d5817637a9bf8754d28c284f74b11e41dc | 404 | class <%= migration_class_name %> < ActiveRecord::Migration
def self.up
create_table :<%= table_name %> do |t|
t.string :locale
t.string :key
t.text :value
t.boolean :is_proc, :default => false
t.timestamps
end
add_index :<%= table_name %>, :locale
add_index :<%= ta... | 22.444444 | 59 | 0.596535 |
790ecffa127d005a30b9d58800b2bc16c0be654d | 1,616 | # encoding: utf-8
module Mongoid
module Relations
module Touchable
extend ActiveSupport::Concern
module ClassMethods
# Add the metadata to the touchable relations if the touch option was
# provided.
#
# @example Add the touchable.
# Model.touchable(meta)
... | 26.064516 | 77 | 0.543936 |
ffe0676471eff553ee47d89110d8c519fbeaf972 | 328 | class ActivityComment < ApplicationRecord
audited associated_with: :activity, on: [:destroy]
belongs_to :activity, counter_cache: true, touch: true
belongs_to :person
validates :body, presence: true
PERMITTED_ATTRIBUTES = [:body, :created_at, :overwrite, :person_id, :updated_at, :updated_in_db_at, :id].fre... | 29.818182 | 113 | 0.762195 |
2117f88d40095adee457b6687c132235faac5b73 | 196 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work ConferenceItem`
module Hyrax
module Actors
class ConferenceItemActor < Hyrax::Actors::BaseActor
end
end
end
| 19.6 | 56 | 0.760204 |
ac5cff0586a43be253c0f5731b03479aa6412553 | 979 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v9/services/group_placement_view_service.proto
require 'google/ads/google_ads/v9/resources/group_placement_view_pb'
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require... | 32.633333 | 171 | 0.775281 |
1dfee99d7ff84349a352ced6fceb883f384aefbb | 449 | # Copyright 2014 Mainio Tech Ltd.
#
# @author Antti Hukkanen
# @license See LICENSE (project root)
class RemoteController < ApplicationController
before_action :set_project
private
# Use callbacks to share common setup or constraints between actions.
def set_project
@project = Project.find(p... | 21.380952 | 73 | 0.694878 |
ab3a4a736ea9e420fd87e8ab4c5c917e6444a7f6 | 1,813 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 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 ... | 38.574468 | 131 | 0.777716 |
18c0db29884b55ed1771786e22bfbe9e1710b9f2 | 616 | class Quality
include Mongoid::Document
include Mongoid::Timestamps
extend Dragonfly::Model
field :name, :type => String
field :link, :type => String
field :image_uid, :type => String
dragonfly_accessor :image
belongs_to :gathering, index: true
belongs_to :account, index: true
validates_pr... | 20.533333 | 48 | 0.62987 |
e8600c48725899b40114caeb8acc90e2af4c8b98 | 759 | module Kratom
module LayoutEmbedded
private
def render_with_layout
layout.render { render }
end
def layout
site.templates.get(layout_name)
rescue MissingResourceError => e
raise MissingResourceError, missing_layout_message(layout_name)
end
def missing_layout_message(la... | 24.483871 | 70 | 0.635046 |
796299a69762b91b02758ec9c62c6760dea7b9e1 | 86 | module DbdDataEngine
class ApplicationController < ActionController::Base
end
end
| 17.2 | 54 | 0.825581 |
5d2ff1a22bda43f87a20be31dc5b7e8a919c81f4 | 45 | module FastTools
VERSION = "0.1.0.pre"
end
| 11.25 | 23 | 0.688889 |
bf696ec41d5d6878bfb4db0c53caae66cb4f6142 | 1,338 | # -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
require 'looker-sdk/version'
Gem::Specification.new do |s|
s.name = 'looker-sdk'
s.version = LookerSDK::VERSION
s.date = "#{Time.now.strftime('%F')}"
s.authors = ['Looker']
s.email = 'opensource+sdkruby@looker.... | 46.137931 | 120 | 0.64574 |
bfbff8412a64eee7bbb43c740d1d32933d7a55df | 1,306 | Pod::Spec.new do |s|
s.name = 'Validator'
s.platform = :ios
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '10.0'
s.version = '3.1.1'
s.summary = 'Validator is a user input validation library written in Swift.'
s.description = <<-DESC
Validator is a user input validation library written in... | 32.65 | 87 | 0.669985 |
79c8019f2a92bee8c32e09b859f3dd64a3c533cf | 899 | cask 'colorsnapper' do
version '1.5.1'
sha256 '7e14a69e521153d9aa6fb8c75932b52e1ddb0f60b00178123fc0636b32010016'
# cs2-binaries.s3.amazonaws.com was verified as official when first introduced to the cask
url "https://cs2-binaries.s3.amazonaws.com/ColorSnapper2-#{version.dots_to_underscores}.zip"
appcast 'htt... | 39.086957 | 94 | 0.708565 |
1afafe58188ba9c578a7ce1414304db85e2f5f88 | 1,139 | Gem::Specification.new do |s|
s.name = 'logstash-input-bitbucket'
s.version = '0.1.0'
s.licenses = ['Apache-2.0']
s.summary = 'BitBucket input plugin'
s.description = 'Import data from BitBucket server to aggregate analytic data'
s.homepage = 'http://liatr.io'
s.authors ... | 39.275862 | 120 | 0.644425 |
bf6ea4e9649a692177e17f8e43ebce8a6b856e5b | 3,519 | class Mapnik < Formula
desc "Toolkit for developing mapping applications"
homepage "https://mapnik.org/"
url "https://github.com/mapnik/mapnik/releases/download/v3.1.0/mapnik-v3.1.0.tar.bz2"
sha256 "43d76182d2a975212b4ad11524c74e577576c11039fdab5286b828397d8e6261"
license "LGPL-2.1-or-later"
revision 7
he... | 34.165049 | 123 | 0.693379 |
ff7ec0d572f9038e32195602920af9183361d49a | 5,506 | # Copyright (c) 2016, 2021, 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... | 34.198758 | 245 | 0.666364 |
e890a6678f540729ce7bd5a16d2ac91057f79e4a | 15,016 | # coding: utf-8
# Usage:
# $ gem install rmath3d_plain
# $ ruby test_convex_decomposition.rb
require 'pp'
require 'opengl'
require 'glfw'
require 'rmath3d/rmath3d_plain'
require_relative 'nanovg'
require_relative 'compgeom/convex_partitioning'
require_relative 'compgeom/intersection'
OpenGL.load_lib()
GLFW.load_lib()... | 30.335354 | 273 | 0.642914 |
01d6ef577956338921761b18e2a6a7fe8a552670 | 183 | class TestMrubyRustRegexp < MTest::Unit::TestCase
def test_escape
assert_equal RustRegexp.escape('\\'), '\\\\'
assert_equal RustRegexp.escape('fucking'), 'christ'
end
end
| 26.142857 | 55 | 0.710383 |
79c4ad41811507249a840cc6f84db32bedcf43f8 | 270 | class CreateLogins < ActiveRecord::Migration[5.2]
def change
create_table :logins, id: :uuid do |t|
t.references :user, foreign_key: true, type: :uuid
t.references :service_provider, polymorphic: true, type: :uuid
t.timestamps
end
end
end
| 24.545455 | 68 | 0.681481 |
bb8b5bc7bc78e3827050e3c27697b855ae2eb8a9 | 623 | # frozen_string_literal: true
# == Schema Information
#
# Table name: alchemy_essence_htmls
#
# id :integer not null, primary key
# source :text
# creator_id :integer
# updater_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
module Alchemy
cla... | 24.92 | 120 | 0.686998 |
ffabc13cf8e7e9778d8965065d212c5fb460631b | 6,920 | =begin
#Site Manager API
#Site Manager API
The version of the OpenAPI document: 1.0.0
Contact: autosde@il.ibm.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
=end
require 'date'
module OpenapiClient
# NativeCapability
class NativeCapability
# name
attr_accesso... | 28.833333 | 209 | 0.612861 |
335f0cc4cb9106b245756ff13224997aae6d9004 | 1,951 | # 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::V2020_06_01
module Models
#
# Describes the destination of connection monitor.
#
class ConnectionMonitorDesti... | 27.478873 | 77 | 0.530497 |
e21ef6fdc28535d9f24810e90452c63fb20a3f49 | 1,956 | require_relative 'pieces'
require_relative '../chess_utils/chess_utils'
class Board
include ChessUtils
include ChessUtils::Renderable
def initialize
@rows = Array.new(SIZE) { Array.new(SIZE) }
end
def [](pos)
row, col = pos
rows[row][col]
end
def []=(pos, piece)
row, col = pos
rows... | 18.628571 | 72 | 0.623211 |
03e3ca9e593ca0e3c9aea4804dfe919779643846 | 3,614 | class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
before_action :require_login
before_action :check_if_admin
# GET /users
# GET /users.json
def index
@title = 'Home'
@this_user = Admin.find(session[:user_id])
@users = User.all
@ca... | 25.814286 | 143 | 0.637797 |
1d4cc20a46772fcf18834b9caca80b0b27052fe4 | 135 | require 'rails_helper'
RSpec.describe Products::Product, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 22.5 | 56 | 0.748148 |
e99c18edfcf2cc5e152aac5740089a6681cfa8cf | 1,251 | module Dothoop
class ProfileResource < ResourceKit::Resource
include ErrorHandlingResourcable
resources do
# GET /profile
action :all do
verb :get
path "#{Dothoop.configuration.path_url}/profile"
handler(200) { |response| ProfileMapping.extract_collection(response.body, :... | 30.512195 | 107 | 0.649081 |
ed11a0fe20a6da1a52d073955ebb9da478d81f0f | 2,482 | class Elm < Formula
desc "Functional programming language for building browser-based GUIs"
homepage "https://elm-lang.org"
url "https://github.com/elm/compiler/archive/0.19.1.tar.gz"
sha256 "aa161caca775cef1bbb04bcdeb4471d3aabcf87b6d9d9d5b0d62d3052e8250b1"
license "BSD-3-Clause"
bottle do
cellar :any_s... | 31.820513 | 108 | 0.61805 |
61af797f97194ec649b4a487c9f98708ce6d046d | 2,689 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::DataBox::Mgmt::V2018_01_01
module Models
#
# Operation Collection.
#
class OperationList
include MsRestAzure
include MsRest::JSO... | 27.161616 | 80 | 0.509483 |
086bf8aad72540582bcc0e3c1fbab7db24300d49 | 92 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "server_side_validation"
| 30.666667 | 58 | 0.771739 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.