conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix test that was broken\n\nThe test was working due to a bug in activefedora-aggregation that was\nfixed.\nhttps://github.com/projecthydra-labs/activefedora-aggregation/issues/73\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CurationConcerns:...
ruby
chosen
[ { "from": "human", "value": "Add spec for testing informing of user\n" }, { "from": "gpt", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\nMODULE_ENTRY_XPATH = \"/project/component[@name='ProjectModuleManager']/modules/module\"\n\ndescribe \"generate task\" do\n describe...
ruby
chosen
[ { "from": "human", "value": "Add unit test for haml render\n" }, { "from": "gpt", "value": "# class HamlRender\n# def initialize(haml_path)\n# @haml = File.read(haml_path)\n# @engine = Haml::Engine.new(@haml)\n# @scope = Object.new\n# end\n#\n# def render(page)\n# html = @e...
ruby
chosen
[ { "from": "system", "value": "Fix bad description on spec\n" }, { "from": "human", "value": "RSpec.describe FilesController do\n before do\n sign_in create(:user)\n end\n\n describe 'GET /files' do\n before do\n get :index, site_id: site.id\n end\n\n context 'when site has no...
ruby
chosen
[ { "from": "system", "value": "Add specs for hash serialization.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Crashplan\n describe Resource do\n describe '#serialize' do\n before do\n Resource.class_eval do\n attribute :created_at, :from => 'creation...
ruby
chosen
[ { "from": "system", "value": "Refactor test suite for Rupert::RPM::Header.\n\nNote that I'm trying not to shoot myself in the foot by iterating over `TAGS`\nkeys as `Header` implementation does. Otherwise it would be never caught if a\nmethod is missing, misnamed, or deleted.\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Update podspec to reduce maintenance\n\nFrom here on out, just update the `s.version` field — don't worry about the tag, it will take care of itself!\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Expecta'\n s.version = '0.2.4'\n s.licen...
ruby
chosen
[ { "from": "system", "value": "Create directory if it doesn't exist for cucumber stdout txt file\n" }, { "from": "human", "value": "require 'baseball_stats'\n\nBaseballStats::DataSource.name_key = \"playerID,birthYear,nameFirst,nameLast\"\nBaseballStats::DataSource.name_key << \"\\naardsda01,1900...
ruby
chosen
[ { "from": "system", "value": "Make rake a development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/timers/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Tony Arcieri\"]\n gem.email = [\"tony.a...
ruby
chosen
[ { "from": "system", "value": "Add one more test to make it more fun\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass WelcomeControllerTest < ActionController::TestCase\n test \"should get index\" do\n get :index\n assert_response :success\n end\n\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with min ruby version" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'xcpretty/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Comment out test while we figure out what's up.\n" }, { "from": "human", "value": "=begin\n\nCopyright 2012 Shared Learning Collaborative, LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with t...
ruby
chosen
[ { "from": "system", "value": "Add required and length validations\n" }, { "from": "human", "value": "# encoding: utf-8\nclass <%= _.capitalize(name) %>\n include DataMapper::Resource\n\n property :id, Serial\n <% _.each(attrs, function (attr) { %>\n <% if (attr.attrType == 'Enum') { %>proper...
ruby
chosen
[ { "from": "system", "value": "Update Etcher version to 1.0.0-beta.14" }, { "from": "human", "value": "cask 'etcher' do\n version '1.0.0-beta.13'\n sha256 '0a7b9f7b8b2a21478957e2815f430444285736761652f9b3c7f4fbefea7db356'\n\n # resin-production-downloads.s3.amazonaws.com was verified as offici...
ruby
chosen
[ { "from": "system", "value": "Add an example for an arbitrary callable as an event callback.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Lita::Handler::EventRouter do\n let(:robot) { instance_double(\"Lita::Robot\", name: \"Lita\") }\n\n subject do\n Class.new do\...
ruby
chosen
[ { "from": "system", "value": "Update Management Tools to 1.9.0\n" }, { "from": "human", "value": "cask :v1 => 'management-tools' do\n version '1.8.1'\n sha256 '959d87a4699fb9ec85f06313c2842dca0fc7e9e230dc992cd3ea05f03d76f0b7'\n\n url \"https://github.com/univ-of-utah-marriott-library-apple/ma...
ruby
chosen
[ { "from": "system", "value": "Modify AuthenticationHelpers to remove deprecation warning\n" }, { "from": "human", "value": "module AuthenticationHelpers\n def stub_current_user user\n ApplicationController.any_instance.stub(:current_user) { user }\n end\n\n def stub_authorize_user!\n Ap...
ruby
chosen
[ { "from": "system", "value": "Simplify creating online data object\n" }, { "from": "human", "value": "# Notify clients when users go online/offline and how many of them are named\nclass AppearanceChannel < ApplicationCable::Channel\n def subscribed\n # Notify clients who are not the current ...
ruby
chosen
[ { "from": "system", "value": "Bump up version to 0.5\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"BTNavigationDropdownMenu\"\n s.version = \"0.4.1\"\n s.summary = \"The elegent navigation dropdown menu\"\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Remove methods for articles controller.\n\n* So that developers get errors to drive development.\n" }, { "from": "human", "value": "class ArticlesController < ApplicationController\n before_filter :set_article, only: [:show, :update, :destroy]\n\n def index\n r...
ruby
chosen
[ { "from": "system", "value": "Change calendar to diplay current user's data only\n" }, { "from": "human", "value": "class CalendarController < ApplicationController\n layout \"logged_in\"\n def index\n @versions = Version.all\n end\nend" }, { "from": "gpt", "value": "class Cale...
ruby
chosen
[ { "from": "system", "value": "Add authentication on feedback form\n\nrefs #1554\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# This file is part of Mconf-Web, a web application that provides access\n# to the Mconf webconferencing system. Copyright (C) 2010-2012 Mconf\n#\n# This fi...
ruby
chosen
[ { "from": "system", "value": "Add user create controller method\n" }, { "from": "human", "value": "class ProfilesController < ApplicationController\n def new\n @user = User.find(params[:user_id])\n @profile = @user.build_profile\n end\n\n def create\n end\nend\n" }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "Add page caching for json of stops and stations in area.\n" }, { "from": "human", "value": "class ServicesController < ApplicationController\n \n include ApplicationHelper\n \n def in_area\n expires_in 60.seconds, :public => true \n map_height = (params[:h...
ruby
chosen
[ { "from": "system", "value": "Change session params to require email instead of username\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n\n end\n\n def create\n @user = User.find_by(username: session_params[:username])\n\n if @user && @us...
ruby
chosen
[ { "from": "system", "value": "Include author id in workflow vacancies filter query.\n" }, { "from": "human", "value": "class WorkflowController < ApplicationController\n before_filter :authenticate_user!\n \n def index\n @vacancies = {}\n @candidatures = {}\n \n { vacancies: Vacan...
ruby
chosen
[ { "from": "system", "value": "Trim sequences to codon boundary\n" }, { "from": "human", "value": "#! /usr/bin/env ruby\n#\n# Filter for FASTA files\n#\n\nrequire 'bigbio'\n\ncount = 0\nFastaReader::emit_fastarecord(-> { gets }) { | rec |\n p count += 1\n print rec.to_fasta\n}\n\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Change design by contract example\n" }, { "from": "human", "value": "# Design by contract example\n\nclass A\n def initialize\n @transactions = []\n @total = 0\n end\n\n def buy price\n @transactions << price\n @total += price\n end\n\n def sell pri...
ruby
chosen
[ { "from": "system", "value": "Add rack dependency to pick up string compare function\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'breach_mitigation/version'\n\nGem::Specification....
ruby
chosen
[ { "from": "system", "value": "Add content_id to page data\n\nBy including this here, the content_id will be automatically sent to\npanopticon. The content_id was generated by running `SecureRandom.uuid`\nin the rails console.\n" }, { "from": "human", "value": "class BusinessSupportPage\n DATA =...
ruby
chosen
[ { "from": "system", "value": "Delete unnecessary all method call.\n" }, { "from": "human", "value": "#\n# The home page that displays all latest news\n#\nclass HomeController < ApplicationController\n\n def index\n @comments = Comment.latest.limit(10).all\n @versions = OntologyVersion.acc...
ruby
chosen
[ { "from": "system", "value": "Add missing links to /users and /notifications.\n" }, { "from": "human", "value": "class RootController < ApplicationController\n # Display links to sub resources.\n def index\n root = {\n :uid => \"grid5000\",\n :links => [\n {\n :rel...
ruby
chosen
[ { "from": "system", "value": "Use accessor instead of ivar in Repository\n" }, { "from": "human", "value": "module Arrthorizer\n class Repository\n include Enumerable\n\n NotFound = Class.new(ArrthorizerException)\n\n def each(&block)\n storage.values.each(&block)\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue when branch no longer exists.\n" }, { "from": "human", "value": "module BugzillaWorkerCommon\n BugNotFoundError = Class.new(StandardError)\n\n def product\n Settings.commit_monitor.bugzilla_product\n end\n\n def with_bug(bug_id)\n return unless b...
ruby
chosen
[ { "from": "human", "value": "Add Sequel Pro Nightly Build 4293" }, { "from": "gpt", "value": "class SequelProNightly < Cask\n version '4293'\n sha256 '8d75ee4c5198de7bfde6a3fb5578812c1dbe13e08f6451dc219f31fc0d3ef722'\n\n url 'http://nightly.sequelpro.com/builds/Sequel_Pro_r0c2ea8b95e.dmg'\n ...
ruby
chosen
[ { "from": "system", "value": "Fix inclusion of TimeCoercions in Coercer::Time\n" }, { "from": "human", "value": "module Coercible\n class Coercer\n\n # Coerce Time values\n class Time < Object\n extend TimeCoercions\n\n primitive ::Time\n\n # Passthrough the value\n #\...
ruby
chosen
[ { "from": "system", "value": "Add default agregator type on data element creation for backward compatibility\n" }, { "from": "human", "value": "module Dhis2\n module Api\n class DataElement < Base\n class << self\n def create(client, elements)\n elements = [elem...
ruby
chosen
[ { "from": "system", "value": "Fix images being added as dashboard to Refinery.engines\n" }, { "from": "human", "value": "require 'dragonfly'\nrequire 'rack/cache'\nrequire 'refinerycms-core'\nrequire File.expand_path('../generators/images_generator', __FILE__)\n\nmodule Refinery\n module Images...
ruby
chosen
[ { "from": "system", "value": "Add MIT license in spec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/writer/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Joe Sak\"]\n gem.email = [\"joe@joesak...
ruby
chosen
[ { "from": "system", "value": "[PH][104191480] Clean up for rerun fix\n" }, { "from": "human", "value": "require 'minitap'\n\nmodule Minitest\n\n ##\n # Base class for TapY and TapJ runners.\n #\n class Minitap\n\n attr_accessor :all_results\n\n def tapout_before_case(test_case)\n ...
ruby
chosen
[ { "from": "system", "value": "Use require_relative instead of require\n" }, { "from": "human", "value": "require 'rails_bootstrap_navbar/version'\nrequire 'rails_bootstrap_navbar/railtie' if defined?(Rails)\n" }, { "from": "gpt", "value": "require_relative 'rails_bootstrap_navbar/ver...
ruby
chosen
[ { "from": "system", "value": "Add 'rubocop-rspec' as a development dependency\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative 'lib/chainer/version'\n\nGem::Specification.new do |s|\n s.name = 'chainer'\n s.version = ::Chainer::VERSION\n s.date ...
ruby
chosen
[ { "from": "system", "value": "Use lowercase for gem name\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'Servi'\n s.version = '0.0.0'\n s.date = '2015-05-23'\n s.summary = \"Form, errors and results hanlder\"\n s.authors = [\"Kevin Hann...
ruby
chosen
[ { "from": "system", "value": "Update local podspec to refer new version\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'GPActivityViewController'\n s.version = '1.1.2'\n s.authors = { 'Gleb Pinigin' => 'gpinigin@gmail.com' }\n s.homepage = 'https://githu...
ruby
chosen
[ { "from": "system", "value": "Move index to be used on parent for testing\n" }, { "from": "human", "value": "ActiveRecord::Schema.define do\n self.verbose = false\n\n create_table :users, force: true do |t|\n t.string :email\n t.timestamps null: false\n end\n\n create_table :admins, fo...
ruby
chosen
[ { "from": "human", "value": "Add integration test framework for wordlist client\n" }, { "from": "gpt", "value": "require_relative '../spec_helper.rb'\n\nrequire 'symgate/wordlist/client'\n\nRSpec.describe(Symgate::Wordlist::Client) do\n def client\n user_password_client_of_type(Symgate::Word...
ruby
chosen
[ { "from": "system", "value": "Fix test_file specification in gemspec.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"cerberus_core/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Implement PEM file set feature\n" }, { "from": "human", "value": "require \"version\"\n\nmodule ApnsS3\nend\n" }, { "from": "gpt", "value": "require \"version\"\nrequire \"aws-sdk\"\nrequire \"apns\"\n\nmodule ApnsS3\n # Set PEM file to APNS module\n #...
ruby
chosen
[ { "from": "system", "value": "Use better syntax for string interpolation\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass Crawler\n attr_accessor :url\n\n def initialize(url)\n @url = url\n end\n\n def document\n @document ||= Nokogiri::HTML(open(url))\n end\n\n def lin...
ruby
chosen
[ { "from": "system", "value": "Enable page caching for avatars\n" }, { "from": "human", "value": "class AvatarsController < ApplicationController\n include DynamicImage::Controller\n\n private\n\n def model\n Avatar\n end\nend\n" }, { "from": "gpt", "value": "class AvatarsContr...
ruby
chosen
[ { "from": "system", "value": "Fix links that use old 'cohort' parameter\n" }, { "from": "human", "value": "# frozen_string_literal: true\n#= Controller for course functionality\nclass ExploreController < ApplicationController\n respond_to :html\n\n def index\n campaign = params[:campaign] |...
ruby
chosen
[ { "from": "system", "value": "Fix css controller where theme name is missing\n" }, { "from": "human", "value": "module Pwb\n class CssController < ActionController::Base\n # renders a stylesheet with client configured variables\n def custom_css\n @current_website = Website.unique_ins...
ruby
chosen
[ { "from": "system", "value": "Update test_result statuses upon state changes\n" }, { "from": "human", "value": "class Job < ActiveRecord::Base\n module JobResult\n extend ActiveSupport::Concern\n \n \n def calculate_result\n \n # Default to errored if no results have been ...
ruby
chosen
[ { "from": "system", "value": "Copy locale file on install\n" }, { "from": "human", "value": "module DeviseUserbin\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"../../templates\", __FILE__)\n desc \"Add DeviseUserbin config v...
ruby
chosen
[ { "from": "system", "value": "Remove Ruby 1.9 support in the Gemfile\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'knife_ec_backup/version'\n\nGem::Specification.new do |s|\n...
ruby
chosen
[ { "from": "system", "value": "Add Toast dependency to .podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"StrawServiceToast\"\n s.version = \"0.1.2\"\n s.summary = \"Toast service of Straw iOS\"\n\n s.description = <<-DESC\n To...
ruby
chosen
[ { "from": "system", "value": "Add action mailer default url options\n" }, { "from": "human", "value": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded o...
ruby
chosen
[ { "from": "system", "value": "Remove old reference to TrustCommerce\n" }, { "from": "human", "value": "config.cache_classes = true\nconfig.whiny_nils = true\n\n# Show full error reports and disable caching\nconfig.action_controller.consider_all_requests_local = false\nconfig.action_controller.pe...
ruby
chosen
[ { "from": "system", "value": "Make it easier to test production builds locally\n" }, { "from": "human", "value": "CarrierWave.configure do |config|\n if EnvironmentBasedUploader.use_fog?\n config.fog_provider = 'fog/aws'\n config.fog_credentials = {\n provider: 'AWS',\n aws_acce...
ruby
chosen
[ { "from": "system", "value": "Set timeout to 10 minutes and disable validate on write\n" }, { "from": "human", "value": "require 'mini_magick'\n\nMiniMagick.configure do |config|\n config.shell_api = \"posix-spawn\"\n config.timeout = 300\n config.validate_on_create = false\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Hide configuration shenanigans in a block\n\nI'm feeling paranoid about the scope variables like redis_config_file\nget defined in. Hiding it in a block to limit the scope.\n" }, { "from": "human", "value": "redis_config_file = Rails.root.join('config', 'resque.yml'...
ruby
chosen
[ { "from": "system", "value": "Remove type attribute from default tag templates\n\n`type` attribute for javascripts and stylesheets is neraly useless in HTML5:\r\n\r\n http://www.w3.org/html/wg/drafts/html/master/document-metadata.html#attr-link-type\r\n http://www.w3.org/html/wg/drafts/html/master/scripti...
ruby
chosen
[ { "from": "system", "value": "Fix url to point to new bucket\n" }, { "from": "human", "value": "require 'json'\n\nclass LanguagePack::Helpers::Nodebin\n URL = \"https://nodebin.herokai.com/v1/\"\n\n def self.query(q)\n response = Net::HTTP.get_response(URI(\"#{URL}/#{q}\"))\n if response...
ruby
chosen
[ { "from": "system", "value": "Bump Bash 4.1 patch level to 9\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass Bash <Formula\n url 'http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz'\n homepage 'http:/...
ruby
chosen
[ { "from": "system", "value": "Use env rather than @env when constructing fallback request data.\n" }, { "from": "human", "value": "module Airbrake\n module Rails\n # Rack middleware for Rails applications. Any errors raised by the upstream\n # application will be delivered to Airbrake and...
ruby
chosen
[ { "from": "system", "value": "Add Cameron as an author\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/easy-deployment/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jeremy Olliver\", \"Nigel Ramsay\", \"Shevaun ...
ruby
chosen
[ { "from": "system", "value": "Add a description to the podspec\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint NAME.podspec' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# To learn more about a Podspec see http://guides.cocoapods....
ruby
chosen
[ { "from": "system", "value": "Expire cache when articles are updated\n" }, { "from": "human", "value": "# Homepage articles. Includes XML format.\nclass Admin::ArticlesController < Admin::AdminController\n layout \"admin/application\"\n before_filter :require_administrator\n\n def index\n ...
ruby
chosen
[ { "from": "system", "value": "Move method to application controller\n" }, { "from": "human", "value": "module WhitelabExplore\n extend ActiveSupport::Concern\n\n included do\n before_filter :set_document\n before_filter :set_filter\n before_filter :set_filtered_amount\n end\n \n pr...
ruby
chosen
[ { "from": "system", "value": "Add filesize to convert size to human readable format\n" }, { "from": "human", "value": "module Ckeditor\n class PictureDecorator < Ckeditor::AssetDecorator\n end\nend" }, { "from": "gpt", "value": "module Ckeditor\n class PictureDecorator < Ckeditor:...
ruby
chosen
[ { "from": "system", "value": "Store scraped content in db\n" }, { "from": "human", "value": "class ScrapePageJob < ApplicationJob\n queue_as :default\n\n def perform(url)\n ScrapePageUrl.new(url).call\n end\nend\n" }, { "from": "gpt", "value": "class ScrapePageJob < Application...
ruby
chosen
[ { "from": "system", "value": "Fix missing constant error with ZMQ exception\n" }, { "from": "human", "value": "# Monkey Patch the new curve_keypair method until\n# a new release of ffi-rzmq is out.\nmodule ZMQ\n class Util\n def self.curve_keypair\n public_key = FFI::MemoryPointer.from_...
ruby
chosen
[ { "from": "human", "value": "Add file with Idea policies\n" }, { "from": "gpt", "value": "class IdeaPolicy < ApplicationPolicy\n def new?\n end\n\n def create?\n end\n\n def update?\n end\n\n def edit?\n end\n\n def destroy?\n end\n\n def index?\n user.present?\n end\n\nend\n" }...
ruby
chosen
[ { "from": "human", "value": "Add missing `BigDecimal` constant definitions.\n" }, { "from": "gpt", "value": "require_relative '../../spec_helper'\nrequire 'bigdecimal'\n\ndescribe \"BigDecimal constants\" do\n ruby_version_is \"2.5\" do\n it \"defines a VERSION value\" do\n BigDecimal.c...
ruby
chosen
[ { "from": "system", "value": "Fix missing user in Errors\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'haml'\n\nmodule Lysergide\n module ErrorHelpers\n def route_missing\n if @app\n super\n else\n not_found\n end\n end\n end\nend\n\ncla...
ruby
chosen
[ { "from": "system", "value": "Disable ActiveStorage to remove related paths, and ActionCable\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBu...
ruby
chosen
[ { "from": "system", "value": "Work around a compiler issue with g++ on Linux\n" }, { "from": "human", "value": "module RbPlusPlus\n module Builders\n\n # Expose a const value\n class ConstNode < Base\n\n def build\n add_child IncludeNode.new(self, code.file)\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update error messages to reflect new changes in remote service.\n" }, { "from": "human", "value": "class Service::RationalJazzHub < Service::HttpPost\n string :username\n password :password\n string :override_server_url\n white_list :username\n\n def receive_pu...
ruby
chosen
[ { "from": "system", "value": "Add way to get something to do.\n" }, { "from": "human", "value": "module Seam\n module Persistence\n def self.find_by_effort_id effort_id\n effort = Seam::InMemory.records.select { |x| x.id == effort_id }.first\n return nil unless effort\n effort...
ruby
chosen
[ { "from": "system", "value": "Add new api system to library\n" }, { "from": "human", "value": "require 'spree_core'\nrequire 'spree_amazon_fps/engine'\nrequire 'amazon/fps/signature_utils'\n" }, { "from": "gpt", "value": "require 'spree_core'\nrequire 'spree_amazon_fps/engine'\nrequi...
ruby
chosen
[ { "from": "system", "value": "Move Engine to the Thincloud::Postmark module" }, { "from": "human", "value": "class Engine < ::Rails::Engine\n\n # Require the config initializer in advance so it is available for\n # the \"thincloud.postmark.action_mailer\" initializer\n initializer \"thincloud...
ruby
chosen
[ { "from": "system", "value": "Add task to republish political content\n\nEditions that are `political: true` need to be republished following the\nelection if we update the government record. This will enable history\nmode on that content and display the 'Published under' banner.\n\nThis commit adds a rake ...
ruby
chosen
[ { "from": "system", "value": "Remove no longer existing CachedGemFile\nRe-alphabetize the autoloads\n" }, { "from": "human", "value": "#:nodoc:\nmodule Gemstash\n autoload :Authorization, \"gemstash/authorization\"\n autoload :Cache, \"gemstash/cache\"\n autoload :CachedGe...
ruby
chosen
[ { "from": "system", "value": "Replace custom exceptions with MCE\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'closure_tree'\nrequire 'configurations'\nrequire 'active_record_union'\n\nrequire 'monarchy/exceptions'\nrequire 'monarchy/validators'\nrequire 'monarchy/ta...
ruby
chosen
[ { "from": "system", "value": "Tweak style to please CircleCI\n\nThe style checks running on CircleCI are slightly different than\nlocal ones, in particular, CircleCI's style configuration doesn't\nlike quotes inside %w(...). Humor it.\n\nSigned-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6...
ruby
chosen
[ { "from": "system", "value": "Return application/xml as response type for propfind requests; Remove necessity for calling Railsdav.initialize! in an initializer\n" }, { "from": "human", "value": "module Railsdav\n autoload :ControllerExtensions, 'railsdav/controller_extensions'\n autoload :Rou...
ruby
chosen
[ { "from": "system", "value": "Correct directory path for requiring extensions\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'logger'\nrequire 'active_support'\n\n# Use active supports auto load mechanism\nDependencies.load_paths << File.dirname(__FILE__)\n\n# Configure active su...
ruby
chosen
[ { "from": "system", "value": "Make forum topics sluggable too.\n" }, { "from": "human", "value": "class ForumTopic < ActiveRecord::Base\n has_many :posts, class_name: 'ForumPost', foreign_key: :topic_id\nend\n" }, { "from": "gpt", "value": "class ForumTopic < ActiveRecord::Base\n h...
ruby
chosen
[ { "from": "system", "value": "Add order by date to posts.\n" }, { "from": "human", "value": "class Profile\n attr_reader :user\n\n def initialize(user, view_context)\n @user = user\n @view_context = view_context\n end\n\n def posts\n if current_users_profile?\n @user.posts\n ...
ruby
chosen
[ { "from": "system", "value": "Allow draft content to be tagged\n\nWe allow other publishing apps like Whitehall to tag draft content, so\nit should be allowed here as well.\n" }, { "from": "human", "value": "class ContentLookupForm\n attr_accessor :base_path\n include ActiveModel::Model\n\n v...
ruby
chosen
[ { "from": "system", "value": "Fix bug where file names get embedded single quotes.\n" }, { "from": "human", "value": "# CsvShaperTemplate\n# Rails view template class\nclass CsvShaperTemplate < CsvShaper::Shaper\n # Expected `encode` call\n # Instantiates a new CsvShaperTemplate object and cal...
ruby
chosen
[ { "from": "system", "value": "Extend specs for class derivation.\n" }, { "from": "human", "value": "require File.expand_path('../gir_ffi_test_helper.rb', File.dirname(__FILE__))\n\n# Tests deriving Ruby classes from GObject classes.\ndescribe \"Class derivation\" do\n before do\n save_module...
ruby
chosen
[ { "from": "system", "value": "Set log column as blog\n" }, { "from": "human", "value": "class CreateJobs < ActiveRecord::Migration\n def self.up\n create_table :jobs do |t|\n t.integer :recipe_id\n t.string :task\n t.datetime :start_time\n t.datetime :end_time\n t.bo...
ruby
chosen
[ { "from": "system", "value": "Add get multi/all to read only\n" }, { "from": "human", "value": "module Flipper\n module Adapters\n # Public: Adapter that wraps another adapter and raises for any writes.\n class ReadOnly\n include ::Flipper::Adapter\n\n class WriteAttempted < Err...
ruby
chosen
[ { "from": "system", "value": "Tweak avatar uploader to avoid upscaling\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass AvatarUploader < CarrierWave::Uploader::Base\n\n include CarrierWave::MiniMagick\n\n # Override the directory where uploaded files will be stored.\n # This is a...
ruby
chosen
[ { "from": "system", "value": "Add a few more file extensions for various programming languages\n" }, { "from": "human", "value": "module Gitlactica\n module RepoComplexity\n KNOWN_EXTENSIONS = %w(js rb)\n\n def self.for_tree(tree)\n blobs = tree.blobs.select { |blob| interesting_blob...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error - add missing comma\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path(File.dirname(__FILE__) + \"/lib/cheetah\")\n\nGem::Specification.new do |s|\n s.name = \"cheetah\"\n s.version = Cheetah::VERSI...
ruby
chosen
[ { "from": "system", "value": "Make accept token generation a class method.\n\nSo if you already have a mechanism to handle http requests you\ncan fecth the token without creating a handshake object.\n" }, { "from": "human", "value": "require 'digest/sha1'\n\nmodule WebSocket\n class ClientHands...
ruby
chosen
[ { "from": "system", "value": "Update typo for store_name column in table\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Location do\nlet(:store) { Location.new(name: \"711\") }\n\n it 'can be created' do\n location = create :location\n expect(location).to_not be_nil\...
ruby
chosen
[ { "from": "system", "value": "Add edge case to loop when invalid input; improve loop control flow\n" }, { "from": "human", "value": "class NprTodaysNews::CLI\n\n def initialize\n puts \"Please type 'list' to list feature stories or 'exit' to quit.\"\n\n scraper = NprTodaysNews::Scraper.ne...
ruby
chosen