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 |
|---|---|---|---|---|---|
ff99688ad7faca3d59f71077b929d69ee1dbf04e | 176 | FactoryBot.define do
factory :maintenance_type do
name { 'Test Maintenance Type' }
description { 'Test Maintenance Type description' }
active { true }
end
end
| 19.555556 | 55 | 0.698864 |
08ed46aeb47a4efe340447ca0d4fdfb2f0f98c19 | 243 | Deface::Override.new(
virtual_path: 'spree/admin/shared/sub_menu/_product',
name: 'sales_schedules_admin_tab',
insert_bottom: '[data-hook="admin_product_sub_tabs"]',
text: '<%= tab(:sales_schedules, label: "sales_schedules") %>'
) | 40.5 | 65 | 0.720165 |
b921a7416bffeed5826b5e39d46a60ce8231f72f | 372 | require "spec_helper"
describe OpenXml::Pptx::Properties::FontReferenceItalic do
include PropertyTestMacros
it_should_use tag: :italic, name: "font_reference_italic"
for_attribute(:rid) do
with_value("rId256") do
it_should_assign_successfully
it_should_output "<p:italic r:id=\"rId256\"/>"
e... | 21.882353 | 59 | 0.75 |
ff4a200170f1da3cb4ec23b90bd2fdfc3e2657e4 | 2,112 | describe Travis::API::V3::Services::User::Find, set_app: true, billing_spec_helper: true do
let(:user) { Travis::API::V3::Models::User.find_by_login('svenfuchs') }
let(:token) { Travis::Api::App::AccessToken.create(user: user, app_id: 1) }
let(:headers) {{ 'HTTP_AUTHORIZATION' => "token #{token}" ... | 42.24 | 160 | 0.553504 |
1c1347c5a570b01545b4b069bb26173ab58c5d81 | 3,010 | # frozen_string_literal: true
module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize
include ActionView::Helpers::UrlHelper
# We use a class method here instead of a constant, allowing EE to redefine
# the returned `Hash` more easily.
def self... | 33.444444 | 338 | 0.73588 |
03e9917fc8b242d7fdfbec58aebd1e3efed25c05 | 3,315 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' ... | 32.821782 | 130 | 0.606033 |
e9ddc6634490ec658bda9b57c47d5be206d84925 | 2,377 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 36.015152 | 87 | 0.754733 |
03ea5fdda6e545ae736c3dc4348933f4f0b09a2f | 3,404 | # 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::KeyVault::V2016_10_01
module Models
#
# The deleted certificate item containing metadata about the deleted
# certificate.
#
... | 29.859649 | 79 | 0.46651 |
876a89679de3a72adbd07d88943ada82e0b39d28 | 1,730 | # necessary when requiring fog without rubygems while also
# maintaining ruby 1.8.7 support (can't use require_relative)
__LIB_DIR__ = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift __LIB_DIR__ unless $LOAD_PATH.include?(__LIB_DIR__)
require 'fog/version'
# Use core
require 'fog/core'
# Previously treat... | 25.820896 | 75 | 0.786705 |
79084feedc6be63b0da3d5915c19fbb820df21df | 1,846 | class Chezmoi < Formula
desc "Manage your dotfiles across multiple diverse machines, securely"
homepage "https://chezmoi.io/"
url "https://github.com/twpayne/chezmoi.git",
tag: "v2.7.1",
revision: "87033e249b13c1b82c83aee248f6569f3efe26a3"
license "MIT"
head "https://github.com/twpayne/chezmo... | 40.130435 | 122 | 0.734561 |
2195f573008c447a208f473ccab55c19f0e2a964 | 556 | Pod::Spec.new do |s|
s.name = 'BugshotKit'
s.version = '0.1.0'
s.summary = 'In-app bug reporting for developers and testers, with annotated screenshots and the console log.'
s.homepage = 'https://github.com/marcoarment/BugshotKit'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Marco Arment... | 39.714286 | 112 | 0.652878 |
6115262ce2cf4504939157cc10ac9bd80b0ff495 | 203 | require 'rubygems'
require 'test/unit'
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'linesource'
class Test::Unit::TestCase
end
| 20.3 | 66 | 0.748768 |
392e68fa38e213fd26c146f67de1095a872608be | 2,287 | # 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_02_01
module Models
#
# Describes the storage location for a packet capture session.
#
class PacketCapt... | 30.493333 | 79 | 0.557499 |
0818d4da1b924c94f08c581e8ffe03d7df31c48f | 1,952 | require "capistrano/dsl/authorized_keys_paths"
require "capistrano/authorized_keys/helpers"
include Capistrano::AuthorizedKeys::Helpers
include Capistrano::DSL::AuthorizedKeysPaths
AUTHORIZED_KEYS_ABORT_MESSAGE = "The following hosts have an invalid authorized keys file: %s".freeze
namespace :authorized_keys do
de... | 33.084746 | 131 | 0.752561 |
ed21fbfd5b9c546edabe4d9aa4656948843a805f | 313 | class FontCrushed < Formula
head "https://github.com/google/fonts/raw/main/apache/crushed/Crushed-Regular.ttf", verified: "github.com/google/fonts/"
desc "Crushed"
homepage "https://fonts.google.com/specimen/Crushed"
def install
(share/"fonts").install "Crushed-Regular.ttf"
end
test do
end
end
| 28.454545 | 122 | 0.731629 |
262682f7df5b65e5ee7e22548f61f947f8d4e352 | 1,770 | Pod::Spec.new do |s|
# 框架的名称
s.name = "MageBRPickerView"
# 框架的版本号
s.version = "2.7.5"
# 框架的简单介绍
s.summary = "A custom picker view for iOS."
# 框架的详细描述(详细介绍,要比简介长)
s.description = <<-DESC
A custom picker view for iOS, Include "日期选择器,时间选择器,地址选择器,自定义字符串选择器,支持自定义样式,适配深色... | 28.095238 | 139 | 0.641808 |
f754cdc231b8b404cef8abf780aaa553a53ea1df | 5,173 | require 'spec_helper'
require 'timecop'
require './app/controllers/monitoring/status_controller'
describe Monitoring::HealthController, type: :controller do
routes { monitoring::Engine.routes }
let(:time) { Time.local(1990) }
before do
Timecop.freeze(time)
end
after do
Timecop.return
end
desc... | 24.286385 | 92 | 0.506283 |
187fc0615d8ee72f8d837a898a73eaa6427221b5 | 469 | require 'notaru/includes'
module Notaru
class Notaru
def initialize
@bot = Configuration.parse
if @bot.config.logging
logfile = storage(File.join('logs', 'irc.log'))
@bot.loggers << Cinch::Logger::FormattedLogger.new(File.open(logfile, 'w+'))
end
end
def start
@b... | 18.76 | 84 | 0.618337 |
ff3ca9df50213046facff7b6bc80c363b3a3dafe | 719 | #!/usr/bin/env ruby -w
require 'rmagick'
# Demonstrate the Image#enhance method
img = Magick::Image.read('images/Flower_Hat.jpg').first
img = img.add_noise(Magick::UniformNoise)
eimg = img.enhance
# Zoom in so we can see the change
img.resize!(3)
eimg.resize!(3)
# Make a before-and-after composite
e... | 24.793103 | 72 | 0.7121 |
03989eb667847af7916d94bcad31786353a039f2 | 247 | require 'rails_helper'
RSpec.describe Admin::ArticlesController, type: :controller do
# describe "GET #show" do
# it "returns http success" do
# get :show
# expect(response).to have_http_status(:success)
# end
# end
end
| 19 | 62 | 0.668016 |
4a63a88e54f753803f2dfdb7dfd0597d190a9858 | 2,950 | module CartoDB
class UserOrganization
def initialize(org_id, owner_id)
@owner = User.where(:id => owner_id).first
raise "The organization needs a owner" if @owner.nil?
if !@owner.organization_id.nil? && @owner.organization_id != org_id
raise "The user already has a organization and ... | 31.382979 | 106 | 0.655593 |
08bb341c40f1845793657198a8ead1ca199d95be | 2,792 | # frozen_string_literal: true
# Copyright 2016-2019 New Context, 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 b... | 28.20202 | 104 | 0.688395 |
2641d7cfc0c83870653446298e2e9c22d1ac31b9 | 528 | Pod::Spec.new do |s|
s.name = "iOSDetector"
s.version = "0.1.3"
s.summary = "Tiny Utility for iOS."
s.homepage = "https://github.com/azu/iOSDetector"
s.license = 'MIT'
s.author = { "azu" => "azuciao@gmail.com" }
s.source = { :git => "https... | 33 | 99 | 0.541667 |
ac987a50f19cfef15541b520ed14961efc7b131b | 287 | require_relative "recurse_try/version"
require_relative "recurse_try/plugin_methods"
require_relative "recurse_try/method_class"
require_relative "recurse_try/version"
module RecurseTry
def self.included(klass)
klass.include PluginMethods
klass.extend PluginMethods
end
end
| 23.916667 | 45 | 0.832753 |
91402042448e172012a5393bb1f1b5038dc45d58 | 246 | class CreateProjectmanagerRelationships < ActiveRecord::Migration[5.1]
def change
create_table :projectmanager_relationships do |t|
# 项目用户管理多对多
t.integer :user_id
t.integer :project_id
t.timestamps
end
end
end
| 22.363636 | 70 | 0.711382 |
1c93713cd53235a90d18a8e1349a5cc6ea642d8c | 960 | require 'gtt_5t_api_client/time_table/dom_table'
module Gtt5tApiClient
class TimeTable
PATH = '/5t/trasporto/arrival-times-byline.jsp'
def initialize(stop_id, datetime)
@stop_id = stop_id
@datetime = datetime
@base_url = "#{SCHEME}://#{BASE_DOMAINE}#{PATH}"
end
def times
@ti... | 20 | 129 | 0.623958 |
4a8c0f31ebc7c80ad08238947ab362e33fcc570e | 1,973 | require 'matrix'
class Sudoku
def initialize(grid)
@grid = grid
end
def is_valid
Board.new(@grid).solved?
rescue ArgumentError
false
end
class Board
attr_reader :grid, :block_size
def initialize(grid)
assert_dimensions(grid)
@grid = grid
@valid_chunk = (1..grid.siz... | 21.922222 | 87 | 0.601115 |
1dc25f47c11b95fce6417c22213ca3d53926eff8 | 7,229 | #-------------------------------------------------------------------------
# # Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | 36.882653 | 119 | 0.553742 |
916546bc0a209ace5f75cf38e3b9744de0d1c0f8 | 1,031 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "grape_on_rails_routes"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into file... | 38.185185 | 99 | 0.734239 |
28974849a7f7eb11a95b4ac1a3b519eb031c6f06 | 338 | class Entry
def initialize( entry_id, author, date, title, html )
@entry_id = entry_id
@author = author
@date = date
@title = title
@html = html
end
def entry_id
return @entry_id
end
def author
return @author
end
def title
return @title
end
def date
return @date
end
def html
retu... | 10.903226 | 55 | 0.662722 |
ff080721476cf55c92137c8cf550db2da7a075a4 | 1,756 | module ActiveScaffold
module Bridges
class FileColumn
module FileColumnHelpers
class << self
def file_column_fields(klass)
klass.instance_methods.select { |m| m.to_s =~ /_just_uploaded\?$/ }.collect { |m| m[0..-16].to_sym }
end
def generate_delete_helpers(k... | 31.927273 | 124 | 0.590547 |
331c082525410b804f0d6b6324e489dd453d5723 | 1,144 | class FakeColor
def initialize(text); @text = text; end
%w{ red green yellow blue underline }.each do |m|
define_method(m){ @text }
end
end
class VanillaText
class << self
def apply
String.class_eval do
def colored
FakeColor.new self
end
def unindent ... | 17.875 | 72 | 0.532343 |
e8bd95b707635742863ac5e8ffb436e4ea57fdbd | 13,271 | # 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... | 46.893993 | 249 | 0.735363 |
fff01731e55b1a98dbc4366653ac3a42cbf61381 | 12,312 | =begin
#UltraCart Rest API V2
#UltraCart REST API Version 2
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.15-SNAPSHOT
=end
require 'date'
module UltracartClient
class ItemOptionValue
# Additional dimens... | 32.832 | 273 | 0.649204 |
7a6120ce512caeecc08853c94c87570be60835ba | 387 | module Speed
def go_fast
p "I am an instance of #{self.class} and I can run very fast"
end
end
class Car
include Speed
def go
p "I am an instance of Car and I go with normal speed"
end
end
class Truck < Car
def go_slow
p "I am an instance of Truck and I go with slow speed"
end
end
Car.new.g... | 15.48 | 65 | 0.700258 |
1da955814797f66bc5482a10403847245b9cec90 | 3,573 | ##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
require 'msf/core/post/windows/services'
class ... | 31.619469 | 159 | 0.684859 |
7919cf79090facad2cecd7472279bb47620d8670 | 1,127 | =begin
#Kubernetes
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require 'spec_helper'
require 'json'
# Unit tests for Kuberne... | 23.978723 | 102 | 0.735581 |
5d64d916c7191fb2f2c08bf9b5da4ca5b7145bd5 | 275 | require 'test_helper'
class LinkParserTest < Minitest::Test
def test_parse
@html = File.read File.expand_path("track_fragment.html", "test/data")
assert_equal "https://mp3mp3.site/start.php?q=-50678799_422765730",
Sektor::LinkParser.parse(@html)
end
end
| 22.916667 | 74 | 0.727273 |
abb2466d07284b61c5895e3f0d321de926d0d33e | 505 | load 'tasks/audit_code.rake'
load 'tasks/ci/brakeman.rake'
load 'tasks/ci/bundle_audit.rake'
load 'tasks/ci/commit_cop.rake'
load 'tasks/ci/dependencies.rake'
load 'tasks/ci/housekeep.rake'
load 'tasks/ci/linguist.rake'
load 'tasks/ci/minitest.rake'
load 'tasks/ci/notes.rake'
load 'tasks/ci/prometheus.rake'
load 'tasks... | 28.055556 | 33 | 0.768317 |
b936c2fe20077f6513c8bf561c1b505a88d8703e | 3,248 | module Sorcery
module Controller
module Submodules
module External
module Providers
# This module adds support for OAuth with microsoft liveid
# When included in the 'config.providers' option, it adds a new option, 'config.liveid'.
# Via this new option you can configur... | 34.924731 | 106 | 0.44181 |
39e8ea2e11eeba93cc04daad1d3200d7485b9c05 | 320 | # frozen_string_literal: true
FactoryBot.define do
factory :project_repository do
project
after(:build) do |project_repository, _|
project_repository.shard_name = project_repository.project.repository_storage
project_repository.disk_path = project_repository.project.disk_path
end
end
end
| 24.615385 | 83 | 0.778125 |
26a5d1c2f22c8857879a2ea2830809f6203b0695 | 2,206 | class Znc < Formula
desc "Advanced IRC bouncer"
homepage "https://wiki.znc.in/ZNC"
url "https://znc.in/releases/archive/znc-1.7.1.tar.gz"
sha256 "44cfea7158ea05dc2547c7c6bc22371e66c869def90351de0ab90a9c200d39c4"
revision 1
bottle do
sha256 "29762087ad3267dd6b7164aad34e6cbe6316efe0d5d858b6bb20405b89f37e... | 30.219178 | 106 | 0.652312 |
87b0a27289b1192b832e6482162570835c93caea | 794 | require "erb"
module Wps
module Apis
module Authen
def index(redirect_uri, state, scope = :user_info)
uri = ERB::Util.url_encode(redirect_uri)
"#{URI::join(API_BASE_URL, 'oauthapi/v2/authorize')}?redirect_uri=#{uri}&appid=#{app_id}&state=#{state}&response_type=code&scope=#{scope}"
end... | 31.76 | 146 | 0.662469 |
ac452cb7c227a45a69183da9d9b8b3c2f3d09000 | 2,443 | # frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'opentelemetry/instrumentation/que/version'
Gem::Specification.new do |spec|
spec.name = 'opentel... | 47.901961 | 193 | 0.724928 |
1d2c38b127b11f95bc3ca2ddff1a7a24bdc815b3 | 187 | require "test_helper"
class PlayerTest < Minitest::Test
def setup
@player = Minesweeper::Player.new
end
def test_that_it_has_a_player_class
refute_nil @player
end
end
| 13.357143 | 37 | 0.737968 |
919d0626a9484e52d59494a01c4645eff0028fa8 | 1,062 | #
# Be sure to run `pod spec lint JPushApiManager.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://gi... | 36.62069 | 103 | 0.629002 |
5d997dd3b87b6b1b4aca4112c35dee63fe4fa76d | 3,556 | #
# Lockstep Software Development Kit for Ruby
#
# (c) 2021-2022 Lockstep, Inc.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @author Ted Spence <tspence@lockstep.io>
# @author Manish Narayan B S <manish.n@lockstep.io>
# @autho... | 41.348837 | 317 | 0.639483 |
39c79e10e3412a81ff8c43d3747944396c03c51d | 338 | name 'gusztavvargadr_packer_sql17d'
maintainer 'Gusztáv Varga'
maintainer_email 'me@gusztavvargadr.me'
license 'MIT'
description 'Installs/Configures Packer SQL Server 2017 Developer'
long_description 'Installs/Configures Packer SQL Server 2017 Developer'
version '0.0.0'
depends 'gusztavvargadr_packer_w'
depends 'gusz... | 30.727273 | 71 | 0.840237 |
f87aa0b4d5d8eb782c19cf3de5960f8266d87465 | 869 | Pod::Spec.new do |s|
s.name = "AppSendr-iOS-SDK"
s.version = "1.0"
s.summary = "iOS SDK for AppSendrPlus"
s.description = <<-DESC
Use AppSendr iOS SDK in your application to automatically download the latest version available on OTA.
DE... | 23.486486 | 122 | 0.565017 |
62bf6fdf2d93040c9f26d60e377edf18fd87096e | 1,243 | # frozen_string_literal: true
class ContributorName < ApplicationRecord
belongs_to :publication, inverse_of: :contributor_names
belongs_to :user, inverse_of: :contributor_names, optional: true
validates :publication, :position, presence: true
validate :at_least_one_name_present
delegate :webaccess_id, to: ... | 30.317073 | 111 | 0.718423 |
03b640d18db27c5bb2780b94c55ff0df474c0964 | 96 | require 'date'
describe "DateTime.jd" do
it "needs to be reviewed for spec completeness"
end
| 16 | 49 | 0.75 |
e223d5237899a5fd8d9e97d6fab38ff9bbb209ce | 319 | class YoutubeUploadLimitExceededException < StandardError
def initialize(message = nil)
if message.nil?
message = getDefaultMessage
end
@message = message
super
end
def getDefaultMessage
'Youtube uploadLimitExceeded: The user has exceeded the number of videos they may upload.'
end
end | 22.785714 | 94 | 0.742947 |
262a1141e00f498da92d3605e64d0441408e35b2 | 197 | module Bot::DiscordEvents
module Heartbeat
extend Discordrb::EventContainer
heartbeat do |_event|
puts "Heartbeat at #{Time.now}"
end
end
end | 24.625 | 47 | 0.57868 |
91decef22a0d3bfeffcee8d83caa00da7343e601 | 1,575 | # Encoding: UTF-8
[{beforeRunningCommand: "nop",
command:
"#!/usr/bin/env ruby\n\nrequire ENV['TM_BUNDLE_SUPPORT'] + \"/lib/spec/mate/switch_command\"\nSpec::Mate::SwitchCommand.new.go_to_twin(ENV['TM_PROJECT_DIRECTORY'], ENV['TM_FILEPATH'])",
input: "none",
keyEquivalent: "^$",
name: "Alternate File",
... | 38.414634 | 188 | 0.703492 |
03b343767ab0da0ed9adf17c29de51d83b0c4675 | 2,460 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Christopher Brown (<cb@opscode.com>)
# Copyright:: Copyright (c) 2008 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... | 25.894737 | 135 | 0.643089 |
08e25b2db3926a8d6ed29dbfba4f54950317e52e | 673 | # frozen_string_literal: true
# from https://pawelurbanek.com/rails-secure-encrypt-decrypt
module Encryptable
extend ActiveSupport::Concern
class_methods do
def attr_encrypted(*attributes)
attributes.each do |attribute|
define_method("#{attribute}=".to_sym) do |value|
return if value.ni... | 25.884615 | 67 | 0.644874 |
1cf9115985b1431ef6a2cff916ca03503b5b0664 | 737 | # == Schema Information
#
# Table name: guest_room_reservations
#
# id :bigint not null, primary key
# date :date not null
# created_at :datetime not null
# updated_at :datetime not null
# community_id :bigint not null
# resident_id :bigint ... | 26.321429 | 64 | 0.663501 |
7a378b927def77dd5668408d6d19a6bfe9101c23 | 5,762 | class CfnLint < Formula
include Language::Python::Virtualenv
desc "Validate CloudFormation templates against the CloudFormation spec"
homepage "https://github.com/aws-cloudformation/cfn-python-lint/"
url "https://files.pythonhosted.org/packages/5f/95/0f5fc9cc4798bace8a8991171dad1ccf46dfa10d814d00fbc28bb718a71a... | 43.984733 | 149 | 0.801111 |
6aa6d62d5197fb984735da833c8218408968271e | 235 | # frozen_string_literal: true
module Dhis2
module Api
module Version228
class ProgramIndicator < ::Dhis2::Api::Base
include ::Dhis2::Api::Listable
include ::Dhis2::Api::Findable
end
end
end
end
| 18.076923 | 49 | 0.646809 |
1c303a7697c7625f7829661d3d7fee024606b42e | 13,344 | =begin
#ORY Keto
#Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
The version of the OpenAPI document: v0.6.0-alpha.6
Contact: hi@ory.sh
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5... | 41.058462 | 156 | 0.677308 |
7a34e5a3b3c9186022a2763b042761bc682004ac | 549 | Pod::Spec.new do |s|
s.name = "CheckConnectivity"
s.version = "1.0.7"
s.summary = "Checks Connectivity."
s.description = "Checks internet connection."
s.homepage = "https://github.com/"
s.license = "MIT"
s.author = "Kahuna"
s.platform = :ios, "8.0"
... | 21.115385 | 105 | 0.581056 |
1139e7ada2a9cf868752e5b4a094165d43c698ab | 782 | require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
setup do
@user = users(:one)
end
test "should get index" do
get users_url, as: :json
assert_response :success
end
test "should create user" do
assert_difference('User.count') do
post users_url, params: {... | 20.051282 | 68 | 0.654731 |
87624084d117557df4bbbc7e5e7fd18348484024 | 103 | # Reclass so we can raise our own Exceptions.
class SDP
class RuntimeError < StandardError
end
end
| 17.166667 | 45 | 0.76699 |
e2ecf8cc1116fecd577f8c232a5b1017362ace12 | 759 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
get 'sessions/new'
root "static_pages#home"
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
post '/signup', t... | 26.172414 | 66 | 0.681159 |
d5b45dff3795ba118d23aa8f14c0ac6d78db7bc2 | 246 | module ActiveRecord
module ShardFor
# Railtie of activerecord-shard_for
class Railtie < ::Rails::Railtie
rake_tasks do
load File.expand_path('../../tasks/activerecord_shard_for.rake', __FILE__)
end
end
end
end
| 22.363636 | 82 | 0.682927 |
7a50673a3f9e14aee17f076f5d87eb2b90523178 | 563 | if defined?(ChefSpec)
def configure_varnish_repo(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:varnish_repo, :configure, resource_name)
end
def configure_vcl_file(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:vcl_file, :configure, resource_name)
end
def configure_vcl_template(res... | 31.277778 | 85 | 0.792185 |
266a7da5bf8115ac2961388d7a0bfcd483612013 | 441 | # 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_07_01
module Models
#
# Defines values for OfficeTrafficCategory
#
module OfficeTrafficCategory
O... | 23.210526 | 70 | 0.69161 |
18d68c053fd2a9069457d662478096e740d288ac | 905 | module InvoiceRepresenter
include ThreeScale::JSONRepresenter
wraps_resource
property :id
property :friendly_id
property :created_at
property :updated_at
property :state
property :paid_at
property :due_on
property :issued_on
property :currency
property :cost
property :vat_rate, render_nil... | 15.338983 | 63 | 0.744751 |
7a3eb678cf36b017e6d560ec3d793ba2c3e35182 | 339 | class CreateIngressPoints < ActiveRecord::Migration
def change
create_table :ingress_points do |t|
t.decimal :lat, null: false, scale: 6, precision: 9
t.decimal :long, null: false, scale: 6, precision: 9
t.string :portal_name, null: true, default: nil
t.timestamps null: false... | 28.25 | 64 | 0.651917 |
e8a5ae104e36ce56447a841cd560cdc450f4e706 | 5,134 | require "cloudapp/cli/collections"
require "cloudapp/credentials.rb"
require "http"
require "optparse"
module CloudApp
module CLI
class CollectionsPrompt
@@token = nil
def self.print_help
$stdout.puts <<EOS
Usage:
cloudapp --collections [flags] [option... | 37.75 | 185 | 0.600117 |
abb00d7f2b8fb7f2b22c064cd8f54ba997d08eb3 | 92 | node(:accounts) do |accounts|
@accounts.map { |c| partial "accounts/show", object: c }
end | 30.666667 | 58 | 0.684783 |
e9b418c2989ea337a29899058973132e37c25471 | 331 | class Chord; end;
class Chord::Type; end;
class Chord::Type::AugMaj7 < Chord::Type
def self.in_chord_symbol
"+maj7"
end
def self.norm_interval_structure
[ "1", "3", "#5", "7" ]
end
def self.anki_filename
"augmaj7"
end
def self.anki_tag
"augmaj7"
end
def self.html_symbol
"+maj7"... | 13.791667 | 40 | 0.63142 |
624a95f202806e1ee65286087427e8b273fb7666 | 747 | # encoding: utf-8
class MinimalMapObservation
attr_accessor :id, :lat, :long, :location, :location_id
def initialize(id, lat, long, location_or_id)
@id = id
@lat = lat
@long = long
if location_or_id.is_a?(Fixnum) or
location_or_id.is_a?(String)
@location_id = location_or_id.to_i
e... | 18.219512 | 64 | 0.646586 |
4a384240f9df0839bc3635f33dc45bed76657319 | 5,122 | # This is a MiniTest test file. It will test the Predictor object in predictor.rb
# Minitest documentation here: http://docs.seattlerb.org/minitest/
# require can be used to access gems (i.e. libraries)
# Libraries tend to be used very often in Ruby programs and especially Rails projects
# Note that you can add a .r... | 35.082192 | 85 | 0.738774 |
b9965031534f694c4c5e4b7fd461e5f5077639f8 | 6,317 | def build_js(from_dir, build_file_name, to_dir, target_file_name, min = false)
require 'sprockets'
require 'sprockets/es6'
target = File.expand_path(target_file_name, to_dir)
environment = Sprockets::Environment.new
environment.register_engine('.es6', Sprockets::ES6)
environment.append_path(from_dir)
envi... | 33.247368 | 87 | 0.558493 |
d52ecda3a8f721b8b2a06cd76b2425faec85d991 | 9,375 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rbmysql'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
d... | 34.340659 | 146 | 0.591253 |
797492dd1642043853d30ec2192f087c003145d3 | 126 | class AromaSerializer < ActiveModel::Serializer
attributes :id, :aroma
has_many :wine_ids, serializer: WineSerializer
end
| 25.2 | 48 | 0.801587 |
ff3501c7f4069073d8beaced1a41d0c0aa0e0376 | 158 | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
UnclaimedMoney::Application.initialize!
| 26.333333 | 52 | 0.810127 |
d55e6e98939e1945a2b02686420e596232b9a1c9 | 5,365 | # frozen_string_literal: true
require "simplecov"
SimpleCov.start do
track_files "lib/clangd_client/**/*.rb"
add_filter %r{^/spec/}
enable_coverage :branch
end
require "clangd_client"
require "language_server/client"
require "language_server/protocol"
Dir[File.join(File.expand_path(__dir__), "support/**/*.rb"... | 43.97541 | 92 | 0.743336 |
1a8a77ee99ef838eb140ce8c8bddf5c6eb51875b | 906 | #!/usr/bin/ruby
# == Description
#
# Creating and summarizing a correlation matrix with daru and statsample
$:.unshift(File.dirname(__FILE__)+'/../lib/')
require 'statsample'
Statsample::Analysis.store("Statsample::Bivariate.correlation_matrix") do
# Create a Daru::DataFrame containing 4 vectors a, b, c and d.
#... | 27.454545 | 76 | 0.698675 |
62679a263ba5b357afe636d6d3ea62b19821dbaa | 989 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"... | 30.90625 | 82 | 0.779575 |
91dfa3b3a78399d0e7c8812056884ab267ed14f8 | 441 | cask 'ckb' do
version '0.2.6'
sha256 '724f7ee9a0e363304bc2b0b82713582bf366a07f2e4c4639389bb6f7efb7ebbf'
url "https://github.com/ccMSC/ckb/releases/download/v#{version}/ckb.pkg"
appcast 'https://github.com/ccMSC/ckb/releases.atom',
checkpoint: 'e78446bd6ad2ad006934a73a1165dbce61e7d99b3a6da6537dff6abe7... | 29.4 | 88 | 0.755102 |
08904ef76ddfa6d7e82e7ce4851e777bb93e44bf | 155 | # frozen_string_literal: true
require_relative 'sleeping_kangaroo12/version'
require_relative 'sleeping_kangaroo12/digest'
module SleepingKangaroo12
end
| 19.375 | 46 | 0.870968 |
38672e116794025d5cd768fff1c36569cc67ef84 | 1,322 | # frozen_string_literal: true
require_relative "lib/grumlin/version"
Gem::Specification.new do |spec|
spec.name = "grumlin"
spec.version = Grumlin::VERSION
spec.authors = ["Gleb Sinyavskiy"]
spec.email = ["zhulik.gleb@gmail.com"]
spec.summary = "Gremlin graph traversal la... | 34.789474 | 118 | 0.677005 |
33ccd78d675770d58e4b250dd6a41de9520cdb9c | 105 | class MeditationSerializer
include JSONAPI::Serializer
attributes :title, :audio, :comments, :id
end
| 21 | 43 | 0.780952 |
61ba6c93cf3ae83a8e0f7866bbdcf85a5c461389 | 815 | class ResultsController < ApplicationController
def index; end
def show
@path = params[:base_path]
@path = URI.parse(@path).path if @path.starts_with?("http")
@document = Services.search_api.get("/content?link=#{@path}")
rescue GdsApi::HTTPNotFound
flash[:error] = "That URL wasn't found."
red... | 32.6 | 98 | 0.703067 |
e8edcb8b473808e4f196a61b58f3eb756c54f78d | 466 | class Customer
def order
barista = Barista.new
barista.brew
end
end
class Barista
def brew
espresso = Espresso.new
milk = Milk.new
cup = Cup.new
cup.receive(espresso.brew, milk.steam)
end
end
class Espresso
def brew
'エスプレッソ'
end
end
class Milk
def steam
'スチームミルク'
end
e... | 12.263158 | 42 | 0.665236 |
5df181a1bac252ee3fed2e071310e3c4fdbc9594 | 271 | FactoryGirl.define do
factory :benchmark_type do
association :repo
sequence(:category) { |n| "bm_category#{n}" }
script_url 'https://raw.githubusercontent.com/ruby-bench/ruby-bench-suite/master/ruby/benchmarks/bm_app_answer.rb'
digest 'abcde'
end
end
| 30.111111 | 118 | 0.734317 |
aba79ff7b06edde102f4b8e87648aa7b823c503a | 1,810 | require "rails_helper"
module ActiveAdmin
RSpec.describe Resource, "Attributes" do
let(:application) { ActiveAdmin::Application.new }
let(:namespace) { ActiveAdmin::Namespace.new application, :admin }
let(:resource_config) { ActiveAdmin::Resource.new namespace, Post }
describe "#resource_attributes"... | 32.321429 | 119 | 0.590608 |
262562f946dca2bb4f44b4f5b8a9877ec104a047 | 417 | namespace :test do
task :performance do
output = File.join(Rails.root, 'tmp', 'performance.csv')
results = File.open(output, 'w+')
results.puts 'Operation;Time (ms)'
results.close
Dir["#{File.join(Rails.root, 'test', 'performance')}/**/*.rb"].each do |file|
next if file =~ /base_perform... | 29.785714 | 81 | 0.589928 |
21cadc3de29d95f0b81bb64a0f8b09ac57ccd875 | 1,967 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex/encoder/alpha2/alpha_mixed'
class Metasploit3 < Msf::Encoder::Alphanum
Rank = LowRanking
def initialize
super(
'Name' => "... | 26.945205 | 87 | 0.612608 |
b91551f3bc05f22d3af502b8f7e6846eee38a9fd | 815 | =begin
#Tatum API
## Authentication <!-- ReDoc-Inject: <security-definitions> -->
OpenAPI spec version: 3.9.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.31
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Tatum::InlineResponse20035
# Auto... | 23.285714 | 85 | 0.747239 |
ff6c044f93e560a66f6aa47e88164190296810ac | 4,876 | # encoding: utf-8
require 'rspec/core'
require 'rspec/expectations'
require 'rspec/mocks'
require_relative '../../spec_helper'
describe CartoDB::TableRelator do
describe '.rows_and_size' do
before(:all) do
CartoDB::UserModule::DBService.any_instance.stubs(:enable_remote_db_user).returns(true)
@user ... | 33.627586 | 110 | 0.647457 |
ac4320797da09777b16cd2eaa817406d17fecdbc | 373 | class VCarreraDetalle < ActiveRecord::Base
self.table_name= "v_carreras_detalles"
self.primary_key = "carrera_detalle_id"
attr_accessible :carrera_detalle_id,:carrera_id,:piloto_id, :datos_piloto, :numero_piloto, :posicion, :created_at,:updated_at
scope :orden_01, -> { order("carrera_detalle_id")}
sc... | 33.909091 | 128 | 0.753351 |
4aa759ccc2e95f3f1b9426ac70b0be6d7d53fa7e | 1,600 | # Copyright 2017 OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 29.090909 | 75 | 0.68875 |
28e32c9ced8df05dcdff745301d99dbdfc5092cc | 4,185 | require 'em_test_helper'
class TestHeaderAndContentProtocol < Test::Unit::TestCase
class SimpleTest < EM::P::HeaderAndContentProtocol
attr_reader :first_header, :my_headers, :request
def receive_first_header_line hdr
@first_header ||= []
@first_header << hdr
end
def receive_headers hdrs... | 26.826923 | 87 | 0.58638 |
e8cba18376c9e8643572c864f48a0df9c1b40487 | 974 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: runtime/runtime.proto for package 'runtime'
require 'grpc'
require 'runtime/runtime_pb'
module Runtime
module Runtime
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_metho... | 33.586207 | 97 | 0.724846 |
acaf63b43f1607b1fa274e572b36a5d661be168b | 7,846 | require_relative '../spec_helper'
describe 'Base' do
class FooClass
include ::Plotrb::Base
end
class BarClass
end
class BazClass
end
describe 'ClassMethods' do
let(:foo) { Class.new { include ::Plotrb::Base } }
describe '.attributes' do
it 'has attributes' do
foo.respond_... | 24.36646 | 79 | 0.618404 |
b9cb59075ad812fbb878108f82474a23241e0ed7 | 1,846 | # frozen_string_literal: true
require 'stringio'
class Pry
class Command
class Ri < Pry::ClassCommand
match 'ri'
group 'Introspection'
description 'View ri documentation.'
banner <<-'BANNER'
Usage: ri [spec]
View ri documentation. Relies on the "rdoc" gem being installe... | 24.289474 | 82 | 0.541712 |
217d9f2202e43dfa727555ec3a48a551ed9f238c | 2,858 | require 'common/version/release_version_list'
module Bosh::Common::Version
describe ReleaseVersionList do
let(:version_list) { described_class.parse(versions) }
def parse(version)
Bosh::Common::Version::ReleaseVersion.parse(version)
end
describe '#parse' do
let(:versions) { ['1.0.1', '1... | 37.116883 | 127 | 0.645556 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.