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
5d4bf9406331d63ca7e113bd1b09e690e3f9dd7e
1,545
require 'spec_helper' describe_recipe 'kubernetes-cluster::flanneld' do context 'with default node attributes' do let(:chef_run) { ChefSpec::SoloRunner.new.converge(described_recipe) } it { expect(chef_run).to enable_service('flanneld') } it { expect(chef_run).to_not enable_service('docker') } it { ...
40.657895
80
0.680906
62c267fc7246621a2429c39fb34985c5d9d5259d
207
module Evdev module FFI class LogData < ::FFI::Struct layout( :priority, LogPriority, :global_handler, LogFuncT, :device_handler, DeviceLogFuncT ) end end end
17.25
39
0.603865
8774f6a14c18dbcc83f0b4cea2f5e6452bd0d9c2
214
require 'comment_extractor/extractor' class CommentExtractor::Extractor::Css < CommentExtractor::Extractor filename /\.css$/ filetype 'css' include CommentExtractor::Extractor::Concerns::SlashExtractor end
23.777778
68
0.794393
b983bdf9f326aaa5fd495a3ca981df3d15debb98
2,182
# frozen_string_literal: true # See https://github.com/shakacode/react_on_rails/blob/master/docs/basics/configuration.md # for many more options. ReactOnRails.configure do |config| # This configures the script to run to build the production assets by webpack. Set this to nil # if you don't want react_on_rails bui...
50.744186
98
0.593951
87b1a3e1441d0325ad2754722948b06dd9234996
1,181
module PaginationHelper def paginate(base_url,collection) set_pagination_params count = collection.count links = generate_links(base_url,count,@per_page,@page) response.headers["Link"] = links.join(",") if !links.empty? collection.skip(@offset).limit(@per_page) end def generate_links(base_u...
31.078947
84
0.682472
bb3137cfe8ae94a1f347b114af497980cff4b493
1,651
require 'test_helper' class UsersControllerTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) @other_user = users(:archer) end test "should redirect index when not logged in" do get users_path assert_redirected_to login_url end test "should get new" do get sign...
28.964912
101
0.640824
4acf4f824a8e78f5998cade0453335fe01044e64
292
cask 'subtools' do version '1.0.1' sha256 '2557e042d1df12dacfe5d87ff6c96d252721f3d10a26dbb7f8dc2e3ac6248e91' url "http://www.emmgunn.com/downloads/subtools#{version}.zip" name 'SUBtools' homepage 'http://www.emmgunn.com/subtools-home/' app "subtools#{version}/SUBtools.app" end
26.545455
75
0.760274
7a2aad1a1add7a90e3299f8ec237f432b8fe3404
759
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 CampClubApp class Application < Rails::Application # Initialize configuration defaults for originally generated Rai...
31.625
79
0.743083
e9962624465046a6e444b4e28c158b43731bf4d8
1,869
class Pulumi < Formula desc "Cloud native development platform" homepage "https://pulumi.io/" url "https://github.com/pulumi/pulumi.git", tag: "v2.21.2", revision: "543cbe194c17a515eb682b9dd105b0dcfd30a810" license "Apache-2.0" head "https://github.com/pulumi/pulumi.git" bottle do sha2...
40.630435
122
0.699304
21355973be18d86a4f732ee7fbdeb379cfb2e309
4,970
## # Subclass the We Enhance IT form builder for the autism funding application. class AutismFundingFormBuilder < WeitFormBuilder # Find formatters.rb in app/lib include Formatters # def bootstrap_form_for(object, options = {}, &block) # super(object, options, &block) # end # Returns a check_box tag de...
31.0625
103
0.688732
b9bdbfddf835a5c1b0fb274d42cbfa1ce579c2c4
5,012
require 'xcodeproj' module Pod class ProjectManipulator attr_reader :configurator, :xcodeproj_path, :platform, :remove_demo_target, :string_replacements, :prefix def self.perform(options) new(options).perform end def initialize(options) @xcodeproj_path = options.fetch(:xcodeproj_path) ...
35.295775
251
0.680168
3392149158a0c71b39bfd66306e4d0e83e4d2b2d
2,463
Website::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 # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action...
36.761194
104
0.752335
01839d19d861a5ea69c1c430a9adab62dad25da6
17,074
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'enumerator' require 'nbtfile' require 'stringio' require 'zlib' shared_examples_for "readers and writers" do Tokens = NBTFile::Tokens unless defined? Tokens Types = NBTFile::Types unless defined? Types def self.a_reader_or_writer(desc, s...
35.719665
108
0.512124
265d38d0cc865718764cf5bd211b6bf238436c09
750
require 'spec_helper' require_relative 'support/pages/cost_report_page' describe 'Cost report project context', type: :feature, js: true do let(:project1) { FactoryBot.create :project } let(:project2) { FactoryBot.create :project } let(:admin) { FactoryBot.create :admin } let(:report_page) { ::Pages::CostRepo...
30
86
0.745333
61548ecd986e7bcd1cf1d7589c5de952ed372cb8
3,639
require 'net/sftp' require 'uri' require_relative '../spec_helper' module SFTPHelper class MockSession < ::Net::SFTP::Session def initialize # Intentionally do not call super end end class MockEntry attr_reader :attributes attr_reader :name def initialize(name) @name = name...
28.209302
86
0.651827
8718fdbd382ba20f037d0b1dcca4eafc4a9b24a0
6,468
# frozen_string_literal: true module DeadEnd # Represents a single line of code of a given source file # # This object contains metadata about the line such as # amount of indentation, if it is empty or not, and # lexical data, such as if it has an `end` or a keyword # in it. # # Visibility of lines ca...
27.641026
139
0.612554
edd0b75ff65259c231e8e647aed7d018675575a6
1,846
class Mg3a < Formula desc "Small Emacs-like editor inspired like mg with UTF8 support" homepage "http://www.bengtl.net/files/mg3a/" url "http://www.bengtl.net/files/mg3a/mg3a.160511.tar.gz" sha256 "1281e31930216565cf6572e05064e06fcbf64074f9ebf4677ef0e4b22fbf21f8" bottle do cellar :any_skip_relocation ...
35.5
92
0.690141
ffba1e39e843cad58712819e8ca4b58b89100d22
409
class Numeric if (instance_method :truncate).arity == 0 def truncate_to_precision precision if (precision = precision.to_i) > 0 factor = 10 ** precision (self * factor).truncate.fdiv factor else truncate end end else # use native method in Ruby >= 2.4 alias ...
25.5625
51
0.665037
7a0ff23b95fbee13e0fe37f1c44f2dbd28046d04
128
class RemoveCostFromProjects < ActiveRecord::Migration[5.2] def change remove_column :projects, :cost, :decimal end end
21.333333
59
0.757813
1a812dbf76b5e365e6f749a9b84b5edeb69e1232
170,964
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
43.249178
136
0.628132
1adca90de21221dfe1e641eef3d70d53e0daeaa3
7,763
# This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../config/environment', __dir__) # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? require ...
39.810256
133
0.704109
62c761ec9aec35f0a0e7353567b306246ec10742
3,706
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
31.40678
102
0.705613
1caf2d4b567b7b8c873328f39d18e93c07b43960
29,035
## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Taskrouter < Domain class V1 < Version class WorkspaceList < ListResource ## # Initialize the WorkspaceList ...
39.503401
214
0.580541
91626080a6cf883a513b2be149263be4fdbcb4e9
948
#!/usr/bin/env ruby # -*- coding: utf-8 -*- require "csv" require "mechanize" require "nokogiri" require "open-uri" agent = Mechanize.new{ |agent| agent.history.max_size=0 } agent.user_agent = 'Mozilla/5.0' data = [] CSV.open("teams.csv").each do |team| team_name = team[0] if not(team[1]=="html") next e...
16.344828
62
0.550633
915049fa5658f5f6f22af34c2fa74895e59216b7
405
cask :v1 => 'balsamiq-mockups' do version '3.2.4' sha256 '1980c14936c4afe1afe4f1406465903e622fdf73d5cd9f6349480d6f551f3275' url "https://builds.balsamiq.com/mockups-desktop/Balsamiq_Mockups_#{version}.dmg" name 'Balsamiq Mockups' homepage 'https://balsamiq.com/' license :commercial app "Balsamiq Mockups...
28.928571
83
0.758025
ab7fa33325ec00fae580e4347deb5cc5d4a8e5f4
381
require_relative '../../lib/markdowner' class PlainOverrideController < ApplicationController layout 'plain' def show @plain_override = PlainOverride.find_by_path(params[:path]) raise ActionController::RoutingError.new('Not Found') unless @plain_override @page_title = @plain_override.title params[...
29.307692
80
0.753281
189fee98aa020d1538c54b9bd5b0f5f13981376e
1,845
# frozen_string_literal: true class Admin::AppearancesController < Admin::ApplicationController before_action :set_appearance, except: :create def show end def preview_sign_in render 'preview_sign_in', layout: 'devise' end def create @appearance = Appearance.new(appearance_params) if @appea...
21.705882
88
0.724661
f8292ed2a54a00d9931b45e5476e996ba4845ca0
343
ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rspec/rails' Dir['spec/support/**/*.rb'].each{ |f| require f } RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true config....
24.5
68
0.760933
87493d242b86aa97516442e862049df0f6d15ff7
1,119
require 'chapter/search_reference' class Chapter include Her::Model attributes :chapter_note_id, :headings_from, :headings_to, :section_id has_one :chapter_note, name: '_chapter_note', data_key: '_chapter_note_id', path: '/chapter_note' has_many :headings has_many :search_references, class_name: 'Chapter::...
19.631579
99
0.723861
1c40fae799cbb5d4efaebadee74c2407646279ce
318
require "test_helper" class Inline::ErbTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Inline::Erb::VERSION end def test_render_context tpl = Inline::Erb.render('tpl_test', name: 'john') assert_match tpl.strip(), 'Hi, john' end end __END__ @@ tpl_test Hi, <%= name %>
16.736842
54
0.698113
917dd6a14655e7d59723f20e31f9e11eabb046d2
186
class CreateCompaniesSkills < ActiveRecord::Migration[5.1] def change create_table :companies_skills do |t| t.references :company t.references :skill end end end
20.666667
58
0.709677
e90b38841defdd2028081508865e5a58fe7beb66
836
Pod::Spec.new do |spec| spec.name = "ResultBuilderKit" spec.version = "1.2.0" spec.summary = "A set of result-builders" spec.description = <<-DESC This library provides a set of result-builders DESC spec.homepage = "https://github.com/muukii/ResultBuilderKit" spec.license = "MIT" sp...
33.44
103
0.663876
d5635849a69367380478970d2d11f5c6131d244f
1,043
Pod::Spec.new do |s| s.name = "WTUserCenterModel" s.version = "0.0.5" s.summary = "WTUserCenterModel个人中心模块" s.homepage = "https://github.com/aliang666/WTUserCenterModel" s.license = "MIT" s.author = { "jienliang000" => "jienliang000@163.com" } s.platform = :io...
27.447368
107
0.604986
e27872ca28f8b5877a7380114a61cd6405af6294
1,114
class Termrec < Formula desc "Record videos of terminal output" homepage "https://angband.pl/termrec.html" url "https://github.com/kilobyte/termrec/archive/v0.19.tar.gz" sha256 "0550c12266ac524a8afb764890c420c917270b0a876013592f608ed786ca91dc" license "LGPL-3.0" head "https://github.com/kilobyte/termrec.git...
33.757576
104
0.684919
39b25b2aa7e4ae73d61b7f5911713c392b398359
3,184
# 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 # # Rewrite rule set of an application gateway. # class ApplicationGatewayRewriteRuleSet < SubResourc...
30.912621
82
0.502827
01a7ef7e0b64b682f5303045569e1b98bbf911fe
493
# Feature: User index page # As a user # I want to see a list of users # So I can see who has registered feature 'User index page', :devise do # Scenario: User listed on index page # Given I am signed in # When I visit the user index page # Then I see my own email address scenario 'user sees own...
24.65
44
0.681542
26d94f2e93feb627d97065d60e0a5c85e4abc8bd
55,483
# This file was automatically generated, any manual changes will be lost the # next time this file is generated. # # Platform: rbx 2.2.3.n364 RubyLint.registry.register('Errno') do |defs| defs.define_constant('Errno') do |klass| klass.inherits(defs.constant_proxy('Object', RubyLint.registry)) klass.define_m...
27.603483
77
0.735739
ffd5cbcefbe64bc6a5c21f1156fd19a27a42c65a
373
require 'net/http' require 'json' require 'active_support' # required require 'active_support/core_ext/hash/conversions' # for Hash.from_xml require 'active_support/core_ext/string/inflections' # for demodulize require 'yt/annotations/for' module Yt module Annotations # Auto-load For to have the easy syntax Yt:...
24.866667
74
0.774799
b95fbacebfab7ad7a77214fcef3022392578ceca
6,007
class PortfolioMaker::CommandLineInterface attr_accessor :user_portfolio def run capital = 0 loop do puts "How much would you like to deposit into your account?" capital = gets.chomp break if ((capital.to_i > 0) && capital.scan(/\D/).empty?) puts "Please enter correct val...
30.492386
181
0.562677
e841c970ddfb934436aa69264fb1de0c0b8af0bd
266
require File.expand_path('../spec_helper', __FILE__) require File.expand_path('../../lib/phone_number_processor', __FILE__) require 'twilio-ruby' require 'vcr' VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' c.hook_into :webmock end
26.6
70
0.766917
e98b24a7d2847011b896a1413acc76b7dde69558
2,179
# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don'...
36.316667
85
0.771914
031e84280885a79badcbdb5d395ac39022097e66
140
require 'rails_helper' RSpec.describe "top/index.html.erb", :type => :view do pending "add some examples to (or delete) #{__FILE__}" end
23.333333
56
0.714286
7ac1e3395489ea72444624f12cfeee8ed4db25ef
2,413
RSpec.describe MiqApache::Control do it "should run_apache_cmd with start when calling start" do expect(MiqApache::Control).to receive(:run_apache_cmd).with('start') MiqApache::Control.start end it "should run_apache_cmd with graceful-stop and start when calling restart with graceful true" do expect(...
40.898305
101
0.726896
acea2a4c859603b5fea5e6a276a11442cda3b92b
2,759
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rail...
43.793651
86
0.750997
ffb2ff1c9d150fe3a7efb425850515ef2e666bbe
449
module Badger def Badger.badge text, badge_url, target_url badge_url = "%s.%s" % [ badge_url, Config.instance.config['badge_type'] ] unless ['Repo Size', 'Dependency CI'].include? text badge_style = Config.instance.config['badge_style'] badge_url = "%s?style=%s" % [ badge_url, ...
21.380952
57
0.576837
e9c8fc25756b0603b193c477212f6ce2095f72d0
345
class AwsSnsMessage::Base < ApplicationRecord self.table_name = :aws_sns_messages belongs_to :recording, optional: true include EventPublisher validates :type, presence: true validates :aws_sns_message_id, presence: true, uniqueness: true def payload_message payl...
18.157895
45
0.686957
08d69ecfde96a286611c9e67050ccf6588fca5f0
1,094
=begin #Accounting API #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 2.1.3 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.0 =end require 'spec_helper' require 'json' ...
26.047619
107
0.754113
21fa9e50434cf2ebf0a3485bb5fdc90ec1de4f6b
341
module SessionsHelper def sign_in(user) cookies.permanent[:auth_token] = user.id end def current_user @current_user ||= User.find_by(id: cookies[:auth_token]) if cookies[:auth_token] end def user_signed_in? current_user.present? end def sign_out_user cookies.delete(:auth_token) if user_...
18.944444
84
0.727273
5db94784cbc2ee929ce74cd793afb13d4bcc4c80
720
# # Cookbook Name:: hadoop # Recipe:: oozie_client # # Copyright © 2013-2014 Cask Data, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
28.8
74
0.75
3812dda6ba082a3b6de092eb3175bfaa82da65b3
1,373
# frozen_string_literal: true # rubocop:disable Gitlab/ModuleWithInstanceVariables module EE module Admin module UsersController extend ::Gitlab::Utils::Override def reset_runners_minutes user if ClearNamespaceSharedRunnersMinutesService.new(@user.namespace).execute redire...
26.921569
117
0.666424
037e96335fd901d5c82b88d76da9cb4ae8898e74
1,424
module TPPlus module Motion module Utilities extend self def is_digit_or_letter?(char, expected) if char.to_s.match?(/[FUTfutNBDnbd]/) return expected == :char elsif char.to_s.match?(/[-?\d+]/) return expected ==...
37.473684
96
0.543539
622bb91e5466a4cfc8b45b8adbb58c906cf54f4b
3,323
module Brakeman class TemplateParser include Brakeman::Util attr_reader :tracker KNOWN_TEMPLATE_EXTENSIONS = /.*\.(erb|haml|rhtml|slim)$/ TemplateFile = Struct.new(:path, :ast, :name, :type) def initialize tracker, file_parser @tracker = tracker @file_parser = file_parser @file...
31.056075
107
0.59043
26ded4c592bf23ddc8f10d6ea0b41e300a098254
225
class CreateCats < ActiveRecord::Migration[5.2] def change create_table :cats do |t| t.string :name t.string :color t.boolean :kid_friendly t.integer :age t.timestamps() end end end
17.307692
47
0.622222
91741bd1266ef69c7de83f12ddd5d4c71d247b3a
2,545
class Pyqt < Formula desc "Python bindings for v5 of Qt" homepage "https://www.riverbankcomputing.com/software/pyqt/download5" url "https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193079a86842a789edb7988dca39eab44579088a1d1/PyQt5-5.15.2.tar.gz" sha256 "372b08dc9321d1201e4690182697c5e7ffb2e0770e6b...
36.357143
140
0.675442
1d8d7128c049a3efb729cb61ef90bdf814f0a0b9
4,944
class Admin::CategoriesController < Admin::AdminBaseController def index @selected_left_navi_link = "listing_categories" @categories = @current_community.top_level_categories.includes(:translations, children: :translations) end def new @selected_left_navi_link = "listing_categories" @category = ...
34.816901
128
0.712783
e8366393c4ac2039a9ded89811498ce3c1192197
188
class RemoveTripOrderFromFlights < ActiveRecord::Migration[5.0] def up remove_column :flights, :trip_order end def down add_column :flights, :trip_order, :integer end end
18.8
63
0.739362
18522b110a3c3b2bb984f38455c5d6cd8bea4384
256
class AddIsVisibleAndLabelToSystemConfigFieldCustomizations < ActiveRecord::Migration[5.2] def change add_column :system_config_field_customizations, :is_visible, :boolean add_column :system_config_field_customizations, :label, :string end end
36.571429
90
0.828125
4ae3f6c6876bd966a62afc5a69e52b3e8219abba
252
#!/usr/bin/env ruby require 'parser/current' code = Dir.glob "#{__dir__}/kintama/scripts/*" code.each do |path| file = File.read path puts file p Parser::CurrentRuby.parse(file) p Parser::CurrentRuby.parse(file).to_hash puts "\n---\n" end
18
46
0.686508
91483e39f5c0c56b37c30e4a412a4ca0b770e059
323
class RemoveTokensFromUserAccounts < ActiveRecord::Migration def change remove_column :user_accounts, :token_expires_at, :datetime, after: :token_secret remove_column :user_accounts, :token_secret, :string, after: :token remove_column :user_accounts, :token, :string, null: false, after: :image_url end e...
40.375
84
0.773994
393e3df1d3e915494da621599b6d647b2a996ce9
3,364
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry include Msf::Auxiliary::Report include Msf::Post::Windows::UserProfiles def initialize(info = {}) ...
27.349593
108
0.593341
088960a458156e0fd2877b60a4dd6e5aa093c0d7
1,062
Pod::Spec.new do |s| s.name = 'FTS3HTMLTokenizer' s.version = '3.2.2' s.summary = 'FTS3 HTML Tokenizer' s.license = 'MIT' s.author = 'Stephan Heilner' s.homepage = 'https://github.com/stephanheilner/FTS3HTMLTokenizer' s.source = { :git => "https://github.com/stephanh...
55.894737
302
0.694915
2837d1c02c4bc9492e1a9623ea4199a5d3ebbbe9
2,543
# frozen_string_literal: true require 'spec_helper' RSpec.describe API::DependencyProxy, api: true do include ExclusiveLeaseHelpers let_it_be(:user) { create(:user) } let_it_be(:blob) { create(:dependency_proxy_blob )} let_it_be(:group, reload: true) { blob.group } before do group.add_owner(user) ...
29.229885
90
0.644514
21038b8416a080c0b5d6802ec18575c28c352d43
1,996
class Photographer < ActiveRecord::Base # Devise modules. Others available are: :encryptable, :confirmable, :timeoutable and :omniauthable, :trackable devise :database_authenticatable, :token_authenticatable, :recoverable, :rememberable, :lockable, :validatable # Validations validates :name, :presence => true...
36.962963
219
0.689379
2116b39ea6023ed46153a183cd2cf192c34e49cb
924
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 QuotesApp class Application < Rails::Application # Settings in config/environments/* take pre...
36.96
98
0.737013
d516b6db7d3e50bdf7aa7bccf3969b73ed200286
443
require 'spec_helper' describe Algorithmable::Searches do context '#when factoring new objects' do let(:factory) do Object.new.extend Algorithmable::Searches end it do search = factory.binary_search(1, [2, 4, 5, 1].sort) expect(search).to eq(0) end it do tree = factory.n...
22.15
66
0.681716
4a792070bc6ed2747e4734fbeeba6c8bf855e1db
132
package 'php5-gd' do action :install end execute 'php5enmod gd' do command 'php5enmod gd' not_if "php -m | grep -q 'gd'" end
14.666667
32
0.674242
ac46516dab628c74808d914138b09c13fb3115e3
974
# # Author:: Christo De Lange (<opscode@dldinternet.com>) # Cookbook Name:: php # Recipe:: ini # # Copyright 2011-2015, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
31.419355
74
0.711499
f7ca7fe633c1c037d6686ef7f8d72014ad3e94dc
936
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
32.275862
74
0.730769
f803152685dfbb1808b3ffaf8c55e1c2634876a0
315
class AddConfigTable < ActiveRecord::Migration def self.up # Config table has been moved to tog-core end def self.down # Config table has been moved to tog-core end end
31.5
111
0.422222
26464458d84b011aaad910272740939ed65934fe
1,253
name "td" #version '' # git ref dependency "td-agent-files" build do block do # setup related files pkg_type = project.packagers_for_system.first.id.to_s install_path = project.install_dir # for ERB project_name = project.name # for ERB project_name_snake = project.name.gsub('-', '_') # for vari...
37.969697
103
0.672785
61ac42415fd2a36aeb08c168da46c78fa22e3a79
2,644
# # Cookbook:: chef # Recipe:: default # # Copyright:: 2010, OpenStreetMap Foundation # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # U...
20.030303
116
0.70764
7942ca270858b1c42a595b2a2e49c49c5040338b
857
require 'rails_helper' RSpec.describe SchoolClassesController, type: :routing do describe 'routing' do it 'routes to #index' do expect(get: '/school_classes').to route_to('school_classes#index') end it 'routes to #show' do expect(get: '/school_classes/1').to route_to('school_classes#show', i...
28.566667
88
0.66161
4a656af0db66a4bb1ec8b32b4b60cbb7fde58545
1,146
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'index requests' do describe 'GET /api/v1/timelines/:timeline_id/stories' do subject(:endpoint_call) do get "/api/v1/timelines/#{timeline.id}/stories?page=1", headers: { 'Authentication' => auth_token } end let(:user) {...
26.045455
85
0.643979
1dedee58e1257b23940d93feb4e0b22b1c5f83d9
1,141
require 'spec_helper' describe IEX::Resources::Resource do context 'float number to percent (Positive)' do subject do IEX::Resources::Resource.float_to_percentage(0.09123) end it 'converts to percentage' do expect(subject).to eq '+9.12%' end end context 'float number to percent (Nega...
23.285714
60
0.658195
334b53c0657f9c3c63922211f5dcaa74894a4316
385
require 'spec_helper' describe "posting_portals/show" do before(:each) do @posting_portal = assign(:posting_portal, stub_model(PostingPortal, :description => "Description" )) end it "renders attributes in <p>" do render # Run the generator again with the --webrat flag if you want to use we...
24.0625
87
0.706494
91f885a255b309f0b5d39b5b1cd98ed135e1c686
180
class UserSerializer include FastJsonapi::ObjectSerializer attributes :id, :username, :email, :password_digest has_many :businesses, serializer: BusinessSerializer end
22.5
55
0.788889
f76fc8b1c3924cb965eaadf25cf0774cd0231877
581
cask 'memory-tracker-by-timely' do version '2019.17' sha256 'a33bbe09e545cc1ecd338dfb57adc1d6a69b05d3e68f7fa1e410bfa0bf48c3ed' # timelytimetracking.s3.amazonaws.com was verified as official when first introduced to the cask url 'https://timelytimetracking.s3.amazonaws.com/mac_tracker/Memory%20Tracker%20by%20Ti...
36.3125
98
0.790017
bfa1d2ebfd3454906e12fccce327105984606b36
207
# frozen_string_literal: true class RemoveUpdatesSinceFromHesaCollectionRequests < ActiveRecord::Migration[6.1] def change remove_column :hesa_collection_requests, :updates_since, :datetime end end
25.875
81
0.821256
ab4d18b4227fdda267c8a3a5c0db39189c3e8d02
10,767
# # Copyright:: Copyright (c) 2014-2018 Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
31.667647
127
0.652549
f8b05c834153d0df8bda7100e45c7356cb5fd507
1,799
class BagsController < ApplicationController before_action :set_bag, only: [:show, :edit, :update, :destroy] before_action :authenticate_user! load_and_authorize_resource # GET /bags # GET /bags.json def index @bags = Bag.all end # GET /bags/1 # GET /bags/1.json def show end # GET /bags/n...
23.363636
88
0.637576
d5aae7f596bde565e8ba3b777db42b6b789d0c15
107
require 'trello_cli/cli/card/create' require 'trello_cli/cli/card/list' require 'trello_cli/cli/card/move'
26.75
36
0.803738
e852898b6b8a62e3762a8d42854c2603b771d038
2,800
### # Page options, layouts, aliases and proxies ### page "/index.html", :layout => :landing pages_for_pagination = [] pages_for_pagination_index = 0 data.pages.each do |subject, subject_data| if !subject_data.children pages_for_pagination << "/#{subject_data.metadata.url}" else subject_data.children.ea...
29.787234
120
0.717857
011551996115ab89a47d6557aa892c8b0b5183f6
2,819
#!/usr/bin/env ruby # Encoding: utf-8 # # Copyright:: Copyright 2011, Google Inc. All Rights Reserved. # # License:: 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 # # ...
32.77907
80
0.672224
08edd1767863aa67ad0c2e95151b83e900a1abd8
2,152
require 'fileutils' # The purpose of this is to go over all document records and match them # with respective files. # Where files are present, create the expected directory structure, e.g. # /private/elibrary/documents/1/filename # Where files are missing, generate a report. # source_dir is the path to the directory w...
35.866667
96
0.667751
8719a2f73fd79a4d788bd1414166aef6c70a2350
9,187
require File.dirname(__FILE__) + '/../spec_helper' describe "A Call node" do relates "self.method" do compile do |g| g.push :self g.send :method, 0, false end end relates "1.m(2)" do compile do |g| g.push 1 g.push 2 g.send :m, 1, false end end relates "h(1, 2, ...
15.92201
80
0.487319
39b2d81c14e5d5867756242d05243269ee1cbb22
651
require 'rexml/document' describe "REXML::Attributes#prefixes" do before :each do @e = REXML::Element.new("root") a1 = REXML::Attribute.new("xmlns:a", "bar") a2 = REXML::Attribute.new("xmlns:b", "bla") a3 = REXML::Attribute.new("xmlns:c", "baz") @e.attributes << a1 @e.attributes << a2 @e....
27.125
62
0.637481
e241dd69e908f13b7c995b4702be3424cc747964
15,190
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
48.685897
154
0.752535
e8c559856620aec7c461c4e87bac7b1bc6d6bb0d
1,536
# Copyright 2015 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
30.72
253
0.65625
ac6a38fd079681f711e10900724cfa861bad733e
3,659
class User < ApplicationRecord has_many :microposts, dependent: :destroy has_many :active_relationships, class_name: "Relationship", foreign_key: "follower_id", dependent: :destroy has_many :passive_relationships, class_name: "Relationship...
31.273504
78
0.678874
7913b3247c3c49c0d6979d5d377dd16910c6acb7
5,152
# This file is auto-generated from the current state of the database. Instead of editing this file, # please use the migrations feature of Active Record to incrementally modify your database, and # then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your data...
43.294118
149
0.692158
11306aee37b793ed12914172c9fa5ff8866e249c
4,437
#-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2021 the OpenProject GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork ...
33.870229
111
0.687176
91aceb918cde8ba6ad2e7a308906bde24d27f058
573
# frozen_string_literal: true FactoryBot.define do factory :profile do account { FactoryBot.create(:account) } first_name { Faker::Superhero.name } last_name { Faker::Superhero.name } dob { Faker::Date.birthday } address { Faker::Address.street_address } city { Faker::RickAndMorty.location } ...
24.913043
73
0.685864
61bac8ac90155bc394b844aa27a3c16f841079ea
1,029
module PathHelpers def path_to(page_name) case page_name when 'an invoice page' %r{^/invoices/[^/+]+$} when "the invoice's project's page" project_path @invoice.project when "the project's client's page" client_path @project.client when 'the user profile edit page' edit_use...
27.810811
106
0.627794
033c3e17908576a1b28fee8c548cfc4c9e2490d6
114
module API class ActivityController < APIController def show perform Activity::Show end end end
14.25
42
0.701754
088834609f322d0fe3a3350a2c593cf2c55ed6c9
221
require "./config/application" app = MyApp::Application.new use Rack::ContentType app.route do match "greetings/show", default: {"controller" => "greetings", "action" => "show"} root "greetings#index" end run app
17
84
0.701357
ac70c953dbb1c35aeedca3213d44d7b858cbdfbb
272
class SetAsdaMobileToParticipating < ActiveRecord::Migration[6.1] def up MobileNetwork.find_by_brand('Asda Mobile').update(participation_in_pilot: 'yes') end def down MobileNetwork.find_by_brand('Asda Mobile').update(participation_in_pilot: 'no') end end
27.2
84
0.772059
91c0e48c14259ccc42963736ed9db98b62af39c6
376
require 'bundler/setup' require 'slanger/health_check' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.exp...
25.066667
66
0.757979
7a2bc0c0611b7f84ba7ac72a81ad63c826bccc4c
546
# frozen_string_literal: true class Teachers::SessionsController < Devise::SessionsController # before_action :configure_sign_in_params, only: [:create] # GET /resource/sign_in # def new # super # end # POST /resource/sign_in # def create # super # end # DELETE /resource/sign_out # def des...
19.5
69
0.697802
87e759b0570fd332fae0678dd7782db65ec86d07
3,607
def member_response File.read(File.dirname(__FILE__) + '/member.json') end def members_response File.read(File.dirname(__FILE__) + '/members.json') end def roll_call_votes_response File.read(File.dirname(__FILE__) + '/roll_call_votes.json') end def member_vote_comparison_response File.read(File.dirname(__FIL...
25.58156
88
0.441918
bb08fa2a30cd4a3689943370c78a0f14eac134a8
860
require 'spec_helper' describe 'newrelic_lwrp_test::agent_dotnet' do before do stub_resources end context 'Windows' do let(:chef_run) do ChefSpec::SoloRunner.new(:log_level => LOG_LEVEL, :platform => 'windows', :version => '2012', :step_into => ['newrelic_agent_dotnet']) do |node| stub_nod...
30.714286
150
0.713953