conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "[DEPLOY] Install treetop at compile time"
},
{
"from": "human",
"value": "chef_gem 'treetop' do\n action :install\nend\n"
},
{
"from": "gpt",
"value": "g = chef_gem 'treetop' do\n action :nothing\nend\n\ng.run_action :install\n\nGem.clear_paths\n"
}
... | ruby | chosen |
[
{
"from": "system",
"value": "Remove lib prefix because it's in the LOAD_PATH\n"
},
{
"from": "human",
"value": "require 'bundler'\nBundler.setup\n\n$LOAD_PATH.concat([\n File.expand_path('../lib', __FILE__),\n File.expand_path('../vendor/rdmx', __FILE__)\n])\n\n\nrequire 'helios'\nrequire 'li... | ruby | chosen |
[
{
"from": "system",
"value": "Make Base.action_profiler a no-op with log message if ruby-prof isn't available.\n"
},
{
"from": "human",
"value": "begin\n require 'action_profiler'\n ActionController::Base.send :include, ActionController::ActionProfiler\n ActionController::Base.logger.info \"A... | ruby | chosen |
[
{
"from": "system",
"value": "Add .rb extension to generated migration file"
},
{
"from": "human",
"value": "require 'rails/generators'\nrequire 'rails/generators/migration'\n\nmodule Markable\n class MigrationGenerator < Rails::Generators::Base\n include Rails::Generators::Migration\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Enhance the test \"some string\" method to support creating 'pending' tests.\n\nIf no block is provided to the test method, a default test will be generated which simply flunks. This makes it easy for you to generate a list of what you intend to do, then flesh it out with actu... | ruby | chosen |
[
{
"from": "system",
"value": "Use sign_in helper instead of stub spree_current_user\n"
},
{
"from": "human",
"value": "RSpec.describe Spree::UsersController, type: :controller do\n\n let(:admin_user) { create(:user) }\n let(:user) { create(:user) }\n let(:role) { create(:role) }\n\n before {... | ruby | chosen |
[
{
"from": "system",
"value": "Update spec to avoid name collisions\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nRSpec.shared_examples_for \"auditable\" do\n let(:model) { described_class }\n let(:model_name) { model.name.underscore.to_sym }\n\n describe \"before validat... | ruby | chosen |
[
{
"from": "system",
"value": "Fix default options when listing events\n\nThe generated documentation added an `options` argument without a\ndefault so existing uses broke.\n"
},
{
"from": "human",
"value": "module Fog\n module Compute\n class Brightbox\n class Real\n # Lists even... | ruby | chosen |
[
{
"from": "system",
"value": "Use Rails-provided module for migration numbering\n"
},
{
"from": "human",
"value": "require 'rails/generators'\nrequire 'rails/generators/migration'\n\n# This generator adds a migration for the {FriendlyId::History\n# FriendlyId::History} addon.\nclass FriendlyIdGe... | ruby | chosen |
[
{
"from": "system",
"value": " Remove legacy Float \"exponential?\" and \"integral_part_is_nil?\" helper methods\n\nmethods not used anymore, so little cleanup we make.\n"
},
{
"from": "human",
"value": "module NumbersAndWords\n module Wrappers\n class Float\n attr_accessor :number\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor a bit placeholder for mapping input (text only)\n"
},
{
"from": "human",
"value": "module SimpleForm\n module Inputs\n # Uses MapType to handle basic input types.\n class MappingInput < Base\n extend MapType\n\n map_type :password, :to => :... | ruby | chosen |
[
{
"from": "system",
"value": "Fix `undefined local variable` errors in the update org slugs rake task\n\n- On second-line while running each of the rake tasks within each of\n the apps as per the guide to change an organisation slug, we came\n across this one that didn't work. Fix it by referencing\n `ar... | ruby | chosen |
[
{
"from": "system",
"value": "Add comment spec for ModuleInitialize.\n"
},
{
"from": "human",
"value": "require_relative '../../spec_helper'\nrequire_lib 'reek/smell_detectors/module_initialize'\n\nRSpec.describe Reek::SmellDetectors::ModuleInitialize do\n it 'reports the right values' do\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) keypad horror\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/5572392fee5b0180480001ae/train/ruby\n# --- iteration 1 ---\nKEYPAD_MAPPINGS = { \"1\" => \"7\", \"2\" => \"8\", \"3\" => \"9\", \"7\" => \"1\", \"8\" => \"2\", \"9\" => \"... | ruby | chosen |
[
{
"from": "system",
"value": "Add real url to pictures.\n"
},
{
"from": "human",
"value": "class PlacesController < ApplicationController\n before_action :authenticate_user!\n\n RANGE = 50 # Anything farther than 50km probably does not make any sense\n\n def find\n render json: format_plac... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor SelectTypeListPresenter spec so it isn't affected by works being generated\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Sufia::SelectTypeListPresenter do\n let(:instance) { described_class.new(user) }\n let(:user) { create(:user) }... | ruby | chosen |
[
{
"from": "system",
"value": "Disable SQL logging when setting user API token\n"
},
{
"from": "human",
"value": "require 'open-uri'\n\nclass AuthenticationController < ApplicationController\n before_action :authenticate_user! \n def status\n puts AppConfig\n\n @config = AppConfig[\"stack... | ruby | chosen |
[
{
"from": "system",
"value": "Read the form from the right object\n"
},
{
"from": "human",
"value": "class RemindDraftEventProposals < CivilService::Service\n private\n\n def inner_call\n drafts_to_remind.each do |proposal|\n EventProposalsMailer.unfinished_draft_reminder(proposal).del... | ruby | chosen |
[
{
"from": "system",
"value": "Remove step from Location stories test so it passes\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\n# Tests scenarios related to interacting with Locations\nclass LocationStoriesTest < ActionDispatch::IntegrationTest\n\n setup do\n @user = log_in_as_... | ruby | chosen |
[
{
"from": "human",
"value": "Add a missing worldwide organisation edition association\n\nCorporate information pages are supposed to have an associated\norganisation or worldwide organisation. This edition somehow doesn't\nhave one, so anything which tries to use the edition is throwing an\nerror. For exa... | ruby | chosen |
[
{
"from": "human",
"value": "Fix superseded documents failing sync checks\n\nSome DocumentCollections contain Documents that are in a peculiar state\nwhere the Document is superseded but there are no further editions for\nthe Document. A data migration fixes these by correctly unpublishing\nthese Documents.... | ruby | chosen |
[
{
"from": "system",
"value": "Rewrite migration that broke in Travis CI\n"
},
{
"from": "human",
"value": "Sequel.migration do\n change do\n tables = %i(ca_key_infos entity_attributes publication_infos\n registration_infos)\n\n tables.each do |table|\n rename_column ta... | ruby | chosen |
[
{
"from": "system",
"value": "Use login bash in execute resource to install gems\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: system_info\n# Recipe:: default\n#\n# Copyright 2014, Travis CI GmbH\n#\n# MIT License\n#\n\ngit '/usr/local/system_info' do\n repository 'https://github.com/... | ruby | chosen |
[
{
"from": "system",
"value": "Add saver-call count assertion to tipper test\n"
},
{
"from": "human",
"value": "require_relative 'app_controller_test_base'\n\nclass TipperControllerTest < AppControllerTestBase\n\n def self.hex_prefix\n '25E'\n end\n\n # - - - - - - - - - - - - - - - - - -\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use file path, not dir path\n\nCopy/paste failure"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass DumpsController < ApplicationController\n before_action :set_dump, only: %i[show edit update destroy]\n\n # GET /dumps\n # GET /dumps.json\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change boss battle route name to /temple\n"
},
{
"from": "human",
"value": "class GamesController < ApplicationController\n include GamesHelper\n\n def index\n end\n\n def level_select\n @levels = get_levels\n end\n\n def boss_battle\n @assets = get_leve... | ruby | chosen |
[
{
"from": "system",
"value": "Add toggle_admin method to UserController\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n before_action :authenticate_admin!\n\n expose(:users_repo) { UsersRepository.new }\n expose(:users) do\n UserDecorator.decorate_collect... | ruby | chosen |
[
{
"from": "system",
"value": "Fix broken specs; make master green\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n# EBWiki Users controller\nclass UsersController < ApplicationController\n def show\n @user = User.find(params[:id])\n end\n\n def edit\n @user = User.fi... | ruby | chosen |
[
{
"from": "human",
"value": "Add base mailer for other mailers to inherit from\n"
},
{
"from": "gpt",
"value": "require 'mandrill'\n\nclass BaseMandrillMailer < ActionMailer::Base\n default(\n from: \"hello@example.com\",\n reply_to: \"hello@example.com\"\n )\n\n private\n\n def send_m... | ruby | chosen |
[
{
"from": "system",
"value": "Add credit method to Check payment method\n\nWhen using the `Check` payment method, you can not create a reimbursement\nas the `ReimbursementPerfomer` always creates a `Spree::Refund`, which calls\nthe `#credit` method on the payment method originally used.\n\nThis fix adds a `... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Use existing Gem name.\"because it forces the user to pass a different :require option.\n\nThis reverts commit c1f18f4541554367fe5910fc1bc8caecd7d09682.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FIL... | ruby | chosen |
[
{
"from": "system",
"value": "Use Mongoid::Timestamps to define timestamp fields\n"
},
{
"from": "human",
"value": "module Score\n extend ActiveSupport::Concern\n\n included do\n belongs_to :user, foreign_key: :uid\n\n field :s, as: :score, type: Integer\n field :cat, as: :created_at,... | ruby | chosen |
[
{
"from": "system",
"value": "Load templates from user cms instead of cms base\n"
},
{
"from": "human",
"value": "module Grantox\n class Layout\n def self.installed\n Dir[\"#{Grantox::Engine.root}/app/views/layouts/grantox/templates/**/*.html.erb\"].map { |m| File.basename(m, \".*\") }\... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor gce_firewall integration spec to be more robust\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'helpers/integration_spec_helper'\n\ndescribe \"gce_firewallrule\" do\n it_behaves_like \"a resource that can be created and destroyed\" do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix time zones for dtstart (again)\n"
},
{
"from": "human",
"value": "class CalendarInvite\n include PrettyUrlHelper\n include FormattedDateHelper\n\n def initialize(outcome = Outcome.new)\n @calendar = build_calendar(outcome)\n end\n\n def to_ical\n @cal... | ruby | chosen |
[
{
"from": "system",
"value": "Add | Exposing rabbit consumers through the API\n"
},
{
"from": "human",
"value": "class RabbitConsumer\n include Mongoid::Document\n include Mongoid::Timestamps\n\n field :channel, type: String\n field :tag, type: String\n field :task_id\n field :alive, type:... | ruby | chosen |
[
{
"from": "human",
"value": "Support Samlink renew cert in soap\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\nclass SamlinkRenewCertRequestSoapBuilderTest < ActiveSupport::TestCase\n setup do\n @params = samlink_renew_certificate_params\n\n # Convert the keys here since the co... | ruby | chosen |
[
{
"from": "human",
"value": "Add Kernel recipe with microcode installation stanza\n"
},
{
"from": "gpt",
"value": "#\n# Cookbook Name:: sys\n# Recipe:: kernel\n#\n# Copyright 2017, GSI HPC department\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this ... | ruby | chosen |
[
{
"from": "system",
"value": "Add OpenCycleMap as the default layer\n"
},
{
"from": "human",
"value": "module ApplicationHelper\n def cancel_link(url = {action: :index})\n content_tag(\"li\", class: \"cancel\") do\n link_to t(\"cancel\"), url\n end\n end\n\n def basic_map(&block)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove random ordering when selecting users to poll."
},
{
"from": "human",
"value": "class BatchUserPoller < Service\n def perform\n domains = domains_to_poll\n logger.info \"About to poll the following domains: #{domains.to_sentence}\"\n\n domains.each d... | ruby | chosen |
[
{
"from": "system",
"value": "Set to port 80 to match previous commit\n\n"
},
{
"from": "human",
"value": "$domain = 'localhost:8080'# or base URL\n$savefolder = 'p'# Where the files are to be saved\n$banned_ext = %w(.exe .msi .scr .cpl) # Banned extensions/files\n$code = '' # Code that all user... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec to include new asset locations\n"
},
{
"from": "human",
"value": "\nPod::Spec.new do |s|\n\n s.name = \"UICircularProgressRing\"\n s.version = \"1.4.0\"\n s.summary = \"A highly customizable circular progress bar for iOS written i... | ruby | chosen |
[
{
"from": "system",
"value": "Add current_status association to Registration\n"
},
{
"from": "human",
"value": "require_dependency \"renalware/transplants\"\nrequire \"document/base\"\n\nmodule Renalware\n module Transplants\n class Registration < ActiveRecord::Base\n include Document::... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecations for nested cucumber steps.\n"
},
{
"from": "human",
"value": "Then /^the output should say the file \"([^\"]*)\" was created$/ do |file|\n Then \"the output should match /create(.+)#{file}/\"\nend\n\nThen /^the file \"([^\"]*)\" should contain a co... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to exclude test assets from compiled gem\n\nWe noticed that the .gem file unnecessarily includes the test directory, including a 3 megabyte test.log file after installation. I've updated the gemspec line with the latest convention from `bundle gem`'s generator, a... | ruby | chosen |
[
{
"from": "system",
"value": "Fix hidden proposals restore feature\n\nAdd recursive restore option to restore all soft deleted relations.\n"
},
{
"from": "human",
"value": "class Admin::HiddenProposalsController < Admin::BaseController\n include FeatureFlags\n\n has_filters %w[without_confirme... | ruby | chosen |
[
{
"from": "human",
"value": "Add IosRatingsBuilder (not finished yet)\n"
},
{
"from": "gpt",
"value": "require 'rest-client'\nrequire_relative '../util/string'\nrequire_relative '../ratings'\n\nmodule AppReputation\n class IosRatingsBuilder\n @@base_url = 'https://itunes.apple.com/$[country]... | ruby | chosen |
[
{
"from": "system",
"value": "Fix product price nil error\n"
},
{
"from": "human",
"value": "xml.instruct! :xml, :version=>\"1.0\", :encoding=>\"UTF-8\"\n\nxml.rss \"version\" => \"2.0\", \"xmlns:g\" => \"http://base.google.com/ns/1.0\" do\n xml.channel do\n xml.title Spree::GoogleMerchant::... | ruby | chosen |
[
{
"from": "human",
"value": "Test the app.rb implementation of advanced_search\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\nrequire \"integration_test_helper\"\n\nclass SecondarySearchTest < IntegrationTest\n\n def setup\n super\n stub_backend\n end\n\n def test_returns_json_for_... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs for Java compile/running.\n"
},
{
"from": "human",
"value": "require \"spec_helper_#{ENV['SPEC_TARGET_BACKEND']}\"\n\ndescribe package('python-dev'), :if => ['debian', 'alpine'].include?(os[:family]) do\n it { should be_installed }\nend\n\ndescribe packag... | ruby | chosen |
[
{
"from": "system",
"value": "Raise an error if an unexpected doc type is returned\n\nThis had been missed for a document type I'm adding and was leading to it\nappearing that there were no results. The same thing is done in\nlib/finder_frontend.rb#presenter_class\n"
},
{
"from": "human",
"value... | ruby | chosen |
[
{
"from": "system",
"value": "Use updated pedant with chef-client tests as client\n"
},
{
"from": "human",
"value": "name \"opscode-pedant\"\nversion \"rel-0.7.0\"\n\ndependencies [\"ruby\",\n \"bundler\",\n \"rsync\"]\n\nsource :git => \"git@github.com:opscode/opscode-... | ruby | chosen |
[
{
"from": "system",
"value": "Change find_for_oauth method name to find_or_create_from_oauth\n"
},
{
"from": "human",
"value": "class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController\n\tdef facebook\n @user = User.find_for_oauth(request.env[\"omniauth.auth\"], current_... | ruby | chosen |
[
{
"from": "system",
"value": "Send workflow emails to production"
},
{
"from": "human",
"value": " EMAIL_GROUPS = {\n :dev => ['quirkafleeg@theodi.org'],\n :business => ['quirkafleeg@theodi.org'],\n :citizen => ['quirkafleeg@theodi.org']\n }\n"
},
{
"from": "gpt",
"value":... | ruby | chosen |
[
{
"from": "system",
"value": "Add Sidekiq::JobRetry::Skip to list of excluded exceptions\n\nBy adding sentry-sidekiq in 596aba9c8d we were able to get Sidekiq\nerrors sent to Sentry. However we got these in addition to the\nSidekiq::JobRetry::Skip ones, this occurs because they aren't an\nexcluded exception... | ruby | chosen |
[
{
"from": "system",
"value": "Move session secret to env var\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will become invalid!\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove secret token from git\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key is used for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will become inva... | ruby | chosen |
[
{
"from": "system",
"value": "Add .pre for next release\n"
},
{
"from": "human",
"value": "module EY\n module Serverside\n class Adapter\n VERSION = \"2.0.5\"\n # For backwards compatibility, the serverside version default will be maintained until 2.1\n # It is recommended tha... | ruby | chosen |
[
{
"from": "system",
"value": "Update save method with user_id argument\n"
},
{
"from": "human",
"value": "require 'fog/openstack/models/model'\n\nmodule Fog\n module Compute\n class OpenStack\n class KeyPair < Fog::OpenStack::Model\n identity :name\n\n attribute :fingerpr... | ruby | chosen |
[
{
"from": "system",
"value": "guests/darwin: Exit on error setting hostname"
},
{
"from": "human",
"value": "module VagrantPlugins\n module GuestDarwin\n module Cap\n class ChangeHostName\n def self.change_host_name(machine, name)\n comm = machine.communicate\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update comorbidity document w/ new RReg fields & order\n"
},
{
"from": "human",
"value": "require \"document/embedded\"\nrequire \"document/enum\"\n\nmodule Renalware\n module Renal\n class ProfileDocument < Document::Embedded\n\n class Comorbidities < Docu... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor out inventory_unit in default populator.\n"
},
{
"from": "human",
"value": "module Spree\n class DefaultLicenseKeyPopulator < LicenseKeyPopulator\n\n def get_available_keys(inventory_unit, quantity, license_key_type=nil)\n return false unless count... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unimplemented properties on LoadBalancer\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the L... | ruby | chosen |
[
{
"from": "system",
"value": "Add validation rule to url field for VideoPlatform model\n"
},
{
"from": "human",
"value": "# == Schema Information\n#\n# Table name: videos\n#\n# id :integer not null, primary key\n# videoable_id :integer\n# videoable_type :string(255)\n# ... | ruby | chosen |
[
{
"from": "system",
"value": "Add new migration for testing\n"
},
{
"from": "human",
"value": "class CreateNotifiableDeviceTokens < ActiveRecord::Migration\n \n def change\n create_table :notifiable_device_tokens do |t|\n t.string :token\n t.string :user_id\n \tt.string :provid... | ruby | chosen |
[
{
"from": "system",
"value": "Hide default translation message when default locale is active\n"
},
{
"from": "human",
"value": "module ActsAsSimpleTranslatable\n module ClassMethods\n def acts_as_simple_translatable_on(*fields)\n # scope :with_translations, -> (locale) { joins(:translat... | ruby | chosen |
[
{
"from": "system",
"value": "Use the query_string method to add the page parameter. This allows enumerating over resources that already have query string params."
},
{
"from": "human",
"value": "##\n# Experimental:\n# If included, allows iterating over collection resources as though they were e... | ruby | chosen |
[
{
"from": "system",
"value": "Add a description to the generator.\n"
},
{
"from": "human",
"value": "require 'rails/generators/base'\nrequire 'rails/generators/migration'\nrequire 'rails/generators/active_record'\n\nclass CarrierwaveActiverecordGenerator < Rails::Generators::Base\n\n include Ra... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Frontend specs for capybara2.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"Template rendering\" do\n context \"with layout option set to 'application' in the configuration\" do\n\n before do\n @app_layout = Rails.root.join('app... | ruby | chosen |
[
{
"from": "system",
"value": "Add display name for physical switch\n"
},
{
"from": "human",
"value": "module ManageIQ::Providers\n class Lenovo::PhysicalInfraManager::PhysicalSwitch < ::PhysicalSwitch\n include_concern 'Operations'\n end\nend\n"
},
{
"from": "gpt",
"value": "mod... | ruby | chosen |
[
{
"from": "system",
"value": "Refresh target can't be a hash\n"
},
{
"from": "human",
"value": "describe ManageIQ::Providers::Lenovo::PhysicalInfraManager::Refresher do\n let(:auth) do\n FactoryGirl.create(:authentication,\n :userid => 'admin',\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make ChatNames::FindUserService stable by not checking a precise time\n\nSigned-off-by: Rémy Coutable <4ea0184b9df19e0786dd00b28e6daa4d26baeb3e@rymai.me>\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe ChatNames::FindUserService, services: true ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow creation of contacts by default.\n(Tests written before this switch was introduced need it to be set to true. This should be fixed so that tests cover the code on both values of the switch).\n"
},
{
"from": "human",
"value": "module JobsworthInitializer\n ext... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic tests for ActionDispatch::ExceptionWrapper\n"
},
{
"from": "gpt",
"value": "require 'abstract_unit'\n\nmodule ActionDispatch\n class ExceptionWrapperTest < ActionDispatch::IntegrationTest\n class TestError < StandardError\n attr_reader :backtrace\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add tests to validates rules for SettingsController\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\n#\n# == Admin namespace\n#\nmodule Admin\n #\n # == SettingsController test\n #\n class SettingsControllerTest < ActionController::TestCase\n inclu... | ruby | chosen |
[
{
"from": "system",
"value": "Remove explicit (and unnecessary) `nil` from Etc.groupname and Etc.username\n"
},
{
"from": "human",
"value": "require 'etc'\n\nEtc.instance_eval do\n def groupname(gid)\n Etc.group { |e| return e.name if gid == e.gid }\n nil\n end\n\n def username(uid)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Tweak GreenButtonAdoption spec to match standard template"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'earth/electricity/green_button_adoption'\n\ndescribe GreenButtonAdoption do\n describe 'Green Button program adoption data', :data_miner => tr... | ruby | chosen |
[
{
"from": "human",
"value": "Test harness to test full generation process\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nrequire 'rubygems'\nrequire 'bundler/setup'\n\nrequire 'test/unit'\nrequire 'date'\nrequire 'fileutils'\n\nrequire_relative '../lib/imageprep/metad... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for background notifications in webhook call method\n"
},
{
"from": "human",
"value": "module ExceptionNotifier\n class WebhookNotifier\n\n def initialize(options)\n @default_options = options\n end\n\n def call(exception, options={})\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration to fix shipped shipments marked as \"ready\""
},
{
"from": "gpt",
"value": "class MarkOrdersWithShippedInventoryAsShipped < ActiveRecord::Migration\n def up\n \tSpree::InventoryUnit.shipped.reject do |inventory_unit|\n inventory_unit.shipment.bla... | ruby | chosen |
[
{
"from": "system",
"value": "Restructure delete_if to ensure calling function isn't returned prematurely\n"
},
{
"from": "human",
"value": "class Hash\n def deep_merge(other_hash)\n dup.deep_merge!(other_hash)\n end\n\n def deep_merge!(other_hash)\n other_hash.each_pair do |k,v|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test by assigning the proper SHA\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nfeature 'Download buttons in tags page', feature: true do\n given(:user) { create(:user) }\n given(:role) { :developer }\n given(:status) { 'success' }\n given(:tag)... | ruby | chosen |
[
{
"from": "system",
"value": "Move to not using the options key\n"
},
{
"from": "human",
"value": "require 'active_support/core_ext/class/attribute'\n\nmodule ElasticRecord\n class Config\n class_attribute :servers\n\n class_attribute :connection_options\n self.connection_options = {}\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a variable name in the Inotify backend.\n"
},
{
"from": "human",
"value": "module FSSM::Backends\n class Inotify\n def initialize\n @notifier = INotify::Notifier.new\n end\n\n def add_handler(path, preload=true)\n @notifier.watch(handler.path... | ruby | chosen |
[
{
"from": "system",
"value": "Add route to Test base\n"
},
{
"from": "human",
"value": "require 'geocoder/results/base'\n\nmodule Geocoder\n module Result\n class Test < Base\n\n %w[latitude longitude city state state_code province\n province_code postal_code country country_code a... | ruby | chosen |
[
{
"from": "system",
"value": "Remove ... from trimming string names\n"
},
{
"from": "human",
"value": "module Optical\n module StringExensions\n refine String do\n def mid_truncate(len)\n return self.clone if size <= len\n return self[0...len] unless len > 4\n mid =... | ruby | chosen |
[
{
"from": "human",
"value": "Update political status of EFA and NCTL\n\nEducation Funding Agency and National College for Teaching are both\npolitical orgs. This commit adds a data migration to update the\npolitical status and rerun the PoliticalContentIdentifier.\n"
},
{
"from": "gpt",
"value":... | ruby | chosen |
[
{
"from": "system",
"value": "Fix silly string interpolation error\n"
},
{
"from": "human",
"value": "require_dependency \"qonsole_rails/application_controller\"\n\nmodule QonsoleRails\n class QonsoleController < ApplicationController\n layout \"application\"\n\n def index\n @qconfig... | ruby | chosen |
[
{
"from": "system",
"value": "Check if the topic is an existing channel\n"
},
{
"from": "human",
"value": "module Channels\n class AutoCompletedChannel < Mustache::Railstache\n def title\n h self[:topic].title\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "module Chan... | ruby | chosen |
[
{
"from": "system",
"value": "Fix post-action redirects in Manage::WorkExperiences\n\nSigned-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>\n"
},
{
"from": "human",
"value": "module Manage\n class WorkExperiencesController < ManageController\n before_action :set_... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor to use yield instead of call(block) in with_format method.\n"
},
{
"from": "human",
"value": "module Flms\n class ApplicationController < ActionController::Base\n\n # When we want to render a partial as HTML, but specify the plain_html custom\n # for... | ruby | chosen |
[
{
"from": "system",
"value": "Convert \" to ' in steps\n\nprefer single quotes if interpolation not needed.\n"
},
{
"from": "human",
"value": "Given(\"the downtime feature flag is enabled\") do\n allow(Settings).to receive(:downtime_warning_enabled?).and_return true\nend\n\nGiven(\"the downtime... | ruby | chosen |
[
{
"from": "system",
"value": "Use initials if logo is not present\n"
},
{
"from": "human",
"value": "class Pending::IdentitySerializer < Pending::BaseSerializer\n def identity_type\n object.identity_type\n end\n\n def avatar_kind\n 'uploaded'\n end\n\n def avatar_url\n object.logo\... | ruby | chosen |
[
{
"from": "system",
"value": "Change dependencies for active record\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'surety'\n s.version = '0.1.0'\n s.date = Time.now.strftime('%Y-%m-%d')\n s.summary = 'A lightweight g... | ruby | chosen |
[
{
"from": "system",
"value": "Use deliver instead of deliver_now\n"
},
{
"from": "human",
"value": "class CotnEmailController < ApplicationController\n before_action :set_admins, :set_users\n\n def new\n @message = Message.new\n @message.subject = \"Call for Vols for MN-POP at Con of the... | ruby | chosen |
[
{
"from": "system",
"value": "Add name attribute to Conversion API\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Api\n ##\n # A conversion job\n #\n class ConversionResource < ApiResource\n immutable\n\n ##\n # Properties\n #\n attributes :status, ... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Switch to using just aggregate for a validated meter collection\"\n\nThis reverts commit 994317a9e788b2a59786936ca9d2fd8e736a67d9.\n"
},
{
"from": "human",
"value": "require 'dashboard'\n\nclass AggregateSchoolService\n def initialize(school)\n @school ... | ruby | chosen |
[
{
"from": "human",
"value": "Migrate old messages to new query syntax\n"
},
{
"from": "gpt",
"value": "class ConvertMessageRecipientsToRecipientQueries < ActiveRecord::Migration[5.1]\n CONVERSION_MAPPING = {\n \"bus-list-cornell-bing\" => [\"bus-list\", 1],\n \"bus-list-buffalo... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration: Create artist_identities table\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nclass CreateArtistIdentities < ActiveRecord::Migration[5.1]\n def change\n create_table :artist_identities, id: :uuid, default: \"uuid_generate_v4()\" ... | ruby | chosen |
[
{
"from": "system",
"value": "Make elasticsearch spec a bit more flexible\n\ngiven the special definition of pretty json\n"
},
{
"from": "human",
"value": "describe 'elasticsearch installation', sudo: true do\n before :all do\n sh('sudo service elasticsearch start')\n sleep 5\n sh('cur... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.