conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Disable rubocop rule for 0.36\n\nUsing a conditional here doesn't make sense\n" }, { "from": "human", "value": "# determine if we should install or not\ndef mce_should_install?\n return true if node['mcelog']['always_install']\n return false if platform?('windows'...
ruby
chosen
[ { "from": "system", "value": "Add method docstrings to the Sql module\n" }, { "from": "human", "value": "require 'time'\n\nmodule Rake\n module TableTask\n\n class Sql\n\n def self.get_array sql\n Db.execute(sql)\n end\n\n def self.truthy_value\n Db.truthy_value\...
ruby
chosen
[ { "from": "system", "value": "Fix bug with showing create merge request button while merge request are disabled in project settings" }, { "from": "human", "value": "module CompareHelper\n def compare_to_mr_button?\n params[:from].present? && params[:to].present? &&\n @repository.branch_...
ruby
chosen
[ { "from": "system", "value": "Add participation token to utm hash\n" }, { "from": "human", "value": "class PollEmailInfo\n include Routing\n attr_reader :recipient, :poll, :actor, :action_name\n\n def send_reason\n # TODO: determine why this recipient is receiving this email\n # PollEma...
ruby
chosen
[ { "from": "system", "value": "Add a tag to allow ignoring the CORS test\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'spec_helper'\n\nRSpec.feature \"Cross-origin requests\", type: :request do\n let(:evaluate_json_uri) { URI.join(Capybara.app_host, '/evaluate.json') }\n\n it ...
ruby
chosen
[ { "from": "system", "value": "Revert \"don't render adapter if response is js\"\n\nThis reverts commit f8a6288249550e948040a51f1b82b9645d35ff45.\n\nConflicts:\n\n\tlib/active_scaffold/extensions/action_controller_rendering.rb\n" }, { "from": "human", "value": "# wrap the action rendering for Act...
ruby
chosen
[ { "from": "system", "value": "Change type faker price generate.\n" }, { "from": "human", "value": "# spec/factories.rb\n\nFactoryGirl.define do\n factory :fee do\n garage { FactoryGirl.create(:garage) }\n name Faker::Commerce.department\n price Faker::Number.number(3)\n end\nend\n"...
ruby
chosen
[ { "from": "system", "value": "Change gem spec to reflect new homepage url\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"interrogate/version\"\n\nGem::Specification.new do |s|\n s.name = \"interrogate\"\n s.version...
ruby
chosen
[ { "from": "system", "value": "Set explicit activesupport dependency to 4.2\n" }, { "from": "human", "value": "$: << File.expand_path('../lib', __FILE__)\nrequire 'mongoid/undo/version'\n\nGem::Specification.new do |gem|\n gem.name = 'mongoid-undo'\n gem.version = Mongoid::Undo::...
ruby
chosen
[ { "from": "human", "value": "Test bad commands return UNKNOWN_COMMAND\n" }, { "from": "gpt", "value": "require 'beanstalk_integration_tests/test_helper'\n\nclass OtherTest < BeanstalkIntegrationTest\n\n context 'Bad commands' do\n\n should 'return UNKNOWN_COMMAND for a variery of bad command...
ruby
chosen
[ { "from": "system", "value": "Speed up clinical trial processing\n" }, { "from": "human", "value": "class UpdateClinicalTrials < ApplicationJob\n\n def perform\n Source.where(source_type: 'PubMed').each do |source|\n resp = Scrapers::PubMed.call_pubmed_api(source.citation_id)\n cli...
ruby
chosen
[ { "from": "system", "value": "Correct index view main render\n" }, { "from": "human", "value": "class Admin::ServerStateController < Admin::ApplicationController\n\n\tdef index\n\t\t@autorizedIps = ServerStatus.first.ips\n\t\t@authorizedIps = nil if(!@authorizedIps.is_a?(Array))\n\t\tif request....
ruby
chosen
[ { "from": "system", "value": "Comment out old mailer method\n" }, { "from": "human", "value": "class NotificationMailer < ActionMailer::Base\n default from: \"notifications@cityvoiceapp.com\"\n include NotificationsMailerHelper\n helper :notifications_mailer\n\n def confirmation_email(notifi...
ruby
chosen
[ { "from": "system", "value": "Add item ref to master inventory\n" }, { "from": "human", "value": "class SpreadsheetExporter\n def initialize\n @workbook = Spreadsheet::Workbook.new\n end\n\n def self.master_inventory\n SpreadsheetExporter::MasterInventory.new\n end\n\n def write(targe...
ruby
chosen
[ { "from": "system", "value": "Remove unused borrower generate functions\n" }, { "from": "human", "value": "def generate_title_number\n title_number = Pxeger.new('^([A-Z]{0,3}[1-9][0-9]{0,5}|[0-9]{1,6}[ZT])$')\n title_number.generate\nend\n\ndef generate_new_borrower_no_middle\n {\n forenam...
ruby
chosen
[ { "from": "system", "value": "Add mutation to root mutation type\n" }, { "from": "human", "value": "# Root Query type for changing model state\nMutationType = GraphQL::ObjectType.define do\n name 'Mutation'\n description 'The mutation root of this schema for creating or changing data.'\n fiel...
ruby
chosen
[ { "from": "system", "value": "Add issued date to medical safety alerts\n\nAdd the issued date attribute to the medical safety alert date metadata\nin the model so that it can be shown in the frontend. This corresponds\nto this commit in specialist publisher:\nalphagov/specialist-publisher#281\n\nThe trello ...
ruby
chosen
[ { "from": "system", "value": "Maintenance: Simplify MacroPolicy::Scope to work without sub-selects.\n" }, { "from": "human", "value": "# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/\n\nclass MacroPolicy < ApplicationPolicy\n class Scope < ApplicationPolicy::Scope\n\...
ruby
chosen
[ { "from": "system", "value": "Fix url path in task serializer\n" }, { "from": "human", "value": "class TaskSerializer < ActiveModel::Serializer\n attributes :id, :label, :assignment_name, :project, :story, :url, :project_users, :completed, :due_at, :due_at_pretty\n has_one :assignment\n\n def...
ruby
chosen
[ { "from": "system", "value": "Add a sample nested list test for MiddlewareServerController.\n" }, { "from": "human", "value": "describe MiddlewareServerController do\n render_views\n before(:each) do\n stub_user(:features => :all)\n end\n\n it 'renders index' do\n get :index\n expec...
ruby
chosen
[ { "from": "system", "value": "Allow server node bool to be changed via config.\n" }, { "from": "human", "value": "module Aggro\n # Public: Stores the current cluster config. Persists to disk after changes.\n class ClusterConfig\n attr_reader :node_name\n\n def initialize(path)\n @pa...
ruby
chosen
[ { "from": "system", "value": "Sort options on step creation for testability\n" }, { "from": "human", "value": "module Elasticity\n\n class HiveStep\n\n attr_accessor :name\n attr_accessor :script\n attr_accessor :variables\n attr_accessor :action_on_failure\n\n def initialize(scr...
ruby
chosen
[ { "from": "system", "value": "Allow to change type and value of SSA::Constant.\n" }, { "from": "human", "value": "module Furnace\n class SSA::Constant < SSA::Value\n attr_reader :type\n attr_reader :value\n\n def initialize(type, value)\n super()\n\n @value, @type = value, ty...
ruby
chosen
[ { "from": "system", "value": "Add TomDoc documentation to the Interactor::Organizer module\n\n[ci skip]\n" }, { "from": "human", "value": "module Interactor\n module Organizer\n def self.included(base)\n base.class_eval do\n include Interactor\n\n extend ClassMethods\n ...
ruby
chosen
[ { "from": "system", "value": "Fix S3_ENVIRONMENTS to expect comma-separated list" }, { "from": "human", "value": "module Paperclip\n module S3\n if defined? Rails::Railtie # Don't break rails 2.x\n require 'rails'\n class Railtie < Rails::Railtie\n initializer 'paperclip.for...
ruby
chosen
[ { "from": "system", "value": "Set apostle config if in rails test mode\n" }, { "from": "human", "value": "require \"apostle_rails/version\"\nrequire \"apostle_rails/mailer\"\n" }, { "from": "gpt", "value": "require 'apostle'\nrequire \"apostle_rails/version\"\nrequire \"apostle_rails...
ruby
chosen
[ { "from": "system", "value": "Make control flow more manageable here.\n" }, { "from": "human", "value": "require 'thin'\nrequire 'em-synchrony'\nrequire 'rack'\nrequire 'rack/lobster'\n\nmodule Frisky\n class Device\n\n # Multicasts discovery messages to advertise its root device, any embedd...
ruby
chosen
[ { "from": "system", "value": "Revert \"Load gems of assets group before of precompile\"\n\nThis reverts commit bbc19aa2f54abb5dcddfc0a9bb0ec79b34bde128.\nThe assets group doesn't exist anymore in Rails default Gemfile\n" }, { "from": "human", "value": "require 'rake'\nrequire 'rake/sprocketstask...
ruby
chosen
[ { "from": "system", "value": "Allow less than Active Record 8\n\nActive Record shouldn't introduce any breaking changes until version 8\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nGem::Specification.new do |spec|\n spec.add_dependency \"activerecord\", [\">= 3.0\", \"< 7...
ruby
chosen
[ { "from": "system", "value": "Revert \"Added aws_secret_acces_key on test for travis\"\n\nThis reverts commit 5918d24986c426b024bd7e7b9c4ba3ef5494210d.\n" }, { "from": "human", "value": "CarrierWave.configure do |config|\n config.storage :fog\n\n config.fog_credentials = {\n :provider ...
ruby
chosen
[ { "from": "system", "value": "Update AdSet to pull down all available v2.4 fields, add insights connection\n" }, { "from": "human", "value": "require 'zuck/facebook/ad_creative'\n\nmodule Zuck\n class AdSet < RawFbObject\n\n # Known keys as per\n # [fb docs](https://developers.facebook.co...
ruby
chosen
[ { "from": "system", "value": "Update SpotifyBeta.app to version 1.0.0.995.gcdfee982-1486\n" }, { "from": "human", "value": "cask :v1 => 'spotifybeta' do\n version '1.0.0.974.ga39487e3-1439'\n sha256 '55ab8ed9446654f007a8dc1782f26d836b3ddd585a6dbc36b19148f7d624c18b'\n\n url \"http://download.s...
ruby
chosen
[ { "from": "system", "value": "Change instructions on actions in README.\n" }, { "from": "human", "value": "class <%= class_name %>Table < TableCloth::Base\n # Define columns with the #column method\n # column :name, :email\n\n # Columns can be provided a block\n #\n # column :name do |objec...
ruby
chosen
[ { "from": "system", "value": "Remove unused constant from Configuration\n" }, { "from": "human", "value": "require 'lotus/utils/path_prefix'\nrequire 'lotus/assets/config/asset_type'\n\nmodule Lotus\n module Assets\n class UnknownAssetType < ::StandardError\n def initialize(type)\n ...
ruby
chosen
[ { "from": "system", "value": "Use ruby1.9 hash syntax, add commas to info hash.\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class GitLab < OmniAuth::Strategies::OAuth2\n option :name, 'gitlab'\n\n option :client_options, {...
ruby
chosen
[ { "from": "system", "value": "Complete rewrite of `EnableButton` to ensure compatibility with all other Rack apps\n" }, { "from": "human", "value": "module Rack::Insight\n class EnableButton\n include Render\n\n MIME_TYPES = [\"text/plain\", \"text/html\", \"application/xhtml+xml\"]\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add ability to override the XLSX template name\n" }, { "from": "human", "value": "module Stradivari\n module XLSX\n\n module Controller\n def render_xlsx(options = {})\n xlsx = render_to_string\n\n if xlsx[-1] == \"\\n\" # HACK FIXME bypass HA...
ruby
chosen
[ { "from": "human", "value": "Add rake task to check for spending proposals\n" }, { "from": "gpt", "value": "namespace :spending_proposals do\n\n desc \"Check if there are any spending proposals in DB\"\n task check: :environment do\n if Rails.env.production? && SpendingProposal.any?\n ...
ruby
chosen
[ { "from": "system", "value": "Fix the checksum processor for IOs without a path.\n" }, { "from": "human", "value": "# -*- ruby -*-\n#encoding: utf-8\n\nrequire 'digest/sha2'\n\nrequire 'thingfish' unless defined?( Thingfish )\nrequire 'thingfish/processor' unless defined?( Thingfish::Processor )...
ruby
chosen
[ { "from": "system", "value": "Handle case of new object not having title yet\n" }, { "from": "human", "value": "class Role < ActiveRecord::Base\n\n has_and_belongs_to_many :rights\n\n validates_presence_of :title\n validates_uniqueness_of :title\n\n def to_s\n self.title.titleize\n end\n...
ruby
chosen
[ { "from": "system", "value": "Make sure gems are installed prior to going forward\n" }, { "from": "human", "value": "namespace :blank do\n task :switch_origin do\n `git remote add origin #{ENV['REPO']}`\n `git push origin master`\n `git fetch origin`\n `git checkout origin/master`\n...
ruby
chosen
[ { "from": "system", "value": "Make task more verbose, comment\n" }, { "from": "human", "value": "namespace :rekey do\n desc 'Re-key all images'\n task :all => :environment do\n\n Image.all.each do |image|\n old_key = image.key\n\n image.key = loop do\n tmp = SecureRandom.ur...
ruby
chosen
[ { "from": "human", "value": "Add Rake Task to Setup Server\n" }, { "from": "gpt", "value": "require 'SUPPORT'\nrequire 'awesome_print'\n\nnamespace :support do\n desc \"Initialize a new SUPPORT Server\"\n task :setup, :server_name do |t, args|\n args.with_defaults(:server_name => \"primary\...
ruby
chosen
[ { "from": "system", "value": "Remove extraneous comment in cli_args helper\n" }, { "from": "human", "value": "# Helpers module\nmodule Helpers\n # Helpers::Docker module\n module Docker\n def cli_args(spec)\n cli_line = ''\n spec.each_pair do |arg, value|\n case value\n ...
ruby
chosen
[ { "from": "system", "value": "Send email to new users on lotifyme click\n" }, { "from": "human", "value": "class PicksController < ApplicationController\n\n before_action :join_number\n def create\n @user = User.find_by(email: params[:pick][:email])\n if !@user\n @user = User.c...
ruby
chosen
[ { "from": "system", "value": "Fix sign-up issue for those that prefer regular user registration\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n before_action :require_logged_in, only: [:show]\n\n def show\n @user = User.find(params[:id])\n end\n\n def ne...
ruby
chosen
[ { "from": "system", "value": "Update user show page to render json data\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n before_action :authenticate_user!\n\n def show\n if current_user.id == params[:id].to_i\n @user = current_user\n else\n red...
ruby
chosen
[ { "from": "system", "value": "Remove 'should' from spec description" }, { "from": "human", "value": "require 'spec_helper'\n\nclass Dummy < ActiveResource::Base\n self.site = 'http://something'\nend\n\nclass OtherDummy < ActiveResource::Base\n self.site = 'http://somethingelse'\nend\n\ndescrib...
ruby
chosen
[ { "from": "system", "value": "Add prereqs field to Charm serializer\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# app/serializers/charm_serializer.rb\nclass CharmSerializer < ActiveModel::Serializer\n attributes :id, :character_id, :type, :name, :cost, :timing, :duration...
ruby
chosen
[ { "from": "system", "value": "Add leaves method to ConditionCounter for ABC metric.\n" }, { "from": "human", "value": "require_relative \"counter\"\n\nmodule Measurement\n class ConditionCounter < Counter\n end\nend\n" }, { "from": "gpt", "value": "require_relative \"counter\"\n\nm...
ruby
chosen
[ { "from": "system", "value": "Fix the failed features caused by translation\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nrequire 'spec_helper'\n\nfeature 'user registration' do\n let(:user) { build :user }\n let(:submit) { I18n.t('labels.sign_up') }\n\n before(:each) { visit...
ruby
chosen
[ { "from": "human", "value": "Create spec for PointsCalculator service\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe PointsCalculator, type: :class do\n let(:user) { create(:user) }\n let(:user2) { create(:user) }\n let(:campaign) { create(:campaign, users: [user, u...
ruby
chosen
[ { "from": "system", "value": "[Spec] Verify 404 if no owner is found\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire 'app/controllers/api/owners_controller'\n\nmodule Pod::TrunkApp\n describe OwnersController, 'concerning the details of a s...
ruby
chosen
[ { "from": "system", "value": "Allow Sinatra 2 in gemspec\n\nFixes #72, Fixes #70\n" }, { "from": "human", "value": "# encoding:utf-8\n\nGem::Specification.new do |gem|\n gem.name = \"sinatra-activerecord\"\n gem.version = \"2.0.11\"\n\n gem.description = \"Extends Sinatra with A...
ruby
chosen
[ { "from": "system", "value": "Add a helper method for getting authorizations by access token, hiding the hashing details.\n" }, { "from": "human", "value": "require 'active_record'\n\nmodule OAuth2\n module Model\n autoload :BelongsToOwner, ROOT + '/oauth2/model/belongs_to_owner'\n autolo...
ruby
chosen
[ { "from": "system", "value": "Add dependency on 'pg' gem for PostgreSQL back end.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'preserves/version'\n\nGem::Specification.new do |spe...
ruby
chosen
[ { "from": "system", "value": "Fix stephen's lame not_if statement\n" }, { "from": "human", "value": "# Joyent pkgsrc puts stuff in the wrong directory (/opt/local/etc). \n# We're working around this by linking /etc/sudoers to /opt/local/etc/sudoers \n# until they correct this as this is the lea...
ruby
chosen
[ { "from": "system", "value": "Update podspec to version 0.2.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"LVGUtilities\"\n s.version = \"0.1.3\"\n s.summary = \"Basic Swift utility functions.\"\n s.homepage = 'https://github.com/letvargo/LVGUt...
ruby
chosen
[ { "from": "system", "value": "Add updated schema to specs\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rspec_api_documentation/dsl'\n\nresource \"Root\" do\n header \"Accept\", \"application/hal+json\"\n\n get \"/\" do\n example \"Getting the root resource\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for orders resources\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe 'Orders', type: :request do\n describe 'GET /orders' do\n it 'successful request' do\n get '/api/orders'\n expect(response).to have_http_status(200)\...
ruby
chosen
[ { "from": "system", "value": "Handle namespaced class names in generator\n\n[closes #47]\n" }, { "from": "human", "value": "Fabricator(:<%= singular_name %>) do\n<% attributes.each do |attribute| -%>\n <%= attribute.name %> <%= attribute.default.inspect %>\n<% end -%>\nend\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Add AccessLoggingPolicy and ConnectionDrainingPolicy attributes\n" }, { "from": "human", "value": "module Skywriter\n module Resource\n module ElasticLoadBalancing\n # AWS::ElasticLoadBalancing::LoadBalancer Resource\n # \n class LoadBalancer\n ...
ruby
chosen
[ { "from": "system", "value": "Fix install in bundler 1.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"mongoid_auto_increment_id\"\n s.version = \"0.2\"\n s.platform = Ge...
ruby
chosen
[ { "from": "system", "value": "Add spec for ancestors on a singleton class\n\nMRI 1.9 did not include the singleton classes in the list of ancestors\nbut 2.x does.\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/...
ruby
chosen
[ { "from": "system", "value": "Rework EditionPublisher to expose multiple failure reasons.\n" }, { "from": "human", "value": "class EditionPublisher < EditionService\n def failure_reason\n @failure_reason ||= if !edition.valid?\n \"This edition is invalid: #{edition.errors.full_messages....
ruby
chosen
[ { "from": "system", "value": "Drop support for Rails < 3.2\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"obvious_data/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix the new Provider Account form error\n" }, { "from": "human", "value": "#\n# Copyright 2011 Red Hat, 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 License.\n# You ma...
ruby
chosen
[ { "from": "human", "value": "Add some tests for setting group preferences.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe \"Group prefs\" do\n\n def get_field(name)\n find_field(I18n.t(\"formtastic.labels.group_pref.#{name}\"))\n end\n\n context \"as a group member\" ...
ruby
chosen
[ { "from": "system", "value": "Correct spec for static pages\n" }, { "from": "human", "value": "require 'rails_helper'\n\n\n\ndescribe \"Static pages\" do \n\tlet(:page_title) {\"Ruby on Rails Tutorial Sample App\"}\n\tsubject {page}\n\n\tdescribe \"Home page\" do\n\t\tbefore {visit home_path} \n...
ruby
chosen
[ { "from": "system", "value": "Make migration not validate against new validations\n" }, { "from": "human", "value": "class RemoveNameFromAccounts < ActiveRecord::Migration\n def up\n Account.all.each do |a|\n person = Person.find_by_email(a.email)\n if person\n person.name =...
ruby
chosen
[ { "from": "system", "value": "Remove trailing comma in run_list\n" }, { "from": "human", "value": "name \"security\"\ndescription \"The role with security-related recipes for nodes\"\nrun_list(\n \"recipe[openssh]\",\n \"recipe[sudo]\",\n \"recipe[denyhosts]\",\n \"recipe[iptables]\",\n \"r...
ruby
chosen
[ { "from": "system", "value": "Add development dependency 'pry' to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sad_panda/version'\n\nGem::Specification.new do |spec|\n sp...
ruby
chosen
[ { "from": "system", "value": "Add pt-BR locale file when bootstrapping\n" }, { "from": "human", "value": "puts \"Adding default files ...\".magenta\n\ncopy_static_file 'app/views/layouts/application.html.haml'\ncopy_static_file 'Procfile'\n\n%w{attr_accessible_security.rb requires.rb}.each do |c...
ruby
chosen
[ { "from": "system", "value": "Set :dependent => :destroy on the has_many :metrics association\n" }, { "from": "human", "value": "class Client < ActiveRecord::Base\n has_many :metrics\n \n accepts_nested_attributes_for :metrics, :allow_destroy => true\n \n validates_presence_of :name\n vali...
ruby
chosen
[ { "from": "system", "value": "Check content of each comic\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ComixScraper::Scraper do\n \n before :each do\n @scraper = ComixScraper::Scraper.new()\n end\n \n it 'can get new releases' do\n new_releases = @scraper.get_n...
ruby
chosen
[ { "from": "system", "value": "Add default value to the type of weight a variant has\n" }, { "from": "human", "value": "module Shopify\n class VariantConverter\n def initialize(spree_variant, shopify_variant)\n @spree_variant = spree_variant\n @shopify_variant = shopify_variant\n ...
ruby
chosen
[ { "from": "system", "value": "Add Message to Dummy Hickwell Test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass HickwellTest < ActiveSupport::TestCase\n def setup\n @hickwell = Hickwell.create!\n end\n\n test \"should have maskable_attribute foo\" do\n assert @hickwel...
ruby
chosen
[ { "from": "system", "value": "Update Ebb adapter to work with latest Ebb 0.1.0 [Ry Dahl]\n" }, { "from": "human", "value": "require 'ebb'\nmodule Merb\n \n module Rack\n\n class Ebb\n # start an Ebb server on given host and port.\n \n # ==== Parameters\n # opts<Hash>:: O...
ruby
chosen
[ { "from": "system", "value": "Fix formatting exception when skipping a community cookbook\n" }, { "from": "human", "value": "# Default location aka community/supermarket cookbook\nmodule Monolith\n class DefaultLocation < BaseLocation\n def install\n # For now we just copy any community...
ruby
chosen
[ { "from": "system", "value": "Drop unnecessary line of code\n" }, { "from": "human", "value": "require \"net/https\"\n\nmodule Core\n class HttpRequest\n def get(url)\n uri = URI.parse(url)\n request = Net::HTTP::Get.new(uri.request_uri)\n yield request if block_given?\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change text for shipping costs.\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => 'spree/orders/edit',\n :name => 'add_delivery_costs_to_cart',\n :insert_before => '[data-hook=\"outside_cart_form\"]',\n ...
ruby
chosen
[ { "from": "system", "value": "Update query for DYK feed\n\nArticlesCourses generally only get created for mainspace pages, so we can't use them as an indicator that a page is connected to a current course.\n" }, { "from": "human", "value": "class RevisionAnalyticsService\n\n def self.dyk_eligib...
ruby
chosen
[ { "from": "system", "value": "Fix warning so code works on Ruby 2.1, 2.3, 2.4\n" }, { "from": "human", "value": "module Workflows\n # helper mixin for Workflows\n module WorkflowHelper\n private\n\n def try_services(*fns, success: success, failure: failure)\n Workflows::Workflow.cal...
ruby
chosen
[ { "from": "system", "value": "Add specs for some RbConfig::CONFIG values\n\n* rubylibdir and archdir are used by Bootsnap:\n https://github.com/Shopify/bootsnap/blob/2390a1a5/lib/bootsnap/explicit_require.rb\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\nrequire 'rbcon...
ruby
chosen
[ { "from": "system", "value": "Add extra files in gemspec.\n" }, { "from": "human", "value": "# This file is part of ruby-snowmath.\n# Copyright (c) 2013 Noel Raymond Cower. All rights reserved.\n# See COPYING for license details.\n\nGem::Specification.new { |s|\n s.name = 'snow-math'\n ...
ruby
chosen
[ { "from": "human", "value": "Fix for a bug in Google Authenticator OTP check\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass GoogleAuthenticatorTest < ActionDispatch::IntegrationTest\n test \"should not be able to authenticate without otp\" do\n u = Factory.build(:user)\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for Lita module.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Lita do\n it \"memoizes a hash of Adapters\" do\n adapter_class = double(\"Adapter\")\n described_class.register_adapter(:foo, adapter_class)\n expect(described_c...
ruby
chosen
[ { "from": "system", "value": "Refactor so it is more unique.\n" }, { "from": "human", "value": "require \"minitest/autorun\"\n\nclass OptionalTests < MiniTest::Unit::TestCase\n \n def test_env\n assert true\n end\n \n def test_working_chain\n user_name = 'Bob'\n user = User.new(use...
ruby
chosen
[ { "from": "system", "value": "Add rake to dev deps" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"sprockets\"\n s.version = \"2.0.0.beta.6\"\n s.summary = \"Rack-based asset packaging system\"\n s.description = \"Sprockets is a Rack-based asset packaging system t...
ruby
chosen
[ { "from": "system", "value": "Fix validation in case, when started at is nil." }, { "from": "human", "value": "class TableReservation < ActiveRecord::Base\n\n validates :table_number, presence: true\n validates :started_at, presence: true\n validates :ended_at, presence: true\n\n validate :e...
ruby
chosen
[ { "from": "system", "value": "Set default secrets for development/test\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 ...
ruby
chosen
[ { "from": "system", "value": "Add comment about MaxSize number\n" }, { "from": "human", "value": "module Barcelona\n module Network\n class AutoScalingGroup < CloudFormation::Resource\n def self.type\n \"AWS::AutoScaling::AutoScalingGroup\"\n end\n\n def define_resource...
ruby
chosen
[ { "from": "system", "value": "Fix class name for Devise::Authenticatable\n" }, { "from": "human", "value": "require 'devise/strategies/authenticatable'\n\nmodule Devise\n module Strategies\n class LdapAuthenticatable < Autheneticatable\n\n # Tests whether the returned resource exists in...
ruby
chosen
[ { "from": "system", "value": "rpearce: Remove this function it has been replaced\n" }, { "from": "human", "value": "require 'stacks/namespace'\n\nmodule Stacks::Services::VirtualSftpService\n attr_reader :proxy_vhosts\n attr_reader :proxy_vhosts_lookup\n\n def self.extended(object)\n objec...
ruby
chosen
[ { "from": "system", "value": "Add sort by teacher name alphabetically on teacher show page\n" }, { "from": "human", "value": "class TeachersController < ApplicationController\n \n def index\n @teachers = Teacher.all\n end\n\n def show\n @teacher = Teacher.find(params[:id])\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Move the desc one level up \n\nMake the task visible (from rake -T) by moving the desc one level up" }, { "from": "human", "value": "namespace :dev do\n task :cache do\n desc 'Toggle development mode caching on/off'\n\n if File.exist? 'tmp/caching-dev.txt'\n ...
ruby
chosen
[ { "from": "system", "value": "Update node.js versions to latest.\n\n - Stable is now v0.4.12\n - Unstable is now v0.5.8" }, { "from": "human", "value": "default[:nodejs][:versions] = [\"0.4.11\", \"0.5.5\"]\ndefault[:nodejs][:aliases] = {\"0.5.5\".to_sym => \"latest\", \"0.4.11\".to_sym => ...
ruby
chosen
[ { "from": "system", "value": "Allow sonarqube addon on external PRs\n\nIn this case, addon runs without sensitive data\n" }, { "from": "human", "value": "module Travis\n module Scheduler\n module Serialize\n class Worker\n module Config\n class Addons < Struct.new(:confi...
ruby
chosen
[ { "from": "human", "value": "Add simple formatter for BigDecimal and his friends\n" }, { "from": "gpt", "value": "require_relative 'base_formatter'\n\nmodule AwesomePrint\n module Formatters\n class SimpleFormatter < BaseFormatter\n\n attr_reader :string, :type, :inspector, :options, :i...
ruby
chosen
[ { "from": "system", "value": "Revert \"MISC - use attr_reader i/o class_attribute for columns_pool\"\n\nThis reverts commit ead8c75abbfc1cd6adb66dee63d21e1ed66f8cd6.\n" }, { "from": "human", "value": "module WulinMaster\n module GridColumns\n extend ActiveSupport::Concern\n\n included do\...
ruby
chosen