conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Implement 'recv_nonblock' instead of recv\n\nThis solves Issue #4.\n" }, { "from": "human", "value": "class Request\n attr_reader :uri, :headers\n def initialize(client)\n @uri = extract_uri(client)\n @headers = extract_headers(client)\n end\n\n#Handles onl...
ruby
chosen
[ { "from": "system", "value": "Update demo task to respect newly added validation for local_id\n" }, { "from": "human", "value": "puts \"Creating demo educators...\"\nEducator.destroy_all\n\nEducator.create!([{\n email: \"demo@example.com\",\n password: \"demo-password\",\n admin: true\n}, {\n...
ruby
chosen
[ { "from": "system", "value": "Move name generation code out of initialize\n\nThere is still a part of this that I don't like. It seems that the\ngenerate_name method should handle the naming errors. However, the\nbouncer methods currently depend on the @name instance variable\nbeing set. I see two alternati...
ruby
chosen
[ { "from": "system", "value": "Fix broken Audit Trail feature test\n" }, { "from": "human", "value": "Given(/^a document that has gone through many changes$/) do\n begin_drafting_publication('An frequently changed publication')\n click_on \"Save and continue\"\n assert page.has_content?('An fr...
ruby
chosen
[ { "from": "system", "value": "Remove non-printable characters from JSON string\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'json'\nrequire './box_score_entry'\n\nclass BoxScore\n attr_reader :bses\n\n BS_URI = \"http://scores.espn.go.com/nba/gamecast12/master?xhr=1&gameId=%s...
ruby
chosen
[ { "from": "system", "value": "Allow PhantomJS to be auto-installed again\n\nThe [phantomjs gem] can automatically install PhantomJS if it isn't already available on the system.\n\nThis functionality was disabled in commit b938bff6f76bc23232b523e0d2a688d34b9d6e22. This was done for security reasons – because...
ruby
chosen
[ { "from": "system", "value": "Use double-quotes on lines w/ string interpolation\n" }, { "from": "human", "value": "require 'formula'\n\nclass P0f < Formula\n homepage 'http://lcamtuf.coredump.cx/p0f3/'\n url 'http://lcamtuf.coredump.cx/p0f3/releases/p0f-3.07b.tgz'\n sha1 'ae2c4fbcddf2a5ced33...
ruby
chosen
[ { "from": "system", "value": "B: Fix posts/index.html is not found\n" }, { "from": "human", "value": "require './config/app.rb'\n\nmodule Rack\n class ScsBlog < Static\n def call(env)\n status, headers, response = @file_server.call(env)\n if status == 404\n if env[\"PATH_INF...
ruby
chosen
[ { "from": "system", "value": "Use the Rack::Static middleware for serving the static public folder.\n" }, { "from": "human", "value": "require 'application'\n\nuse Rack::Session::Cookie\nuse Rack::ShowExceptions\n\nrun Application" }, { "from": "gpt", "value": "require 'application'\...
ruby
chosen
[ { "from": "system", "value": "Use newer Honeybadger middleware\nOld one is deprecated.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\n\nBundler.require\n\nuse Rack::SslEnforcer if ENV[\"RACK_ENV\"] == \"production\"\n\nHoneybadger.configure do |config|\n config.api_ke...
ruby
chosen
[ { "from": "system", "value": "Make the autofill of the mac address work with proxies\n" }, { "from": "human", "value": "module Devices\n class ComputersController < ApplicationController\n before_filter :authenticate_user!\n before_filter :assign_computer, only: [:edit, :update, :destroy]...
ruby
chosen
[ { "from": "system", "value": "Fix cloud_files gemspec: nokogiri < 1.10\n" }, { "from": "human", "value": "require './gemspec_helper'\n\nif Gem::Version.new(RUBY_VERSION) < Gem::Version.new(\"2.3.0\")\n gemspec_for 'cloud_files', [['net-ssh'], ['mime-types'], ['nokogiri', '< 1.10'], ['fog-racksp...
ruby
chosen
[ { "from": "system", "value": "Update google chrome repo to be amd64-only\n" }, { "from": "human", "value": "#\n# Cookbook Name:: desktop\n# Recipe:: google-chrome\n#\n# Copyright 2015, Andrew Jones\n#\n# All rights reserved - Do Not Redistribute\n#\n\napt_repository 'google-chrome-unstable' do\n...
ruby
chosen
[ { "from": "system", "value": "Fix passing datetime param to sql\n" }, { "from": "human", "value": "require 'identity/importer/tasks/members'\n\nmodule Identity\n module Importer\n module Tasks\n module CiviCRM\n class Members < Identity::Importer::Tasks::Members\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Use alias_method_chain instead of reimplementing method\n" }, { "from": "human", "value": "require \"active_support/concern\"\n\nmodule RailsSoftDeletable\n module Associations\n extend ActiveSupport::Concern\n\n included do\n def target_scope\n r...
ruby
chosen
[ { "from": "system", "value": "Change perf tests to new boundaries\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"io/console\"\nrequire \"rspec-benchmark\"\n\nRSpec.describe TTY::Screen, \".size\" do\n include RSpec::Benchmark::Matchers\n\n it \"detectes size 15x ...
ruby
chosen
[ { "from": "system", "value": "Add 2017 State of the Nation Address and polish markup." }, { "from": "human", "value": "require 'sinatra'\nrequire 'ostruct'\nrequire 'word_bunny'\n\nget '/' do\n @sample_text_title = \"Example: President Aquino's State of the Nation Address 2013\"\n speech = Fil...
ruby
chosen
[ { "from": "system", "value": "Use single quotes for non-interpolated strings\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"stash_datacite/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specific...
ruby
chosen
[ { "from": "system", "value": "Raven: Use to_unsafe_h instead of to_hash whichi is deprecated.\n\nFormer-commit-id: cf4f069b658e8d4c705cd0a42a8d64a8e3c0c994" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n def no_resp_redir(dest)\n respond_to do |format|...
ruby
chosen
[ { "from": "system", "value": "Add 301 redirect for heroku domain\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with: :exc...
ruby
chosen
[ { "from": "system", "value": "Set access headers to all (todo: revert)\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with...
ruby
chosen
[ { "from": "system", "value": "Make use of current_team helper\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass TeamInviteController < ApplicationController\n def create\n @team_invite_submissions = TeamInviteForm.new(team_invite_params)\n @team = current_team\n\n ...
ruby
chosen
[ { "from": "system", "value": "Prepare decorator for all locations\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass GameyeServerDecorator < ServerDecorator\n def flag\n if location_flag\n tag.span \"\", class: \"flags flags-#{location_flag}\", title: location_name\...
ruby
chosen
[ { "from": "system", "value": "Add top level documentation for concerns\n" }, { "from": "human", "value": "module PrimaryAttachment\n extend ActiveSupport::Concern\n include ApplicationHelper\n\n def picture?\n picture.present? && picture.online\n end\n\n def picture_medium\n picture.i...
ruby
chosen
[ { "from": "system", "value": "Fix NoMethodError on journal preview without JavaScript\n" }, { "from": "human", "value": "module Pwfmt::PreviewsControllerPatch\n extend ActiveSupport::Concern\n\n included do\n before_render :set_issue_wiki_format, only: [:issue]\n before_render :set_news_...
ruby
chosen
[ { "from": "human", "value": "Add explicit many_to_one integration spec for arel\n" }, { "from": "gpt", "value": "require 'spec_helper_integration'\n\ndescribe '[Arel] Many To One with generated mapper' do\n include_context 'Models and Mappers'\n\n before(:all) do\n setup_db\n\n insert_us...
ruby
chosen
[ { "from": "system", "value": "Fix typo in commented code.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\nrequire 'gnuplot'\n\ndescribe SPCore::HybridResampling do\n\n context '.resample' do\n it 'should produce output signal with the ...
ruby
chosen
[ { "from": "system", "value": "Add a specific error class." }, { "from": "human", "value": "require \"pry\"\n\nrequire \"livereload-rails/version\"\nrequire \"livereload-rails/watcher\"\nrequire \"livereload-rails/client\"\nrequire \"livereload-rails/middleware\"\nrequire \"livereload-rails/engin...
ruby
chosen
[ { "from": "system", "value": "Fix 'undefined method `hostname' for String'\n" }, { "from": "human", "value": "require 'json'\nrequire 'net/http'\n\nmodule Nehm\n\n class HTTPClient\n\n ##\n # SoundCloud API client ID\n\n CLIENT_ID = '11a37feb6ccc034d5975f3f803928a32'\n\n ##\n # E...
ruby
chosen
[ { "from": "system", "value": "Fix handling of the subject - treatments should stick now\n" }, { "from": "human", "value": "require 'rigor/middleware/cookie_jar'\nrequire 'rigor/middleware/session'\n\nmodule Rigor\n class Middleware\n def initialize(app, options={})\n @app, @options = ap...
ruby
chosen
[ { "from": "system", "value": "Print backtrace: only if err responds to it.\n\ngit-svn-id: 55dab261027a0615fa60e6fe1b42a29d056462f7@84 3b289f47-807e-410a-85af-7ee1d5ead6e2\n" }, { "from": "human", "value": "require 'cabar'\n\nmodule Cabar\n\n # Common error base class for Cabar.\n class Error <...
ruby
chosen
[ { "from": "system", "value": "Remove rake args that don't have a value\n\nFixes #413\n" }, { "from": "human", "value": "desc \"Run the javascript specs\"\ntask teaspoon: :environment do\n require \"teaspoon/console\"\n\n options = {\n files: ENV[\"files\"].nil? ? [] : ENV[\"files\"].split(\...
ruby
chosen
[ { "from": "system", "value": "Make link to auth clickable\n" }, { "from": "human", "value": "module Twat\n class Actions\n\n # Add is somewhat of a special case, everything else hangs off config for\n # it's magic, However we're forced to do it manually here- config doesn't\n # know an...
ruby
chosen
[ { "from": "system", "value": "Allow scheduling from after_commit hooks\n" }, { "from": "human", "value": "module Sidekiq\n module Worker\n module ClassMethods\n module NoSchedulingFromTransactions\n NESTING = ::Rails.env.test? ? 1 : 0\n\n %i(perform_async perform_at perfor...
ruby
chosen
[ { "from": "human", "value": "Add Reviewer so Invenio can fetch and review Pull Requests\n" }, { "from": "gpt", "value": "module Invenio\n class Reviewer\n\n attr_reader :client, :pull_requests\n\n def self.run\n reviewer = new\n reviewer.fetch\n reviewer.review\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Implement a basic recursive_delete_if that passes the failing test.\n" }, { "from": "human", "value": "require 'json'\nrequire \"json/merge_patch/version\"\n\nmodule JSON\n MergeError = Class.new(StandardError)\n\n def self.merge(document, merge_patch)\n docume...
ruby
chosen
[ { "from": "system", "value": "Add version to user agent\n" }, { "from": "human", "value": "require 'faraday_middleware'\n\nmodule MtGox\n module Connection\n private\n\n def connection\n options = {\n :ssl => {:verify => false},\n :url => 'https://mtgox.com',\n :...
ruby
chosen
[ { "from": "system", "value": "Add plugins to asset copying\n" }, { "from": "human", "value": "namespace :ckeditor do\n def copy_assets(regexp)\n Rails.application.assets.each_logical_path(regexp) do |name, path|\n asset = Rails.root.join('public', 'assets', name)\n p \"Copy #{path}...
ruby
chosen
[ { "from": "system", "value": "Add a spec shared_example for testing TreeNode:: icons\n" }, { "from": "human", "value": "shared_examples 'TreeNode::Node#key prefix' do |prefix|\n describe '#key' do\n it \"begins with #{prefix}\" do\n expect(subject.key).to start_with(prefix)\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Remove forgotten decorates_assigned call in HomeController." }, { "from": "human", "value": "class HomeController < ApplicationController\n\n decorates_assigned :directory_categories, with: CategoryDecorator\n\n def show\n\n end\n\n def display_menu_button_in_he...
ruby
chosen
[ { "from": "system", "value": "Add new column for task model\n" }, { "from": "human", "value": "Hanami::Model.migration do\n change do\n create_table :tasks do\n primary_key :id\n column :title, String\n column :body, String, text: true\n column :link, Str...
ruby
chosen
[ { "from": "system", "value": "Update GitHub user information on sign in\n" }, { "from": "human", "value": "require 'inch_ci/action'\n\nmodule Action\n module User\n class Signin\n include InchCI::Action\n\n CLIENT_ID = InchCI::AccessToken[:github_client_id]\n CLIENT_SECRET...
ruby
chosen
[ { "from": "system", "value": "Clay: Use current binary and homepage URLs\n\nThe Clay homepage has moved to http://claylabs.com/clay/. The claylanguage.org\nhostname still redirects to the old site, so that should be changed as well.\n\nCloses #8935.\n\nSigned-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe...
ruby
chosen
[ { "from": "system", "value": "Remove events from the events index if they are booked\n" }, { "from": "human", "value": "module EventsHelper\n\n def date_time_helper(date_time)\n \"#{date_time.strftime('%A, %b %d, %Y')} at #{date_time.strftime('%I:%M %p')}\"\n end\n\n def available?(event)\...
ruby
chosen
[ { "from": "system", "value": "Add location to ArcadeMachine json.\n" }, { "from": "human", "value": "class ArcadeMachine < ActiveRecord::Base\n include HasImages\n include Slugged\n\n validates :title, presence: true\n validates :players, numericality: { only_integer: true, greater_than: 1 }...
ruby
chosen
[ { "from": "system", "value": "Allow for find only in saved DtoCollection\n\nAllow for find only in saved DtoCollection\n" }, { "from": "human", "value": "class DtoCollection\n attr_accessor :saved, :data, :data_index,\n :dependencies, :manager_ref, :attributes\n\n def initialize...
ruby
chosen
[ { "from": "system", "value": "Fix use of login when no user associated\n" }, { "from": "human", "value": "atom_feed :language => Settings.app_lang do |feed|\n feed.title t('.messages_list')\n feed.updated @messages.first.updated_at if !@messages.empty?\n\n @messages.reverse.each do |msg|\n ...
ruby
chosen
[ { "from": "system", "value": "Update default missing README text\n" }, { "from": "human", "value": "class ExtractExtensionVersionWorker\n include Sidekiq::Worker\n\n def perform(extension_id, tag, compatible_platforms)\n return if not semver?(tag)\n\n @tag = tag\n @extension = Extensi...
ruby
chosen
[ { "from": "system", "value": "Change the podspec version -> 2.6.0\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"Framezilla\"\n spec.version = \"2.5.0\"\n spec.summary = \"Comfortable syntax for working with frames.\"\n\n spec.homep...
ruby
chosen
[ { "from": "system", "value": "3321: Fix getting principal IP from headers\n\nAuthors: 72d0743fa974f1b94d0389ab43a06cc7eebf90ac@chrisholmes\n" }, { "from": "human", "value": "class SamlController < ApplicationController\n protect_from_forgery except: :request_post\n\n UNDETERMINED_IP = '<PRINCI...
ruby
chosen
[ { "from": "system", "value": "Update gemspec file: homepage, summary and description\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"simple_datatable/version\"\n\n# Describe your gem and declare its dependencies:\nGem...
ruby
chosen
[ { "from": "system", "value": "Clean up utf8 as we go.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nmodule Buildbox\n class Result\n require 'securerandom'\n\n attr_reader :uuid, :command\n attr_accessor :finished, :exit_status\n\n def initialize(command)\n @uuid ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with 414 error when posting to create a document\n" }, { "from": "human", "value": "module Doccy\n \n class Documents\n \n def self.create(auth_token, template_id, document_params)\n options = { query: { auth_token: auth_token, document: doc...
ruby
chosen
[ { "from": "human", "value": "Create Link Checker metric class with initializer\n\nSimilar to the Accuracy metric I have added code for the Link Checker\nmetric initializer.\n\nSigned-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>\n" }, { "from": "gpt", "value": "requi...
ruby
chosen
[ { "from": "system", "value": "Remove trailing pp debug output\n" }, { "from": "human", "value": "\nclass Flor::Pro::Cron < Flor::Macro\n #\n # \"cron\" is a macro procedure.\n #\n # ```\n # cron: '0 0 1 jan *'\n # task albert 'take out garbage'\n # ```\n #\n # is automatically turned ...
ruby
chosen
[ { "from": "system", "value": "Fix sending mails after photo export\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# 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.\...
ruby
chosen
[ { "from": "system", "value": "Add id constraint to version routes\n" }, { "from": "human", "value": "module JsonApiRoutes\n VALID_IDS = /[0-9]*/\n \n def id_constraint(path)\n { :\"#{ path.to_s.singularize }_id\" => VALID_IDS }\n end\n \n def create_links(path, links)\n links_regex =...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.13 to 0.1.14\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP li...
ruby
chosen
[ { "from": "human", "value": "Isolate all DJ logging to the DJ log files.\n" }, { "from": "gpt", "value": "# monkey patch BufferedLogger to allow a custom formatter\nclass ActiveSupport::BufferedLogger\n def formatter=(formatter)\n @log.formatter = formatter\n end\nend\n\n# ensure DJ is logg...
ruby
chosen
[ { "from": "system", "value": "Handle case when ScheduledSet is empty\n" }, { "from": "human", "value": "require \"sidekiq/api\"\n\nnamespace :sidekiq do\n desc \"Check if there are any scheduled that should have already been run, if so fire up sidekiq\"\n task :process_scheduled do\n # side...
ruby
chosen
[ { "from": "system", "value": "Delete legacy steps about $tmp and $home\n" }, { "from": "human", "value": "require 'tmpdir'\n\nGiven /^a temporary directory called '(.+)'$/ do |name|\n path = Dir.mktmpdir\n at_exit do\n delete_path path\n end\n variable_table[name] = path\nend\n\nGiven /^a...
ruby
chosen
[ { "from": "system", "value": "Improve code style by removing parenthesis\n" }, { "from": "human", "value": "require 'devise/strategies/authenticatable'\nrequire 'tiddle/model_name'\nrequire 'tiddle/token_issuer'\n\nmodule Devise\n module Strategies\n class TokenAuthenticatable < Authenticata...
ruby
chosen
[ { "from": "system", "value": "Move the Wisecrack ID out of Mongo and to the API" }, { "from": "human", "value": "class Client\n include Mongoid::Document\n field :name, type: String\n field :wisecrack_id, type: String\n embeds_many :projects\nend" }, { "from": "gpt", "value": "cl...
ruby
chosen
[ { "from": "system", "value": "Copy changed of jurisdiction names in seed data\n" }, { "from": "human", "value": "Office.find_or_create_by(name: 'Digital')\nOffice.find_or_create_by(name: 'Bristol')\n\nunless ENV=='production'\n User.create([{\n name: 'Admin',\n ema...
ruby
chosen
[ { "from": "system", "value": "Add seed file which populates questions with comments\n" }, { "from": "human", "value": "require 'faker'\n\n20.times do\n Question.create!(\n title: Faker::Lorem.sentence,\n content: Faker::Lorem.paragraph,\n asker_id: rand(100),\n best_answer_id: rand(...
ruby
chosen
[ { "from": "system", "value": "Remove a missed reference to ActiveRecord.\n" }, { "from": "human", "value": "Dummy::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 relo...
ruby
chosen
[ { "from": "system", "value": "Test dummy app with current_user helper.\n" }, { "from": "human", "value": "# Use this hook to configure cornerstone.\nCornerstone::Config.setup do |config|\n\n # == Authenticated User Method\n # Specify the method in which your application accesses the authentica...
ruby
chosen
[ { "from": "system", "value": "Make myself person to email\n" }, { "from": "human", "value": "#!/usr/bin/env gem build\n# -*- encoding: utf-8 -*-\n\nrequire 'date'\n\n# Load this library's version information\nrequire File.expand_path('../lib/merb_datamapper/version', __FILE__)\n\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Configure Capybara to run `Webrick` in tests\n\nThis commit resolves dependecy issues due to the absence of `puma` from\nthe project's Gemfiles:\n\n```\nFailure/Error: raise LoadError, \"Capybara is unable to load `puma` for its server, please add `puma` to your project or spec...
ruby
chosen
[ { "from": "system", "value": "Add unit tests for client\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Client do\n\n # TODO: this entire class needs a test double for Resting \n # which can receive messages\n it \"has a valid mock\" do\n client = double('Client')\n e...
ruby
chosen
[ { "from": "system", "value": "Add automatically restart nodeJs App\n" }, { "from": "human", "value": "include_recipe 'deploy'\ninclude_recipe \"nginx::service\"\n\nnode[:deploy].each do |application, deploy|\n\tif deploy[:application_type] != 'nodejs'\n\t\tnext\n\tend\t\n\tChef::Log.info(\"Deplo...
ruby
chosen
[ { "from": "system", "value": "Delete and create the database on each scenario\n" }, { "from": "human", "value": "# Generated by cucumber-sinatra. (Sat Oct 01 19:57:01 +0200 2011)\n\nENV['RACK_ENV'] = 'test'\n\nrequire File.join(File.dirname(__FILE__), '..', '..', 'recharge.rb')\n\nrequire 'capyb...
ruby
chosen
[ { "from": "system", "value": "Change author and app description in gemspec\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"activelogic/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification...
ruby
chosen
[ { "from": "system", "value": "Update EmailCampaignMigration to use the new object model\n" }, { "from": "human", "value": "class ChangePublishingAppForEmailCampaignContent < ActiveRecord::Migration\n class DraftContentItem < ActiveRecord::Base; end\n class LiveContentItem < ActiveRecord::Base;...
ruby
chosen
[ { "from": "human", "value": "Remove removed_document_ids entries that point to deleted documents\n\nAt some point in the past, we fully deleted some sections from a manual\nso that they no longer exist. Unfortunately we left references to their\nids in the removed_document_ids of the manual they used to be...
ruby
chosen
[ { "from": "system", "value": "Update mailer address and subject" }, { "from": "human", "value": "class FootprintMailer < ActionMailer::Base\n default :from => \"from@example.com\"\n\n def footprint_email(user, checkins=nil, application_url=nil)\n @user = user\n @checkins = checkins\n ...
ruby
chosen
[ { "from": "human", "value": "Add Gravatar module for User model. Prefills data on registration\n" }, { "from": "gpt", "value": "module Gravatar\n # Provides methods for social data added through Gravatar's Verified Services\n extend ActiveSupport::Concern\n\n included do\n %w(facebook flic...
ruby
chosen
[ { "from": "system", "value": "Sort departures rather than stop_times\n\nThere are cases where realtime updates change the order of departures.\nOrdering by departure.time ensures that they are always ordered by\nactual departure time." }, { "from": "human", "value": "class DepartureFetcher\n in...
ruby
chosen
[ { "from": "system", "value": "Sort role payment type options alphabetically\n" }, { "from": "human", "value": "class RolePaymentType\n include ActiveRecordLikeInterface\n\n attr_accessor :id, :name\n\n Unpaied = create!(id: 1, name: \"Unpaid\")\n ParliamentarySecretary = create!(id: 2, name:...
ruby
chosen
[ { "from": "system", "value": "Fix database serialization of job class names with Que\n\nWhen passing a class constant as a job argument, Que’s stored procedures serialize it to JSON in the database as `{}`. This means that when the job (the ActiveJob “wrapper”) is deserialized from the database, it can’t fi...
ruby
chosen
[ { "from": "system", "value": "Update gemspec licenses to be array of strings\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rack/honeytoken/version'\n\nGem::Specification.new do |sp...
ruby
chosen
[ { "from": "system", "value": "Reduce maximum for baseline speed test\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire_relative 'test_base'\n\nclass FeatureBaselineSpeedTest < TestBase\n\n def self.id58_prefix\n '159'\n end\n\n # - - - - - - - - - - - - - - - - - - ...
ruby
chosen
[ { "from": "system", "value": "Add newline at the end of a file\n" }, { "from": "human", "value": "module Skeptic\n module Rules\n class SpacesAroundOperators\n DESCRIPTION = 'Spaces around operators'\n\n OPERATORS_WITHOUT_SPACES_AROUND_THEM = ['**']\n\n def initialize(data)\n ...
ruby
chosen
[ { "from": "system", "value": "Use ::Rails instead of Rails\n\nPrevents Rails 4 Rake error: uninitialized constant Sprockets::Rails::Engine\n" }, { "from": "human", "value": "require 'sprockets/media_query_combiner/processor'\n\nif defined?(Rails)\n module Sprockets\n module MediaQueryCombine...
ruby
chosen
[ { "from": "system", "value": "Use created_at time that is now set in deliveries table\n" }, { "from": "human", "value": "class Delivery < ActiveRecord::Base\n belongs_to :email\n belongs_to :address\n has_many :postfix_log_lines, -> { order \"time DESC\" }\n has_many :open_events\n\n after_...
ruby
chosen
[ { "from": "system", "value": "Add red & make private\n" }, { "from": "human", "value": "class ResistorColorDuo\n\n def self.value(colors)\n \"#{ColorArray.index(colors[0])}#{ColorArray.index(colors[1])}\".to_i\n end\n\n ColorArray = [\n \"black\",\n \"brown\",\n \"no_color\",\n ...
ruby
chosen
[ { "from": "system", "value": "Add null:false constraint to item image attachment\n" }, { "from": "human", "value": "class CreateItems < ActiveRecord::Migration[5.0]\n def change\n create_table :items do |t|\n t.integer :user_id, null: false\n t.integer :section_id, null: fa...
ruby
chosen
[ { "from": "system", "value": "Use FileUtils to move tempfile\n" }, { "from": "human", "value": "require 'tempfile'\n\nmodule HaproxyWeight\n class Config\n def initialize(filename)\n @filename = filename\n @lines = []\n\n File.open(@filename).each do |line|\n @lines << ...
ruby
chosen
[ { "from": "system", "value": "Use YAML.load_file instead of YAML.load(File.Read).\n\nUse File.join instead of concatenating bits of path.\n" }, { "from": "human", "value": "module IBANTools\n class Conversion\n\n def self.local2iban(country_code, data)\n config = load_config country_cod...
ruby
chosen
[ { "from": "system", "value": "Fix bug only primary key id.\n" }, { "from": "human", "value": "require 'rolify/adapters/base'\n\nmodule Rolify\n module Adapter \n class ResourceAdapter < ResourceAdapterBase\n def resources_find(roles_table, relation, role_name)\n resources = rel...
ruby
chosen
[ { "from": "system", "value": "Add to_file task to export namespace\n\nThis implements the build function on the new TaxonTreeExport\nclass to build the taxon tree array and convert it\nto JSON. Then saves the JSON to a file in the temp directory\n\nThe json task now also implements the TaxonTreeExport build...
ruby
chosen
[ { "from": "system", "value": "Fix typo in last commit.\n" }, { "from": "human", "value": "class Liquid::NewspaperDrop < Liquid::BaseDrop\n \n def initialize(account, options = {})\n @account = account\n end\n\n def url\n @account.url\n end\n\n def sections\n @sections ||= @account...
ruby
chosen
[ { "from": "system", "value": "Handle HTTP errors in workaround.\n" }, { "from": "human", "value": "module Audit\n class TeamBnet < Team\n\n def refresh\n # Forked library, processing the result of each Character\n # is called from within the RBattlenet library\n RBattlenet.set...
ruby
chosen
[ { "from": "human", "value": "Add test for new `rabbitmq-server-version` template\n\n[#155509097]\n\nSigned-off-by: Michal Kuratczyk <304440fa11254af9197fe70f6c35e6528f26afc4@pivotal.io>\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'bosh/template/renderer'\n\nRSpec.describe 'Se...
ruby
chosen
[ { "from": "system", "value": "Remove Redcarpet from dev dependencies\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 |gem|\n gem.name = \"rubyg...
ruby
chosen
[ { "from": "system", "value": "Update rspec dev dependency from 2.14 -> 3.3\n" }, { "from": "human", "value": "$LOAD_PATH << File.expand_path('../lib', __FILE__)\nrequire 'diffux_core/version'\n\nGem::Specification.new do |s|\n s.name = 'diffux-core'\n s.version = DiffuxCore::VER...
ruby
chosen
[ { "from": "system", "value": "Add examples of using the Rack::Builder shortcuts" }, { "from": "human", "value": "module Rack #:nodoc:\n class Builder\n def expose_resource options\n @ins << lambda do |app|\n Rack::JSON::Resource.new app, options\n end\n end\n\n def pub...
ruby
chosen
[ { "from": "system", "value": "Add sensible CPU/Mem restart thresholds\n" }, { "from": "human", "value": "God.watch do |w|\n w.name = \"farmbot_rpi_controller\"\n w.dir = File.expand_path(File.dirname(__FILE__))\n w.start = \"ruby farmbot.rb\"\n w.keepalive\nend\n" }, { "from": "gpt",...
ruby
chosen
[ { "from": "system", "value": "Update podspec to version 0.0.15\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"DFImageManager\"\n s.version = \"0.0.14\"\n s.summary = \"Complete solution for fetching, preheating, caching and adjusting images\"\n s.h...
ruby
chosen
[ { "from": "system", "value": "Make binding.eval Ruby 3.0 compatible.\n\nRuby 3.0 changes behavior of `binding.eval` [[1]] resulting in test\nfailure:\n\n~~~\nWebConsole::EvaluatorTest#test_Evaluator_callers_are_cleaned_up_of_unneeded_backtraces [/home/travis/build/rails/web-console/test/web_console/evaluato...
ruby
chosen