conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove module from method call\n" }, { "from": "human", "value": "require 'matrix'\n\nmodule ToyRobot\n # Direction\n module Direction\n TURN = (2 * Math::PI).freeze\n ROUND = 12\n\n def self.included(base)\n base.extend ClassMethods\n base.dire...
ruby
chosen
[ { "from": "system", "value": "Add t() to translate bug check\n\nwhich will bump the confidence to High if t() or translate() are used\nin the application.\n" }, { "from": "human", "value": "require 'checks/base_check'\nrequire 'processors/lib/find_call'\n\n#Check for vulnerability in translate()...
ruby
chosen
[ { "from": "system", "value": "Fix bug where server responds with just Message.\n" }, { "from": "human", "value": "require_relative 'helpers/iterator'\nrequire_relative 'errors'\n\nmodule Uncomtrade\n\n class Response\n\n def initialize(response)\n @response = JSON.parse(response.body)\n...
ruby
chosen
[ { "from": "system", "value": "Sort the input by scope groups\n\nThis change makes sure that more local variables and methods come before\nconstants and global variables. It also eliminates naturally eliminates\nduplicate results as we don't try to extract overlapping methods.\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Allow minor versions of Spree\n\nSee @van5150 fork." }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = \"spree-refinerycms-authentication\"\n s.version = \"3.0.0\"\n s.authors = [\"Philip Ar...
ruby
chosen
[ { "from": "system", "value": "Fix Require so Travis will pass\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'guard/shopifytheme'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Remove deprecated has_rdoc from gemspec" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'jammit'\n s.version = '0.6.0' # Keep version in sync with jammit.rb\n s.date = '2010-11-08'\n\n s.homepage = \"http://docume...
ruby
chosen
[ { "from": "system", "value": "Rename scores to records in player_scores json for API.\n" }, { "from": "human", "value": "class Api::ScoresApiController < Api::ApiController\n resource_description do\n resource_id 'records'\n end\n\n def_param_group :mode do\n param :weapons, %w(true fal...
ruby
chosen
[ { "from": "system", "value": "Add test for newsletter user model method\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass NewsletterUserTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "require ...
ruby
chosen
[ { "from": "system", "value": "Add migration for divesite location join table\n" }, { "from": "human", "value": "class CreateDivesitesLocations < ActiveRecord::Migration\n def change\n create_table :divesites_locations do |t|\n end\n end\nend\n" }, { "from": "gpt", "value": "c...
ruby
chosen
[ { "from": "system", "value": "Change to fix logo output.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nRSpec.describe 'rtty' do\n it \"prints available commands and global options\" do\n output = <<-OUT\n\\e[31m ┏━━━┓\n ┏━┳╋┳┳━┻━━┓\n ┣━┫┗┫┗┳┳┳━┫\n ┃ β”ƒβ”β”«β”β”«β”ƒβ”ƒβ˜…β”ƒ\n ┃ ┗━┻━╋┓┃ ┃\...
ruby
chosen
[ { "from": "system", "value": "Add additional tests for the Skill method\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Skill do\n it \"is valid with a title\" do\n skill = Skill.new(title: \"juggling\")\n expect(skill.valid?).to be true\n end\n\n it \"is invalid w...
ruby
chosen
[ { "from": "system", "value": "Fix invalid argument in reload command message\n" }, { "from": "human", "value": "module Invoker\n module IPC\n class ReloadCommand < BaseCommand\n def run_command\n Invoker::COMMANDER.on_next_tick(message_object) do |reload_message|\n reloa...
ruby
chosen
[ { "from": "system", "value": "Fix this to use the puppetpath correctly.\n" }, { "from": "human", "value": "require 'beaker-rspec'\n\nUNSUPPORTED_PLATFORMS = [ 'windows', 'Solaris' ]\n\nunless ENV['RS_PROVISION'] == 'no'\n hosts.each do |host|\n # Install Puppet\n if host.is_pe?\n ins...
ruby
chosen
[ { "from": "system", "value": "Check for parameters method so we don't blow up on Ruby 1.8.7\n" }, { "from": "human", "value": "# :stopdoc:\n#Copyright (c) 2002-2012 Rally Software Development Corp. All Rights Reserved.\n#Your use of this Software is governed by the terms and conditions\n#of the ...
ruby
chosen
[ { "from": "system", "value": "Make Spree::Admin::VariantsController spec less dumb\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::Admin::VariantsController do\n let(:user) { mock_model Spree::User }\n before do\n controller.stub :current_user => user\n user.s...
ruby
chosen
[ { "from": "human", "value": "Add test cases of IRuby.table\n" }, { "from": "gpt", "value": "module IRubyTest\n class UtilsTest < TestBase\n sub_test_case(\"IRuby.table\") do\n def setup\n @data = {\n X: [ 1, 2, 3 ],\n Y: [ 4, 5, 6 ]\n }\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Add missing dependencies to gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)\nrequire 'smart_field_constraints/version'\n\nGem::Specification.new do |s|\n s.name = \"smart_field_constraints\"\n s.versi...
ruby
chosen
[ { "from": "system", "value": "Create a simple project with default values in the acceptance test\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'rundeck class' do\n context 'default parameters' do\n it 'applies successfully' do\n pp = <<-EOS\n class...
ruby
chosen
[ { "from": "system", "value": "Fix Rails 6 deprecation warning\n\n```\nDEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller. (called from new at /path/to/arbre/spec/rails/rails_spec_helper.rb:37)\n```\n" }, { "from": "human", "...
ruby
chosen
[ { "from": "system", "value": "Update routes call for tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"Campaigns API\", type: :request do\n let!(:campaign) { create(:campaign) }\n # let!(:ad_group) { create(:ad_group) }\n let(:campaign_id) { campaign.id }\n\n...
ruby
chosen
[ { "from": "system", "value": "Build size by number of keys\n" }, { "from": "human", "value": "class HashMap\n\n attr_reader :weight\n attr_reader :size\n\n def initialize\n @data = Array.new(10)\n @size = 0\n @weight = 0.8\n end\n\n def empty?\n @size =...
ruby
chosen
[ { "from": "system", "value": "Add update_attributes admin action to edit role action\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoAdmin\n module GobiertoPlans\n class ProjectPolicy < ::GobiertoAdmin::BasePolicy\n attr_reader :project\n\n ALLOWE...
ruby
chosen
[ { "from": "system", "value": "Check for .js in stead of js\n" }, { "from": "human", "value": "require 'pathname'\n\n# This will fail when initializing assets, but we don't need\n# generators for asset initialization anyway. Let it fail\n# silently\n#\nbegin; require \"generators/install_generato...
ruby
chosen
[ { "from": "system", "value": "Move monkey patch from outside Season\n" }, { "from": "human", "value": "module Season\n module Scopes\n def self.included(base)\n base.class_eval do\n def self.created_before( date )\n scoped( :conditions => [ \"#{table_name}.created_at < ?...
ruby
chosen
[ { "from": "system", "value": "Add heroku_san gem to template\n" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule DynamoKickstarter\n class AppGenerator < Rails::Generators::NamedBase\n source_root File.expand_path('../templates', __FILE__)\n\n def readme\n remove_...
ruby
chosen
[ { "from": "system", "value": "Add index method to create geojson to use in ajax call when displaying all programs\n" }, { "from": "human", "value": "class ProgramsController < ApplicationController\n\tdef search\n @results = Program.program_search(params[\"search\"])\n\tend\n\n\tdef map_resul...
ruby
chosen
[ { "from": "system", "value": "Improve API for using CFG programmatically.\n" }, { "from": "human", "value": "require \"require_all\"\n\nrequire_relative \"tree/ast\"\nrequire_rel \"analysis/*\"\nrequire_rel \"control/*\"\n\nmodule RDG\n class CFG\n def self.from_path(path)\n new(Tree::A...
ruby
chosen
[ { "from": "human", "value": "Update dataset_version_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeDatasetVersionIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :dataset_versions, :id, :bigint\n\n change_column :datasets, :dataset_ver...
ruby
chosen
[ { "from": "system", "value": "Set amsterdam as the timezone\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Add some navigation integration tests\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nfeature \"Navigation\" do\n before :each do\n @user = FactoryGirl.build(:user)\n @user.save!\n visit '/users/sign_in'\n fill_in 'user_email', :with => @u...
ruby
chosen
[ { "from": "system", "value": "Add Kevin and Jack to email ccs\n" }, { "from": "human", "value": "class SignupMailer < ActionMailer::Base\n default from: \"brigade-info@codeforamerica.org\"\n\n def greeting(user)\n puts \"HITTING THE MAILER\"\n @user = user\n mail(to: user.email, subje...
ruby
chosen
[ { "from": "system", "value": "Add attr_accessors to Authentication model.\n" }, { "from": "human", "value": "class Authentication < ActiveRecord::Base\n belongs_to :user\n\n def update_omniauth(omniauth)\n self.update_attributes(:provider => omniauth['provider'], \n ...
ruby
chosen
[ { "from": "system", "value": "Handle blank email_frequency fields correctly \n" }, { "from": "human", "value": "class Notification\n LESS_THAN_A_DAY = 23.hours\n LESS_THAN_A_WEEK = 6.days + LESS_THAN_A_DAY\n\n LAST_SEEN = { daily: LESS_THAN_A_DAY,\n weekly: LESS_THAN_A_WEEK }\n...
ruby
chosen
[ { "from": "system", "value": "Fix comment controller create action.\n\nCreate a comment with the appropriate parameters. Manually set the idea\nand author id's. Redirect back to the idea's 'show' view whether or not\nsaving the idea succeeded with an appropriate message.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "human", "value": "Add custom test script for DNA interactive\n\n[#69191506]\n" }, { "from": "gpt", "value": "# Initial cells view.\n$test.save_screenshot\n\n# Issues on iPad, can't click button correctly.\nunless $test.browser == :iPad\n next_step = $test.driver.find_element(:css, '#...
ruby
chosen
[ { "from": "system", "value": "Make PP Express response more robust.\n" }, { "from": "human", "value": "module ActiveMerchant #:nodoc:\n module Billing #:nodoc:\n class PaypalExpressResponse < Response\n def email\n @params['PayerInfo']['Payer']\n end\n \n def name\...
ruby
chosen
[ { "from": "system", "value": "Add validations to the conductor.\n\nThis enables the conductor to have non persistent attributes,\ne.g. an accepting the TOS checkbox when registering an account.\n" }, { "from": "human", "value": "require \"active_model\"\nrequire \"forwardable\"\n\nclass ActiveCo...
ruby
chosen
[ { "from": "system", "value": "Use splat operator instead of array-wrapping\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'json'\n\nmodule Burlesque\n class Client\n attr_reader :http\n\n PUB_ENDPOINT = '/publish'\n SUB_ENDPOINT = '/subscribe'\n STATUS_ENDPOINT = '/s...
ruby
chosen
[ { "from": "system", "value": "Allow exceptions to be marked unimportant\n" }, { "from": "human", "value": "module Discordrb\n # Logs debug messages\n class Logger\n attr_writer :debug\n\n def debug(message, important = false)\n puts \"[DEBUG : #{Thread.current[:discordrb_name]} @ #{...
ruby
chosen
[ { "from": "system", "value": "Set shipping address from order in ShipmentSerializer\n" }, { "from": "human", "value": "require 'active_model/serializer'\n\nmodule Spree\n module Hub\n class ShipmentSerializer < ActiveModel::Serializer\n attributes :id, :order_id, :email, :cost, :status,...
ruby
chosen
[ { "from": "system", "value": "Add started_at and finished_at to Backupset, and use for statistics.\n" }, { "from": "human", "value": "module Frakup\n class Backupset\n include DataMapper::Resource\n \n property :id,\n Serial\n property :created_at,\n DateTime\n property...
ruby
chosen
[ { "from": "system", "value": "Add test to fixnumns bug\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'money'\n\nmodule HasMoneyFields\n module ClassMethods\n def has_money_fields *args\n options = args.extract_options!\n options.symbolize_keys!\n options....
ruby
chosen
[ { "from": "system", "value": "Fix the integration test too." }, { "from": "human", "value": "#\n# Copyright 2015, Noah Kantrowitz\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy o...
ruby
chosen
[ { "from": "system", "value": "Bring AssetManagerDeleteAssetWorker into line with the update worker\n\nBy calling GdsApi::Response#to_hash on the response from the Asset\nManager API and renaming the local variable from gds_api_response ->\nattributes.\n\nI think it's important to keep these two worker class...
ruby
chosen
[ { "from": "system", "value": "Add Pentonville to the dashboard trial\n\nTo be merged Monday 18th July.\n" }, { "from": "human", "value": "Rails.configuration.dashboard_trial = %w[ Belmarsh Cardiff Coldingley ]\n" }, { "from": "gpt", "value": "Rails.configuration.dashboard_trial = %w[...
ruby
chosen
[ { "from": "system", "value": "Use app name when backing up\n\nThis is necessary when you have multiple remotes in your repo and they\naren't named \"heroku\".\n" }, { "from": "human", "value": "module Heroku::Deploy::Task\n class DatabaseBackup < Base\n include Heroku::Deploy::Shell\n\n d...
ruby
chosen
[ { "from": "system", "value": "Add tests for proper tableoid selection in queries\n" }, { "from": "human", "value": "require 'spec_helper'\n\nrequire 'pry'\n\ndescribe ActiveRecord::MTI::Calculations do\n\n context \"don't project tableoid on\" do\n it \"grouping\" do\n\n Admin.create(em...
ruby
chosen
[ { "from": "system", "value": "Comment out the feature test as it wasn't completed\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature \"Build an addition\" do\n scenario \"User wants to build an addition\" do\n visit \"/permits/new\"\n\n check \"permit[addition]\"\n cli...
ruby
chosen
[ { "from": "system", "value": "Update acceptance test to use Application builder\n" }, { "from": "human", "value": "require_relative '../../lib/robotic_sheep_dog/application'\nrequire 'stringio'\n\nRSpec.describe RoboticSheepDog::Application do\n\n let(:app) { lambda { |f| RoboticSheepDog::Appli...
ruby
chosen
[ { "from": "system", "value": "Remove the template_root from the Ember template name" }, { "from": "human", "value": "require 'sprockets'\nrequire 'sprockets/engines'\nrequire 'barber-emblem'\nrequire 'barber'\n\n\nmodule Middleman\n module Emblem\n class Template < Tilt::Template\n def ...
ruby
chosen
[ { "from": "system", "value": "Raise a proper exception for 422\n" }, { "from": "human", "value": "module Quaderno\n module Exceptions\n class InvalidSubdomainOrToken < Exception\n end\n\n class InvalidID < Exception\n end\n\n class RateLimitExceeded < Exception\n end\n\n cl...
ruby
chosen
[ { "from": "system", "value": "Make value's from Literals available" }, { "from": "human", "value": "module Tritium\n module Parser\n module Instructions\n class Literal < Instruction\n def initialize(filename, line_num, value)\n super(filename, line_num)\n @valu...
ruby
chosen
[ { "from": "system", "value": "Add tests for Utils.notify method\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Freddy::Utils do\n describe '.format_exception' do\n subject { described_class.format_exception(exception) }\n\n let(:exception) { double(backtrace: backtra...
ruby
chosen
[ { "from": "system", "value": "Add test for travis variant with single ruby version\n" }, { "from": "human", "value": "describe 'travis.yml' do\n it \"matches versions and excludes\" do\n travis = YAML.safe_load(File.open(ManageIQ::UI::Classic::Engine.root.join('.travis.yml')))\n\n version...
ruby
chosen
[ { "from": "system", "value": "Remove half-done testing suite until ready\n" }, { "from": "human", "value": "require 'active_record'\nrequire_relative '../lib/pretty_param'\n\nclass TestObject < ActiveRecord::Base\n\tdef title\n\t\t\"Exciting, yet complicated (!@@&*) title \"\n\tend\n\tdef name\...
ruby
chosen
[ { "from": "human", "value": "Add specs for ShippingFee class\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\nklasses = [Yuso::Yamato::ShippingFee, Yuso::Sagawa::ShippingFee, Yuso::Yubin::ShippingFee]\nklasses.each do |klass|\n RSpec.describe klass do\n describe '.load' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add new time travel example\n" }, { "from": "human", "value": "describe 'Time travel with ActiveSupport::Testing::TimeHelpers' do\n context 'travel_back' do\n before { travel_to Time.new(2004, 11, 24, 01, 04, 44) }\n after { travel_back }\n\n it do\n ...
ruby
chosen
[ { "from": "human", "value": "Add time_zone attribute to user model\n" }, { "from": "gpt", "value": "class AddUserTimeZones < ActiveRecord::Migration\n def self.up\n add_column :users, :time_zone, :string\n end\n\n def self.down\n remove_column :users, :time_zone\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Fix missing foreign key for pending_jobs\n" }, { "from": "human", "value": "Sequel.migration do\n change do\n create_table :pending_jobs do\n column :query_id, :text, primary_key: true\n end\n end\nend\n" }, { "from": "gpt", "value": "Sequel...
ruby
chosen
[ { "from": "system", "value": "Add logging for user_id downloading MI report\n" }, { "from": "human", "value": "require 'csv'\n\nclass CaseWorkers::Admin::ManagementInformationController < CaseWorkers::Admin::ApplicationController\n skip_load_and_authorize_resource only: %i[index download genera...
ruby
chosen
[ { "from": "system", "value": "Use pkg_info for check_is_installed and get_version\n\nPrevious version assumed GNU grep is installed which may not always be\nthe case\n" }, { "from": "human", "value": "class Specinfra::Command::Smartos::Base::Package < Specinfra::Command::Solaris::Base::Package\n...
ruby
chosen
[ { "from": "human", "value": "Add version check for SafeBuffer vulnerability\n\nupgrading is recommended, no workarounds\nhttps://groups.google.com/group/rubyonrails-security/browse_thread/thread/edd28f1e3d04e913?pli=1\n" }, { "from": "gpt", "value": "require 'brakeman/checks/base_check'\n\n#Chec...
ruby
chosen
[ { "from": "system", "value": "Add rspec as development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'uniara_virtual_parser/version'\n\nGem::Specification.new do |spec|\n...
ruby
chosen
[ { "from": "system", "value": "Create subject sets all for the same project\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :subject do\n project\n association :uploader, factory: :user\n\n sequence(:zooniverse_id) { |n| \"TES#{n.to_s(26).rjust(8, '0')}\" }\n metad...
ruby
chosen
[ { "from": "system", "value": "Fix projects helper patch. Trial 3\n" }, { "from": "human", "value": "require_dependency 'projects_helper'\nrequire_dependency 'intouch_helper'\n\nmodule Intouch\n module Patches\n module ProjectsHelperPatch\n def self.included(base)\n base.send(:inc...
ruby
chosen
[ { "from": "system", "value": "Add description, summary and homepage to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'parsley-rails/version'\n\nGem::Specification....
ruby
chosen
[ { "from": "human", "value": "Add basic test for Status check of application.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Citygram::Routes::Status do\n include Citygram::Routes::TestHelpers\n\n describe 'GET /status' do\n it 'returns a non-empty body' do\n stub_...
ruby
chosen
[ { "from": "system", "value": "Add unique_args to contact_us mailer\n\nSendgrid should send these along with the event webhook. We'll use these\nto reconnect and email with the resource that initiated it.\n" }, { "from": "human", "value": "class ContactMailer < ApplicationMailer\n\n def contact_...
ruby
chosen
[ { "from": "human", "value": "Add migration for credit invoice booking templates.\n" }, { "from": "gpt", "value": "class AddCreditInvoiceBookingTemplates < ActiveRecord::Migration\n def self.up\n Account.create!([\n {:code => \"2000\", :title => \"Kreditoren\"},\n {:code => \"4000\"...
ruby
chosen
[ { "from": "system", "value": "Support twitter_id in sharing services.\n" }, { "from": "human", "value": "class SharingService < ApplicationRecord\n belongs_to :user\n default_scope { order(Arel.sql('lower(label)')) }\n\n def link_options(entry)\n entry_url = entry.fully_qualified_url ? ERB...
ruby
chosen
[ { "from": "system", "value": "Update gem name to include puppet.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/sooty/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"David Winter\"]\n gem.email = [\"i@djw.m...
ruby
chosen
[ { "from": "system", "value": "Revert \"https only in production\"\n\nThis reverts commit 2b7e3e085808927a2b4cd05e91981c685bb8639c.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n\n include GDS::SSO::ControllerMethods\n \n def d...
ruby
chosen
[ { "from": "system", "value": "Add index route to application controller\n" }, { "from": "human", "value": "require './config/environment'\n\nclass ApplicationController < Sinatra::Base\n\n configure do\n set :public_folder, 'public'\n set :views, 'app/views'\n end\nend\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Return json object to get serialization to render correctly\n" }, { "from": "human", "value": "class ApplicationController < ActionController::API\n\n DEFAULT_PER_PAGE = Kaminari.config.default_per_page\n DEFAULT_PAGE_NUM = 1\n\n def filter\n params.fetch(:fil...
ruby
chosen
[ { "from": "system", "value": "Fix typo in the XSRF token header\n\n* fixes submittion of Angular requests that require this token\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n before_filter :authenticate\n after_filter :set_c...
ruby
chosen
[ { "from": "system", "value": "Fix kramdown rendering for data vault\n" }, { "from": "human", "value": "class DataVaultsController < ApplicationController\n\n def show\n @data_vault = DataVault.find(params[:id])\n render :text => @data_vault.data\n end\n\n def update\n @data_vault = D...
ruby
chosen
[ { "from": "system", "value": "Revert \"remove rails version requirement\"\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"change_manager/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specificati...
ruby
chosen
[ { "from": "system", "value": "Add a spec for BasicObject subclasses that include Kernel (from JRUBY-4871)\n" }, { "from": "human", "value": "require File::join( File::dirname(__FILE__), %w{ .. .. spec_helper } )\n\nruby_version_is \"1.9\" do\n require File::join( File::dirname(__FILE__), %w{ sh...
ruby
chosen
[ { "from": "system", "value": "Add typed subresource actions keys\n" }, { "from": "human", "value": "describe 'API configuration (config/api.yml)' do\n let(:api_settings) { Api::ApiConfig }\n\n describe 'collections' do\n let(:collection_settings) { api_settings.collections }\n\n it \"is ...
ruby
chosen
[ { "from": "system", "value": "Remove the dependency on chef_hostname now that hostname is built in\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name \"base\"\nmaintainer \"\"\nmaintainer_email \"\"\nlicense ...
ruby
chosen
[ { "from": "system", "value": "Set minimum version of iOS to 5.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'REMarkerClusterer'\n s.version = '2.0'\n s.authors = {'Roman Efimov' => 'romefimov@gmail.com'}\n s.homepage = 'https://github.com/romaonthego/REMarkerClusterer'...
ruby
chosen
[ { "from": "system", "value": "Correct the comment. It's not thread-safe.\n" }, { "from": "human", "value": "require \"activerecord/delay_touching/version\"\n\n# Per-thread tracking of the touch state\nmodule ActiveRecord\n module DelayTouching\n class State\n attr_accessor :nesting\n\n ...
ruby
chosen
[ { "from": "system", "value": "Delegate: Implement .html_safe by delegating it to the resulting string\n\nFixes issue where calling html_safe on the delegate object results in exceptions.\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n\nmodule PhraseApp\n module InContextEditor\n...
ruby
chosen
[ { "from": "system", "value": "Fix bug in RewriteMarkedTemplates - only rewrite each marked template once\n" }, { "from": "human", "value": "module Texas\n module Build\n module Task\n class RewriteMarkedTemplates < Base\n def run\n build.ran_templates.select { |t| t.mark...
ruby
chosen
[ { "from": "system", "value": "Add fog to the list of gems to install. This is needed for the new ec2 code\n\n\nFormer-commit-id: 504840b6eb04819455652251a05ba183b1bbf435 [formerly b8a61c0da962b0af8ea8021d84dc65161c6e369a] [formerly 1d16cb5a81aeabf5134297f1a23ce3b516134afa [formerly d3a1bf2f117930f47492ada2...
ruby
chosen
[ { "from": "system", "value": "Add explicit \"run\" dependency tag\n" }, { "from": "human", "value": "require 'options'\n\nmodule Dependable\n RESERVED_TAGS = [:build, :optional, :recommended]\n\n def build?\n tags.include? :build\n end\n\n def optional?\n tags.include? :optional\n end...
ruby
chosen
[ { "from": "system", "value": "Use require_relative to improve load time.\n" }, { "from": "human", "value": "# Top level module for TZInfo.\nmodule TZInfo\n # Top level module for TZInfo::Data.\n module Data\n # The directory containing the TZInfo::Data files.\n LOCATION = File.dirname(Fi...
ruby
chosen
[ { "from": "system", "value": "Rename test case when there is no country in the yandex results\n" }, { "from": "human", "value": "# encoding: utf-8\n$: << File.join(File.dirname(__FILE__), \"..\", \"..\")\nrequire 'test_helper'\n\nclass YandexTest < GeocoderTestCase\n\n def setup\n Geocoder.c...
ruby
chosen
[ { "from": "system", "value": "Fix accidental change that shouldn't have happened\n" }, { "from": "human", "value": "\n# HACK: If running on Windows, then add the current directory to the PATH\n# for the current process so it can find the bundled dlls before the require\n# of the actual extension...
ruby
chosen
[ { "from": "system", "value": "Refactor Document class for Podcast to inherit easily\n" }, { "from": "human", "value": "class Document\n attr_reader :id, :filename\n DIR_PATH = 'db/docs'\n URL_PATH = 'docs'\n\n class << self\n def all\n Dir.glob(\"#{DIR_PATH}/*.md\").map do |filename|...
ruby
chosen
[ { "from": "system", "value": "Enable css inlining for all email\n" }, { "from": "human", "value": "class Filters::Master < Filters::Delivery\n def data(delivery)\n # DKIM filter needs to always be the last one\n filtered = Filters::Dkim.new(Filters::ClickTracking.new(Filters::AddOpenTrack...
ruby
chosen
[ { "from": "system", "value": "Remove duplication of reset permission check\n" }, { "from": "human", "value": "module Admin\n class PasswordResetsController < AdminController\n skip_before_action :ensure_administrator\n\n def new\n @password_reset = PasswordReset.new\n end\n\n d...
ruby
chosen
[ { "from": "system", "value": "Remove description from threads factory.\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: message_threads\n#\n# id :integer not null, primary key\n# issue_id :integer\n# created_by_id :integer not null\n...
ruby
chosen
[ { "from": "human", "value": "Add specs for mass-assignment security.\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'dm-rails/mass_assignment_security'\n\n# Because mass-assignment security is based on ActiveModel we just have to\n# ensure that ActiveModel is called.\ndescribe D...
ruby
chosen
[ { "from": "system", "value": "Remove crop name test from homepage members list\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'home/_members.html.haml', type: \"view\" do\n before do\n @member = FactoryBot.create(:london_member)\n @member.updated_at = 2.days.ago\n ...
ruby
chosen
[ { "from": "system", "value": "Rewrite test cases to not use UTF-8 characters to avoid errors.\n" }, { "from": "human", "value": "shared_examples \"a popup\" do |initiator, selector|\n context \"when the popup isn't clicked\" do\n it \"should not show the popup\" do\n expect(page).to hav...
ruby
chosen
[ { "from": "system", "value": "Update log level from info\n" }, { "from": "human", "value": "require 'alephant/renderer/version'\nrequire 'alephant/renderer/view_mapper'\nrequire 'alephant/logger'\n\nmodule Alephant\n module Renderer\n def self.create(config, data)\n Renderer.new(config,...
ruby
chosen
[ { "from": "system", "value": "Send email notifcations during december 2013\n" }, { "from": "human", "value": "desc \"Send daily emails\"\ntask :send_emails => :environment do\n User.all.each {|u| u.send_notification_email rescue nil } if Time.now.utc < Date.parse('2012-12-25')\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Initialize instance vars to avoid warnings\n" }, { "from": "human", "value": "module Tokeneyes\n # Represents a word as read from the stream, with certain useful related metadata.\n class Word\n attr_reader :text\n attr_accessor :punctuation_before, :punctua...
ruby
chosen