conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Switch to local license for pg exporter.\n"
},
{
"from": "human",
"value": "#\n## Copyright:: Copyright (c) 2016 GitLab Inc.\n## License:: Apache License, Version 2.0\n##\n## Licensed under the Apache License, Version 2.0 (the 'License');\n## you may not use this fi... | ruby | chosen |
[
{
"from": "system",
"value": "Update Chef dependency to >= 16\n"
},
{
"from": "human",
"value": "name 'osl-mysql'\nissues_url 'https://github.com/osuosl-cookbooks/osl-mysql/issues'\nsource_url 'https://github.com/osuosl-cookbooks/osl-mysql'\nmaintainer 'Oregon State... | ruby | chosen |
[
{
"from": "human",
"value": "Add italian mobile and home phone numbers\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nmodule Faker\n module PhoneNumberIT\n extend ModuleUtils\n extend self\n\n def phone_number\n if rand(0..1) == 1\n home_phone_number\n else\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove the bogus dependency on yum\n\nYou're requiring Chef 12.18+ which has yum_repository in it so there isn't being used for anything.\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "name ... | ruby | chosen |
[
{
"from": "human",
"value": "Build HTML from Aruba's output. Try it out with RECORD_HTML=true rake\n"
},
{
"from": "gpt",
"value": "if ENV['RECORD_HTML']\n\n=begin\n\nBuilds a HTML representation of the files used in each scenario.\nSource files get syntax highlighted with Pygments (http://pygme... | ruby | chosen |
[
{
"from": "system",
"value": "Move api call to Heroe model\n"
},
{
"from": "human",
"value": "require 'digest/md5'\n\nclass HeroesController < ApplicationController\n\n def index\n\n render \"heroes\"\n end\n\n def all\n # Marvel API only returns a maximum of 100 results per call\n #... | ruby | chosen |
[
{
"from": "system",
"value": "Set table name back after we're done\n\nEnsures future migrations that change data in the User model work.\n"
},
{
"from": "human",
"value": "class AddConfirmableToDevise < ActiveRecord::Migration\n def self.up\n add_column :pw_dyn_user, :confirmation_token, :st... | ruby | chosen |
[
{
"from": "human",
"value": "Add a an id (pk) to drug_types_drugs\n"
},
{
"from": "gpt",
"value": "class AddPkToDrugTypesDrugs < ActiveRecord::Migration[5.1]\n def change\n\n # Remove the old PK\n reversible do |direction|\n direction.up { execute \"ALTER TABLE drug_types_drugs DROP ... | ruby | chosen |
[
{
"from": "system",
"value": "tt-1609: Refactor to sting interpolation Pair: @rachelthecodesmith @CharlesIC\n"
},
{
"from": "human",
"value": "module ConfigEndpoints\n PATH = '/config'.freeze\n PATH_PREFIX = Pathname(PATH)\n IDP_LIST_SUFFIX = 'idps/idp-list/%s/%s'.freeze\n IDP_LIST_SIGN_IN_S... | ruby | chosen |
[
{
"from": "system",
"value": "Add validation for Financial Reports\n\nPrepare for users inputting data rather than script\nChange from has_one to the correct belongs_to\nCheck for numerical values in year,spending, funding\n"
},
{
"from": "human",
"value": "class FinancialReport < ActiveRecord::... | ruby | chosen |
[
{
"from": "system",
"value": "FIX: Use tutorial enrolments for checking group tutorial\n"
},
{
"from": "human",
"value": "#\n# Records which students are in this group... used to determine the related students on submission\n#\nclass GroupMembership < ActiveRecord::Base\n include LogHelper\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use unless instead of if for correct behavior\n"
},
{
"from": "human",
"value": "module Everything\n module AddPiecesToPieceRefinement\n refine Everything::Piece do\n attr_reader :parent\n\n def parent=(parent_piece)\n @parent = parent_piece\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Move api calls to Heroe model\n"
},
{
"from": "gpt",
"value": "class Heroe < ApplicationRecord\n validates :name, uniqueness: true\n\n def self.save_hero_data\n # offset = 0\n response_count = nil\n # until response_count == 0\n # character_data = mar... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor add generator of hooks on single transactions\n"
},
{
"from": "human",
"value": "require 'dredd_hooks/definitions'\nrequire 'dredd_hooks/runner'\n\nmodule DreddHooks\n\n # The Ruby hooks API\n module Methods\n\n def self.define_hooks_on_single_transact... | ruby | chosen |
[
{
"from": "system",
"value": "Fix crash when error response is not a valid JSON\n"
},
{
"from": "human",
"value": "module Fog\n module Scaleway\n module Errors\n def self.decode_error(error)\n body = begin\n Fog::JSON.decode(error.response.body)\n re... | ruby | chosen |
[
{
"from": "system",
"value": "Check if dj queue defined instead of just empty\n"
},
{
"from": "human",
"value": "dep_included? 'delayed_job'\n\n_cset :dj_queues, nil\n\nnamespace :delayed_job do\n\n desc \"Writes the delayed job part of the Procfile\"\n task :procfile, :roles => :dj do\n pr... | ruby | chosen |
[
{
"from": "system",
"value": "Change files in gemspec file\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"yy/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Add \"api\" to reserved group short names list.\n"
},
{
"from": "human",
"value": "class SubdomainValidator < ActiveModel::EachValidator\n def validate_each(object, attribute, value)\n return unless value.present?\n reserved_names = %w(www ftp mail pop smtp a... | ruby | chosen |
[
{
"from": "system",
"value": "Remove extra space in help banner for subcommands."
},
{
"from": "human",
"value": "module Troo\n module CLI\n class ThorFixes < Thor\n # def self.exit_on_failure?\n # true # exit code is non-zero on error\n # end\n\n def self.banner(command... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Move readonly load to katla\"\n\nThis reverts commit 3dd8db9fac8442e4f32fa3a55e7b68c27ece526a.\n"
},
{
"from": "human",
"value": "name \"web\"\ndescription \"Role applied to all web/api servers\"\n\ndefault_attributes(\n :accounts => {\n :users => {\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for ascii table indentation.\n"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n\nrequire 'spec_helper'\n\ndescribe TTY::Table::Renderer::ASCII, 'indentation' do\n let(:header) { ['h1', 'h2', 'h3'] }\n let(:rows) { [['a1', 'a2', 'a3'], ['b1',... | ruby | chosen |
[
{
"from": "system",
"value": "Change route to share application\n"
},
{
"from": "human",
"value": "#module CatarseStripe\n #class Engine < ::Rails::Engine\n #isolate_namespace CatarseStripe\n #end\n#end\nmodule ActionDispatch::Routing\n class Mapper\n def mount_catarse_stripe_at(catarse... | ruby | chosen |
[
{
"from": "system",
"value": "Add some missing methods to the top-level object.\n"
},
{
"from": "human",
"value": "# depends on: module.rb class.rb\n\ndef self.to_s\n \"main\"\nend\n\nmodule Rubinius\n AtExit = []\nend\n\nclass NilClass\n alias_method :|, :^\n\n def call(*a)\n raise Local... | ruby | chosen |
[
{
"from": "system",
"value": "Fix indentation for user auth feature spec\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.feature 'User authentication' do\n let!(:user) { create(:user) }\n\n specify 'can log in with valid credentials' do\n visit new_user_session_path... | ruby | chosen |
[
{
"from": "human",
"value": "Move twitter text filter spec to its proper place\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe PublifyApp::Textfilter::Twitterfilter do\n def filter_text(text, filters)\n TextFilter.filter_text(text, filters)\n end\n\n it 'should replace ... | ruby | chosen |
[
{
"from": "system",
"value": "Make element_type read-only for List and SList\n"
},
{
"from": "human",
"value": "require 'ffi-glib/container_class_methods'\n\nmodule GLib\n # Common methods for List and SList.\n module ListMethods\n include Enumerable\n attr_accessor :element_type\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change to explicitly require nokogiri\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass HTMLCompressFilter < Nanoc::Filter\n identifier :html_compress\n type :text\n\n def run(content, params={})\n doc = Nokogiri::HTML(content)\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Reorder and group thor options for clarity\n"
},
{
"from": "human",
"value": "require 'thor'\n\nmodule Stevenson\n class Application < Thor\n desc 'stevenson new PROJECT_NAME', 'generates a Jekyll at PROJECT_NAME'\n\n method_option :branch,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Resolve \"Circular dependency detected\" (duplicate)\n"
},
{
"from": "human",
"value": "namespace :gitlab do\n namespace :assets do\n desc 'GitLab | Assets | Compile all frontend assets'\n task compile: [\n 'yarn:check',\n 'assets:precompile',\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use overcommit to run rake lint checks\n"
},
{
"from": "human",
"value": "append_to_file \"Rakefile\" do\n <<~RUBY\n\n begin\n require \"rubocop/rake_task\"\n RuboCop::RakeTask.new\n task default: %w[test test:system rubocop]\n rescue LoadError # rubocop... | ruby | chosen |
[
{
"from": "system",
"value": "[Podspec] Read version from the package.json, add author, add tag to the git source, add .git extension\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"react-native-video\"\n s.version = \"0.7.1\"\n s.summary = \"A <Video />... | ruby | chosen |
[
{
"from": "system",
"value": "Swap test gem install of fpm for chef-ruby-lvm\n\nfpm has some deps that are failing to compile now on centos 6 and\nopensuse 42\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "#\n# Cookbook:: end_to_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix alchemy_language factory to use the right site factory\n\nThere must have been slipped one `site` when namespacing the factories.\n"
},
{
"from": "human",
"value": "require 'factory_girl'\nrequire 'alchemy/test_support/factories/site_factory'\n\nFactoryGirl.defi... | ruby | chosen |
[
{
"from": "system",
"value": "Update `Convection.stack` to accept a configuration block\n"
},
{
"from": "human",
"value": "##\n# Root module\n##\nmodule Convection\n class << self\n def template(*args, &block)\n Model::Template.new(*args, &block)\n end\n\n def stack(*args)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix index (nonexistent field, too long of a name)\n"
},
{
"from": "human",
"value": "class CreateLocalizedFields < ActiveRecord::Migration\n def self.up\n create_table :localized_fields do |t|\n t.string :localized_object_type\n t.integer :loc... | ruby | chosen |
[
{
"from": "system",
"value": "Comment our crop parent on api resource until we can specify the model\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Api\n module V1\n class CropResource < BaseResource\n immutable\n\n filter :approval_status, default: 'app... | ruby | chosen |
[
{
"from": "system",
"value": "Add fix for Rails 4\n"
},
{
"from": "human",
"value": "module MultiTest\n def self.disable_autorun\n if defined?(Test::Unit::Runner)\n Test::Unit::Runner.module_eval(\"@@stop_auto_run = true\")\n end\n end\nend\n"
},
{
"from": "gpt",
"value"... | ruby | chosen |
[
{
"from": "system",
"value": "Remove erroneous requiring of deprecated classes\n"
},
{
"from": "human",
"value": "$:.unshift(File.dirname(__FILE__)) unless\n $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))\n\nrequire 'rubygems'\nrequire 'json'\n\nreq... | ruby | chosen |
[
{
"from": "system",
"value": "Use the override of nothing instead of a value default\n"
},
{
"from": "human",
"value": "require 'ethos/schema'\nrequire 'ethos/attributes'\nrequire 'ethos/collection'\n\nmodule Ethos\n module Entity\n module ClassMethods\n def schema\n @_schema ||=... | ruby | chosen |
[
{
"from": "system",
"value": "Update to jekyll-sass-converter to v1.2.0.\n\nThis version allows for users to set a custom output style in safe mode.\nhttps://github.com/jekyll/jekyll-sass-converter/releases/tag/v1.2.0\nhttps://github.com/jekyll/jekyll-sass-converter/compare/v1.1.0...v1.2.0\nhttps://github.c... | ruby | chosen |
[
{
"from": "system",
"value": "Use the Data class for fetching default snippet data when compiling.\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nmodule Snp\n # Snp::Compiler\n #\n # This class takes a template file name and builds it, using the template\n # definition, default data to... | ruby | chosen |
[
{
"from": "system",
"value": "Use keyword arguments instead of an options hash.\n"
},
{
"from": "human",
"value": "class Udongo::Crypt\n attr_reader :options\n\n def initialize(options = {})\n @options = options.reverse_merge!(secret: Rails.configuration.secret_key_base)\n end\n\n def cry... | ruby | chosen |
[
{
"from": "system",
"value": "Include `Which` within Util autoloads\n"
},
{
"from": "human",
"value": "module Vagrant\n module Util\n autoload :Busy, 'vagrant/util/busy'\n autoload :CommandDeprecation, 'vagrant/util/command_deprecation'\n autoload :Counter, ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix descriptions in the .gemspec file\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jekyll-paginate_command/version'\n\nGem::Specification.new do |spe... | ruby | chosen |
[
{
"from": "system",
"value": "Fix use wrong module name.\nIndent the code.\n"
},
{
"from": "human",
"value": "# This method is base on fireapp docs example.\r\n# The url will join {http_path} variable.\r\nmodule ViewHelpers\r\n def new_link_to(name, href, options={})\r\n href = File.join(Hel... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for author indices\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe.skip BlogPostsController, type: :controller do\n describe '#index' do\n it 'should return all non-draft blog posts' do\n\n end\n\n it 'should never return a d... | ruby | chosen |
[
{
"from": "human",
"value": "Add most localities controller tests\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe LocalitiesController, type: :controller do\n before(:example) do\n sign_in_user(double('user', role?: 'admin'))\n end\n\n describe 'GET :index' do\n it '... | ruby | chosen |
[
{
"from": "system",
"value": "Update the pod version for testing\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'QRCodeReader.swift'\n s.module_name = 'QRCodeReader'\n s.version = '6.0.0'\n s.license = 'MIT'\n s.summary = 'Simp... | ruby | chosen |
[
{
"from": "system",
"value": "Add the hello world example war to the test\n\nThis better simulates a wrapper cookbook\n"
},
{
"from": "human",
"value": "# make sure we have java installed\ninclude_recipe 'java'\n\n# Install Tomcat 8.0.32 to the default location\ntomcat_install 'helloworld' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "JariBakken: Fix error in the file_detector example.\n\ngit-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@15466 07704840-8298-11de-bf8c-fd130f914ac9\n"
},
{
"from": "human",
"value": "module Selenium\n module WebDriver\n\n #\n # @api private\n #\n\n m... | ruby | chosen |
[
{
"from": "system",
"value": "Add inspect-style to_s and remove NullToken\n"
},
{
"from": "human",
"value": "# Token class\nclass Token\n attr_reader :type, :text\n\n def initialize(text)\n @type = :text\n @text = text\n end\n\n def output(spacer)\n spacer.output @text\n end\nend\n... | ruby | chosen |
[
{
"from": "system",
"value": "Package version increased from 0.2.0.1 to 0.2.1.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.2.0.1'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' '\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add more dependencies to Gemfile.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'warming_drawer/version'\n\nGem::Specification.new do |gem|\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add comment to puts statement\n"
},
{
"from": "human",
"value": "answer = 1 + rand(1000)\nputs answer\nputs \"Guess what number I'm thinking of. It's between 1 and 1000\"\nguess = gets.to_i\nwhile guess != answer\n puts \"Wrong! Guess again!\"\n guess = gets.t... | ruby | chosen |
[
{
"from": "system",
"value": "Use Hoptoad if it is installed. Otherwise do nothing"
},
{
"from": "human",
"value": "module Sunspot\n module Rails\n module Failover\n module ExceptionHandlerAdapter\n \n def self.handle(exception)\n case exception_handler\n w... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for area archiving\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\nclass AreaArchiveTest < ActionDispatch::IntegrationTest\n def setup\n @admin = users(:david)\n @area = areas(:one)\n log_in_as(@admin)\n end\n\n test \"unsuccessful are... | ruby | chosen |
[
{
"from": "human",
"value": "Add Mongrel fix back in for now\n"
},
{
"from": "gpt",
"value": "if Rails.version == '2.3.10' && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel)\n \n # Pulled right from latest rack. Old looked like this in 1.1.0 ve... | ruby | chosen |
[
{
"from": "system",
"value": "Use SQL to update records in migration\n\nBecause SQL is faster than AR.\n"
},
{
"from": "human",
"value": "class LoadIssueIdToSearcherRecord < ActiveRecord::Migration\n def change\n reversible do |d|\n d.up do\n sql = \"UPDATE searcher_records SET i... | ruby | chosen |
[
{
"from": "system",
"value": "Make git commands show only in debug mode\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'open3'\n\nmodule Clamshell\n class Dependency\n attr_accessor :name\n end\n\n class Git < Dependency\n attr_accessor :uri, :ref\n\n def initialize(... | ruby | chosen |
[
{
"from": "system",
"value": "Restructure to allow matches_all to be called from a subclass\n"
},
{
"from": "human",
"value": "module Discordrb::Events\n class Negated\n attr_reader :object\n def initialize(object); @object = object; end\n end\n\n def matches_all(attributes, to_check, &... | ruby | chosen |
[
{
"from": "system",
"value": "Split method into smaller methods\n"
},
{
"from": "human",
"value": "module Morph\n class DockerMaintenance\n def self.delete_container_and_remove_image(container)\n Rails.logger.info \"Deleting container #{container}...\"\n container.delete\n\n b... | ruby | chosen |
[
{
"from": "system",
"value": "Change sidekiq retry behaviour on InitialTaggingImport\n\nThis shouldn't really be retrying at all - we report errors back to the\nuser fairly comprehensively and manual retry controls are built into the\nUI.\n"
},
{
"from": "human",
"value": "class InitialTaggingIm... | ruby | chosen |
[
{
"from": "system",
"value": "Update the version of `deprecation_horizon`\n"
},
{
"from": "human",
"value": "if Rails::VERSION::MAJOR > 3\n module Comable\n class Deprecator < ActiveSupport::Deprecation\n def initialize(deprecation_horizon = '0.4.0', gem_name = 'Comable')\n super... | ruby | chosen |
[
{
"from": "system",
"value": "Use updated-for-Sinatra-1.4 method of testing accept header.\n\nCannot use request.accept?() because many browser requests\nautomatically include */* which causes that method to\nreturn true.\n"
},
{
"from": "human",
"value": "module Descartes\n class Web < Sinatra... | ruby | chosen |
[
{
"from": "system",
"value": "Update serverspec test to test for c:/opscode directory\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'Host File' do\n\n describe file('c:/windows/system32/drivers/etc/hosts') do\n it { should be_file }\nend\n\nend"
},
{
"from": "gpt... | ruby | chosen |
[
{
"from": "system",
"value": "Raise error if Redis not set\n"
},
{
"from": "human",
"value": "module Searchkick\n class ReindexQueue\n attr_reader :name\n\n def initialize(name)\n @name = name\n end\n\n def push(record_id)\n redis.lpush(redis_key, record_id)\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use Blizzard data instead of internal data.\n"
},
{
"from": "human",
"value": "module Audit\n class ReputationData < Data\n def add\n reps = {}\n\n REPUTATIONS[@character.data['faction']].each do |reputation, name|\n match = @data['reputation'].... | ruby | chosen |
[
{
"from": "system",
"value": "Create or drop hstore extension only if necessary."
},
{
"from": "human",
"value": "class SetupHstore < ActiveRecord::Migration\n def self.up\n execute \"CREATE EXTENSION hstore\"\n end\n\n def self.down\n execute \"DROP EXTENSION hstore\"\n end\nend\n"
... | ruby | chosen |
[
{
"from": "system",
"value": "Simplify and document TrainedStudentsManager a bit.\n"
},
{
"from": "human",
"value": "class TrainedStudentsManager\n def initialize(course)\n @course = course\n end\n\n def students_without_overdue_training\n students_scope.count\n end\n\n private\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Make the `QA:Page::Project::Show` driver less brittle\n\nThis allows the test to continue even if the GitLab instance being\ntested, or the user being used, had SSH access configured.\n"
},
{
"from": "human",
"value": "module QA\n module Page\n module Project\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update BetterTouchTool to use brew-cask\n"
},
{
"from": "human",
"value": "applications_package \"BetterTouchTool\" do\n source \"http://www.boastr.de/BetterTouchTool.zip\"\nend\n"
},
{
"from": "gpt",
"value": "include_recipe \"applications::homebrewca... | ruby | chosen |
[
{
"from": "system",
"value": "Add more tests for artist\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Artist, :type => :model do\n it \"should require a name\" do\n artist = Artist.new\n expect(artist.valid?).to eq(false)\n expect(artist.errors[:name]).to eq([\"c... | ruby | chosen |
[
{
"from": "system",
"value": "Use normal hash methods to access, dig isn't available in ruby < 2.3\n"
},
{
"from": "human",
"value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = pac... | ruby | chosen |
[
{
"from": "system",
"value": "Make the string a fancypath"
},
{
"from": "human",
"value": "meta :lbaction do\n accepts_value_for :source\n\n def actions_dir\n \"~/Library/Application Support/LaunchBar/Actions\"\n end\n\n def path\n actions_dir / name\n end\n\n template {\n met? {... | ruby | chosen |
[
{
"from": "system",
"value": "Add another auto increment test\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe AchievementsController, type: :controller do\n describe \"#create\" do\n context \"logged in user\" do\n before do\n # Log in user\n @u... | ruby | chosen |
[
{
"from": "system",
"value": "Clean localstorage before each test\n"
},
{
"from": "human",
"value": "RSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n expectations.include_chain_clauses_in_custom_matcher_descriptions = true\n end\n\n config.mock_with :rspec do |mo... | ruby | chosen |
[
{
"from": "system",
"value": "Drop support for opal versions prior to 0.9"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/opal/jquery/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'opal-jquery'\n s.version = Opal::JQue... | ruby | chosen |
[
{
"from": "system",
"value": "Update author email, add homepage and license.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'open_badges/version'\n\nGem::Specification.new ... | ruby | chosen |
[
{
"from": "system",
"value": "Use helper Store module in main module\n"
},
{
"from": "human",
"value": "module ConfigBadger\n autoload :VERSION, 'config_badger/version'\n\n autoload :Assertions, 'config_badger/assertions'\n autoload :Errors, 'config_badger/errors'\n autoload :Op... | ruby | chosen |
[
{
"from": "system",
"value": "Sort helper requires for easier inspection.\n"
},
{
"from": "human",
"value": "require 'mspec/helpers/bignum'\nrequire 'mspec/helpers/flunk'\nrequire 'mspec/helpers/io'\nrequire 'mspec/helpers/scratch'\nrequire 'mspec/helpers/tmp'\nrequire 'mspec/helpers/const_looku... | ruby | chosen |
[
{
"from": "system",
"value": "Remove 'already init' warnings for proxy classes."
},
{
"from": "human",
"value": "module Proxy\n\n class ProxyContainer\n\n attr_reader :subject, :accepts\n\n def initialize(subject, accepts)\n @subject = subject\n @accepts = accepts\n end\n\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add monkey patched Array class for start on Queue\n"
},
{
"from": "gpt",
"value": "# Monkey patch of standard Ruby Array class\n\nclass Array\n # File activesupport/lib/active_support/core_ext/array/wrap.rb, line 36\n # source http://devdocs.io/rails/array#method-c... | ruby | chosen |
[
{
"from": "system",
"value": "Add a task to lowercase all existing emails\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace :users do\n desc 'Merge users with different case variations of same email'\n task merge_duplicate_users: :environment do\n require 'duplic... | ruby | chosen |
[
{
"from": "system",
"value": "Use the new CLI registry in the CLI app."
},
{
"from": "human",
"value": "module ToyRobot\n class CLI\n def initialize(registry: nil)\n @robot = ToyRobot::Robot.new\n @registry = registry.nil? ? build_register : registry\n end\n\n def run\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Split tags from high-order functions in Mustang\n"
},
{
"from": "human",
"value": "require 'wlang'\nmodule WLang\n class Mustang < WLang::Dialect\n include Temple::Utils\n\n evaluator :hash, :send, :nofail\n\n def plus(buf, fn)\n if x = evaluate(fn)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update ffi gem to 1.9.18\n"
},
{
"from": "human",
"value": "dir 'core_gems'\ndownload \"bundler\", \"1.14.5\"\ndownload \"msgpack\", \"1.0.3\"\nif td_agent_2?\n download \"cool.io\", \"1.4.6\"\nelse\n download \"cool.io\", \"1.5.0\"\nend\ndownload \"http_parser.rb... | ruby | chosen |
[
{
"from": "system",
"value": "Fix order so can drop despite constraint.\n"
},
{
"from": "human",
"value": "class AddEximLog < ActiveRecord::Migration\n def self.up\n create_table :exim_logs do |t|\n t.column :exim_log_done_id, :integer\n t.column :info_request_id,... | ruby | chosen |
[
{
"from": "system",
"value": "Update example to new library name\n"
},
{
"from": "human",
"value": "require 'watch'\n\nclass LibWatch < Watch\n def on_change(directory)\n puts \"Ruby callback: #{directory.inspect}\"\n end\nend\n\nl = LibWatch.new\n\np l.latency\nl.latency = 0.2\np l.latency... | ruby | chosen |
[
{
"from": "system",
"value": "Allow specifying different S3 bucket\n\nThis allows sharing env between components while keeping images in its own bucket.\n"
},
{
"from": "human",
"value": "module Helpers\n def preset\n OpenStruct.new(IMAGE_PRESETS[@preset_name.to_sym])\n end\n\n def send_to... | ruby | chosen |
[
{
"from": "system",
"value": "Fix expectation style for better error message\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire 'spec_helper'\nrequire 'hako/schedulers/ecs_definition_comparator'\n\nRSpec.describe Hako::Schedulers::EcsDefinitionComparator do\n describe '#d... | ruby | chosen |
[
{
"from": "system",
"value": "Change the podspec library syntax a bit.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\ts.name = 'FreeStreamer'\n\ts.version = '1.3.7'\n\ts.license = 'BSD'\n\ts.summary = 'A low-memory footprint ... | ruby | chosen |
[
{
"from": "human",
"value": "Add sampler for CPU usage\n"
},
{
"from": "gpt",
"value": "module Custodian\n module Samplers\n\n class CPU < Custodian::Samplers::Sampler\n describe \"CPU usage\"\n\n def sample\n cpu = `top -l 1`.match /CPU usage: ([0-9]+\\.[0-9]+%) user, ([0-9... | ruby | chosen |
[
{
"from": "system",
"value": "Add thor as a development dependency\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'mark_version'\n s.version = '0.1.0'\n s.date = '2015-05-30'\n s.summary = 'A tool for recording the version of a ruby application.'\n s.authors = [... | ruby | chosen |
[
{
"from": "system",
"value": "Make default for ok_for_ml true and avoid nulls\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass AddOkForMlToImages < ActiveRecord::Migration[6.1]\n def change\n add_column(:images, :ok_for_ml, :boolean)\n end\nend\n"
},
{
"from... | ruby | chosen |
[
{
"from": "system",
"value": "Remove readline that does work nicely with other agents.\n"
},
{
"from": "human",
"value": "require 'readline'\nmodule Gisele\n class VM\n class Command\n class Interactive < Agent\n\n def runone\n prompt = \"\\n? Please choose an action:(li... | ruby | chosen |
[
{
"from": "system",
"value": "Update dependent serverkit gem with 0.4.7 or higher\n"
},
{
"from": "human",
"value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"vagrant/serverkit/version\"\n\nGem::Specification.new do |spec|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Split the custom validations into two distinct validations for user sessions"
},
{
"from": "human",
"value": "class UserSession\n include ActiveModel::Validations, ActiveModel::Model\n\n attr_accessor :reference, :password, :email_address\n validates_presence_of ... | ruby | chosen |
[
{
"from": "system",
"value": "Modify required files path to include specific folders only.\n"
},
{
"from": "human",
"value": "require 'bundler'\nBundler.require\n\nDir.glob('./**/*.rb').each { |file| require file }\n\nuse Assets\nrun Sinatra::Application\n"
},
{
"from": "gpt",
"value... | ruby | chosen |
[
{
"from": "human",
"value": "Test fixes - message boards.\n"
},
{
"from": "gpt",
"value": "class MessageBoardsAdminPage < BladesDBPage\r\n PAGE_TITLE = BladesDBPage::PAGE_TITLE + BladesDBPage::PAGE_TITLE_CONNECTOR + \"Message Boards\"\r\n\r\n def create_board(name: nil, blurb: nil, ic: fal... | ruby | chosen |
[
{
"from": "system",
"value": "Use variable_size_secure_compare for HTTP auth\n\nThis change is similar to the patch for CVE-2015-7576 for Rails\n5.0.0.beta1.1 and other versions.\n"
},
{
"from": "human",
"value": "module StripeEvent\n class WebhookController < ActionController::Base\n if res... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.