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 |
|---|---|---|---|---|---|
6147f347a518bdbb8d0f4faad36b1fb20c91a560 | 1,271 | cask "atom" do
version "1.55.0"
sha256 "42932be997034b026d3f3104fb7b4c88a08852afba74f0d10b02a261db2508b6"
url "https://github.com/atom/atom/releases/download/v#{version}/atom-mac.zip",
verified: "github.com/atom/atom/"
name "Github Atom"
desc "Text editor"
homepage "https://atom.io/"
auto_updates ... | 37.382353 | 136 | 0.715972 |
7ade97d68c84b3cab8abc5b30e5a8df5d865d679 | 247 | # This migration comes from hyrax (originally 20160328222166)
class AddExternalKeyToContentBlocks < ActiveRecord::Migration[4.2]
def change
add_column :content_blocks, :external_key, :string
remove_index :content_blocks, :name
end
end
| 30.875 | 66 | 0.789474 |
91e5115fbb59c137b5c3d1afce8f9fc50f2a4dd8 | 180 | # frozen_string_literal: true
require_relative '../base_game/suicide'
# Class to represent a Quake Suicide
class QuakeSuicide < Suicide
# No customization required for now
end
| 20 | 39 | 0.788889 |
b9b6359364bd57d02f4e984366bc15ece9d1086e | 269 | require_relative 'Export/exporttopdf'
require_relative 'Export/exporttoimage'
require_relative 'Export/exporttohtml'
require_relative 'Export/exporttoxps'
require_relative 'Export/exporttosvg'
require_relative 'Export/exporttoxaml'
require_relative 'Export/exporttoxml' | 38.428571 | 39 | 0.873606 |
e8885981af01117d38ad52082d9790c5b9d365d1 | 1,312 | require 'test_helper'
class ShoppingListsControllerTest < ActionDispatch::IntegrationTest
setup do
@shopping_list = shopping_lists(:one)
end
test "should get index" do
get shopping_lists_url
assert_response :success
end
test "should get new" do
get new_shopping_list_url
assert_response ... | 26.77551 | 144 | 0.757622 |
acbbe84500afefecb7fd4bd7901c2a82f03d9caf | 159 | # frozen_string_literal: true
class WelcomeController < ApplicationController
before_action :session_already_set
def home
@user = User.new
end
end
| 15.9 | 47 | 0.779874 |
7973ffb5862cff16c6bb9c372abcf90aa4f5d696 | 2,901 | require "rails_helper"
describe "user notification preferences service" do
describe "GET /user_notification_preferences/:user_id" do
context "when the user is not authenticated" do
it "returns not authorized" do
given_i_am_an_unauthenticated_user
when_i_get_the_user_notification_preferences_... | 32.595506 | 97 | 0.732851 |
f701afef2ae8a3f11c966fa93f33ba287b8d0690 | 1,017 | module CanTango::Api
module Can
module Account
include CanTango::Api::Ability::Account
# Example: generated from types of accounts! (see below)
# def admin_account_can?(*args)
# current_account_ability(:admin).can?(*args)
# end
def self.included(base)
::CanTango.confi... | 30.818182 | 116 | 0.594887 |
1da6a6ad91f4c6402c5212c2a81eb030787f2fd2 | 1,307 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Batch::Mgmt::V2019_08_01
module Models
#
# Specifies how tasks should be distributed across compute nodes.
#
#
class TaskSchedulingPolicy
... | 26.673469 | 76 | 0.572303 |
38759312dadf3f35ef93fb74925bf3b8a1cd3bde | 10,374 | module Her
module Model
# This module handles all methods related to model attributes
module Attributes
extend ActiveSupport::Concern
# Initialize a new object with data
#
# @param [Hash] attributes The attributes to initialize the object with
# @option attributes [Hash,Array] :... | 32.117647 | 96 | 0.589262 |
08ea245796c79b54c947147398a21b33e3717879 | 173 | require File.expand_path('../../../../spec_helper', __FILE__)
require 'socket'
describe "Addrinfo#ipv6_multicast?" do
it "needs to be reviewed for spec completeness"
end
| 24.714286 | 61 | 0.734104 |
e85a0e1a5d070b8e4b78197618a26222d0a62a2a | 1,578 | require 'spec_helper'
describe SK::SDK::Oauth, "in general" do
before :each do
#setup test oAuth-data to work with
@set = oauth_settings
end
it "should create a new instance" do
lambda{ SK::SDK::Oauth.new(@set)}.should_not raise_error
end
it "should get salesking url" do
a = SK::SDK::Oauth... | 28.178571 | 82 | 0.653992 |
08d56fd07a78d9bbae6bdbbffbf81a44d2996dde | 3,043 | require 'test_helper'
require 'tweet_handler'
require 'twitter'
require 'support/fake_tweets'
class TweetHandlerTest < ActiveSupport::TestCase
test "on post, should save 'tweet'" do
@tweet = Twitter::Tweet.new($tweet)
assert_difference('Tweet.count', 1) do
TweetHandler.on_post(@tweet)
end
end
... | 29.259615 | 97 | 0.686494 |
18c0dd7838010b8fdf04fdfa66108f2c772ecdda | 1,042 | module CharacterSet
class CharacterSetConverter
attr_reader :characters, :options, :size
def initialize(characters, options = {})
@characters = characters
options[:repeat] = true unless options.include?(:repeat)
@options = options
@size = characters.size
end
def to_characters(... | 26.05 | 69 | 0.653551 |
1ca7ebf6e9c061ece3d1bb74ac8f2102127b4de4 | 6,595 | require 'rails_helper'
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_market.rb"
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_application.rb"
RSpec.describe ShopEmployeeNotices::EmployeeTerminatingCoverageConfirmation, :dbclean => :after_each do
include_context "setup ... | 54.057377 | 275 | 0.73768 |
01285922d8f56c808831bc9c9e5944189a2ea5a0 | 668 | require_relative 'boot'
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 GameReviewProject
class Application < Rails::Application
# Initialize configuration defaults for originally generat... | 33.4 | 82 | 0.767964 |
ab620b627e9d4ea33426301058e09c41ed96441f | 299 | json.meta do
json.status "ok"
json.set! :"message-type", "contributor_role"
json.set! :"message-version", "v7"
end
json.contributor_role do
json.cache! ['v7', @contributor_role], skip_digest: true do
json.(@contributor_role, :id, :title, :description, :image_url, :timestamp)
end
end
| 24.916667 | 79 | 0.702341 |
bbf363de3bd33b6b76b2a76085cdaedd9a05fff9 | 2,468 | # taglist_spec.rb
#
# @author Ollivier Robert <roberto@keltia.net>
#
# $Id: taglist_spec.rb,v a08712c41a07 2012/12/06 22:53:38 roberto $
require 'rspec'
require 'gmail/taglist'
describe GMail::TagList do
before(:each) do
@tl = GMail::TagList.new
@t1 = GMail::Tag.new('Foo')
@t2 = GMail::Tag.new('Bar/... | 20.915254 | 70 | 0.581037 |
389e4a2a6959343b3d0527046e711fdd98edac25 | 5,437 | describe Match do
describe Match::Utils do
before(:each) do
allow(FastlaneCore::Helper).to receive(:backticks).with('security -h | grep set-key-partition-list', print: false).and_return(' set-key-partition-list Set the partition list of a key.')
end
describe 'import' do
it 'f... | 51.780952 | 208 | 0.683097 |
7970151d603407dac9c1d6b50aeee26058058c3c | 14,695 | # frozen_string_literal: true
module SearchHelper
SEARCH_GENERIC_PARAMS = [
:search,
:scope,
:project_id,
:group_id,
:repository_ref,
:snippets,
:sort,
:force_search_results,
:project_ids
].freeze
def search_autocomplete_opts(term)
return unless current_user
resource... | 31.602151 | 152 | 0.648792 |
bf09abc7d99b80c71fe88a204ebcd86ab5cce973 | 1,603 | # frozen_string_literal: true
# rubocop:disable Metrics/BlockLength
RSpec.describe Limpio do
it "has a version number" do
expect(Limpio::VERSION).not_to be nil
end
context "for Hashes" do
let(:hash) do
{
key1: "value1",
key2: "",
key3: {
key4: "value4",
... | 17.811111 | 60 | 0.436057 |
012efddc5d35221144818b628465b595b87a7603 | 1,038 | class Bluepill < Formula
desc "Testing tool for iOS that runs UI tests using multiple simulators"
homepage "https://github.com/linkedin/bluepill"
url "https://github.com/linkedin/bluepill.git",
:tag => "v5.4.1",
:revision => "08d3951f77dcf5a54e6a03cc6ae5b3f774d1bb04"
license "BSD-2-Clause"
head "... | 32.4375 | 90 | 0.684971 |
ac75b1432872648e14fb11c284910cb0300867f2 | 291 | class CrateQuestionSequenceLogsTable < ActiveRecord::Migration[5.1]
def change
create_table :question_sequence_logs do |t|
t.jsonb :log, null: false, default: '{}'
t.timestamps
end
add_reference :results, :question_sequence_log, index: true, default: nil
end
end
| 29.1 | 77 | 0.718213 |
61339f5cb5ce9a17eeeca389ef5276eeadd53d57 | 336 | class InvoiceItem < ApplicationRecord
include Versions
belongs_to :invoice
delegate :vat_rate, to: :invoice
def item_sum_without_vat
(price * quantity).round(3)
end
alias_method :subtotal, :item_sum_without_vat
def vat_amount
subtotal * (vat_rate / 100)
end
def total
(subtotal + vat_am... | 16.8 | 47 | 0.720238 |
2888c9ab4c020f1cb2bae22d7dde6b8438c727d0 | 2,331 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Dat... | 30.272727 | 102 | 0.733591 |
ac2b621df2f6e07b43c9933013693653d4b446a7 | 17,601 | require 'fileutils'
require 'vcr/util/hooks'
module VCR
# Stores the VCR configuration.
class Configuration
include Hooks
include VariableArgsBlockCaller
include Logger
# The directory to read cassettes from and write cassettes to.
#
# @overload cassette_library_dir
# @return [String... | 37.851613 | 110 | 0.671098 |
08c9096cbcd065d38b33c3014bfa12cd39eb5ea5 | 64 | module Simple
module Metrics
VERSION = "0.0.12"
end
end
| 10.666667 | 22 | 0.65625 |
87bdf0f1d784cca357232b8fc09d5e7535052f6c | 1,738 | ActiveModelSerializers.config.adapter = :json_api
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 developmen... | 38.622222 | 85 | 0.776755 |
01062232f3b3fdcd43a666feb5ce662f3589b114 | 252 | module MsGraph
class User < Node
def initialize(id, attributes = {})
super
end
class << self
def me(access_token)
new(:me).authenticate(access_token)
end
def all(access_token)
end
end
end
end | 14.823529 | 43 | 0.583333 |
ab41e8bf13ce1b84e5e38eaaf24cea19db8fa96e | 132 | class Invite < ApplicationRecord
belongs_to :party
belongs_to :guest
validates :add_on, :rsvp, presence: true
end
| 16.5 | 44 | 0.69697 |
d56d1f82668a73bd0e4f9f16ce43e4ba9374a12c | 827 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
test 'index as admin including pagination and delete links' do
log_in_as(@admin)
get users_path
assert_template 'users/index'
assert_select 'div... | 25.060606 | 66 | 0.677146 |
ac3fd49e0397525f3d4f4025edafe81db0883a68 | 381 | class Ufo::CLI
class Clean < Base
def run
folders = %w[log output tmp]
folders = folders.map do |folder|
".ufo/#{folder}"
end
sure?("Will remove folders: #{folders.join(' ')}")
folders.each do |folder|
FileUtils.rm_rf("#{Ufo.root}/#{folder}")
end
logger.in... | 23.8125 | 57 | 0.559055 |
ff7f2c7f81b6d3354ed23ba224b2e657ce23a60d | 144 | require 'test_helper'
class ActivemerchantPaymentechOrbitalTest < Test::Unit::TestCase
def test_something_for_real
assert true
end
end
| 18 | 64 | 0.805556 |
bf9dd8991b9d1be32fbd6310b4cf90a42d0897be | 776 | Pod::Spec.new do |s|
s.name = "FlowFramework"
s.version = "1.8.3"
s.module_name = "Flow"
s.summary = "Working with asynchronous flows"
s.description = <<-DESC
Flow is a Swift library for working with event handling, asynchronous operations and life time management.
... | 36.952381 | 125 | 0.588918 |
91df5a394c2dfd804c05ce1098bbc45ea9908df3 | 447 | # Preview all emails at http://localhost:3000/rails/mailers/supervisor_mailer
# :nocov:
class SupervisorMailerPreview < ActionMailer::Preview
def account_setup
supervisor = Supervisor.find_by(id: params[:id]) || Supervisor.last
SupervisorMailer.account_setup(supervisor)
end
def weekly_digest
supervis... | 29.8 | 77 | 0.765101 |
28a1c7bbeabe0bea952e6eaeb68ef5832ab62fa8 | 380 | $LOAD_PATH.unshift '../lib'
require 'memory_record'
class A
include MemoryRecord
memory_record [
{key: :a},
{key: :b},
]
end
[A[:b], A[:a]].sort.collect(&:key) # => [:a, :b]
class B
include MemoryRecord
memory_record [
{key: :a},
]
end
# class different
[A[:a], B[:a]].sort.collect(&:key) res... | 16.521739 | 97 | 0.6 |
ac5047e22ceb55624fccb8ac17c90c76bb1a15e1 | 17,320 | # frozen_string_literal: true
require 'minitest/autorun'
require 'minitest/mock'
require_relative '../lib/twiglet/logger'
LEVELS = [
{ method: :debug, level: 'debug' },
{ method: :info, level: 'info' },
{ method: :warning, level: 'warn' },
{ method: :warn, level: 'warn' },
{ method: :critical, level: 'fatal... | 30.069444 | 120 | 0.588741 |
87536fa8c1f462031a43a370310d9200bf5825eb | 103 | # Dependencies
require "sass"
# Config
css_dir = "css"
sass_dir = "sass"
output_style = :compressed | 10.3 | 26 | 0.708738 |
f7d36dc550339e6baf67a94a6c9a6499d5d0bf17 | 1,963 | # Configure Solidus Preferences
# See http://docs.solidus.io/Spree/AppConfiguration.html for details
Spree.config do |config|
# Without this preferences are loaded and persisted to the database. This
# changes them to be stored in memory.
# This will be the default in a future version.
config.use_static_prefer... | 26.890411 | 86 | 0.741212 |
bf3d8216f9bd1848c60eaecb23cf042e580628d0 | 2,755 | # 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_05_01
module Models
#
# Network Intent Policy resource.
#
class NetworkIntentPolicy < Resource
i... | 27.828283 | 76 | 0.427223 |
f760b82420763c2168af6a76cb12f1b17f8dd1df | 6,768 | class Pypy < Formula
desc "Highly performant implementation of Python 2 in Python"
homepage "https://pypy.org/"
url "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-src.tar.bz2"
sha256 "6097ec5ee23d0d34d8cd27a1072bed041c8a080ad48731190a03a2223029212d"
head "https://bitbucket.org/pypy/pypy", :using => :... | 36.782609 | 138 | 0.690898 |
f7c04f1400f40ce242e1f9f192a48aa5ba86f772 | 479 | # require 'fileutils'
# require 'net/ftp'
require 'el_finder_s3/operations'
require 'el_finder_s3/dummy_cache_client'
require 'el_finder_s3/cache_connector'
require 'el_finder_s3/adapter'
require 'el_finder_s3/railties'
require 'el_finder_s3/base64'
require 'el_finder_s3/s3_connector'
require 'el_finder_s3/s3_pathname... | 28.176471 | 41 | 0.835073 |
1a3d30f884b4f70b5cc1f85378dfec9921d0217f | 944 | class Counter
attr_reader(:q_count, :d_count, :n_count, :p_count)
def initialize(change)
@totalChange = change
@quarter = 25
@dime = 10
@nickel = 5
@penny = 1
@q_count = 0
@d_count = 0
@n_count = 0
@p_count = 0
end
def change_count()
until @quarter * @q_count > @tot... | 24.842105 | 120 | 0.565678 |
f76f8cbda3521986d2cc90a85b8945da3e469372 | 945 | # frozen_string_literal: true
module RiskifiedRubySdk
class Cancel
class << self
def create(data, client:)
cancel = client.post(path, data).with_indifferent_access
build cancel
rescue NoMethodError => _e
Error.new("NoMethodError: #{data}, cancel: #{cancel}")
end
... | 26.25 | 98 | 0.666667 |
e29c5b7f5444d660187bc64fac257687f89e5ce1 | 2,899 | require "active_support/core_ext/integer/time"
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 any time
# it changes. This slows down response time but is perfect for developme... | 35.790123 | 87 | 0.767161 |
3896a8f5cb66701bf08e8102d24c71e72751697f | 124 | module AppleNewsClient
module Style
class Document < Base
required_property :background_color
end
end
end
| 15.5 | 41 | 0.733871 |
5dd45adbb3c2c756ae87ee71554e816b535b4872 | 722 | #!/usr/bin/ruby
#
# Copyright 2019 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 agre... | 36.1 | 74 | 0.747922 |
6ac48d0269f574a6dfca7f5bcc083e44092d5482 | 985 | # frozen_string_literal: true
require 'rails_helper'
describe PagesHelper do
describe '#render_blog_feed' do
let(:rendered_feed) { helper.render_blog_feed(File.open(File.expand_path(File.join('..', '..', 'fixtures', 'sample_rss_feed.xml'), __FILE__))) }
it 'creates the correct HTML content' do
expect... | 30.78125 | 148 | 0.693401 |
62d494ed92862cf2186853f438ff7749fab68f46 | 1,293 | describe ManageIQ::Providers::CiscoIntersight::PhysicalInfraManager do
it ".ems_type" do
expect(described_class.ems_type).to eq("cisco_intersight")
end
it ".description" do
expect(described_class.description).to eq("Cisco Intersight")
end
let(:ems) { FactoryBot.create(:ems_cisco_intersight_p... | 34.026316 | 86 | 0.719258 |
01d329bc8e72a993ebab227f757cbd4b957e7a3f | 8,313 | # Copyright 2017 Google Inc. 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 24.522124 | 78 | 0.688921 |
38378d32f1de1e1d65b1e2bb6c369c634b0bbef6 | 1,914 | class CategoriesController < ApplicationController
before_action :set_category, only: [:show, :edit, :update, :destroy]
# GET /categories
# GET /categories.json
def index
@categories = Category.all
end
# GET /categories/1
# GET /categories/1.json
def show
end
# GET /categories/new
def new
... | 25.52 | 96 | 0.667189 |
5d0710488d991c0a3804c2dbe0912459a67f477d | 1,435 | ########################################
# #
# Important Note #
# #
# When running calabash-ios tests at #
# www.xamarin.com/test-cloud #
# the methods invoked by #
# CalabashLauncher are overridd... | 30.531915 | 122 | 0.608362 |
bb5453acfa1abab36f0a161ea06a7fccb3f36543 | 5,632 | # frozen_string_literal: true
require 'test_helper'
# Tests for f.input_field
class InputFieldTest < ActionView::TestCase
def with_input_field_for(object, *args)
with_concat_form_for(object) do |f|
f.input_field(*args)
end
end
test "builder input_field only renders the input tag, nothing else" do
... | 31.819209 | 86 | 0.738104 |
1d60657339b2fbac4f6bdd1e2c607cf0e0fd37de | 551 | require 'rails/generators'
module LightAdmin
class VariablesGenerator < ::Rails::Generators::Base
source_root File.expand_path('../../app/assets/stylesheets/light_admin', __dir__)
def add_variables
directory "variables", "app/assets/stylesheets/light_admin/custom_variables"
end
end
class NewS... | 27.55 | 99 | 0.731397 |
6a7611d019bf01ecadda45f6aad92c70547c3efc | 1,685 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe DecodeJWT, type: :service do
subject { described_class.new(raw_jwt) }
describe '#call' do
context 'when given JWT is nil' do
let(:raw_jwt) { nil }
it 'raises DecodeJWTError' do
expect { subject.call }.to raise_error(Deco... | 26.328125 | 67 | 0.616024 |
799cc627d594a1e04c99158c99489586e31fbc9d | 102 | require "docker/client/version"
module Docker
module Client
# Your code goes here...
end
end
| 12.75 | 31 | 0.705882 |
33a75ab94d37ca6852f4b12936a6a2bdfe0185ff | 1,541 | module EventStore
module Messaging
module Message
module Proceed
extend self
def self.call(source, receiver=nil, copy: nil, include: nil, exclude: nil, strict: nil)
proceed(source, receiver, copy: copy, include: include, exclude: exclude, strict: strict)
end
def p... | 26.568966 | 99 | 0.576249 |
4a5ef0f99974f671278535dc4114869ab91966a4 | 648 | cask 'font-monoid-large-1-nocalt' do
version :latest
sha256 :no_check
# github.com/larsenwork/monoid was verified as official when first introduced to the cask
url 'https://github.com/larsenwork/monoid/blob/release/Monoid-Large-1-NoCalt.zip?raw=true'
name 'Monoid-Large-1-NoCalt'
homepage 'http://larsenwork... | 32.4 | 92 | 0.740741 |
28ee19a56ad0d898c4de0b51bc8e227890c3a6ca | 6,328 | require 'rails_helper'
def find_button_by_label(label_text)
find(:xpath, "//form//input[contains(@class,'govuk-button') and @value='#{label_text}']")
end
def find_continue_button
find_button_by_label(I18n.t('submit_button'))
end
def find_summary_button
find_button_by_label(I18n.t('summary.truth.button'))
end
... | 47.578947 | 113 | 0.711915 |
28bbcaf3c634f76fd020db38ccf1c9f99ab1aa3b | 6,785 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
def initialize(info = {})
... | 34.794872 | 108 | 0.607222 |
d581ddb22dc966792043530e124d9886d0b0b639 | 902 | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "login with valid information followed by logout" do
get login_path
post login_path, params: { session: { email: @user.email,
p... | 30.066667 | 68 | 0.635255 |
1dc08deca8cc8be8d3cbb46d7f7ec5ced922c64d | 79 | require 'test_helper'
class CompromissosHelperTest < ActionView::TestCase
end
| 15.8 | 51 | 0.835443 |
0128b02aba6fe30920e0297217f81f2ff4af6318 | 1,096 | require 'rails_helper'
RSpec.describe Evidence::HmrcSkipsController, type: :controller do
let(:office) { create(:office) }
let(:user) { create :user, office: office }
let(:evidence) { create :evidence_check, income_check_type: 'hmrc', application: application }
let(:application) { create :application, user: us... | 36.533333 | 100 | 0.667883 |
38eed275b90c0faeb5a013d90203f35eea175d93 | 1,118 | Pod::Spec.new do |s|
s.name = 'GPActivityViewController'
s.version = '1.1.2'
s.authors = { 'Gleb Pinigin' => 'gpinigin@gmail.com' }
s.homepage = 'https://github.com/gpinigin/GPActivityViewController'
s.summary = 'Alternative to UIActivityViewController compatible with iOS5.0.'
s.source... | 41.407407 | 130 | 0.671735 |
bbd9f89dbb1fe2dfee6c57e2626cc77c1e1c89f4 | 14,961 | #!/usr/bin/env ruby
require 'json'
require 'open3'
require 'yaml'
ENV['PATH'] = Open3.capture2('./_sharedresources', 'mediainfo', 'youtubedl').first
Lists_dir = ENV['lists_dir'].nil? || ENV['lists_dir'].empty? ? ENV['alfred_workflow_data'] : File.expand_path(ENV['lists_dir'])
Towatch_list = "#{Lists_dir}/towatch.yam... | 31.16875 | 236 | 0.672816 |
bb1dca6ccc42348bb03f6fb25ef5847d8a13feb2 | 566 | require 'fog/ecloud/models/compute/authentication_level'
module Fog
module Compute
class Ecloud
class AuthenticationLevels < Fog::Ecloud::Collection
identity :href
model Fog::Compute::Ecloud::AuthenticationLevel
def all
data = service.get_authentication_levels(href).body... | 20.962963 | 61 | 0.606007 |
91db17bb39cb55fefcef00c10ed0ec79238c0877 | 3,627 | require_relative "snapshot"
# EMBELL record (6):
# Consists of:
# record type (6)
# options
# [nudge] if mtefOPT_NUDGE is set
# [embell] embellishment type
# The embellishment types are:
# value symbol description
# 2 emb1DOT over single dot
# 3 emb2DOT over double dot
# 4 emb3DOT over triple dot
# 5 emb1PRIME singl... | 34.875 | 75 | 0.654535 |
bf003eaf7383ec78e31bc16872b66994c24f35f1 | 335 | FactoryBot.define do
sequence :loc_index, 1
factory :medium do
type { "subject_location" }
association :linked, factory: :subject
content_type { "image/jpeg" }
path_opts { ["1"] }
src { "panoptes-uploads.zooniverse.org/1/1/#{SecureRandom.uuid}.jpeg" }
metadata { {index: generate(:loc_index)... | 25.769231 | 75 | 0.662687 |
010d7dd5a082e35c6d9a5e130ed937542d09c2da | 815 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.authors = ['Jim Fiorato']
s.email = 'hello@theoldreader.com.com'
s.homepage = 'https://github.com/theoldreader/feedjira-atypon'
s.license = 'MIT'
s.name = 'feedjira-atypon'
s.platform = Gem::Platform::RUBY
s.summary = 'Atypon RSS format ... | 30.185185 | 72 | 0.669939 |
bffd1551659c567a601e763abf7c5d1942b5aab8 | 1,457 | class Hackrf < Formula
desc "Low cost software radio platform"
homepage "https://github.com/mossmann/hackrf"
url "https://github.com/mossmann/hackrf/archive/v2018.01.1.tar.gz"
sha256 "84dbb5536d3aa5bd6b25d50df78d591e6c3431d752de051a17f4cb87b7963ec3"
license "GPL-2.0"
head "https://github.com/mossmann/hackrf... | 36.425 | 106 | 0.759094 |
b98fa9c22c73c01d9590c6ae5b2ecf2f89ac1e51 | 1,241 | require 'tupelo/app'
Tupelo.application do
child do
write(
{name: "alice", balance: 1000},
{name: "bob", balance: 200}
)
10.times do |i|
alice = take(name: "alice", balance: Numeric)
log alice
alice = alice.dup
alice["balance"] -= 10
write_wait alice
sleep ... | 24.333333 | 76 | 0.604351 |
7a453070a536df8389e019584766c8b614427388 | 563 | module GrafanaDash
class Dashboard
attr_reader :properties
def initialize(options = {})
{
panels: [],
rows: [],
templating: {},
time: {
from: 'now-1h',
to: 'now'
}
}.each do |k, v|
options[k] ||= v
end
@properties = ... | 16.558824 | 42 | 0.515098 |
ab811479521d56ac0e93804b12221e84f214da6c | 491 | # frozen_string_literal: true
class CreateSimulationContagionInstant < ActiveRecord::Migration[5.2]
def change
create_table :simulation_contagion_instants do |t|
t.bigint :contagion_id, null: false
t.bigint :current_population_id
t.integer :day, null: false
t.string :status, default: :cre... | 28.882353 | 69 | 0.718941 |
791d8a4ae9d0735f0b9f44cdc5fd9e0732aa0671 | 24,009 | # 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... | 47.35503 | 326 | 0.699238 |
abfcda5673adcd1b6f23debb323c7c72302f7570 | 3,277 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex'
class Metasploit3 < Msf::Post
def initialize(info = {})
super(update_info(info,
'Name' => 'Windows Gather Enumerate ... | 30.626168 | 119 | 0.595362 |
ed9532724d7b6aa5a0ddc2e5ed0f09734e7e2e4d | 1,164 | # frozen_string_literal: true
#
# Load ElasticLoadBalancing (v1) assets into RedisGraph
#
# Each method returns an array of Cypher queries
#
class AWSLoader::ElasticLoadBalancing < GraphDbLoader
def load_balancer
node = 'AWS_ELASTIC_LOAD_BALANCER'
q = []
# load_balancer node
q.push(_upsert({ node: n... | 27.069767 | 90 | 0.668385 |
797003fcc59a8353e7a45ae438caaf6ea9f9b58c | 5,111 | # frozen_string_literal: true
require "active_record/connection_adapters/abstract_mysql_adapter"
require "active_record/connection_adapters/mysql/database_statements"
gem "mysql2", "~> 0.5"
require "mysql2"
module ActiveRecord
module ConnectionHandling # :nodoc:
# Establishes a connection to the database that'... | 27.777174 | 158 | 0.620818 |
e842f8c64efb561781cb7fa874bcac4730cf07aa | 1,372 | # frozen_string_literal: true
class FrenchScenesController < ApplicationController
layout 'plain'
def new
french_scene = scene.french_scenes.build
render locals: { french_scene: french_scene }
end
def create
french_scene = scene.french_scenes.build
if french_scene.update(french_scene_params... | 22.866667 | 94 | 0.71137 |
015267c629b97f24ac65d0e3c6d3870b9dec69a9 | 161 | FactoryBot.define do
factory :project_membership do
project
user
factory :project_membership_as_admin do
role { 'admin' }
end
end
end
| 14.636364 | 43 | 0.68323 |
4a8a06e1cb65d89bde0c80bfd9afceddc50fc82d | 601 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.homepage = package['homepage']
s.license = package['license']
s.auth... | 26.130435 | 101 | 0.657238 |
39a9fdb3079bbdf9599dfce9b5f9df9a8b91069d | 854 | require 'forwardable'
module Interactive
class Question
extend Forwardable
attr_accessor :question, :options, :columns
def_delegators :@question_type, :reask!
def initialize(&block)
yield self
@options = Interactive::Options(Array(@options), @columns)
raise ArgumentError, "questi... | 23.081081 | 98 | 0.694379 |
621d92b8fde81e3edd42eb36f71c995c8a4b1a12 | 354 | # frozen_string_literal: true
module Numismatics
class FirmDecorator < Valkyrie::ResourceDecorator
display :name,
:city
def manageable_files?
false
end
def manageable_order?
false
end
def manageable_structure?
false
end
def title
[name, city].com... | 14.75 | 51 | 0.624294 |
bb500c34912d588d839bc23a37d3041cad4cfdd2 | 342 | feature "Video tagging" do
scenario 'unwatched videos are not tagged' do
visit('/video/1')
expect(page).to have_no_selector('.watched-tag')
end
scenario 'watched videos are tagged after being watched' do
visit('/video/1')
watch_video()
visit('/video/1')
expect(page).to have_selector('.w... | 22.8 | 61 | 0.681287 |
18eefd2d5295d3029ec74a0697dd33fc44d91ee8 | 1,752 | require 'spec_helper'
describe 'Performance' do
let(:context) { Object.new }
let(:permitted_dsl_performance_penalty) { 60 } # 60% slower is allowed, any slower is not.)
describe 'generating DSL' do
before do
require 'benchmark'
@timing = { }
end
it "is no more than 60% slower than non-... | 33.692308 | 152 | 0.548516 |
1d1962e1d988ddab34bb61530b994447a40060c4 | 4,161 | module HealthSeven::V2_7_1
class Rxe < ::HealthSeven::Segment
# Give Code
attribute :give_code, Cwe, position: "RXE.2", require: true
# Give Amount - Minimum
attribute :give_amount_minimum, Nm, position: "RXE.3", require: true
# Give Amount - Maximum
attribute :give_amount_maximum, Nm, position: "RXE.4"
#... | 46.233333 | 122 | 0.759673 |
215edae051a27dccef3fb494524b8152cd5f7ab9 | 138 | class AddEmsRefToAuthentications < ActiveRecord::Migration[6.0]
def change
add_column :authentications, :ems_ref, :string
end
end
| 23 | 63 | 0.775362 |
e8ac451192ca4095ec527e13d83da9f3906526cd | 5,065 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
def replication_alert_settings_list(*args)
header_params = {}
argstring = args[0].delete('\\')
arg_hash = JSON.parse(argstring)
# Remove task name from arguments - should contain all necessary parameters for URI
arg_hash.delete('_task')
op... | 32.467949 | 217 | 0.669299 |
03922131edb92e1e58e1a7b25664fbab3e5c06c3 | 29,665 | ########################################################################################################################
# OpenStudio(R), Copyright (c) 2008-2017, Alliance for Sustainable Energy, LLC. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitt... | 41.958982 | 186 | 0.639407 |
384aa0c4cc4594cca3b6ecb91c809c2f3ba73db0 | 1,056 | require 'resque'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/array/access'
begin
require 'resque-scheduler'
rescue LoadError
begin
require 'resque_scheduler'
rescue LoadError
false
end
end
module ActiveJob
module QueueAdapters
class ResqueAdapter
class << ... | 25.142857 | 96 | 0.657197 |
bf92ab2a043ed725319a9d3242ca6e263fd91136 | 1,071 | module Hbc::Source; end
require "hbc/source/gone"
require "hbc/source/path_slash_required"
require "hbc/source/path_slash_optional"
require "hbc/source/tapped_qualified"
require "hbc/source/untapped_qualified"
require "hbc/source/tapped"
require "hbc/source/uri"
module Hbc::Source
def self.sources
[
Hbc::... | 28.184211 | 74 | 0.699346 |
1d59585dbaa43554c704f22cb6f3831925018e9f | 567 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "react-native-uuid-generator"
s.version = package['version']
s.summary = package['description']
s.authors = package['author']
s.homepage = package['homepage']
s.lice... | 27 | 116 | 0.604938 |
1819c379ba1a38907fae3be8fb3139ec716ea278 | 9,203 | require 'ostruct'
module Spree
class Shipment < ActiveRecord::Base
belongs_to :order, class_name: 'Spree::Order', touch: true
belongs_to :address, class_name: 'Spree::Address'
belongs_to :stock_location, class_name: 'Spree::StockLocation'
has_many :shipping_rates, dependent: :delete_all
has_many... | 28.580745 | 134 | 0.664783 |
281886884fe4d60b103e17fa57e8f8f0e10c98ac | 8,872 | # Copyright (c) 2016, 2022, 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... | 37.59322 | 245 | 0.671213 |
4a2a9e260125e51f75e0f393560a5147b9a085d7 | 341 | require 'rails_helper'
RSpec.describe 'root', type: :routing do
describe '_path helper' do
context '#root_path' do
subject { root_path }
it { is_expected.to eq '/' }
end
end
describe 'GET /' do
subject { { get: root_path } }
it { is_expected.to route_to(controller: 'status', action: ... | 21.3125 | 73 | 0.630499 |
bb5c6a06651b3e59393c60488c62c01830e459fc | 1,218 | require 'spec_helper'
describe Eclaircir do
describe '.configuration' do
it 'returns a new configuration' do
expect(described_class.configuration).to be_a Eclaircir::Configuration
end
end
describe '.configure' do
before do
allow(described_class)
.to receive(:configuration)
... | 22.145455 | 76 | 0.665846 |
f7434c1aa3e6097d3b87eb6b46a801d5a205d527 | 832 | cask "alfred" do
version "4.3_1205"
sha256 "eca6e890f736b61c339d20e90ccb9b741141bdf05eb4f7695a371f23eceb6cb4"
url "https://cachefly.alfredapp.com/Alfred_#{version}.dmg"
appcast "https://www.alfredapp.com/app/update#{version.major}/general.xml"
name "Alfred"
desc "Application launcher and productivity softw... | 33.28 | 93 | 0.759615 |
1ac9b4c4cf2399dc375262cf7afde20101cfa733 | 1,781 | class PetsController < ApplicationController
before_action :set_pet, only: [:show, :edit, :update, :destroy]
# GET /pets
# GET /pets.json
def index
@pets = Pet.all
end
# GET /pets/1
# GET /pets/1.json
def show
end
# GET /pets/new
def new
@pet = Pet.new
end
# GET /pets/1/edit
def ... | 23.746667 | 89 | 0.630545 |
e97e48553ff88a21b39b760ac33cd1d47f44089d | 1,814 | #
# Be sure to run `pod lib lint CocoaPodDemoBlinkingLabel.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 ... | 45.35 | 180 | 0.681367 |
629144f512d1ef046bdae1d6980616921f2d12c6 | 3,432 | # encoding: utf-8
# Store uploaded files, temporary until the import is created
#
# If files need to present afterwards should implement persistent s3 storage!!
require 'csv'
class Attachment < ActiveRecord::Base
include UserReference
belongs_to :mapping, inverse_of: :attachments
has_many :imports, dependent... | 30.371681 | 126 | 0.699301 |
1d8bdd37ac18fc442da83ac59284cbb420464328 | 123 | attributes :producline_suffix, :description, :number_indents, :goods_nomenclature_item_id,
:leaf, :uk_vat_rate
| 30.75 | 90 | 0.756098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.