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 |
|---|---|---|---|---|---|
ffb252dbd4b425d5a2da069b325c267dc0d2196a | 15,527 | test_name 'Calling all functions.. test in progress!'
tag 'audit:medium',
'audit:acceptance'
# create single manifest calling all functions
step 'Apply manifest containing all function calls'
def manifest_call_each_function_from_array(functions)
manifest = ''
# use index to work around oregano's immutable var... | 66.354701 | 173 | 0.537515 |
e2fd777d13196d7a3ff7167d7f29f7537cf489a8 | 4,113 | # frozen_string_literal: true
require 'spec_helper'
describe Clusters::Providers::Gcp do
it { is_expected.to belong_to(:cluster) }
it { is_expected.to validate_presence_of(:zone) }
include_examples 'provider status', :cluster_provider_gcp
describe 'default_value_for' do
let(:gcp) { build(:cluster_provid... | 24.927273 | 80 | 0.653781 |
281d360dcc5af79bb84a2dd81bc7ea4862f4313f | 747 | cask "font-sarasa-gothic" do
version "0.34.6"
sha256 "9a38c7a510b187446319891e96086efc03cf5dc4828e2956865a32915744bc78"
url "https://github.com/be5invis/Sarasa-Gothic/releases/download/v#{version}/sarasa-gothic-ttc-#{version}.7z"
name "Sarasa Gothic"
name "更纱黑体"
name "更紗黑體"
name "更紗ゴシック"
name "사라사고딕"
... | 29.88 | 111 | 0.745649 |
280807eec29fd089682b17e8e1dadc7d489f0b65 | 110 | class HomeController < ApplicationController
skip_before_action :authenticate_user!
def index
end
end
| 13.75 | 44 | 0.809091 |
112491ed198469bfa6f23f7d3c7cf163947c2b3d | 703 | class CreateTogForumTables < ActiveRecord::Migration
def self.up
create_table :tog_forum_forums do |t|
t.string :title
t.integer :user_id
t.timestamps
end
create_table :tog_forum_topics do |t|
t.integer :forum_id
t.integer :user_id
t.string :title
t.te... | 20.676471 | 52 | 0.634424 |
bb5709a522e3635790911cf38d6ce3bf4cfd1015 | 10,577 | # frozen_string_literal: true
#
# Cookbook Name:: icinga2
# Provider:: environment
#
# Copyright 2014, Virender Khatri
#
# 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.apach... | 47.644144 | 193 | 0.563392 |
7ac22972a98dde2253017e75ad2c4b50241f9d60 | 432 | #load File.dirname(__FILE__) + "/spec_helper.rb"
# Don't include the spec helper here to determine
describe "To run the app" do
it "you should have the aws-s3 gem installed" do
lambda{
require 'rubygems'
gem 'aws-s3'
}.should_not raise_error
end
it "you should have the capistrano gem ins... | 21.6 | 54 | 0.668981 |
1ad8d694450c858422e47fba7ca90b911d4a4707 | 13,398 | require 'spec_helper'
describe 'responseModel' do
include_context 'this api'
def app
ThisApi::ResponseModelApi
end
subject do
get '/swagger_doc/something'
JSON.parse(last_response.body)
end
it 'documents index action' do
expect(subject['paths']['/something']['get']['responses']).to eq(
... | 47.510638 | 160 | 0.544484 |
b9bd9e0d7dfa1af8cc5268fceb555776cefdb06d | 9,475 | # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
require 'date'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# CreateIPSecConnectionTunnelDetails model.
class Core::Models::CreateIPSecConnectionTunnelDetails
ROUTING_ENUM = [
ROUTING_BGP ... | 38.205645 | 161 | 0.688127 |
ff3aa56bbdc3cdd7ee82715c97582a171d7b0868 | 155 | require 'ffi'
module FFI
module Mapscript
class LabelBounds < FFI::Struct
layout :poly, LineObj.ptr,
:bbox, RectObj
end
end
end
| 14.090909 | 35 | 0.63871 |
f711aee5cd4617fe8efebe4137ecffce12df2c51 | 11,254 | # frozen_string_literal: true
require 'thread'
module Puma
# Internal Docs for A simple thread pool management object.
#
# Each Puma "worker" has a thread pool to process requests.
#
# First a connection to a client is made in `Puma::Server`. It is wrapped in a
# `Puma::Client` instance and then passed to... | 28.347607 | 96 | 0.608672 |
62adcae50bd020cfe5a1a137f541465b14b0b5c9 | 2,421 | =begin
#Brainrex API Explorer
#Welcome to the Brainrex API explorer, we make analytics tools for crypto and blockchain. Our currently propiertary models offer sentiment analysis, market making, blockchain monitoring and face-id verification. This AI models can be consumed from this API. We also offer integrations to o... | 41.033898 | 718 | 0.761669 |
6a9c8bb82a734df4075c01ccb4225b01484074e2 | 1,637 | class PasswordResetsController < ApplicationController
before_action :get_user, only: [:edit, :update]
before_action :valid_user, only: [:edit, :update]
before_action :check_expiration, only: [:edit, :update] # Case (1)
def new
end
def create
@user = User.find_by(email: params[:password_reset][:... | 25.578125 | 73 | 0.619426 |
01ba127c0cdef7c6b5cd5e3b7e848f77cbd80d9a | 6,150 | # encoding: utf-8
shared_examples 'IceNine.deep_freeze' do
context 'with an Object' do
let(:value) { Object.new }
before do
value.instance_eval { @a = '1' }
end
it 'returns the object' do
should be(value)
end
it 'freezes the object' do
expect { subject }.to change(value,... | 23.295455 | 74 | 0.606341 |
bf0d2150938463b11d6129c0308f9f1d59764509 | 262 | module Folder
class CheckPreconditions < Tasks
def handle(fun, dir, args)
raise StandardError, ":name must be set" if args[:name].nil?
raise StandardError, ":srcs or :deps must be set" if args[:srcs].nil? and args[:deps].nil?
end
end
end
| 29.111111 | 96 | 0.671756 |
088782d13e3bc4298b964b2c616c714ccb3e414e | 737 | class SessionsController < ApplicationController
def new
end
def create
user = User.find_by(email: params[:session][:email].downcase)
if user && user.authenticate(params[:session][:password])
if user.activated?
log_in user
params[:session][:remember_me] == '1' ? remember(user) : for... | 24.566667 | 77 | 0.640434 |
ac9220e1f0904dadff38559f5a2f94221685755b | 2,845 | # frozen_string_literal: true
require 'openssl'
require 'httpclient'
require 'nokogiri'
require 'json'
module Handochogwa
# 신한카드!
class Shinhan
def initialize(username = nil, password = nil)
create_session
@logged_in = false
authorize(username, password) if username && password
end
... | 24.110169 | 89 | 0.600703 |
1c2b7314e4ed8969a937a7e81015307cb1ef4ab7 | 42,950 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_06_01
#
# ExpressRoutePorts
#
class ExpressRoutePorts
include MsRestAzure
#
# Creates and initialize... | 44.23275 | 162 | 0.708452 |
088e654b36f7f9f589b63dc7e712fdd8a2ae42c0 | 261 | module OdfCore
module Element
module Text
class TocMark < AbstractElement
XML_ELEMENT_NAME = 'text:toc-mark'
CHILDREN = [].freeze
ATTRIBUTES = ["text:outline-level", "text:string-value"].freeze
end
end
end
end
| 17.4 | 71 | 0.624521 |
f8ee9e5d93c03b789b70276cf15db95b903f9fce | 2,262 | # The MIT License
#
# Copyright (c) 2013 Marcelo Guimarães <ataxexe@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without... | 34.8 | 89 | 0.690097 |
28c3219b37b4d6b2a5a45e1c64f07477d2dcf5bf | 3,043 | # frozen_string_literal: true
module MergeRequests
class BaseService < ::IssuableBaseService
def create_note(merge_request, state = merge_request.state)
SystemNoteService.change_status(merge_request, merge_request.target_project, current_user, state, nil)
end
def hook_data(merge_request, action, o... | 34.579545 | 108 | 0.708511 |
33ec1f24aadb106200df501057d36e6383c83e69 | 5,671 | require 'time'
require 'serialport'
require 'phaserunner'
class String
def is_number?
true if Float(self) rescue false
end
end
module CycleAnalystLogger
class CycleAnalyst
# Cycle Analyst serial port Baudrate
attr_reader :baudrate
# Cycle Analyst serial port name
attr_reader :tty
# Has... | 30.326203 | 106 | 0.61118 |
87a1bc72ed92cde113db4dcb0790c5f49649c293 | 3,499 | #--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems'
##
# The Version class processes string versions into comparable values
class Gem::Version
include Comparable
attr_reader :ints
attr_reader :version
##... | 21.078313 | 78 | 0.655616 |
032e38d9fbb43d13eac6a2960eaad2658223fc46 | 77 | # frozen_string_literal: true
module EmailStylist
VERSION = '0.1.1'
end
| 9.625 | 29 | 0.727273 |
bb7ed2c993064aa2ba4d4f2871107ed70056e3b6 | 644 | class Staff::PrioritiesController < Staff::BaseController
def new
@scheme = Scheme.find(scheme_id)
@priority = Priority.new
end
def create
@scheme = Scheme.find(scheme_id)
@priority = Priority.new(priority_params)
@priority.scheme = @scheme
if @priority.valid?
@priority.save
... | 20.774194 | 85 | 0.680124 |
1ae705de40c3605cf0b3fdea8c8669f06febe873 | 1,123 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ResourcesManagement::Mgmt::V2018_03_01_preview
module Models
#
# The error object.
#
class ErrorResponse
include MsRestAzure
# @... | 23.893617 | 70 | 0.536064 |
e9d1ea2026d8eae456326b1b74fc3927de1904d0 | 158 | class CreatePatients < ActiveRecord::Migration[5.1]
def change
create_table :patients do |t|
t.string :name
t.timestamps
end
end
end
| 15.8 | 51 | 0.664557 |
26ccbdcd41c1dea068ab10cd90732d15b8d3ff7f | 647 | module ApplicationHelper
def resource_name
:user
end
def resource
@resource ||= User.new
end
def devise_mapping
@devise_mapping ||= Devise.mappings[:user]
end
def link_to_add_fields(name, f, association)
new_object = f.object.send(associ... | 28.130435 | 93 | 0.604328 |
2688afa554ac6690e8a720b0064405b5527ac271 | 133 | module CloudstackRubyClient
module Api
module S3
cmd_processor :add_s3,
:list_s3s
end
end
end
| 13.3 | 29 | 0.593985 |
87c25589b0ec2c3d82d920752c357cf633668b4c | 6,546 | # frozen_string_literal: true
require "spec_helper"
describe Doorkeeper::OAuth::PasswordAccessTokenRequest do
let(:server) do
double(
:server,
default_scopes: Doorkeeper::OAuth::Scopes.new,
access_token_expires_in: 2.hours,
refresh_token_enabled?: false,
custom_access_token_expires... | 32.246305 | 103 | 0.690804 |
211190560a3c590f8dcc5b019fb841ac8d4bffa0 | 2,052 | #--
# Copyright (c) 2004-2017 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | 34.2 | 72 | 0.789961 |
bbb6219c13eb92d3932bcc708b2113f93d45e731 | 13,516 | require "rails_helper"
RSpec.describe ApplicationHelper, :type => :helper do
describe "#dob_in_words" do
it "returns date of birth in words for < 1 year" do
expect(helper.dob_in_words(0, "20/06/2015".to_date)).to eq time_ago_in_words("20/06/2015".to_date)
expect(helper.dob_in_words(0, "20/07/2015".t... | 39.988166 | 269 | 0.691847 |
ffd2605e6e0f1790bb7755452422ff9029ca7e8c | 233 | # frozen_string_literal: true
module PaymentProcessor
module Exceptions
class InvalidCurrency < ArgumentError; end
class PaymentMethodNotFound < ArgumentError; end
class CustomerNotFound < ArgumentError; end
end
end
| 23.3 | 52 | 0.7897 |
393b49cad760afa802018bbf1fba7a27413e92ba | 1,543 | class Cms::Node::CopyNodesController < ApplicationController
include Cms::BaseFilter
include SS::JobFilter
navi_view "cms/node/main/navi"
model Cms::CopyNodesTask
private
def job_class
Cms::Node::CopyNodesJob
end
def job_bindings
{
site_id: @cur_site.id,
node_id: @cur_node.id
... | 22.362319 | 127 | 0.67466 |
082ffa855b755ab95c84f3a326ab6ba3dd1cd5b8 | 946 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Template::Finders::GlobalTemplateFinder do
let(:base_dir) { Dir.mktmpdir }
def create_template!(name_with_category)
full_path = File.join(base_dir, name_with_category)
FileUtils.mkdir_p(File.dirname(full_path))
FileUtils.touch(full_... | 24.894737 | 85 | 0.689218 |
3372aa0b1f3d8e9756b4f1279e3b9cf1cd216a37 | 2,465 | require "rails_helper"
require "controller_helper"
require "api_test_helper"
require "support/list_size_matcher"
describe AboutController do
let(:identity_provider_display_decorator) { double(:IdentityProviderDisplayDecorator) }
context "LOA1" do
before(:each) do
stub_request(:get, CONFIG.config_api_hos... | 32.866667 | 123 | 0.710345 |
790e66447b8b59cb340de2b6a419909010eb60c1 | 4,744 | # frozen_string_literal: true
require "spec_helper"
if ENV['IODINE']
require 'lite_cable/iodine_server'
require "iodine"
else
require 'lite_cable/server'
require "puma"
end
shared_examples "Lite Cable server" do
let(:cookies) { "user=john" }
let(:path) { "/?sid=123" }
let(:client) { @client = SyncClien... | 33.408451 | 166 | 0.631745 |
bfd74e582480b9cf7b131fcb0ff0f573d855c731 | 1,534 | module RavenDB
class GenerateEntityIdOnTheClient
def initialize(conventions, generate_id)
@_conventions = conventions
@_generate_id = generate_id
end
def identity_property(entity_type)
@_conventions.identity_property(entity_type)
end
def try_get_id_from_instance(entity, id_hold... | 27.890909 | 86 | 0.675359 |
2675e0932075eef2bb60d1892c57c9abac690a9f | 42 | require 'compound_interest/calculator.rb'
| 21 | 41 | 0.857143 |
21ac64e03954830829186cf12cc864fe8e03185a | 136 | class Api::TeamsController < ApplicationController
def show
@teams = Team.all
render :json => @teams, status: 201
end
end
| 15.111111 | 50 | 0.683824 |
edfeb2b1400e09b686376c92c7274bb92dc5a1d5 | 477 | cask "singularity" do
version "1.8.6,6156"
sha256 "002597a1d7386ff1b505416476fce812037a38c61bd152212fd758db943de40c"
# bitbucket.org/SingularityViewer/singularityviewer/ was verified as official when first introduced to the cask
url "https://bitbucket.org/SingularityViewer/singularityviewer/downloads/Singulari... | 39.75 | 136 | 0.796646 |
269dd442859927fdf68b461aa329965d64280ea5 | 475 | # frozen_string_literal: true
class Database < ApplicationRecord
include Attributes::Strip
include Databases::ActiveRecordConfig
include Databases::Credentials
include Databases::ODBC
include Databases::Properties
include Databases::Scopes
include Databases::Search
include Databases::Validations
incl... | 19 | 39 | 0.768421 |
281ec71a9f71e79bce3cb4062e6f9dd7a2a6e15b | 1,498 | require 'activeadmin-sortable/version'
require 'activeadmin'
require 'rails/engine'
module ActiveAdmin
module Sortable
module ControllerActions
def sortable
member_action :sort, :method => :post do
if defined?(::Mongoid::Orderable) &&
resource.class.included_modules.include?(... | 29.372549 | 74 | 0.583445 |
03bd0876ab14e4fcca2b832e322c486296850fdd | 295 | class AudioMate < Cask
version '2.0.4'
sha256 'dd66b67ff57c90d7f2c62c46f6a4049f5cecfbf1d5eb4fd502c447c9f0bef28b'
url 'https://s3.amazonaws.com/apps-leftbee/products/downloadables/000/000/005/original/AudioMate-v2.0.4.dmg'
homepage 'http://audiomateapp.com/'
link 'AudioMate.app'
end
| 29.5 | 110 | 0.783051 |
6a69621b15755b69da95c7870ef3c726fd005971 | 2,200 | class IngramMicro::Transmission
XSD = {
'sales-order-submission' => 'outbound/BPXML-SalesOrderDomestic.xsd',
'sales-order-international' => 'outbound/BPXML-SalesOrderInternational.xsd',
'shipment-status' => 'outbound/BPXML-ShipmentStatus.xsd',
'return-authorization' => 'outbound/BPXML-ReturnAuthorizat... | 31.428571 | 90 | 0.71 |
bf0f7e5c1cbb4bd4719dfb7687e33d4180cd32a5 | 261 | require 'rails_helper'
RSpec.describe "routing to jimmy_wales" do
it "routes http://dyl.anjon.es/jimmywales to jimmy_wales" do
expect(get: "http://dyl.anjon.es/jimmywales").to route_to(
controller: "jimmy_wales",
action: "index")
end
end
| 21.75 | 62 | 0.697318 |
f83ea5e6511398a63ee725a8b252bb3b907b447d | 1,709 |
#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Thu Nov 22 11:53:13 JST 2007
#
require File.dirname(__FILE__) + '/flowtestbase'
require 'openwfe/def'
class FlowTest9b < Test::Unit::TestCase
include FlowTestBase
#
# Test 0
#
class Test0 < OpenWFE::ProcessDefinition
cursor do
set :v => ... | 17.09 | 77 | 0.626097 |
617b2b11752e5795ef22d5e3e1baea4740c701c8 | 564 | require "ffi_yajl"
require "chef_zero/rest_base"
module ChefZero
module Endpoints
# /users/NAME/association_requests/count
class UserAssociationRequestsCountEndpoint < RestBase
def get(request)
get_data(request, request.rest_path[0..-3])
username = request.rest_path[1]
result =... | 28.2 | 91 | 0.66844 |
39d7db5422b3ef89ed12ab21725a4f380e43a255 | 692 | # frozen_string_literal: true
json.id @system.id
json.name @system.name
json.description @system.description
json.coords_x @system.coords_x
json.coords_y @system.coords_y
json.time_to_jump @system.time_to_jump
json.occupation_dates @system.system_occupation_dates do |date|
json.faction d... | 25.62963 | 63 | 0.760116 |
f84db1e8dae30b88a427a90465cb39bed088cefa | 1,855 | require 'pathname'
module Xcake
# This class handles classifing the files and how Xcake should handle them.
#
class PathClassifier
EXTENSION_MAPPINGS = {
PBXFrameworksBuildPhase: %w(.a .dylib .so .framework).freeze,
PBXHeadersBuildPhase: %w(.h .hpp).freeze,
PBXSourcesBuildPhase: %w(.c .m .m... | 26.126761 | 82 | 0.652291 |
1c76bf8443673d4a42385208cb6967b6f004a542 | 495 | # Migration test.
Miguel::Schema.define do
table :a do
primary_key :id
Float :a
foreign_key :fk, :c
end
table :b do
primary_key :id
Text :t
Unsigned :u, default: 123
Signed? :s
timestamps
foreign_key :fk, :c
unique :u
index :create_time
end
table :c do
prima... | 12.692308 | 40 | 0.581818 |
7aa64730f27405cf5f72e6d0cd96d7949d42b98c | 6,798 | require 'spec_helper'
describe Ability, :type => :request do
let(:organization) { threadable.organizations.find_by_slug('raceteam') }
let(:organization_members) { organization.members }
let(:member) { organization.members.current_member}
let(:group) { organization.groups.find_by_slug('electronics') }
let(:g... | 38.625 | 116 | 0.670786 |
916006406570b561e5e78548e51367607cb1ee2c | 1,630 | #
# Be sure to run `pod lib lint DXDownload.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 = 'DXDownlo... | 37.045455 | 101 | 0.634356 |
187c314b30c17e19841eedd8f44e10a7a07fe098 | 1,230 | require 'test_helper'
class FinancialMonthsControllerTest < ActionDispatch::IntegrationTest
setup do
@financial_month = financial_months(:one)
end
test "should get index" do
get financial_months_url
assert_response :success
end
test "should get new" do
get new_financial_month_url
assert... | 25.102041 | 82 | 0.757724 |
61b8e4888322a0b6b416481e44436deac5a62205 | 2,826 | require 'spec_helper'
describe 'collectd::plugin::write_graphite::carbon', type: :define do
let :facts do
{
osfamily: 'Debian',
id: 'root',
concat_basedir: '/dne',
path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
collectd_version: '4.8.0',
operatingsystemm... | 34.463415 | 174 | 0.617834 |
62729436adf95a5559914977401ad089930e7278 | 417 | cask 'vuescan' do
version '9.5.90'
sha256 '0c77e72b7ee929820b06973bb5e953c4b4b66d7aae6f6c201b57ae5f433b8072'
url "https://www.hamrick.com/files/vuex64#{version.major_minor.no_dots}.dmg"
appcast 'https://www.hamrick.com/old-versions.html',
checkpoint: '105d346d578b815e7d1eeb5fdbe5e8c329af7ae6e76c331f6... | 32.076923 | 88 | 0.769784 |
33dbdf40a68010588a06572f75f37159cabd84f9 | 3,831 | # coding: UTF-8
require 'spec_helper'
describe "Assets API" do
before(:all) do
AWS.stub!
end
before(:each) do
@user = FactoryGirl.create(:valid_user)
delete_user_data @user
host! "#{@user.username}.localhost.lan"
end
after(:each) do
@user.destroy
end
let(:params) { { :api_key =>... | 33.605263 | 124 | 0.665362 |
2193207b630bebce8bc3f9395cabe2ac469141d5 | 6,789 | #!/usr/bin/env ruby
require 'yaml'
require 'fileutils'
require_relative '../../../lib/upgrade'
class CommonEnforcer < Upgrade::BaseActivationEnforcer
def enable_micro_depls
micro_depls_deployments = %w[
00-core-connectivity-terraform
bosh-master
concourse credhub-ha credhub-seeder
dns-rec... | 28.52521 | 184 | 0.752835 |
26f1b62c5b675cd1c73e8a8eb608060574262755 | 3,007 | class Cairo < Formula
desc "Vector graphics library with cross-device output support"
homepage "https://cairographics.org/"
url "https://cairographics.org/releases/cairo-1.14.12.tar.xz"
mirror "https://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/cairo-1.14.12.tar.xz"
sha256 "8c90f00c500b22... | 29.480392 | 103 | 0.659461 |
f87e32252139665c32d1186311e27056b67c5fcd | 10,917 | module JABA
##
#
class JabaAttributeBase
attr_reader :services
attr_reader :node
attr_reader :attr_def
##
#
def initialize(attr_def, node, outer_attr)
@services = node.services
@attr_def = attr_def
@node = node
@outer_attr = outer_attr
@last_call_loca... | 26.117225 | 166 | 0.604195 |
e9a5120b6cae4b656301c61beb347eb53e7a57b5 | 297 | # -*- coding: utf-8 -*-
# http://dxruby.sourceforge.jp/DXRubyReference/2009531233720546.htm
require 'dxruby'
image = Image.load('data.png') # data.pngを読み込む
Window.loop do
x = Input.mousePosX # マウスカーソルのx座標
y = Input.mousePosY # マウスカーソルのy座標
Window.draw(x, y, image) # data.pngを描画する
end
| 22.846154 | 67 | 0.703704 |
ab9ee66519bf68c27a065dd91285419ed9eb7c1a | 133 | module Constants::MessageStyle
module Color
EPISODE_NO = '#e3a368'
URL_LINK = '#325b85'
SEPARATOR = '#888888'
end
end | 19 | 30 | 0.669173 |
61db644a3721921207e538f0955abd6cace8698d | 875 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe BulkImports::Groups::Graphql::GetLabelsQuery do
it 'has a valid query' do
tracker = create(:bulk_import_tracker)
context = BulkImports::Pipeline::Context.new(tracker)
query = GraphQL::Query.new(
GitlabSchema,
described_class... | 24.305556 | 62 | 0.710857 |
f738bd2538ff54b9f3912ce881ae4412bcc10db8 | 1,237 | 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 DropHunter
class Application < Rails::Application
# Settings in config/environments/* take pr... | 42.655172 | 99 | 0.726758 |
ffe5cef54cafb32a32296823a91108aebbfda6c7 | 83 | # frozen_string_literal: true
module StoreModel # :nodoc:
VERSION = "0.8.1"
end
| 13.833333 | 29 | 0.710843 |
1cc4cab8ac45ad57312519e8125bd5e3c0865a29 | 3,378 | # 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.121212 | 105 | 0.681172 |
6a6b9ad5314617771b6d50afbc3164b4889fb6c8 | 1,978 | require 'spec_helper'
describe "cms_import_with_upload_policy", type: :feature, dbscope: :example, js: true do
subject(:site) { cms_site }
subject(:index_path) { cms_import_path site.id }
let!(:file) { "#{Rails.root}/spec/fixtures/cms/import/site.zip" }
let!(:name) { File.basename(file, ".*") }
let!(:now) { ... | 29.969697 | 88 | 0.631951 |
bfab97cf1e25bc1233081f24d5f734b3d269ab0b | 9,497 | require 'abstract_unit'
require 'fileutils'
require 'action_view/dependency_tracker'
class FixtureTemplate
attr_reader :source, :handler
def initialize(template_path)
@source = File.read(template_path)
@handler = ActionView::Template.handler_for_extension(:erb)
rescue Errno::ENOENT
raise ActionView:... | 28.349254 | 94 | 0.741813 |
f7b655e381f18e1ba49c58179a1ff93b26e8465b | 1,107 | # frozen_string_literal: true
require 'support/shared_examples_for_rules'
require 'support/shared_examples_for_adjective_rules'
require 'support/shared_examples_for_from_now_adjective_for_rules'
require 'support/shared_examples_for_rule_apply'
require 'support/shared_examples_for_unit_rules'
require 'test_dates'
RSpe... | 27.675 | 66 | 0.715447 |
395840750216c74bbe6d56ec7d6169a04232ef6a | 87 | class MiqGroupDecorator < MiqDecorator
def self.fonticon
'ff ff-group'
end
end
| 14.5 | 38 | 0.735632 |
21385ea5b06640a2e40af3c498571e60d7602873 | 3,172 | require "spec_helper"
describe "Using Capybara::Screenshot with MiniTest" do
include CommonSetup
before do
clean_current_dir
end
def run_failing_case(code)
write_file('test_failure.rb', <<-RUBY)
#{ensure_load_paths_valid}
require 'minitest/autorun'
require 'capybara'
require '... | 28.576577 | 102 | 0.658575 |
e2ebf06122f6f263109013236f582b738ff1c603 | 262 | module Washington
class Failure
attr_reader :message, :function, :original, :error
def initialize message, function, original, error
@message = message
@function = function
@original = original
@error = error
end
end
end
| 20.153846 | 54 | 0.660305 |
d55c9eff4cb8c13db5f66ce15309142db9d00273 | 3,856 | require_relative "../test_helper"
describe Elastomer::Client::Scroller do
before do
@name = "elastomer-scroller-test"
@index = $client.index(@name)
unless @index.exists?
@index.create \
:settings => { "index.number_of_shards" => 1, "index.number_of_replicas" => 0 },
:mappings => ... | 27.942029 | 129 | 0.548755 |
bf6bc58dcf042ade5dd69141e10c5e60283239e1 | 215 |
# config/initializers/recaptcha.rb
if Settings.recaptcha.present?
Recaptcha.configure do |config|
config.site_key = Settings.recaptcha.site_key
config.secret_key = Settings.recaptcha.secret_key
end
end
| 23.888889 | 53 | 0.786047 |
01a6da37808974cdac5429e026b25b3b5cbf9eeb | 540 | module Xcunique
module Keys
CHILDREN = 'children'
FILE_REF = 'fileRef'
FILES = 'files'
ISA = 'isa'
MAIN_GROUP = 'mainGroup'
NAME = 'name'
OBJECTS = 'objects'
PATH = 'path'
PBXGroup = 'PBXGroup'
ROOT_OBJECT = 'rootObject'
end... | 22.5 | 31 | 0.624074 |
014078ec46e03843e97f7c36df50bc29c4df2a78 | 1,046 | require 'rake'
require 'pathname'
require 'rake/clean'
Dir.chdir Pathname.getwd()
SOURCE_FILES = Rake::FileList.new("sources/**/*.md", "sources/**/*.markdown") do |fl|
fl.exclude("**/~*")
fl.exclude(/^sources\/scratch\//)
fl.exclude do |f|
`git ls-files #{f}`.empty?
end
end
task :default => :gen_html
# p... | 24.904762 | 85 | 0.648184 |
08566bfe19c523b7cd536a0c5459594e2f6c9a3e | 5,007 | #
# Be sure to run `pod spec lint SHMIDIKit.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://github.c... | 36.282609 | 101 | 0.589774 |
b91599f04a1a57e372a2a829ba7e70ba9959c050 | 444 | cask 'font-hanamina' do
version '2017.09.04,68253'
sha256 '571cd4a09ae7da0c642d640fc2442c050aa450ebb0587a95cdd097d41a9c9572'
# osdn.dl.osdn.jp/hanazono-font was verified as official when first introduced to the cask
url "https://osdn.dl.osdn.jp/hanazono-font/#{version.after_comma}/hanazono-#{version.before_com... | 34.153846 | 113 | 0.768018 |
bfa578a0741ac07374764890ec7c82f13c3d7ed8 | 36 | AasmPlus::Engine.routes.draw do
end
| 12 | 31 | 0.805556 |
1cd93cd5ec930366ba040d4c35d682e96c1e7e95 | 3,949 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'erb'
require_relative 'octokit_utils'
require_relative 'options'
options = parse_options
parsed = load_url(options)
util = OctokitUtils.new(options[:oauth])
open_prs = []
def does_array_have_pr(array, pr_number)
found = false
array.each do |entry|
... | 33.466102 | 120 | 0.651557 |
b92d2a51cbe6f3c12b33d4b6e1a1ab2801e8aa68 | 849 | class PicardTools < Formula
desc "Tools for manipulating HTS data and formats"
homepage "https://broadinstitute.github.io/picard/"
url "https://github.com/broadinstitute/picard/releases/download/2.23.3/picard.jar"
sha256 "0eae556a8f925d0790d9df2c94b7df323a0107eecdd6ac45866c391921888f23"
license "MIT"
bottl... | 28.3 | 92 | 0.707892 |
79059dcf23aafd6dc432ee5c1205ee825bb9b52f | 1,541 | require "formula"
class Jenkins < Formula
homepage "https://jenkins-ci.org"
url "http://mirrors.jenkins-ci.org/war/1.598/jenkins.war"
sha1 "ee3f94a2eab93a119baaa897a2fd0045cc401e73"
head do
url "https://github.com/jenkinsci/jenkins.git"
depends_on "maven" => :build
end
depends_on :java => "1.6"
... | 27.517857 | 106 | 0.609345 |
6a9f6c7e2b8ade393ab3449bf62b92903eea997d | 3,173 | require 'slack-notifier'
module WorkerTools
module SlackErrorNotifier
def with_wrapper_slack_error_notifier(&block)
block.yield
rescue StandardError => e
slack_error_notify(e) if slack_error_notifier_enabled
raise
end
def slack_error_notifier_enabled
Rails.env.production?
... | 29.933962 | 107 | 0.691459 |
39ba8c35b7cefb4366c9991a24146a0e9bd4f16c | 5,983 | require 'vcap/services/api'
require 'controllers/services/lifecycle/service_instance_binding_manager'
require 'models/helpers/process_types'
require 'actions/services/service_binding_read'
module VCAP::CloudController
class ServiceBindingsController < RestController::ModelController
define_attributes do
to... | 41.839161 | 172 | 0.74344 |
113f5b43c4ecf16c4fb56a3ed802d1fa79dab45b | 1,406 | require "webrat/selenium/application_servers/base"
module Webrat
module Selenium
module ApplicationServers
class Rack < Webrat::Selenium::ApplicationServers::Base
def start
@pid = fork do
if File.exist?("log")
redirect_io(STDOUT, File.join("log", "webrat.webrick... | 27.038462 | 148 | 0.568279 |
036bba7c5bef7ff44a59ea4f6a27f34f5d0c92b0 | 822 | # -*- coding: binary -*-
module Rex
module Crypto
# Returns an encrypted string using AES256-CBC.
#
# @param iv [String] Initialization vector.
# @param key [String] Secret key.
# @return [String] The encrypted string.
def self.encrypt_aes256(iv, key, value)
aes = OpenSSL::Cipher::AES2... | 24.909091 | 51 | 0.615572 |
4afe36b3986247319b528907d56406eb657bc84a | 24,334 | require 'set'
require 'savon'
require 'netsuite/version'
require 'netsuite/errors'
require 'netsuite/utilities'
require 'netsuite/utilities/data_center'
require 'netsuite/rest/utilities/roles'
require 'netsuite/rest/utilities/request'
require 'netsuite/core_ext/string/lower_camelcase'
module NetSuite
autoload :Conf... | 74.644172 | 117 | 0.667831 |
335f70bbc17e90874f3e96907a3172308cbb2be2 | 252 | allowed_environments = %w{ production staging development test }
unless allowed_environments.include? node.chef_environment
raise "Dude, your environment #{node.chef_environment.inspect} is really not one of #{allowed_environments.join(', ')}."
end
| 42 | 122 | 0.793651 |
b9cdee837e0e18d5c8c42cd098d3be228244b6ca | 142 | # frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: 'noreply@serious-lunch.com'
layout 'mailer'
end
| 20.285714 | 44 | 0.78169 |
79c0a1e4704a20e14956d4e5c569676b1ec7f112 | 126 | require_relative('ios/test_app')
def use_test_app!(options = {}, &block)
use_test_app_internal!(:ios, options, &block)
end
| 21 | 47 | 0.738095 |
79481d85882131e8c8badfc9ec35a18fabebb6ab | 1,147 | # frozen_string_literal: true
module Xcode
include MiniTest::Assertions
def self.product_with_name(name, destination:, derived_data_path:)
glob = File.join(derived_data_path, "**/Build/**/Products/#{destination}/#{name}/")
Dir.glob(glob).max_by { |f| File.mtime(f) }
end
def self.find_framework(produc... | 28.675 | 87 | 0.71578 |
1c75c67403da6980963bcaa28e1ca23e02415e5d | 459 | cask 'natron' do
version '2.3.3'
sha256 '3efe76aa82872b2bdd80ec96746151d3997c9662967d008d22a010eff241e483'
url "https://downloads.natron.fr/Mac/releases/Natron-#{version}.dmg",
referer: 'https://natron.fr/download/?os=Mac'
appcast 'https://github.com/MrKepzie/Natron/releases.atom',
checkpoint: ... | 32.785714 | 88 | 0.749455 |
6a088569a52a4a16a979c988083bdd29ecf8a290 | 125 | module Sass::Script::Functions
def microtime()
return Sass::Script::Number.new(Time.now.to_f * 1000)
end
end
| 20.833333 | 61 | 0.664 |
ff48eeb74e74857078a75e55baef8bae94119302 | 3,566 | # frozen_string_literal: true
module Archimate
module FileFormats
module Sax
SaxEvent = Struct.new(:sym, :args, :source)
FutureReference = Struct.new(:obj, :attr, :id)
autoload :AnyElement, 'archimate/file_formats/sax/any_element'
autoload :CaptureContent, 'archimate/file_formats/sax/cap... | 62.561404 | 126 | 0.762479 |
edd4555568bcb5dbb7f432ff429635b64d7edb94 | 566 | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
#ActiveSupport.on_load(:action_controller) do
# wrap_parameters... | 31.444444 | 96 | 0.784452 |
e20944d6a76b6952a1c04fcf220511938d1739d1 | 253 | # frozen_string_literal: true
module Namespaceable
extend ActiveSupport::Concern
included do
include Pundit
before_action :namespace
end
private
def namespace
@namespace = Namespace.friendly.find(params[:slug][1..])
end
end
| 14.055556 | 60 | 0.727273 |
b937e253a893c6756cb54c42871934f18a738d52 | 6,051 | # frozen_string_literal: true
require 'i18n/backend/base'
module I18n
begin
require 'oj'
class JSON
class << self
def encode(value)
Oj::Rails.encode(value)
end
def decode(value)
Oj.load(value)
end
end
end
rescue LoadError
require 'ac... | 29.517073 | 111 | 0.571311 |
1c60e0d668dabd96df5c7a71df6c6a2ada1d26b9 | 131 | require 'test_helper'
class DogsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| 16.375 | 53 | 0.725191 |
ab9409d4e737ae2eab11f5b2f4cf6697bd59cd8e | 8,775 | describe 'Ridgepole::Client#diff -> migrate' do
context 'when add column after id (pk: normal)' do
let(:actual_dsl) do
erbh(<<-ERB)
create_table "employees", force: :cascade do |t|
t.date "birth_date", null: false
t.string "first_name", limit: 14, null: false
t.st... | 36.5625 | 90 | 0.579943 |
f704b81ee6db285c927ca9c97c2c4a81dbc1b819 | 1,461 | module Concurrent
module Synchronization
# @!visibility private
# TODO (pitr-ch 04-Dec-2016): should be in edge
class Condition < LockableObject
safe_initialization!
# TODO (pitr 12-Sep-2015): locks two objects, improve
# TODO (pitr 26-Sep-2015): study
# http://grepcode.com/file/... | 23.95082 | 176 | 0.637235 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.