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 |
|---|---|---|---|---|---|
e2b9bd185757eabd9c296b1f40b84c17c4afc0e1 | 661 | 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 Onebitflix
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rail... | 33.05 | 82 | 0.765507 |
28ae68a08aec509f1cd70a0848d9c326365fd03b | 538 | class Job < ActiveRecord::Base
belongs_to :created_by, class_name: "Member", foreign_key: :created_by_id
belongs_to :approved_by, class_name: "Member", foreign_key: :approved_by_id
scope :approved, -> { where(approved: true) }
scope :submitted, -> { where(submitted: true, approved: false) }
scope :not_submit... | 31.647059 | 77 | 0.697026 |
bb0e7060202b278ccbaca50506c47d8577114fc1 | 1,217 | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the g... | 39.258065 | 99 | 0.743632 |
ac6b5c2cb51dff865b61489991b535820f4b32bb | 747 | require 'spec_helper'
describe XClarityClient do
before :all do
WebMock.allow_net_connect! #-- Uncomment this line if you're testing with a external mock.
conf = XClarityClient::Configuration.new(
:username => ENV['LXCA_USERNAME'],
:password => ENV['LXCA_PASSWORD'],
:host => ENV['LXCA_HOST'... | 23.34375 | 94 | 0.668005 |
1d60cf2243fd8a57c203fe22d557caf6ecd14f7b | 424 | # frozen_string_literal: true
# Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
ActionMailer::Base.smtp_settings = {
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'yourdomain.com',
:addres... | 24.941176 | 41 | 0.724057 |
28c58f3a334c7e90a12517b493d3b5261a8c3782 | 7,845 | # frozen_string_literal: true
module Webdrone
class MethodLogger < Module
class << self
attr_accessor :last_time, :screenshot
end
def initialize(methods = nil)
super()
@methods = methods
end
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')
def included(base)
... | 34.108696 | 142 | 0.604207 |
79aac960c0073de37d7bcd979560b4a43fbcdca7 | 1,368 | describe Pantograph do
describe Pantograph::PantFile do
describe "git_submodule_update" do
it "runs git submodule update without options by default" do
result = Pantograph::PantFile.new.parse("lane :test do
git_submodule_update
end").runner.execute(:test)
expect(result... | 30.4 | 81 | 0.604532 |
6258a355bb980f49a3a253b83a3e20f8c7757a82 | 4,575 | class AddTriggerForEventToRolledupEventQueue < ActiveRecord::Migration
def up
execute <<-SQL
CREATE OR REPLACE FUNCTION flush_rolledup_event_queue()
RETURNS bool
LANGUAGE plpgsql
AS $body$
DECLARE
v_inserts int;
v_prunes int;
BEGIN
IF NOT pg_try_advisory_xact_lock('rolledup_event_queue'::regclass::oid... | 33.639706 | 178 | 0.730929 |
ed4655a58493ac2eb57764f4a7fa3f3f81516371 | 67 | module Public
def self.table_name_prefix
'public_'
end
end
| 11.166667 | 28 | 0.731343 |
7a5fae1f78fa44ddae7aa314d15ca3adb8abb239 | 214 | require "spec_helper"
RSpec.describe PriceComposer do
it "has a version number" do
expect(PriceComposer::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 17.833333 | 48 | 0.724299 |
e83772c63cadf907b1093b2cd2fd952e7982cd2d | 586 | module Mugen
class Account < Client
class << self
#
# /account/stats (GET)
# Retrieves account stats, such as orders made.
#
def stats(options={})
res = self.get "/account/stats", :query => options
check_for_errors(res)
res['response']
end
#
# /account/... | 21.703704 | 58 | 0.539249 |
f7dc6d4311d618e5980ac74b29462f946bc1df08 | 416 | require 'spec_helper'
module SamlIdp
describe Fingerprint do
describe "certificate_digest" do
let(:cert) { sp_x509_cert }
let(:fingerprint) { "a2:cb:f6:6b:bc:2a:33:b9:4f:f3:c3:7e:26:a4:21:cd:41:83:ef:26:88:fa:ba:71:37:40:07:3e:d5:76:04:b7" }
it "returns the fingerprint string" do
expec... | 27.733333 | 125 | 0.673077 |
bbebb7e3d1d23711088978e902b9522949226f13 | 457 | module Isomorfeus
module Preact
class RedisComponentCache
def initialize(*args)
@redis_client = Redis.new(@args)
end
def fetch(key)
json = @redis_client.get(key)
Oj.load(json, mode: :strict)
end
def store(key, rendered_tree, response_status, styles)
... | 22.85 | 79 | 0.623632 |
f70e2032f367a702fc3b91456875ba21fca64092 | 1,559 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'thread'
require 'msf/core'
require 'rex/proto/proxy/socks4a'
class Metasploit3 < Msf::Auxiliary
include Msf::Auxiliary::Report
def initialize
super(
'Name' ... | 21.652778 | 132 | 0.574727 |
5d348902549485a633e7f94ccf5b19fee6188da0 | 1,028 | # frozen_string_literal: true
require 'spec_helper'
describe Ethon::Curl do
describe ".init" do
before { Ethon::Curl.send(:class_variable_set, :@@initialized, false) }
context "when global_init fails" do
it "raises global init error" do
expect(Ethon::Curl).to receive(:global_init).and_return(... | 25.7 | 77 | 0.642996 |
e864b632ac889c17f9cf43e3187da4a1d90f6ae6 | 6,490 | require 'timecop'
describe Kafka::OffsetManager do
let(:cluster) { double(:cluster) }
let(:group) { double(:group) }
let(:logger) { LOGGER }
let(:offset_manager) {
Kafka::OffsetManager.new(
cluster: cluster,
group: group,
logger: logger,
commit_interval: commit_interval,
comm... | 27.383966 | 113 | 0.626502 |
87c0f0d1c4cea8aa07bf703ab1b64f144f2e04ff | 10,819 | #-- copyright
# OpenProject Backlogs Plugin
#
# Copyright (C)2013-2014 the OpenProject Foundation (OPF)
# Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
# Copyright (C)2010-2011 friflaj
# Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason... | 39.922509 | 293 | 0.698216 |
03aa2d8ba659aa8b8c935ceb1a5b259fadad387d | 708 | 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 RailsDocker
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rai... | 30.782609 | 79 | 0.738701 |
ff9d299dbb0285bbbb73174e231b80bc7b3e421a | 1,691 | require 'i18n'
module Enumerize
class Value < String
def initialize(attr, value)
@attr = attr
super(value.to_s)
end
def text
I18n.t(i18n_keys[0], :default => i18n_keys[1..-1])
end
def method_missing(method, *args, &block)
if method[-1] == '?' && @attr.values.include?(me... | 24.507246 | 116 | 0.573034 |
3341522456246735923897238ffcbf586ce601d6 | 244 | module Jekyll
class MarkdownConverter
alias :old_convert :convert
# This adds the gist #1 syntax.
def convert(content)
old_convert content.gsub(/gist #(\d+)/, '[gist #\1](https://gist.github.com/\1)')
end
end
end
| 22.181818 | 87 | 0.639344 |
e9ef2a8dc6c02e3bfdf970a43b546ee15c053bf9 | 4,573 | # Research Methods
# I spent [] hours on this challenge.
i_want_pets = ["I", "want", 3, "pets", "but", "only", "have", 2]
my_family_pets_ages = {"Evi" => 6, "Ditto" => 3, "Hoobie" => 3, "George" => 12, "Bogart" => 4, "Poly" => 4, "Annabelle" => 0}
# Person 1's solution
def my_array_finding_method(source, thing_to_fi... | 38.108333 | 404 | 0.741745 |
f78112bcd166246bf50baae3a15d3c69bb31cc67 | 493 | # frozen_string_literal: true
module Vnstat
class Result
##
# A module that is included by result types that can be compared based
# on their particular time information.
module TimeComparable
##
# @return [Integer, nil]
def <=>(other)
return nil unless other.respond_to?(:by... | 24.65 | 75 | 0.659229 |
1c76e4cf2bcd27430fd26c5c4416a01b3a7af8f7 | 1,550 | class Docker < Formula
desc "Pack, ship and run any application as a lightweight container"
homepage "https://www.docker.com/"
url "https://github.com/docker/docker.git",
:tag => "v17.03.1-ce",
:revision => "c6d412e329c85f32a4b2269b49aaa0794affcf88"
head "https://github.com/docker/docker.git"
bo... | 32.978723 | 95 | 0.723226 |
e265a05a9570ee40bf481cb9f4fb9df073e87e61 | 121 | class RenameActionsTable < ActiveRecord::Migration[5.2]
def change
rename_table :action_tables, :actions
end
end
| 20.166667 | 55 | 0.768595 |
e2d5f43b443a4cdb45e7eefcfbe7c79a9e38cc76 | 320 | require_relative './config/env'
use Rack::MethodOverride
use SessionsController
use UserController
use BookController
use PodcastController
use ArticleController
use RatingController
use CommentController
use FaveQuoteController
use ReactionController
use AuthorController
run ApplicationController | 17.777778 | 32 | 0.83125 |
87a079597df0a4dbf582b517bc36898e346e06c6 | 516 | cask "mweb" do
version "3.4.4,592"
sha256 :no_check
# dl.devmate.com/com.coderforart.MWeb3/ was verified as official when first introduced to the cask
url "https://dl.devmate.com/com.coderforart.MWeb3/MWeb3-ProMarkdownwriting,notetakingandstaticbloggeneratorApp.dmg"
appcast "https://updates.devmate.com/com.c... | 32.25 | 117 | 0.748062 |
d59564f6707d08a8e74ab178fea1326e1e46f7f0 | 1,909 | require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
describe 'Jpmobile::Mobile::valid_ip?' do
[
[ '210.153.84.1' , :Docomo ],
[ '210.153.84.254' , :Docomo ],
[ '210.230.128.225' , :Au ],
[ '210.230.128.238' , :Au ],
[ '123.108.237.1' , :Softbank ]... | 36.711538 | 86 | 0.486642 |
7a92bb50aba2304708abeeed0191e5b4e83d3d38 | 866 | require 'date'
describe "Date#>>" do
it "adds the number of months to a Date" do
d = Date.civil(2007,2,27) >> 10
d.should == Date.civil(2007, 12, 27)
end
it "sets the day to the last day of a month if the day doesn't exist" do
d = Date.civil(2008,3,31) >> 1
d.should == Date.civil(2008, 4, 30)
... | 28.866667 | 80 | 0.665127 |
e91f97bdbe1903645d550e315c6bb506a2548b2b | 89 | require File.expand_path('../application', __FILE__)
Copycopter::Application.initialize!
| 29.666667 | 52 | 0.808989 |
037bfc3a67b8662f99f96e24751ab008c26d6182 | 1,963 | Pod::Spec.new do |s|
s.name = "FontAwesomeIconFactory"
s.version = "1.0"
s.summary = "Create icons using the resolution-independent Font Awesome."
s.description = <<-DESC
A factory for turning Font Awesome pictograms into icon
images for user interface ... | 35.690909 | 82 | 0.560876 |
5df58bfe772cc268e9fcb8b91787e7be614b2ca0 | 26,376 | # = net/pop.rb
#
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
#
# Copyright (c) 1999-2007 Minero Aoki.
#
# Written & maintained by Minero Aoki <aamine@loveruby.net>.
#
# Documented by William Webber and Minero Aoki.
#
# This program is free software. You can re-distribute and/or
# modify this program under the same ... | 26.376 | 85 | 0.565059 |
03c42fae5c539ba82fde70defe313816ef212acc | 322 | class TestJIRAService < MiniTest::Unit::TestCase
def setup; end
def teardown; end
def test_token_constructor
inst = JIRA::JIRAService.instance_with_token 'url', 'user', 'token'
assert_equal 'url', inst.endpoint_url
assert_equal 'user', inst.user
assert_equal 'token', inst.auth_token
end
en... | 23 | 71 | 0.720497 |
bb0a06955634ce3d6ce73ee17a5ddfcaaab3acc4 | 6,006 | ######################################################################
# Copyright (c) 2008-2014, Alliance for Sustainable Energy.
# All rights reserved.
#
# This library is free software you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by... | 40.308725 | 163 | 0.654845 |
613bda4f8446e5011173d3fb6e0d7b04ba80ef1c | 9,684 | # frozen_string_literal: true
module Bundler
class Injector
INJECTED_GEMS = "injected gems".freeze
def self.inject(new_deps, options = {})
injector = new(new_deps, options)
injector.inject(Bundler.default_gemfile, Bundler.default_lockfile)
end
def self.remove(gems, options = {})
i... | 35.343066 | 165 | 0.656547 |
6a52253b2a4858695e8fa7febdbe7d57f67badd8 | 1,446 | # frozen_string_literal: true
module RailFeeds
module NationalRail
# A wrapper class for ::Net::HTTP
class HTTPClient < RailFeeds::HTTPClient
def initialize(credentials: nil, **args)
credentials ||= RailFeeds::NationalRail::Credentials
super
end
# Fetch path from server.
... | 31.434783 | 89 | 0.636929 |
f7fe5cb3cdc24d2320286199af9869e6a937f58d | 1,463 | class Admin::ProgramsController < AdminController
before_action :authenticate_user!
before_action :set_program, only: [:edit,:show,:destroy,:update]
def index
@programs = Program.all
end
def new
@program = Program.new
end
def create
@program = Program.new(program_params)
respond_to... | 22.507692 | 112 | 0.664388 |
6add7643d062c03bbc3de8e58b7675082cb2f6da | 12,218 | =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
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product... | 30.931646 | 240 | 0.62367 |
ab1c2deb0eef7b9529213cc0bbf0b7ef80965da4 | 1,772 | class BondsController < ApplicationController
before_action :set_bond, only: [:show, :edit, :update, :destroy]
# GET /bonds
# GET /bonds.json
def index
@bonds = Bond.all
end
# GET /bonds/1
# GET /bonds/1.json
def show
end
# GET /bonds/new
def new
@bond = Bond.new
end
# GET /bonds/1... | 23.626667 | 88 | 0.637133 |
1a3dc11467e0971377aa0ac174970cd167ff4c7e | 238 | $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
require "yaml"
require "minitest/autorun"
require "minitest/reporters"
require "secret_config"
require "amazing_print"
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
| 23.8 | 62 | 0.785714 |
ed6af57b1a114b187a73c4b6e82576d3056ed32d | 758 | module KhipuChaski
#
class SuccessResponse < BaseObject
attr_accessor :message
# attribute mapping from ruby-style variable name to JSON key
def self.attribute_map
{
# Mensaje a desplegar al usuario
:'message' => :'message'
}
end
# attribute type
... | 19.947368 | 79 | 0.568602 |
e9e9e912b12cb23f361c7e5d68832928591f56d3 | 191 | RSpec.describe OverwatchInfo do
it "has a version number" do
expect(OverwatchInfo::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 19.1 | 48 | 0.717277 |
4aa2d5d7e224a2d479ec47a2df5ba60c44b9888d | 635 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.277778 | 74 | 0.755906 |
ab7262929e0ffa19c32ca406b269e3a0544dc3e0 | 1,863 | # 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
#
# The definition of the user identity under which the task is run.
# Specify either the userName or auto... | 29.109375 | 78 | 0.56146 |
61d66ba4980fed96566d10d0f689e1af784a569a | 1,095 | class Admin::UserController < Admin::AbstractModelController
model_class User
only_allow_access_to :index, :new, :edit, :remove, :when => :admin,
:denied_url => {:controller => 'page', :action => :index},
:denied_message => 'You must have administrative privileges to perform this action.'
def prefer... | 24.886364 | 88 | 0.644749 |
d564448bc4cb0d5e8ed471bcd1a8028254dad3eb | 6,506 | require 'weixin_rails_middleware/helpers/reply_weixin_message_helper'
module WeixinPam
class PublicAccountReply
class KeyEventCallback
attr_accessor :key, :callback, :description
def execute(service)
callback.call(service)
end
end
module KeyEventMethods
extend ActiveSuppo... | 30.401869 | 124 | 0.678758 |
7a133a503c9faf89ca96de45cd2536ec3134608d | 6,662 | =begin
#Ory APIs
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
The version of the OpenAPI document: v0.0.1-alpha.19
Contact: support@ory.sh
Generated by: https://openapi-generator.tech
O... | 30.144796 | 213 | 0.630892 |
082b3494aedb5adbbec97eb7f7e55619438b52c9 | 757 | require 'active_support/concern'
module Versacommerce
class ThemeAPIClient
module Resources
module FileBehaviour
extend ActiveSupport::Concern
included do
define_attribute_method :path
attr_reader :path
validates :path, presence: true
validates :nam... | 20.459459 | 74 | 0.541612 |
01f40a7a465dc0bed59b6196ab6002ab688f5cca | 1,689 | # frozen_string_literal: true
require 'ffaker'
FactoryBot.define do
factory :alert_management_alert, class: 'AlertManagement::Alert' do
triggered
project
title { FFaker::Lorem.sentence }
started_at { Time.current }
trait :with_issue do
issue
end
trait :with_fingerprint do
fi... | 20.597561 | 93 | 0.662522 |
e8ac375f68fbee293e4f1a9921e1e253d3c721f9 | 586 | cask :v1 => 'zooom' do
version :latest
sha256 :no_check
url 'http://software.coderage-software.com/zooom/Zooom_Latest.dmg'
homepage 'http://coderage-software.com/zooom'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
pkg 'Zooom2.pkg'
uni... | 30.842105 | 156 | 0.728669 |
bbd09d34187118c2d172d7a91230de9d0d702c81 | 155 | class WatchingController < ApplicationController
before_action :authorize
def feed
@changes = Change.order('created_at DESC').first(20)
end
end
| 19.375 | 56 | 0.76129 |
bb4565c05f69cf698c68a4fdefae56889b06bfa0 | 121 | module PaxfulEngine
class SyncOrderBookJob < ApplicationJob
def perform
SyncOrderBook.()
end
end
end
| 12.1 | 41 | 0.702479 |
6af086f958ad8c7d550382a9cbcca621049bb8e9 | 6,920 | require_relative 'data_generation/json_to_seed'
def run
remove_old_seeds
data = run_json_to_seed
countries = seed_countries(data)
positions = seed_positions(data)
competitions = seed_competitions(data)
stadia = seed_stadia(data)
clubs = seed_clubs(data)
players = seed_players(dat... | 32.186047 | 109 | 0.648988 |
388df2b8df51ff8adb38a9f191ea50d082c34775 | 1,045 | Pod::Spec.new do |s|
name = "BytedanceAds"
version = "3.3.1.5"
s.name = "Yumi#{name}"
s.version = version
s.summary = "Yumi#{name}."
s.description = "Yumi#{name} is the #{name} SDK cocoapods created by Yumimobi"
s.homepage = "http://www.yumimobi.com/"
s.license = "MIT"
s.author... | 47.5 | 206 | 0.644976 |
b997f9d46f306e95c58d7d4e29c6c221ee95dfd7 | 589 | # typed: true
require "net/http"
require "net/smtp"
# Example:
# begin
# some http call
# rescue *HTTP_ERRORS => error
# notify_hoptoad error
# end
HTTP_ERRORS = [
EOFError,
Errno::ECONNRESET,
Errno::EINVAL,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError,
Timeout::Err... | 16.361111 | 53 | 0.711375 |
01bb33538b37ee6b6ab26314f7b3f8c39e4382e5 | 290 | class CreateLessonGroups < ActiveRecord::Migration[5.0]
def change
create_table :lesson_groups do |t|
t.string :name
t.integer :script_id, null: false
t.boolean :user_facing, null: false, default: true
t.index :script_id
t.timestamps
end
end
end
| 20.714286 | 56 | 0.668966 |
ed12d2f07d8171aa19812bf145e2927dc4e82d46 | 10,850 | require 'optparse'
require 'fileutils'
module Haml
# This module contains code for working with the
# haml, sass, and haml2html executables,
# such as command-line parsing stuff.
# It shouldn't need to be invoked by client code.
module Exec # :nodoc:
# A class that encapsulates the executable code
# ... | 27.749361 | 111 | 0.546175 |
6a9a78ec5c686b90b930db491790127c209802c7 | 2,541 | # encoding: utf-8
require "stud/task"
def silence_warnings
warn_level = $VERBOSE
$VERBOSE = nil
yield
ensure
$VERBOSE = warn_level
end
def clear_data_dir
if defined?(agent_settings)
data_path = agent_settings.get("path.data")
else
data_path = LogStash::SETTINGS.get("path.data")
end
Dir.foreac... | 27.031915 | 142 | 0.700118 |
6a276edef217c683d9a43281de26e42c07ded76e | 2,007 | # -*- coding: utf-8 -*-
ActiveSupport.on_load(:action_controller) do
require 'jpmobile/docomo_guid'
require 'jpmobile/filter'
require 'jpmobile/helpers'
require 'jpmobile/hook_action_view'
require 'jpmobile/trans_sid'
require 'jpmobile/hook_test_request'
ActionDispatch::Request.send :prepend, Jpmobile::En... | 29.514706 | 109 | 0.747384 |
62e4c3662053f96fad08c054d51a9e93c5516a78 | 4,964 | require "cleaner"
require "formula"
describe Cleaner do
include FileUtils
subject { described_class.new(f) }
let(:f) { formula("cleaner_test") { url "foo-1.0" } }
before do
f.prefix.mkpath
end
describe "#clean" do
it "cleans files" do
f.bin.mkpath
f.lib.mkpath
if OS.mac?
... | 20.945148 | 73 | 0.615834 |
edfd347a84d102e1e634e2e5eec14d05b2fc701b | 1,497 | # frozen_string_literal: true
class DistributionManager
def initialize(fastlane:, build_path:, firebase_token:)
@fastlane = fastlane
@build_path = build_path
@firebase_token = firebase_token
end
def upload_to_deploygate(product_name:, api_token:, user:, message:)
ipa_path = "#{@build_path}/#{pro... | 28.245283 | 103 | 0.696059 |
ab376aefaf0bdfd91ad990dbd9dae3741c75c796 | 3,532 | require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require CLUSTER_CHEF_DIR("lib/cluster_chef")
describe ClusterChef::Server do
before do
Chef::Config.stub!(:validation_key).and_return("I_AM_VALID")
@cluster = get_example_cluster('demoweb')
@cluster.resolve!
@facet = @cluster.face... | 37.574468 | 132 | 0.557191 |
38f1674e025b87c335ebd25c5d9f07a735e5625d | 1,260 | #
# DOPv command line main module
#
require 'gli'
require 'dop_common/cli/node_selection'
require 'dop_common/cli/log'
require 'dop_common/cli/global_options'
require 'dopv'
require 'dopv/cli/command_validate'
require 'dopv/cli/command_add'
require 'dopv/cli/command_remove'
require 'dopv/cli/command_list'
require 'dop... | 22.909091 | 106 | 0.727778 |
6171ec0bee37dd0e8e6a4d0a02f84ac5a221ce98 | 3,424 | # options
inspec_bin = 'BUNDLE_GEMFILE=/inspec/Gemfile bundle exec inspec'
api_url = 'https://0.0.0.0'
profile = '/inspec/examples/profile'
user = command('whoami').stdout.strip
pwd = command('pwd').stdout.strip
puts "Run test as #{user} in path #{pwd}"
# TODO: determine tokens automatically, define in kitchen yml
ac... | 37.217391 | 114 | 0.681951 |
5d3e696e97970bf18a772085762983c2ab2a5485 | 1,783 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../../base/subsubcmd'
class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
unless defined?(HELP)
Trepanning::Subcommand.set_name_prefix(__FILE__,... | 33.018519 | 76 | 0.727426 |
f737cbfdb6cafc63ba3068b08b14df78245688d6 | 1,152 | cask "spitfire-audio" do
version "3.3.22,1639562400"
sha256 "0a4b97c384b790a5ded9e426fb6b14a8401f67222af68225bebcea90e61b630b"
url "https://d1t3zg51rvnesz.cloudfront.net/p/files/lm/#{version.csv.second}/mac/SpitfireAudio-Mac-#{version.csv.first}.dmg",
verified: "d1t3zg51rvnesz.cloudfront.net/p/files/lm/"
... | 32 | 126 | 0.715278 |
21ccefacb187fdb1cff67de83cc01b68c4c7c729 | 10,483 | # PuppetX::Cisco - Common utility methods used by Cisco Types/Providers
#
# November 2015
#
# Copyright (c) 2015-2018 Cisco and/or its affiliates.
#
# 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... | 31.766667 | 80 | 0.543833 |
219e8b4fc3f14550bbaf84a5719b6299a37d4671 | 566 | class AddEnergyTracking < ActiveRecord::Migration
def self.up
create_table :energy_consumptions, :force => true do |t|
t.column :project_id, :integer
t.column :name, :string
t.column :amee_profile_item_id, :string
t.column :energy_consumption_type, :s... | 31.444444 | 60 | 0.662544 |
7a917b1ae8ddef646d2a245607a3a636bc981974 | 215 | class CreateResponses < ActiveRecord::Migration[5.2]
def change
create_table :responses do |t|
t.integer :statement_id
t.string :text
t.string :timestamp
t.timestamps
end
end
end
| 19.545455 | 52 | 0.665116 |
26d79932f9e034277ccaef5f410cc05d7a1bde41 | 864 | require 'spec_helper_min'
require_dependency 'carto/oauth_provider/scopes/scopes'
require_relative '../../../../factories/organizations_contexts'
describe Carto::OauthProvider::Scopes::DataservicesScope do
include_context 'organization with users helper'
describe '#add_to_api_key_grants' do
let(:scope) { Cart... | 36 | 113 | 0.674769 |
33f3649cb8c524a6cef8ca562dfddab883d745ec | 617 | require "erb"
module Terraforming
module GKE
class GoogleContainerCluster
def self.tf(client = nil)
self.new(client).tf
end
def initialize(client)
@client = client
end
def tf(project, zone)
clusters = @client.list_clusters(project, zone).clusters
te... | 22.035714 | 128 | 0.623987 |
031edb90527f8f4e2b608cdccf088637267ed04a | 528 | # frozen_string_literal: true
require "rails_helper"
describe "Browsing by Type of Resource" do
before do
VCR.use_cassette("browse_by_type_of_resource") do
create(
:public_etd,
work_type: [
RDF::URI("http://id.loc.gov/vocabulary/resourceTypes/txt"),
]
)
end
en... | 18.857143 | 71 | 0.604167 |
eda9c464b2374f730d8b2aa5e7e6a206ca6f0fcf | 1,869 | module Tatami
module Parsers
module Csv
class HttpRequestParser
include Tatami::Constants::HeaderNames
def self.parse(header, row, name)
raise ArgumentError, 'header must not be null.' if header.to_s.strip == ''
raise ArgumentError, 'row must not be null.' if row... | 42.477273 | 111 | 0.5939 |
d50821c677b0a8b82df3c54ad31fbb5896ee26a3 | 16,942 | # require "pry"
# require "pry-rescue"
require "json"
Puppet::Type.type(:azure_bandwidth_schedule).provide(:arm) do
mk_resource_methods
def initialize(value = {})
super(value)
@property_flush = {}
@is_create = false
@is_delete = false
end
def id=(value)
Puppet.info("id setter called to ch... | 43.552699 | 295 | 0.671585 |
ab68420935b7f8d3ff2a9e1c4500962a30a7cd2b | 36 | module Yarf
VERSION = "0.1.0"
end
| 9 | 19 | 0.638889 |
38699f6caefbf2040071b52ec9aeee0c587bd86d | 774 | class NotificationsTakeTwo < ActiveRecord::Migration
def change
drop_table :feeds
create_table :notifications do |t|
t.integer :notified_user_id
t.integer :originating_user_id
t.integer :event_id
t.integer :subscription_id
t.boolean :seen, default: false
t.integer :type
... | 28.666667 | 72 | 0.72739 |
ab7b5a57b3ab72801705cf486c375e5992ffcabb | 12,248 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
... | 40.556291 | 184 | 0.67611 |
1a28faca9ad618fea8dff4bb7dc664a60dcb73ef | 597 | # frozen_string_literal: true
module Mercy
class Report
module Multiple
def as_json
{
status: status
}.merge(sub_reports_hash)
end
def error?
sub_reports.any?(&:error?)
end
private
def sub_reports_hash
sub_reports.map(&:as_json).as_... | 17.558824 | 67 | 0.577889 |
333bef9c3089620cfbb0b874006ddd6a4b877274 | 1,995 | require 'homebus'
require 'homebus_app'
require 'mqtt'
require 'json'
require 'dotenv'
require 'net/http'
require 'base64'
require 'timeout'
class ESP32CamHomeBusApp < HomeBusApp
DDC = 'org.homebus.experimental.image'
def initialize(options)
@options = options
Dotenv.load('.env')
@url = @options['ca... | 15.833333 | 75 | 0.566917 |
e8a497e83ff00a06fe30254d172d5286daa609c3 | 58 | module Fog
module Core
VERSION = "1.45.0"
end
end
| 9.666667 | 22 | 0.62069 |
e294c34f0d92de863ae700799d3cd8e1adae23cb | 10,010 | RSpec.describe MiqRegion do
let(:region) { FactoryBot.create(:miq_region, :region => ApplicationRecord.my_region_number) }
# the first id from a region other than ours
let(:external_region_id) do
remote_region_number = ApplicationRecord.my_region_number + 1
ApplicationRecord.region_to_range(remote_region_... | 35.371025 | 135 | 0.664236 |
910acbf89e9397aa94cda52dfac1df815c61106c | 5,079 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 44.165217 | 114 | 0.762945 |
91aa71f3dbbbeb6904ee0f4a1dedebbf3137f0fe | 370 | class Edge
attr_accessor :from, :weight, :to
def initialize(from, weight, to)
@from = from
@weight = weight
@to = to
@from.edges << self
@to.edges << self
end
def nodes
return Set.new([@from, @to])
end
def other_node(node)
return node == @to ? @to : @from
end
def to_s
... | 14.8 | 41 | 0.562162 |
ed49dfccef0783b4422d8cea8aa6d8e86a9d798d | 155 | module SensuPluginsCpuUsage
module Version
MAJOR = 0
MINOR = 0
PATCH = 6
VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
end
| 15.5 | 56 | 0.63871 |
0883a7cfa031b2e30da38ce175cd33e1a3b528b2 | 1,189 | class Instead < Formula
desc "Interpreter of simple text adventures"
homepage "https://instead.syscall.ru/"
url "https://github.com/instead-hub/instead/archive/3.1.2.tar.gz"
sha256 "622c04a58fd780d8efdf0706c03596ab68672b31e97865dad6a1fc1540619754"
head "https://github.com/instead-hub/instead.git"
bottle do... | 34.970588 | 107 | 0.761144 |
1869fceee496a895ef67a292a528a9d49890f1cd | 634 | require 'spec_helper'
describe AsanaAPI::Team do
let(:subject) { AsanaAPI::Team.new }
let(:workspaces) { AsanaAPI::Workspace.index! }
it 'returns 200 for index', vcr: true do
expect(subject.index(organization: workspaces.first['id']).code).to eq(200)
end
it 'returns 200 for show', vcr: true do
s... | 30.190476 | 79 | 0.692429 |
ab18b595e65ba5cfe00d6026e6a5a10f1b304164 | 6,637 | # 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::ContainerInstance::Mgmt::V2018_02_01_preview
#
# StartContainer
#
class StartContainer
include MsRestAzure
#
# Creates an... | 45.772414 | 196 | 0.72593 |
1c0bb23947d64773b7d384462d0563a526a4be87 | 2,266 | require_relative 'base_generator'
module Fae
class NestedScaffoldGenerator < Fae::BaseGenerator
source_root ::File.expand_path('../templates', __FILE__)
class_option :parent_model, type: :string, desc: 'Sets the parent model this scaffold belongs_to.'
def go
generate_nested_model_file
generat... | 34.333333 | 147 | 0.70962 |
ab3b633e8461fd48a78b882d061c1f5ac9812167 | 173 | require "middleman-core"
require "middleman-ogp/version"
::Middleman::Extensions.register(:ogp) do
require "middleman-ogp/extension"
::Middleman::OGP::OGPExtension
end
| 21.625 | 41 | 0.768786 |
392d141ea13e683dcba795d2df8ae939a3f1b48c | 339 | # frozen_string_literal: true
module Rails
# Returns the version of the currently loaded Rails as a <tt>Gem::Version</tt>
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 7
MINOR = 0
TINY = 0
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.j... | 18.833333 | 80 | 0.648968 |
91ddb9bde8a8d0f55771fe050d9a37129823a167 | 222 | module CarrierWave
module Support
module UriFilename
def self.filename(url)
path = url.split('?').first
URI.decode_www_form_component(path).gsub(/.*\/(.*?$)/, '\1')
end
end
end
end
| 18.5 | 68 | 0.59009 |
38d512a86cac8e2883155cda75b76c6affe43a0f | 7,700 | # AXKit
# Be sure to run `pod lib lint AXKit.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 = 'AXKit... | 32.627119 | 100 | 0.548831 |
18c3b4173bcc88b2c4cda00889f7cd0d3bce3a33 | 1,872 | # coding: utf-8
module ONIX
class Header
include ROXML
xml_name "Header"
xml_accessor :from_ean_number, :from => "FromEANNumber"
xml_accessor :from_san, :from => "FromSAN"
xml_accessor :sender_identifiers, :from => "SenderIdentifier", :as => [ONIX::SenderIdentifier]
xml_accessor :fro... | 40.695652 | 129 | 0.667201 |
26fe80b8b0be34546ee2bb9f51807fc8036f33cf | 1,100 | cask 'unity-samsung-tv-support-for-editor@5.6.0f3' do
version '5.6.0f3,497a0f351392'
sha256 :no_check
url "https://download.unity3d.com/download_unity/497a0f351392/MacEditorTargetInstaller/UnitySetup-Samsung-TV-Support-for-Editor-5.6.0f3.pkg"
name 'SamsungTV Build Support'
homepage 'https://unity3d.com/unity... | 30.555556 | 142 | 0.709091 |
874dd275edd73d9cdf4b965b2d36cbc79321b408 | 249 | module ActiveVlc
end
require 'active_support'
require 'activevlc/version'
require 'activevlc/parameters'
require 'activevlc/pipeline'
require 'activevlc/dsl'
require 'activevlc/libvlc'
require 'activevlc/runner'
require 'activevlc/syntactic_sugar'
| 20.75 | 35 | 0.827309 |
bfa5161484261c861249ae6331a3b7a84e1b509c | 2,192 | require 'test_helper'
class ModelTest < Minitest::Test
class FakeModel < ChangeHealth::Models::Model
property :dateObject, default: Date.new(2020, 5, 30)
property :someDateString, default: '2020-04-30'
property :someNotDateString, default: 'cat'
property :booleanWithDateInName, default: true
prop... | 31.314286 | 113 | 0.673814 |
d56d245ca066993a62437536c6cf9ee196839f27 | 1,042 | class WireguardTools < Formula
desc "Tools for the WireGuard secure network tunnel"
homepage "https://www.wireguard.io/"
# Please only update version when the tools have been modified/updated,
# since the Linux module aspect isn't of utility for us.
url "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-0.0.... | 41.68 | 171 | 0.763916 |
ab3368750b61b45bd7f7699d85b15cd8caa5d639 | 1,354 | class Chakra < Formula
desc "The core part of the JavaScript engine that powers Microsoft Edge"
homepage "https://github.com/Microsoft/ChakraCore"
url "https://github.com/Microsoft/ChakraCore/archive/v1.11.16.tar.gz"
sha256 "81429055e51a786079002d33d3eae58771f8b7c383b3f47991d63e5be84a7f4d"
bottle do
cell... | 33.02439 | 93 | 0.708272 |
6a3d006a06158bd1fc058b656d82a9cbe443cead | 1,683 | # frozen_string_literal: true
require 'ffi'
FFI.typedef :uint16, :word
FFI.typedef :uint32, :dword
FFI.typedef :uintptr_t, :handle
FFI.typedef :buffer_inout, :lpwstr
FFI.typedef :pointer, :lpcvoid
FFI.typedef :pointer, :lpvoid
FFI.typedef :pointer, :lpdword
FFI.typedef :pointer, :pdword
FFI.typedef :pointer, :phandle... | 25.5 | 84 | 0.686869 |
f8fbb483c2744dfbf77f43dde3af7dbe29bca8ce | 1,313 | # This controller handles the login/logout function of the site.
class SessionsController < ApplicationController
# Be sure to include AuthenticationSystem in Application Controller instead
# render new.rhtml
def new
end
def create
logout_keeping_session!
user = User.authenticate(params[:login], p... | 30.534884 | 99 | 0.696116 |
62fa5b271c8fd6087d9de1ddb6fb8b8f48ac5242 | 5,931 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe MetricsController, type: :controller do
let(:user) { FactoryBot.create(:user) }
let(:bproce) { FactoryBot.create(:bproce, user_id: user.id) }
let(:valid_attributes) { { name: 'Metric name', description: 'description1', bproce_id: bproce.id, d... | 33.134078 | 115 | 0.647277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.