conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix regular expression of email\n\n> The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \\A and \\z, or forgot to add the :multiline => true option?\n" }, { "from": "human", "value": "class Ide...
ruby
chosen
[ { "from": "system", "value": "Read RDFa data in convinience method\n" }, { "from": "human", "value": "require 'rdf'\nrequire 'linkeddata'\n\n# The module that contains everything Semantology-related\nmodule Semantology\n # Convinence method\n # @param input_path [String] path to input file. ca...
ruby
chosen
[ { "from": "system", "value": "Remove click option for Check temporarily\n" }, { "from": "human", "value": "require 'shoes/common/common_methods'\n\nclass Shoes\n class Check\n include Shoes::CommonMethods\n\n attr_reader :parent\n attr_reader :blk\n attr_reader :gui\n\n def initi...
ruby
chosen
[ { "from": "system", "value": "Remove a warning in the console task\n\nPassing the environment's name as a regular\nargument is deprecated and will be removed in the\nnext Rails version. Please, use the -e option\ninstead." }, { "from": "human", "value": "namespace :dev do\n def run_and_stop_if_...
ruby
chosen
[ { "from": "system", "value": "Allow literal '.' in /api/v2/domains/name\n\nfixes #832" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule API\n class SpamDomainsAPI < API::Base\n get '/' do\n std_result SpamDomain.all.order(id: :desc), filter: FILTERS[:domains]\n ...
ruby
chosen
[ { "from": "system", "value": "Update login page to redirect to users profile tweets page\n" }, { "from": "human", "value": "post '/login' do\n user = User.authenticate(params[:username], params[:password])\n puts \"*\"*50\n if user\n session[:user_id] = user.id\n redirect \"users/#{user...
ruby
chosen
[ { "from": "system", "value": "Update wait time on LinkThumbnailer::Exceptions\n" }, { "from": "human", "value": "class FetchLinkDataJob < ApplicationJob\n queue_as :http_service\n\n def perform(post_id, url, retry_count=1)\n post = Post.find(post_id)\n post.link_crawler_cache = LinkCrawl...
ruby
chosen
[ { "from": "system", "value": "Disable ddl transaction for index added concurrently\n" }, { "from": "human", "value": "class CreateIndexOnBuildsIdDescAndRepositoryIdAndEventType < ActiveRecord::Migration\n def up\n execute \"CREATE INDEX CONCURRENTLY index_builds_on_id_repository_id_and_event...
ruby
chosen
[ { "from": "system", "value": "Revert \"restric the rerun for failure or aborted only\"\n\nThis reverts commit cd159fdf1e447191ccf11d80281c75700f8770c2.\n" }, { "from": "human", "value": "module Runnable\n extend ActiveSupport::Concern\n include Stateable\n\n included do\n extend Enumerize\...
ruby
chosen
[ { "from": "human", "value": "Add regression spec for GH-913\n" }, { "from": "gpt", "value": "describe 'GH-891', site: true, stdio: true do\n before do\n File.write('content/hello.html', 'hi!')\n\n File.write('Rules', <<EOS)\n postprocess do\n items.map(&:compiled_content)\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Delete module version from gemspec file\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"email_format_validator/version\"\n\nGem::Specification.new do |s|\n s.name = \"email_format_valida...
ruby
chosen
[ { "from": "system", "value": "Make failed build spec saner\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\ndescribe \"Juici build abstraction\" do\n\n before(:all) do\n @app = Juici::App.new\n end\n\n after(:all) do\n Juici::App.sh...
ruby
chosen
[ { "from": "system", "value": "Use tmpdir instead of ./tmp" }, { "from": "human", "value": "require \"pry\"\nrequire \"defile\"\nrequire \"defile/backend_examples\"\n\ntmp_path = File.expand_path(\"tmp\", Dir.pwd)\n\nif File.exist?(tmp_path)\n raise \"temporary path #{tmp_path} already exists, r...
ruby
chosen
[ { "from": "system", "value": "Modify feature spec to use FakeS3Server\n" }, { "from": "human", "value": "# frozen_string_literal: true\ndescribe 'main process', type: :feature, js: true do\n it \"html includes content 'Listing buckets' and 'my-bucket'\" do\n Aws.config[:s3] = {\n stub_r...
ruby
chosen
[ { "from": "system", "value": "Remove UWDC sample items from Origin specs\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nrequire File.expand_path(File.dirname(__FILE__) + '../../spec_helper')\nrequire 'uwdc'\n\n# AfricaFocus - Hyena Wrestler with Muzzled Hyena\ndef get_africa_focu...
ruby
chosen
[ { "from": "system", "value": "Add override for $stdout to make rspec output pretty\n" }, { "from": "human", "value": "require 'rspec/given'\nrequire 'subtime/timer'\nrequire 'kernel/kernel'\n\ndescribe Timer do\n\n let(:timer_output) { double('timer_output').as_null_object }\n\n describe \"#st...
ruby
chosen
[ { "from": "human", "value": "Add basic test for concern\n" }, { "from": "gpt", "value": "require 'test_helper'\nrequire 'active_record'\n\ndescribe Storied do\n\n class StoriedTestModel\n include ActiveModel::Model\n include Storied\n\n def stories\n Story.all\n end\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update rake and rspec for CVE-2020-8130\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kartograph/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Add edit action for answers\n" }, { "from": "human", "value": "class AnswersController < ApplicationController\n\n def create\n question = Question.find(question_id: params[:question_id])\n @answer = Answer.new(answer_params)\n if @answer && @answer.save\n...
ruby
chosen
[ { "from": "system", "value": "Make remote header handling more flexible\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Auth\n # Fetches the user from the REMOTE_USER header set by the FreeIPA module of\n # the web server.\n class RemoteHeader < Base\n\n def fetc...
ruby
chosen
[ { "from": "system", "value": "Allow non authenticated access to avatars\n" }, { "from": "human", "value": "class UploadsController < ApplicationController\n def show\n model = params[:model].camelize.constantize.find(params[:id])\n uploader = model.send(params[:mounted_as])\n\n if uplo...
ruby
chosen
[ { "from": "system", "value": "Fix validations on invoice line items\n" }, { "from": "human", "value": "class InvoiceAddonLineItem < ActiveRecord::Base\n belongs_to :invoice\n belongs_to :package_addon_type\n\n validates_presence_of :invoice\n validates_presence_of :package_addon_type\n vali...
ruby
chosen
[ { "from": "human", "value": "Add simple implementation of Eliza\n" }, { "from": "gpt", "value": "require 'pat5'\n\nmodule Enumerable\n def some?\n self.each do |v|\n result = yield v\n return result if result\n end\n nil\n end\nend\n\nclass Array\n def random_elt\n self[...
ruby
chosen
[ { "from": "system", "value": "Allow overriding bind options in client library.\n" }, { "from": "human", "value": "require 'multibinder/version'\nrequire 'json'\n\nmodule MultiBinder\n def self.bind(address, port)\n abort 'MULTIBINDER_SOCK environment variable must be set' if !ENV['MULTIBINDE...
ruby
chosen
[ { "from": "system", "value": "Refactor Api registration to be more similar to Compression registration\n" }, { "from": "human", "value": "require 'neptune/api/consumer_metadata'\nrequire 'neptune/api/fetch'\nrequire 'neptune/api/metadata'\nrequire 'neptune/api/offset'\nrequire 'neptune/api/offse...
ruby
chosen
[ { "from": "system", "value": "Fix how these are required.\n" }, { "from": "human", "value": "require \"source_code/method\"\nrequire \"source_code/monkey_patch\"\nrequire \"source_code/version\"\n\nmodule SourceCode\n\n def self.extract_source_for source_location\n Method.new(source_location...
ruby
chosen
[ { "from": "system", "value": "Make color method more explicit\n\nThere was some confusion about where the color method was\ncoming from\n" }, { "from": "human", "value": "class Bike\n attr_reader :color\n\n def initialize(color)\n @color = color\n end\n\n def is_cool?\n color == \"red\...
ruby
chosen
[ { "from": "system", "value": "Allow Resque 2.3 and 2.4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"resque-multi-job-forks\"\n s.version = \"0.5.5\"\n s.authors = [\"Mi...
ruby
chosen
[ { "from": "system", "value": "Fix customer with not-existing customer\n" }, { "from": "human", "value": "class AddCustomerNumber < ActiveRecord::Migration\n def up\n rename_column :customers, :id, :number\n add_column :customers, :id, :primary_key\n fix_customer_references(Project, :nu...
ruby
chosen
[ { "from": "human", "value": "Add simple browser test of ArticleViewer with WhoColor data\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\ndescribe 'Article Viewer', type: :feature, js: true do\n let(:course) { create(:course, start: '2017-01-01', end: ...
ruby
chosen
[ { "from": "human", "value": "Add some (breaking) Vote feature specs\n\nCreate some feature specs for testing voting functionality. Currently,\ntests break for one reason or another when all four are enabled.\nOne issue is that these specs expect to be executed in a particulr\norder, which they shouldn't be ...
ruby
chosen
[ { "from": "system", "value": "spec: Test Slack and HipChat formatting\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Lita::Handlers::AsciiArt, lita_handler: true do\n it { routes_command(\"ascii FRIDAY\").to(:ascii_from_text) }\n\n describe \"#ascii_from_text\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add specs for new BatchUpdateJob\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe BatchUpdateJob do\n before(:all) do\n GenericFile.any_instance.stubs(:terms_of_service).returns('1')\n @user = FactoryGirl.find_or_create(:user)\n @batch = B...
ruby
chosen
[ { "from": "system", "value": "Support multiple services and actions.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: quickservice\n# Recipe:: default\n#\n# Copyright (c) 2015 The Authors, All Rights Reserved.\n\nservice node[:quickservice][:service] do\n action node[:quickservice][:acti...
ruby
chosen
[ { "from": "system", "value": "Add back amazon Linux support\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: push-jobs\n# Recipe:: default\n#\n# Author:: Joshua Timberman <joshua@chef.io>\n# Author:: Charles Johnson...
ruby
chosen
[ { "from": "system", "value": "Fix virus scanning test on local docker instance\n\nWe had one consistent failing test:\n\n```\nVirus scanning of uploaded images a clean asset is available after virus scanning & uploading to cloud storage\nFailure/Error: raise Error, out_str\n\nVirusScanner::Error:\n LibClam...
ruby
chosen
[ { "from": "system", "value": "Fix for incoming mailer failing with undefined method `new' for \"Rack::SSL\":String\n" }, { "from": "human", "value": "# Settings specified here will take precedence over those in config/environment.rb\n\n# The production environment is meant for finished, \"live\"...
ruby
chosen
[ { "from": "system", "value": "Correct name of sysctl variable\n" }, { "from": "human", "value": "name \"draco\"\ndescription \"Master role applied to draco\"\n\ndefault_attributes(\n :networking => {\n :interfaces => {\n :internal_ipv4 => {\n :interface => \"eth0.2801\",\n ...
ruby
chosen
[ { "from": "system", "value": "Fix abilities to allow reading users contributions, likes and dislikes\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initialize(user)\n user ||= User.new\n\n if user.karma.nil?\n user.karma = 0\n end\n\n can :r...
ruby
chosen
[ { "from": "system", "value": "Update check message. Add space.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks::SSL\n describe VerifyCheck do\n before do\n @runner = Scanny::Runner.new(VerifyCheck.new)\n @message = \"Disable certificate verifica...
ruby
chosen
[ { "from": "human", "value": "Create manual reslugging db migration\n" }, { "from": "gpt", "value": "document = Document.find_by_content_id(\"28a17ff2-bc8e-4237-a8f1-6ac290d9b6eb\")\n\nedition = document.editions.published.last\nWhitehall::SearchIndex.delete(edition)\n\ndocument.update!(slug: \"l...
ruby
chosen
[ { "from": "system", "value": "Fix the solaris platform name\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'chef_client_updater'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense 'Apache-2.0'\n...
ruby
chosen
[ { "from": "human", "value": "Add code wars (8) - remove first and last char\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/570597e258b58f6edc00230d\n# --- iteration 1 ---\ndef array(str)\n nums = str.split(\",\")\n return if nums.count < 3\n nums[1..-2].join(\" \")\nend\n\n" ...
ruby
chosen
[ { "from": "system", "value": "Add issues_url and source_url for foodcritic\n" }, { "from": "human", "value": "name 'ambari'\nmaintainer 'JULIEN PELLET'\nmaintainer_email 'chef@julienpellet.com'\nlicense 'Apache 2.0'\ndescription 'Installs/Configures ambari'\nlong_...
ruby
chosen
[ { "from": "system", "value": "Add pry 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 'sirius/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Support tagging specs as slow\n" }, { "from": "human", "value": "require \"gradient\"\nrequire \"pry\"\n\nRSpec.configure do |config|\n\n config.expect_with :rspec do |expectations|\n expectations.include_chain_clauses_in_custom_matcher_descriptions = true\n en...
ruby
chosen
[ { "from": "system", "value": "Create base directories on start.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n#\n# moviebot\n#\n#\n\nrequire 'ostruct'\nrequire 'thread'\nrequire 'securerandom'\nrequire 'net/http'\nrequire 'json'\nrequire 'openssl'\n\nrequire 'websocket/driver'\nrequi...
ruby
chosen
[ { "from": "human", "value": "Add minor test for windows helpers method\n" }, { "from": "gpt", "value": "require_relative '../../libraries/windows.rb'\n\ndescribe ::PCI::Windows do\n describe 'the method #pnp_info' do\n it 'parses ids correctly' do\n hardware_ids = %w[PCI\\VEN_8086&DEV_9...
ruby
chosen
[ { "from": "system", "value": "Add header to the attributes file\n" }, { "from": "human", "value": "default['memcached']['memory'] = 64\ndefault['memcached']['port'] = 11211\ndefault['memcached']['user'] = \"nobody\"\ndefault['memcached']['listen'] = \"0.0.0.0\"\ndefault['memcached']['maxconn'] =...
ruby
chosen
[ { "from": "system", "value": "Add tests for ActiveRecord features on View model\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Riews::View, type: :model do\n describe 'validates' do\n subject { build :view, code: 'helloworld' }\n describe 'code' do\n it { should...
ruby
chosen
[ { "from": "system", "value": "Fix selectors for invisible things (these now need to be explicit for capybara)\n" }, { "from": "human", "value": "require 'acceptance_helper'\n\ndescribe \"Feedback modal\", type: :feature do\n\n context \"as a logged out user\" do\n\n before do\n visit \"...
ruby
chosen
[ { "from": "system", "value": "Add aws-s3 dependency to gemsepec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/snowplow-emr-etl-runner/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Alex Dean <support@snowplowanaly...
ruby
chosen
[ { "from": "system", "value": "Add Extension for PHP7.1 so basic stuff works.\n" }, { "from": "human", "value": "log \"message\" do\n message \"Installing PHP7.1 from deb.sury.org Repository.\"\n level :info\nend\n\napt_package \"apt-transport-https\" do\n action :install\nend\n\napt_repositor...
ruby
chosen
[ { "from": "system", "value": "Remove explicit date from gemspec\n\nThis seems unnecessary. Having one causes wrong dates to be set on Rubygems, and setting `Date.today` fails on Solano.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nre...
ruby
chosen
[ { "from": "system", "value": "Add pry as a 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 'artifactory/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Print JSON rather than plain text\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n\n# This script parses mcs_finder.log to infer which subsequences ended in\n# a bug.\n#\n# It only exists because old STS versions didn't store this information in an\n# easily acc...
ruby
chosen
[ { "from": "system", "value": "Add pcaprub and bit-struct as dependencies\n\n\ngit-svn-id: b3d365f95d627ddffb8722c756fee9dc0a59d335@182 64fbf49a-8b99-41c6-b593-eb2128c2192d\n" }, { "from": "human", "value": "# $Id$\n\nrequire 'rubygems'\nSPEC = Gem::Specification.new do |s|\n s.name = \"racket\"...
ruby
chosen
[ { "from": "system", "value": "Verify if access_token is correct\n" }, { "from": "human", "value": "module Api\n module V1\n class ApiApplicationController < ApplicationController\n respond_to :json\n before_filter :authenticate_token!\n\n def authentica...
ruby
chosen
[ { "from": "system", "value": "Work around the \"(transitive)\" and \"(intransitive)\" labeling when conjugating in the present tense.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nclass NorskPresentTense < Tense\n @keys = \"present\", \"presens\"\n\n def self.regular_conjugation verb...
ruby
chosen
[ { "from": "human", "value": "Test stubs for API authentication\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass ApiAuthenticationTest < ActionDispatch::IntegrationTest\n fixtures :all\n \n test \"authentication should fail with and old token\" do\n flunk\n end\n\n test \"a...
ruby
chosen
[ { "from": "system", "value": "Add published and published_at to white list\n" }, { "from": "human", "value": "class Admin::PostsController < Admin::ApplicationController\n before_action :set_post, only: [:show, :edit, :update, :destroy]\n\n # GET /posts\n def index\n @posts = Post.all\n e...
ruby
chosen
[ { "from": "system", "value": "Revert \"Allow robots to crawl MHRA\"\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n include Slimmer::Headers\n include Slimmer::SharedTemplates\n before_filter :set_slimmer_headers, :set_robots_headers\n\n # Prevent CS...
ruby
chosen
[ { "from": "system", "value": "Add view helper methods in ApplicationController\n" }, { "from": "human", "value": "require './config/environment'\nrequire 'rack-flash'\n\nclass ApplicationController < Sinatra::Base\n use Rack::Flash\n \n configure do\n set :public_folder, 'public'\n set ...
ruby
chosen
[ { "from": "system", "value": "Allow mobile variant to be set\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n include GinaAuthentication::AppHelpers\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session inste...
ruby
chosen
[ { "from": "system", "value": "Remove CSRF protection from ApplicationController\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_for...
ruby
chosen
[ { "from": "system", "value": "Fix error in check_ownership when user isn't signed in\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_fro...
ruby
chosen
[ { "from": "system", "value": "Add empty `details` to content item payload sent to publishing api\n\nThe govuk-content-schemas have changed since the last time this\napplication was updated. The govuk-content-schemas now expects all\ncontent payloads pushed to it to contain a `details` item.\n\nThis problem ...
ruby
chosen
[ { "from": "system", "value": "Fix no-posts case for RSS feeds\n" }, { "from": "human", "value": "xml.instruct! :xml, version: '1.0'\nxml.feed xmlns: 'http://www.w3.org/2005/Atom' do\n xml.id category_feed_url(@category)\n xml.title \"New Questions - #{@category.name} - #{SiteSetting['SiteName'...
ruby
chosen
[ { "from": "system", "value": "Speed up intstalls with multipackage\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook Name:: heartbeat\n# Recipe:: default\n#\n# Copyright 2009-2016, Chef Software, Inc.\n#\n# Licensed un...
ruby
chosen
[ { "from": "human", "value": "Add script to CSV export votes + handle an exact party split in VoteCounts\n" }, { "from": "gpt", "value": "require 'csv'\n\nmodule Hdo\n module Stats\n class VoteExporter\n def initialize(votes = Vote.all)\n @votes = votes\n end\n\n def csv...
ruby
chosen
[ { "from": "system", "value": "Update path to template file\n" }, { "from": "human", "value": "module Moonshine\n module Msttcorefonts\n\n # Define options for this plugin via the <tt>configure</tt> method\n # in your application manifest:\n #\n # configure(:msttcorefonts => {:foo...
ruby
chosen
[ { "from": "human", "value": "Fix editions with broken first_published_at\n\nThere are a dozen or so editions with a first_published_at timestamp\nthat is broken (e.g. 0001-01-01). This fixes them, using the edition's\npublic_timestamp if that is a sensible value, otherwise falling back\nto the latest editio...
ruby
chosen
[ { "from": "system", "value": "Make the failing test pass.\n" }, { "from": "human", "value": "class Array\n def to_objects(&blk)\n data = blk.call\n return [] if data.empty?\n \n result = Object.new\n def result.name\n @name\n end\n def result.name=(value)\n @name ...
ruby
chosen
[ { "from": "system", "value": "Make MediaStatusPersister handle no images\n" }, { "from": "human", "value": "require 'file_helper'\nrequire 'liquid'\n\nclass MediaStatusPersister\n attr_reader :file_helper, :image\n\n LAYOUT = <<-LAYOUT\n---\ntitle: tweet {{tweet.id}}\ntimestamp: {{tweet.timest...
ruby
chosen
[ { "from": "system", "value": "Use UTC as the default time zone\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)\n...
ruby
chosen
[ { "from": "system", "value": "Load rails environment when precompiling assets\n\n* Setting config.assets.initialize_on_precompile to false does not load Rails\n environment when precompiling assets\n* Use of named routes in js.erb files requires Rails environment\n* Heroku suggests setting to false in Rail...
ruby
chosen
[ { "from": "system", "value": "Change to silence test output\n" }, { "from": "human", "value": "RSpec.describe TTY::Command, ':pty' do\n it \"executes command in pseudo terminal mode as global option\", unless: RSpec::Support::OS.windows? do\n color_cli = fixtures_path('color')\n output = ...
ruby
chosen
[ { "from": "system", "value": "Add magic comment and give initial string to set its encoding.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../../spec_helper'\nrequire 'stringio'\nrequire 'zlib'\n\ndescribe \"GzipWriter#write\" do\n\n before :each do\n @data = '1234...
ruby
chosen
[ { "from": "system", "value": "TEST: Use factory girl default create in test create campus\n" }, { "from": "human", "value": "require \"test_helper\"\n\nclass CampusTest < ActiveSupport::TestCase\n def test_create_campus\n data = {\n name: 'Sydney',\n mode: 'automatic',\n abbre...
ruby
chosen
[ { "from": "human", "value": "Add a test to push to travis\n" }, { "from": "gpt", "value": "require \"test_helper\"\n\nclass Colppy::ResourceTest < Minitest::Test\n\n def test_valid_invoices_types\n assert_equal %w(A B C E Z I M X), Colppy::Resource::VALID_INVOICE_TYPES\n end\n\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Enable spec style, let later to remove one of them\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/test_helper')\nrequire 'dummy'\n\nclass DummyTest < MiniTest::Unit::TestCase\n\n def setup\n @dummy = Dummy.new\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make Rails a runtime 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 'text_message_rails/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Fix deployment to hardware device.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Expecta'\n s.version = '1.0.3'\n s.license = { :type => 'MIT', :file => 'LICENSE' }\n s.summary = 'A matcher framework for Objective-C & Cocoa.'\n s.ho...
ruby
chosen
[ { "from": "human", "value": "Add formula for GNU Linear Programming Kit\n\nProvides a library and stand-alone tool for solving linear programs (LPs) and\ninteger linear programs (ILPs). Doesn't depend on anything else.\n" }, { "from": "gpt", "value": "require 'brewkit'\n\nclass Glpk <Formula\n ...
ruby
chosen
[ { "from": "system", "value": "Add User References to Session Migration\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :username\n t.string :email\n t.string :password_digest\n t.reference...
ruby
chosen
[ { "from": "system", "value": "Add compatibility with all Firebase 7 and 8 versions\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"GeoFire\"\n s.version = \"4.2.0\"\n s.summary = \"Realtime location queries with Firebase.\"\n s.homepage = \"https://...
ruby
chosen
[ { "from": "system", "value": "Add modules to `ember_cli/ember` controller\n\nCloses [#480].\n\nWhen the `ApplicationController` extends `ActionController::API`, HTML\nrendering modules and logic are omitted.\n\nTo make the `EmberCli::EmberController` capable of rendering the Ember\napplication's HTML, this ...
ruby
chosen
[ { "from": "human", "value": "Add file for the attribute exercise\n" }, { "from": "gpt", "value": "#Attr Methods\n\n# I worked on this challenge by myself\n\n# I spent 2.5 hours on this challenge.\n\n# Pseudocode\n\n# Input:a name\n# Output: a greeting specific for a name\n# Steps:\n#1)create an ...
ruby
chosen
[ { "from": "human", "value": "Create a class which can prepare a swingset with frameworks in a directory\n" }, { "from": "gpt", "value": "#\nmodule SwingSet\n # Will add frameworks to a given swingset\n class FrameworkDirectory\n def initialize(swingset, framework_path)\n @swingset = sw...
ruby
chosen
[ { "from": "system", "value": "Fix trending maps after refactor\n" }, { "from": "human", "value": "require_relative '../../lib/cartodb/trending_maps'\nrequire_relative '../../lib/static_maps_url_helper'\n\nnamespace :cartodb do\n namespace :trending_maps do\n desc \"Search for yesterday's tre...
ruby
chosen
[ { "from": "system", "value": "Return index after patching it\n" }, { "from": "human", "value": "class LandingController < ApplicationController\n SHORT_UUID_V4_REGEXP = /\\A[0-9a-f]{7}\\z/i\n\n def index\n index_key = if Rails.env.development?\n \"basechurch:index:__develop...
ruby
chosen
[ { "from": "system", "value": "Add per_page support for axioms index.\n" }, { "from": "human", "value": "#\n# Lists axioms of an ontology\n#\nclass AxiomsController < InheritedResources::Base\n\n belongs_to :ontology\n\n actions :index\n has_pagination\n\n respond_to :html, only: %i(index)\n\...
ruby
chosen
[ { "from": "system", "value": "[manage] Order jobs by ID desc.\n" }, { "from": "human", "value": "require 'app/controllers/app_controller'\nrequire 'app/helpers/manage_helper'\nrequire 'app/models/pod'\n\nrequire 'sinatra/twitter-bootstrap'\n\nmodule Pod\n module TrunkApp\n class ManageContro...
ruby
chosen
[ { "from": "system", "value": "Fix pagination paths in Rails 4.2\n" }, { "from": "human", "value": "module Blog::PaginationHelper\n WILL_PAGINATE_BASE = defined?(WillPaginate::ViewHelpers) ? WillPaginate::ViewHelpers::LinkRenderer : WillPaginate::LinkRenderer\n \n class LinkRenderer < WILL_PAG...
ruby
chosen
[ { "from": "system", "value": "Fix account scoped persist options for account option\n" }, { "from": "human", "value": "module AccountScoped\n extend ActiveSupport::Concern\n\n included do\n store_in client: Proc.new {\n name = (Account.current && Account.current.meta['db_name']) || 'de...
ruby
chosen
[ { "from": "human", "value": "Allow ACH bank transfer spree payments to be verified from model level\n" }, { "from": "gpt", "value": "module Spree\n module PaymentDecorator\n def verify!(**options)\n process_verification(options)\n end\n\n private\n\n def process_verification(**...
ruby
chosen
[ { "from": "system", "value": "Fix for Rails security update. Need to make those attributes accessible\n" }, { "from": "human", "value": "# Add access to reviews/ratings to the product model\nSpree::Product.class_eval do\n has_many :reviews\n\n def stars\n avg_rating.round\n end\nend\n" }...
ruby
chosen
[ { "from": "system", "value": "Fix Pundit not receiving context\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n##\n# REST resource\n#\nclass ApplicationResource < JSONAPI::Resource\n abstract\n\n ##\n # Callbacks\n #\n ##\n # Methods\n #\n def fetchable_fields\n # ...
ruby
chosen
[ { "from": "system", "value": "Add event attr on event register model\n" }, { "from": "human", "value": "module Webhook\n class EventRecordSerializer < ActiveModel::Serializer\n delegate :attributes, to: :object\n end\n\n class EventRegister\n def initialize(record, created: false)\n ...
ruby
chosen
[ { "from": "system", "value": "Add solution for calulate grade\n" }, { "from": "human", "value": "# Calculate a Grade\n\n# I worked on this challenge [by myself, with: ].\n\n\n# Your Solution Below" }, { "from": "gpt", "value": "# Calculate a Grade\n\n# I worked on this challenge with...
ruby
chosen