conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Move client onto the player\n" }, { "from": "human", "value": "require 'socket'\n\nrequire \"classless_mud/version\"\n\nclass Game\n def initialize client, player\n @client = client\n @player = player\n end\n\n def start\n @client.puts \"game starting\"\...
ruby
chosen
[ { "from": "system", "value": "Add 'by default resets member of sorted set keys with clean command' test\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe 'Redis::Breadcrumb' do\n before do\n Redis::Breadcrumb.redis = MockRedis.new\n end\n\n it 'by default resets owned ke...
ruby
chosen
[ { "from": "system", "value": "Use I18n.t instead of t.\n" }, { "from": "human", "value": "module VoluntaryClassifiedAdvertisement\n class Engine < ::Rails::Engine\n config.i18n.load_path += Dir[File.expand_path(\"../../../config/locales/**/*.{rb,yml}\", __FILE__)]\n \n config.to_prepar...
ruby
chosen
[ { "from": "system", "value": "Enable transcript for all actions.\n" }, { "from": "human", "value": "module ApiTranscriptAgent\n module Transcribe\n extend ActiveSupport::Concern\n\n included do\n end\n\n module ClassMethods\n def transcribe(*actions)\n before_action only...
ruby
chosen
[ { "from": "system", "value": "Return false if the driver pool is empty\n" }, { "from": "human", "value": "require \"chromedriver_proxy_pool/driver_process\"\n\nmodule ChromedriverProxyPool\n class PoolManager\n def initialize\n @limit = 8\n @acquired = []\n\n establish_drivers...
ruby
chosen
[ { "from": "system", "value": "Update the gemspec description and summary\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = 'periscope'\n gem.version = '1.0.0'\n\n gem.authors = ['Steve Richert']\n gem.email = ['steve.richert@gma...
ruby
chosen
[ { "from": "system", "value": "Tidy up orphaned 'else' statement\n" }, { "from": "human", "value": "class ReservationsController < ApplicationController\n def index\n @reservations = Reservation.all.order(start_date: :asc)\n end\n\n def new\n @reservation = Reservation.new\n load_data...
ruby
chosen
[ { "from": "system", "value": "Update pod spec to 0.1.12\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SSPPullToRefresh'\n s.version = '0.1.11'\n s.summary = 'General classes for \"Pull-To-Refresh\" concept customisation'\n\n s.description ...
ruby
chosen
[ { "from": "system", "value": "Fix path to yml files in specs\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\nDir.glob('locales/*.yml').each do |locale_file|\n describe \"a devise-i18n #{locale_file} locale file\" do\n it_behaves_like 'a...
ruby
chosen
[ { "from": "human", "value": "Add in Feed Parser spec\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.describe BarclaysBikeCli::FeedParser do\n subject { BarclaysBikeCli::FeedParser.new }\n\n describe '#fetch', vcr: { cassette_name: 'feed_xml' } do\n it 'parses expected numbe...
ruby
chosen
[ { "from": "system", "value": "Add checking for saved PaperTrail versions\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe Note do\n let(:note) { FactoryGirl.build(:note) }\n describe \"#notebook_name\" do\n let(:notebook) { FactoryGirl.build(:notebook) }\n it \"get...
ruby
chosen
[ { "from": "system", "value": "Add a spec to test requires" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'opal-node' do\n it 'executes a script that prints \"hello world\"' do\n hello_world = a_file_with_name 'hello_world.rb', and_contents: \"puts 'hello world!'\\n\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add a test for config where it is already in rom format\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ROM::Config do\n describe '.build' do\n let(:raw_config) do\n { adapter: 'memory', hostname: 'localhost', database: 'test' }\n en...
ruby
chosen
[ { "from": "system", "value": "Revert to params for test so Drew can experience the awesomeness\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'tomcat', :type => :class do\n\n let :params_data do\n {\n :tomcat_version => '7.0.50',\n :java_home => '/usr...
ruby
chosen
[ { "from": "system", "value": "Add a method to_rgeo for georuby linear ring\n" }, { "from": "human", "value": "class GeoRuby::SimpleFeatures::LinearRing\n\n class << self\n def from_points_with_close_support(*arguments)\n from_points_without_close_support(*arguments).close!\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Return correct value from getter from runtime_fail\n\nThis will avoid calling setter method on every run because of wrong return from\ngetter.\n" }, { "from": "human", "value": "Puppet::Type.type(:runtime_fail).provide(\n :default,\n) do\n\n def ready\n if reso...
ruby
chosen
[ { "from": "system", "value": "Fix InternalAffairs/NodeDestructuring offenses in StructInheritance\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n module Style\n # This cop checks for inheritance from Struct.new.\n #\n # @exampl...
ruby
chosen
[ { "from": "system", "value": "Add tests for platform methods\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestPlatform < Test::Unit::TestCase\n def setup\n end\n\n def test_can_handle_percent_strings\n Boom::Platform.expects('system').with(\"printf \\\"val%%ue\\\" | #{Boom:...
ruby
chosen
[ { "from": "system", "value": "Support versions that git 1.8.4 and lower\n\nrefs: https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.5.txt\n" }, { "from": "human", "value": "require 'tachikoma_ai/bundler/gem'\n\nmodule TachikomaAi\n module Strategies\n class Bundler\n incl...
ruby
chosen
[ { "from": "system", "value": "Make phpMyAdmin detector detect the upcoming 4.0" }, { "from": "human", "value": "\nmodule Versionator\n module Detector\n # Detects {phpMyAdmin}[http://www.phpmyadmin.net].\n class Phpmyadmin < Base\n set :app_name, \"phpMyAdmin\"\n set :project_ur...
ruby
chosen
[ { "from": "system", "value": "Update source to swift 3.0.1\nUpdate version\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CGRectAlignmentExtensions\"\n s.version = \"1.0.2\"\n s.summary = \"Extending CGRect with Swift alignment function.\"\n s.descript...
ruby
chosen
[ { "from": "system", "value": "Include metadata parser in requires\n" }, { "from": "human", "value": "module Dropdown\n class Post\n attr_reader :source\n\n def initialize(source)\n @source = source\n end\n end\nend\n" }, { "from": "gpt", "value": "module Dropdown\n c...
ruby
chosen
[ { "from": "system", "value": "Create 0.5.0, API not changed, gmail-backup is now in Ruby.\n" }, { "from": "human", "value": "module GMail\n module Utils\n VERSION = \"0.4.7\"\n DB_VERSION = \"3\"\n end\nend\n" }, { "from": "gpt", "value": "module GMail\n module Utils\n VE...
ruby
chosen
[ { "from": "system", "value": "Fix W: Useless assignment to variable - vars.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: openvpn\n# Provider:: conf\n#\n# Copyright 2013, Tacit Knowledge, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use th...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix failing test in railties\"\n\nThis reverts commit 6bdc04624dcc0f45aab93af42d00224f67da36d5.\n\nThis has been reverted because https://github.com/rails/rails/commit/8554537e48d6ed18ef08cb3ac0a9da96ac3c5cd6\n" }, { "from": "human", "value": "require 'abst...
ruby
chosen
[ { "from": "system", "value": "Change the edit answer controller\n" }, { "from": "human", "value": "class AnswersController < ApplicationController\n before_action :set_answer, only: [:show, :edit, :update, :destroy]\n\n def show\n end\n\n def new\n @answer = Answer.new\n @question = Qu...
ruby
chosen
[ { "from": "system", "value": "Apply fixes to rubocop errors\n" }, { "from": "human", "value": "class BatchesController < ApplicationController\n before_action :set_batch\n\n def show\n body = {\n done: @batch.entries.processed.count,\n total: @batch.entries_to_process.count,\n ...
ruby
chosen
[ { "from": "system", "value": "Use Loofah directly when not sanitizing\n" }, { "from": "human", "value": "require \"rails_sanitize\"\n\nmodule XssTerminate\n def self.included(base)\n base.extend(ClassMethods)\n # sets up default of stripping tags for all fields\n base.send(:xss_termina...
ruby
chosen
[ { "from": "system", "value": "Apply xmllint to MAL import XML.\n" }, { "from": "human", "value": "require 'my_anime_list_import'\n\nclass ImportsController < ApplicationController\n before_filter :authenticate_user!\n\n def new\n hide_cover_image\n\n if params[:animelist]\n begin\n ...
ruby
chosen
[ { "from": "system", "value": "Fix name error in upload controller\n" }, { "from": "human", "value": "class UploadsController < ApplicationController\n def upload\n files = params[:files]\n # response needs to be array to prepare for multiple simultaneous uploads\n response = []\n fi...
ruby
chosen
[ { "from": "system", "value": "Fix segfault running in Ruby 2.1.0\n" }, { "from": "human", "value": "module Delayed\n module Plugins\n class Honeybadger < Plugin\n module Notify\n def error(job, error)\n ::Honeybadger.notify_or_ignore(\n :error_class => error...
ruby
chosen
[ { "from": "system", "value": "Fix caollecting domain parent categories\n" }, { "from": "human", "value": "namespace :headlines do\n namespace :domains do\n DOMAINS_CATEGORIES = <<-SQL\n SELECT DISTINCT unnest(array_accum(parents)) parents\n FROM headlines_categories,\n LAT...
ruby
chosen
[ { "from": "human", "value": "Add Rails 5 API controller template for the controller generator\n" }, { "from": "gpt", "value": "<% if namespaced? -%>\nrequire_dependency \"<%= namespaced_file_path %>/application_controller\"\n\n<% end -%>\n<% module_namespacing do -%>\nclass <%= controller_class_...
ruby
chosen
[ { "from": "system", "value": "Update formats to include edge cases\n" }, { "from": "human", "value": "module SimpleForm\n module BankAccountNumber\n COUNTRIES = {\n \"AU\" => [\n { label: \"6 digit BSB number\", format: /\\d{6}/ },\n { label: \"9 digit account number\", fo...
ruby
chosen
[ { "from": "system", "value": "Remove \"on\" key from options\n" }, { "from": "human", "value": "module Protocolist\n module ModelAdditions\n module ClassMethods\n def fires type, options={}\n #options normalization\n options[:on] ||= type\n \n data_proc = if ...
ruby
chosen
[ { "from": "system", "value": "Convert cucumber helpers to build real object\n" }, { "from": "human", "value": "require 'spidr_test'\n\nmodule SpidrTest\n module CucumberHelpers\n def spidr_test_options(additional_options = {})\n @spidr_test_options ||= {}\n @spidr_test_options.merg...
ruby
chosen
[ { "from": "system", "value": "Add test for category route\n" }, { "from": "human", "value": "class CategoryRouteTest < ActionDispatch::IntegrationTest\n def test_redirect_to_2nd_page\n get \"/category/category1/page/2\"\n assert_response(:moved_permanently)\n assert_redirected_to(\"/ca...
ruby
chosen
[ { "from": "system", "value": "Add 'default' scope for use by accounts\n" }, { "from": "human", "value": "class Membership < ActiveRecord::Base\n include DC::Access\n include DC::Roles\n\n validates :role, :inclusion=>{ :in => ROLES }\n validates :account_id, :uniqueness=> { :scope => :...
ruby
chosen
[ { "from": "system", "value": "Use a more functional approach.\n" }, { "from": "human", "value": "module RFunk\n class TypeAnnotation\n attr_reader :parameters, :return\n\n def initialize(annotation)\n case Option(annotation)\n when Some\n @annotation = annotation.split('-...
ruby
chosen
[ { "from": "system", "value": "Add a method to reset the namer" }, { "from": "human", "value": "module SitemapGenerator\n # A poor excuse for an enumerator, but it will have to do.\n # Return an object with a method `next` that generates sitemaps with the given name\n # and an index appended.\...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate login page render\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'rack'\n\nmodule Spontaneous::Rack\n module Authentication\n\n def requires_authentication!(options = {})\n first_level_exceptions = (options[:except_all] || ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Use OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING when encrypting\"\n\nThis reverts commit f4db705c10e9cbea4d344ecb11374baa3071a8be.\n" }, { "from": "human", "value": "require 'travis/support/encrypted_column'\nrequire 'travis/support/secure_config'\n\nclass SslKe...
ruby
chosen
[ { "from": "system", "value": "Change homepage url in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'db_charmer/version'\n\nGem::Specification.new do |s|\n s.name = 'db-charmer'\n s.version = DbCharmer:...
ruby
chosen
[ { "from": "system", "value": "test(project/AddWorkDays): Add test for adding work days from the dashboard\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'adding work days to a project' do\n before :each do\n @user = FactoryGirl.create(:user)\n FactoryGirl.create(:co...
ruby
chosen
[ { "from": "system", "value": "Update Handbrake cask to v0.10.0\n" }, { "from": "human", "value": "cask :v1 => 'handbrake' do\n version '0.9.9'\n sha256 '050f9d0d3a126b25d24cb4971062d66f4f975317b6586f8c288795c17a0c05f9'\n\n url \"http://handbrake.fr/rotation.php?file=HandBrake-#{version}-MacOS...
ruby
chosen
[ { "from": "human", "value": "Add Moscow ML, version 2.10.1\n" }, { "from": "gpt", "value": "class MoscowMl < Cask\n version '2.10.1'\n sha256 '4b3e2035b106c688e43e7d415ca74ca8970f74656cc2c17326c5fb7d1f948ca0'\n\n url \"https://github.com/kfl/mosml/releases/download/ver-#{version}/mosml-#{vers...
ruby
chosen
[ { "from": "system", "value": "Fix notify local users spec\n" }, { "from": "human", "value": "# Copyright (c) 2010-2011, Diaspora Inc. This file is\n# licensed under the Affero General Public License version 3 or later. See\n# the COPYRIGHT file.\n\nrequire 'spec_helper'\n\ndescribe Jobs:...
ruby
chosen
[ { "from": "system", "value": "Configure staging online booking locations\n\nEnable online booking for Hackney and its associated locations in the\nstaging environment.\n" }, { "from": "human", "value": "Locations.online_booking_location_uids = [\n # Corresponding location ID(s)\n]\n\n# Booking ...
ruby
chosen
[ { "from": "system", "value": "Include URL in need-o-tron export\n" }, { "from": "human", "value": "require 'csv_renderer'\nrequire 'csv'\n\nclass NeedsCsv < CsvRenderer\n def fact_checkers(need)\n need.current_fact_checker_emails.join(', ')\n end\n\n def accountabilities(need)\n need.cu...
ruby
chosen
[ { "from": "system", "value": "Fix check for invalid number for tracks. Add comments\n" }, { "from": "human", "value": "require 'json'\nrequire 'faraday'\n\nclass User\n def initialize(id)\n @id = id\n end\n\n def likes(count)\n unless count.class == Fixnum\n puts Paint['Invalid num...
ruby
chosen
[ { "from": "system", "value": "Update PHPUnit to version 4.1.1\n\nCloses #1174\n" }, { "from": "human", "value": "require 'formula'\nrequire File.expand_path(\"../../Requirements/php-meta-requirement\", __FILE__)\nrequire File.expand_path(\"../../Requirements/phar-requirement\", __FILE__)\n\nclas...
ruby
chosen
[ { "from": "system", "value": "Remove < 5 activesupport dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = %q{disqus_api}\n s.version = DisqusApi::VERSION\n\n s.date = %q{2013...
ruby
chosen
[ { "from": "human", "value": "Fix bug in the migration that updated the item positions within the\nlanes. Ignore any items which have a state of 'archived'\n" }, { "from": "gpt", "value": "class Item\n def set_updated_by\n end\nend\n\nclass FixItemPositions < ActiveRecord::Migration\n def self...
ruby
chosen
[ { "from": "system", "value": "Use more verbose variable name\nChange language for loading user data\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n# User Audit - Generated with Octokitchen https://github.com/kylemacey/octokitchen\n\n# Dependencies\nrequire \"octokit\"\n\nOctokit.confi...
ruby
chosen
[ { "from": "system", "value": "Update controller for ajaxed flipping\n" }, { "from": "human", "value": "class GuestsController < ApplicationController\n def create\n params[\"firstnames\"].each_with_index do |name, index|\n new_guest = Guest.new(firstname: name, lastname: params[\"lastna...
ruby
chosen
[ { "from": "system", "value": "Add sleep to login method\n" }, { "from": "human", "value": "module Features\n module ApplicationHelpers\n\n def log_in(user = nil)\n if user.nil?\n user = create(:user, phone_verified: true, email_verified: true)\n end\n visit login_path\n...
ruby
chosen
[ { "from": "system", "value": "Test was populating global namespace and clashing\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Terrestrial::Cli::SimulatorLauncher::LaunchArgsBuilder do\n\n Builder = Terrestrial::Cli::SimulatorLauncher::LaunchArgsBuilder\n\n it 'joins argu...
ruby
chosen
[ { "from": "system", "value": "Make acceptance test more explicit\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Promise with fail\" do\n\n MrDarcy.all_drivers.each do |driver|\n describe \"with driver #{driver}\" do\n let(:promise) { MrDarcy::Promise.new(driver: ...
ruby
chosen
[ { "from": "system", "value": "Update params in charts/crops controller specs\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Charts::CropsController do\n describe 'GET charts' do\n let(:crop) { FactoryBot.create :crop }\n describe 'sunniness' do\n before { get :...
ruby
chosen
[ { "from": "human", "value": "Add spec for spec:scaffold generator\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRails::Generators.lookup([\"rspec:scaffold\"])\n\ndescribe Rspec::Generators::ScaffoldGenerator, type: :generator do\n destination File.expand_path('../../../tmp', File.di...
ruby
chosen
[ { "from": "system", "value": "Fix mapper generator integration spec\n" }, { "from": "human", "value": "require 'spec_helper_integration'\n\ndescribe \"Generated mapper from model definition\" do\n it \"generates mappers for the model\" do\n class Order\n include DataMapper::Model\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add solution for day 17\n" }, { "from": "gpt", "value": "# Write a Calculator class with a single method: int power(int,int).\n# The power method takes two integers, n and p, as parameters and returns the\n# integer result of n^p. If either or is negative, then the...
ruby
chosen
[ { "from": "system", "value": "Use File.exist? instead of File.exists? as it's deprecated\n" }, { "from": "human", "value": "require 'rakuten_web_service'\nrequire \"rakuten_web_service/rails/version\"\nrequire 'rails'\n\nmodule RakutenWebService\n class Railtie < ::Rails::Railtie\n initializ...
ruby
chosen
[ { "from": "system", "value": "Fix gem packaging issue...\nRemoved Jeweler, but didn't add in the paths!\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Add the lib dir to the load path if it not there already." }, { "from": "human", "value": "require 'terminitor/yaml'\nrequire 'terminitor/dsl'\nrequire 'terminitor/runner'\nrequire 'terminitor/abstract_core'\nrequire 'terminitor/cli'\nrequire 'terminitor/abstract_ca...
ruby
chosen
[ { "from": "system", "value": "Change error to new Rails error type\n" }, { "from": "human", "value": "ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(\n Mime[:json].symbol => -> (raw_post) {\n ::JSON.parse(raw_post).tap do |res|\n begin\n ...
ruby
chosen
[ { "from": "system", "value": "Make updating optional because of API problems\n" }, { "from": "human", "value": "require 'rufus-scheduler'\n\nscheduler = Rufus::Scheduler.singleton\n\nscheduler.every(\"5m\") do\n JodelCityController.update_cities\nend\n" }, { "from": "gpt", "value": ...
ruby
chosen
[ { "from": "system", "value": "Make sure a user is logged in before they can ask a question\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n\n def index\n @questions = Question.all\n end\n\n def show\n @question = Question.find(params[:id])\n @com...
ruby
chosen
[ { "from": "system", "value": "Disable authenticity token verification on email subscription\n" }, { "from": "human", "value": "class SubscribeController < ApplicationController\n skip_before_action :do_authenticate_user\n skip_authorization_check\n \n def index\n \n @backurl = params[:...
ruby
chosen
[ { "from": "system", "value": "Remove require tictactoe as it is not needed\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nrequire 'tictactoe'\n\nclass Game\n\n attr_accessor :gametype, :ui\n\n def initialize(args)\n @ui = args.fetch(:ui, nil)\n @gametype...
ruby
chosen
[ { "from": "system", "value": "Upgrade VCR to ensure multipart POSTs work.\n" }, { "from": "human", "value": "require './lib/pew_pew/version'\n\nGem::Specification.new do |gem|\n gem.name = 'pew_pew'\n gem.version = PewPew::VERSION\n gem.summary = 'A Ruby library for using the Mailgun API.'\n ...
ruby
chosen
[ { "from": "system", "value": "Change variable 'map' to 'mapfile' when calling Map.new\n" }, { "from": "human", "value": "class Grid\n\n attr_reader :map, :background\n\n def initialize(window, user, map, tileset, map_key, background)\n @window, @user = window, user\n @map = Map.new(windo...
ruby
chosen
[ { "from": "system", "value": "Use bang versions of methods\n\nSeems like a better thing to do in general. See comment in\nhttps://github.com/solidusio/solidus/pull/224/files#r35865456\n" }, { "from": "human", "value": "Spree::StoreCreditCategory.find_or_create_by!(name: Spree.t(\"store_credit_ca...
ruby
chosen
[ { "from": "human", "value": "Create shared example for find operation\n" }, { "from": "gpt", "value": "shared_examples \"a find operation\" do\n\n let(:resource_name) { described_class.to_s.gsub(/^.*::/, '').downcase }\n\n it \"can fetch a specific resource's occurrence by ID\" do\n VCR.use...
ruby
chosen
[ { "from": "human", "value": "Add unit test for git::server recipe.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe_recipe 'git::server' do\n it { expect(chef_run).to include_recipe('git::default') }\n it do\n expect(chef_run).to create_directory(chef_run.node['git']['serv...
ruby
chosen
[ { "from": "human", "value": "Add a ruby experiment with apache tika server\n" }, { "from": "gpt", "value": "require 'net/http'\nrequire 'rest-client'\nrequire 'mime-types'\n\n#\n# A simple Tika server wrapper that provides the following methods:\n# - meta\n# - text\n# - version\n#\nclass TikaWra...
ruby
chosen
[ { "from": "system", "value": "Remove sensible but overridden private method read_attribute\n\nIt looks like this code, redefined a few lines below was leftover since\nforever == 018d68d939de41e5782ca6bcfcb27b42f7d980d4\n\nAvoid `warning: method redefined; discarding old read_attribute`\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Fix cache storage in staging\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nif ENV['ENVIRONMENT'] == 'production'\n Rails.application.config.session_store :cookie_store, key: CatarseSettings.get_without_cache(:secr...
ruby
chosen
[ { "from": "system", "value": "Add WillPaginate ActionView require to initializer.\n" }, { "from": "human", "value": "# config/initializers/will_paginate.rb\n# \n# This extension code was written by Isaac Bowen, originally found\n# at http://isaacbowen.com/blog/using-will_paginate-action_view-and...
ruby
chosen
[ { "from": "system", "value": "Update vscode extensions and install required gems" }, { "from": "human", "value": "meta :code_extension do\n accepts_value_for :name, :basename\n\n template {\n requires \"visual-studio-code\"\n\n met? {\n shell(\"code --list-extensions\").split(\"\\n\...
ruby
chosen
[ { "from": "system", "value": "Add index to from field\n" }, { "from": "human", "value": "require 'ohm'\nrequire 'ohm/contrib'\nrequire 'mail'\n\nmodule Mailbooth\n module Models\n class Message < Ohm::Model\n include Ohm::Callbacks\n\n RCPT_SEPARATOR = ', '\n CRLF = \"\\r\\n\"...
ruby
chosen
[ { "from": "system", "value": "Add jdbc support. Can someone who uses jdbc double check this?\n" }, { "from": "human", "value": "require 'foreigner/connection_adapters/abstract/schema_statements'\nrequire 'foreigner/connection_adapters/abstract/schema_definitions'\nrequire 'foreigner/connection_a...
ruby
chosen
[ { "from": "system", "value": "Correct neo4j specs to be not wrong\n" }, { "from": "human", "value": "def furbies\n @furbies ||= rand(200..299)\nend\n\ndescribe 'neo4j installation' do\n describe command('which neo4j') do\n its(:stdout) { should match 'bin/neo4j' }\n end\n\n describe 'neo4...
ruby
chosen
[ { "from": "system", "value": "Save Asset rather than touch\n\nspree_assets doesnt have timestamps fields and as of rails 4.0.4 it wont\ntouch associations anymore for models that dont have timestamps fields\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::Asset do\n d...
ruby
chosen
[ { "from": "system", "value": "Put open_dead in the PCap namespace.\n" }, { "from": "human", "value": "require 'pcap/ffi'\nrequire 'pcap/data_link'\nrequire 'pcap/handler'\n\nmodule FFI\n module PCap\n def PCap.open_live(options={})\n device = options[:device]\n promisc = if options...
ruby
chosen
[ { "from": "system", "value": "Make it play nice with older versions of devise\n" }, { "from": "human", "value": "module DeviseInvitable\n module Mailer\n\n # Deliver an invitation email\n def invitation_instructions(record, opts={})\n devise_mail(record, :invitation_instructions, opt...
ruby
chosen
[ { "from": "system", "value": "Add reference about similary medthods\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rrj/tools/gem/config'\n\n# :reek:UtilityFunction\n\nmodule RubyRabbitmqJanus\n # # RRJRSpec\n #\n # Initializer to use with RSpec execution\n class...
ruby
chosen
[ { "from": "system", "value": "Include renderable, and use its render method instead.\n" }, { "from": "human", "value": "module Salt\n class Page\n include Frontable\n\n attr_accessor :path, :contents, :filename, :extension\n\n def initialize(path = nil)\n @path = path\n @exte...
ruby
chosen
[ { "from": "system", "value": "Fix bad require following the renaming of the Events class\n" }, { "from": "human", "value": "require 'timetable/time_helper'\nrequire 'timetable/application'\nrequire 'timetable/cache'\nrequire 'timetable/calendar'\nrequire 'timetable/config'\nrequire 'timetable/da...
ruby
chosen
[ { "from": "system", "value": "Support cjsx (react jsx flavored coffeescript)\n" }, { "from": "human", "value": "require 'guard/compat/plugin'\n\nmodule Guard\n class Jasmine < Plugin\n # The inspector verifies if the changed paths are valid\n # for Guard::Jasmine. Please note that request...
ruby
chosen
[ { "from": "system", "value": "Fix test to use ActiveSupport::Concern" }, { "from": "human", "value": "require 'test_helper'\n\nmodule MyPlugin\n def self.configure(model)\n model.class_eval { attr_accessor :from_configure }\n end\n\n module ClassMethods\n def class_foo\n 'class_foo...
ruby
chosen
[ { "from": "system", "value": "Add json provide. Put Controller under an application module.\n" }, { "from": "human", "value": "# Define a subclass of Ramaze::Controller holding your defaults for all\n# controllers\n\nclass Controller < Ramaze::Controller\n layout :default\n helper :xhtml\n e...
ruby
chosen
[ { "from": "system", "value": "Fix way to specify tags\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"QRCodeKit\"\n s.version = \"0.1.0\"\n s.summary = \"QRCodeKit is a library for capturing and generating QR code in Swift.\"\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Remove config.ssh.password, it hasn't been used in years\n" }, { "from": "human", "value": "Vagrant::Config.run do |config|\n # default config goes here\n config.vagrant.dotfile_name = \".vagrant\"\n config.vagrant.host = :detect\n\n config.ssh.username = \"vagr...
ruby
chosen
[ { "from": "system", "value": "Add a \"setup\" post install message\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bindler/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Add FIXME to test that clears ENV\"\n\nThis reverts commit 8a4e27392805de7ab1e8ef4f14b0e76b171ad328.\n\nHas been fixed by e766457 and 09ef65f on master.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Vcloud::Core::Fog::Login do\n\n # ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary info from tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Authorizator do\n describe '#allowed_to_log_in?' do\n let!(:test_email) { \"test@example.com\" }\n\n subject { described_class.new.allowed_to_log_in...
ruby
chosen
[ { "from": "system", "value": "Remove ambiguity with regexp (to keep CodeClimate happy)" }, { "from": "human", "value": "module Cinch\n module Plugins\n class Uno\n include Cinch::Plugin\n\n match /fart/i, method: :help\n\n def help(m)\n m.reply(\"Farting.\")\n end\...
ruby
chosen
[ { "from": "system", "value": "Use timeout for Proving if timeout is set.\n" }, { "from": "human", "value": "module Hets\n class ProveCaller < ActionCaller\n CMD = 'prove'\n METHOD = :post\n COMMAND_LIST = %w(auto)\n\n PROVE_OPTIONS = {format: 'json', include: 'true'}\n\n def call...
ruby
chosen
[ { "from": "system", "value": "Allow halting with a Rack response array\n" }, { "from": "human", "value": "module Innkeeper\n\tclass Manager\n\t\tattr_reader :app, :config\n\t\tattr_accessor :env\n\n\t\tdef initialize(app)\n\t\t\t@app, @config = app, ::Innkeeper::Config.new\n\t\t\tyield @config i...
ruby
chosen