conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add production_code helper method to spec helper\n" }, { "from": "human", "value": "require 'simplecov'\nrequire_relative '../lib/snmpjr'\n\nSimpleCov.start do\n add_filter '/vendor/'\n coverage_dir 'log/coverage/spec'\nend\n" }, { "from": "gpt", "valu...
ruby
chosen
[ { "from": "system", "value": "Add RSpec config and apply CodeClimate coverage\n" }, { "from": "human", "value": "require \"lita-hackers-news\"\nrequire \"lita/rspec\"\n\n# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin\n# was generated with Lita 4, th...
ruby
chosen
[ { "from": "system", "value": "Enable simplecov for rom gem specs\n" }, { "from": "human", "value": "require 'pathname'\n\nSPEC_ROOT = root = Pathname(__FILE__).dirname\n\nrequire 'rom/core'\n\nDir[root.join('support/*.rb').to_s].each do |f|\n require f\nend\nDir[root.join('shared/*.rb').to_s].e...
ruby
chosen
[ { "from": "system", "value": "Clean up redis after examples\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\nrequire \"rubygems\"\nrequire \"sidekiq/testing\"\nrequire \"active_support/core_ext/numeric/time\"\nrequire \"timecop\"\nrequire \"simplec...
ruby
chosen
[ { "from": "system", "value": "Remove the converge report in chefspec\n\nThese lead to poorly designed specs\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |co...
ruby
chosen
[ { "from": "system", "value": "Change SimpleCov behaviour to stop reporting\n\nChange the SimpleCov behaviour so that it no longer reports coverage\nwhen `rake` completes and acts only as a 'red light' if coverage drops\nsignificantly (by 20%) or drops below a percentage (80%).\n\nNote that to silence the 'C...
ruby
chosen
[ { "from": "system", "value": "Enable support for `rspec --next-failure`.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.join(File.dirname(_...
ruby
chosen
[ { "from": "system", "value": "Use Helper::Exec instead of Helper::Ssh\n" }, { "from": "human", "value": "require 'serverspec'\nrequire 'pathname'\n\nPROJECT_ROOT = (Pathname.new(File.dirname(__FILE__)) + '..').expand_path\n\nDir[PROJECT_ROOT.join(\"spec/support/**/*.rb\")].each { |file| require(...
ruby
chosen
[ { "from": "system", "value": "Remove referenced to undefined :enabled attribute\n" }, { "from": "human", "value": "class PhysicalServer < ApplicationRecord\n include NewWithTypeStiMixin\n\n acts_as_miq_taggable\n\n belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => \"M...
ruby
chosen
[ { "from": "system", "value": "Remove order list connect button\n" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => 'spree/admin/orders/index',\n :name => 'add_shippo_button_to_orders_page',\n :insert_after => \"erb[silent]:contains('content_for :page_actions')\",\n :text ...
ruby
chosen
[ { "from": "system", "value": "Increase graph samples 4 -> 5 in check ins\n" }, { "from": "human", "value": "class StatsService\n GRAPH_SAMPLES = 4\n\n attr_accessor :check_ins, :leader\n\n def initialize(leader)\n @leader = leader\n @check_ins = ::CheckIn.where(leader: leader).order('me...
ruby
chosen
[ { "from": "system", "value": "Change the way config/mailer.yml is read so that it supports configurations other than smtp." }, { "from": "human", "value": "if File.exists?(\"#{RAILS_ROOT}/config/mailer.yml\")\n require \"action_mailer\"\n c = YAML::load(File.open(\"#{RAILS_ROOT}/config/mailer....
ruby
chosen
[ { "from": "system", "value": "Set required ENV var in test\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe Account do\n before do\n @account = FactoryGirl.build(:account)\n end\n\n it \"must be valid\" do\n @account.valid?.must_equal true\n end\n\n it \"must have ...
ruby
chosen
[ { "from": "system", "value": "Make RSpec emit colored output no matter what\n\nWe thought concourse-filter was swallowing color codes.\n\nIt was not. Instead, they were not emitted on CI.\n\n[#133046105]\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'machete'\nrequire 'mach...
ruby
chosen
[ { "from": "system", "value": "Deal with possibly nil source strings\n" }, { "from": "human", "value": "module Skr\n module Concerns\n\n # @see ClassMethods\n module CodeIdentifier\n\n extend ActiveSupport::Concern\n\n # ### Code Identifier Concern\n ...
ruby
chosen
[ { "from": "system", "value": "Add text with newsletter link.\n" }, { "from": "human", "value": "# encoding: UTF-8\nDeface::Override.new(:virtual_path => 'spree/home/index',\n :name => 'add_welcome_text_to_home_page',\n :insert_before => '[data-hook=\"homepag...
ruby
chosen
[ { "from": "system", "value": "Make sure assets can be deleted.\n" }, { "from": "human", "value": "class Backend::AssetsController < Backend::BaseController\n before_action :find_model, only: [:edit, :update, :destroy]\n before_action -> { breadcrumb.add t('b.files'), backend_assets_path }\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add `brew tap-readme <name>` external command.\n\nCloses Homebrew/homebrew#17935.\n" }, { "from": "gpt", "value": "name = ARGV.first\n\nraise \"A name is required\" if name.nil?\n\ntemplate = <<-EOS\nHomebrew-#{name}\n=========#{'=' * name.size}\n\nHow do I install t...
ruby
chosen
[ { "from": "system", "value": "Add authorization for Event Partner\n" }, { "from": "human", "value": "class EventPartnersController < ApplicationController\n before_filter :load_parent\n\n def new\n @event_partner = @event.event_partners.build\n end\n\n def create\n @event_partner = @ev...
ruby
chosen
[ { "from": "system", "value": "BaseAppscript: Add Documentation for the methods defined.\n" }, { "from": "human", "value": "require 'watch_tower/appscript'\n\nmodule WatchTower\n module Editor\n module BaseAppscript\n def self.included(base)\n base.send :include, InstanceMethods\n...
ruby
chosen
[ { "from": "system", "value": "Use ImageUploader::Attachment.new(:image) instead of ImageUploader[:image]\n" }, { "from": "human", "value": "require \"./config/sequel\"\nrequire \"./uploaders/image_uploader\"\n\nclass Photo < Sequel::Model\n include ImageUploader[:image]\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Add alias join to API replies controller\n" }, { "from": "human", "value": "class Api::V1::RepliesController < Api::ApiController\n resource_description do\n description 'Viewing replies to a post'\n end\n\n api! 'Load all the replies for a given post as JSON ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Hostbuddy Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'hostbuddy' do\n version :latest\n sha2...
ruby
chosen
[ { "from": "system", "value": "Fix typo in end-to-end harness\n" }, { "from": "human", "value": "RSpec.describe 'End-to-end' do\n directories = Dir[File.join(File.dirname(__FILE__), '*')]\n .select { |entry| File.directory?(entry) }\n\n def expect_runs(source_file, expected_output)\n exec...
ruby
chosen
[ { "from": "system", "value": "Update spec test for Portal::Country class\n\n" }, { "from": "human", "value": "# frozen_string_literal: false\n\nrequire 'spec_helper'\n\n\nRSpec.describe Portal::Country, type: :model do\n\n # TODO: auto-generated\n describe '.csv_filemame' do\n it 'csv_filem...
ruby
chosen
[ { "from": "system", "value": "Make sure we don't get loaded with bad rspec-core\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = \"rspec_junit_formatter\"\n s.version = \"0.1.3\"\n s.platform = Gem::Platform::RUBY\n s.auth...
ruby
chosen
[ { "from": "system", "value": "Change ingredient field from type to is_natural\n" }, { "from": "human", "value": "class CreateIngredients < ActiveRecord::Migration[5.1]\n def change\n create_table :ingredients do |t|\n \tt.string :name\n \tt.text :description\n \tt.string :type\n ...
ruby
chosen
[ { "from": "system", "value": "Fix appending non-strings to icon\n\nExample: `icon(:copyright, Time.now.year)`\r\n\r\nBefore: © ߟ\r\nAfter: © 2015" }, { "from": "human", "value": "module FontAwesome\n module Sass\n module Rails\n module ViewHelpers\n def icon(icon, *args)\n ...
ruby
chosen
[ { "from": "system", "value": "Add exam students upsert event\n" }, { "from": "human", "value": "Mumukit::Nuntius::EventConsumer.handle do\n\n # Emitted by user registration and modification in classroom\n event 'UserChanged' do |payload|\n User.import_from_resource_h! payload.deep_symbolize...
ruby
chosen
[ { "from": "human", "value": "Add new detailed guidance categories\n" }, { "from": "gpt", "value": "class MainstreamCategory < ActiveRecord::Base; end\nclass EditionMainstreamCategory < ActiveRecord::Base; end\nclass Edition < ActiveRecord::Base; end\nclass DetailedGuide < Edition\n belongs_to :...
ruby
chosen
[ { "from": "human", "value": "Add Photo Supreme v3 single user\n\nInstall the single-user version of IDImager's DAM package, Photo Supreme v3\n" }, { "from": "gpt", "value": "cask :v1 => 'photo-supreme-single-user' do\n version '3'\n sha256 'b2a60379e61ac6a44ac14b05e462a145ad65d5606e78c0cb4d46b...
ruby
chosen
[ { "from": "system", "value": "Fix offense to the LineBreakAfterGuardClauses cop\n\nSigned-off-by: Rémy Coutable <4ea0184b9df19e0786dd00b28e6daa4d26baeb3e@rymai.me>\n" }, { "from": "human", "value": "module Gollum\n GIT_ADAPTER = \"rugged\".freeze\nend\nrequire \"gollum-lib\"\n\nmodule Gollum\n ...
ruby
chosen
[ { "from": "system", "value": "Refactor filtering step to look at items\n\nCheck contents of one item but just asset counts for the rest.\n" }, { "from": "human", "value": "Given(/^a collection of cases exist$/) do\n stub_case_collection_api_request\nend\n\nThen(/^I can get a list of all merger ...
ruby
chosen
[ { "from": "system", "value": "Add extra system tests for when ensure => absent\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'mock class:' do\n context 'default parameters' do\n it 'should run successfully' do\n pp =<<-EOS\n class { 'mock': }\n ...
ruby
chosen
[ { "from": "system", "value": "Add a spec for __LINE__ in eval\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/classes', __FILE__)\n\ndescribe \"Kernel#eval\" do\n before :each do\n @cache = tmp(\"eval_cache....
ruby
chosen
[ { "from": "system", "value": "Remove route explanation from dummy app\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n # The priority is based upon order of creation: first created -> highest priority.\n # See how all your routes lay out with \"rake routes\".\n\n # You ca...
ruby
chosen
[ { "from": "system", "value": "Add todo comment for testing\n" }, { "from": "human", "value": "class ProjectRepository < Hanami::Repository\n def find_by_account(account_id, search = {}, limit = 100)\n query = projects.where(account_id: account_id)\n query = text_search(query, search[:text...
ruby
chosen
[ { "from": "system", "value": "Add association Storage Clusters to Automate Storage Service Model.\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1335658\n\n\n(transferred from ManageIQ/manageiq@57a73d0ca0d96e5c26532709d4755b83de923ff4)\n" }, { "from": "human", "value": "module MiqAeMethodService...
ruby
chosen
[ { "from": "human", "value": "Add migration for adding wdpa id and name to pame evaluations\n" }, { "from": "gpt", "value": "class AddWdpaIdAndNameToPameEvaluations < ActiveRecord::Migration[5.0]\n def change\n add_column :pame_evaluations, :wdpa_id, :integer, default: 0, null: false\n add...
ruby
chosen
[ { "from": "system", "value": "Remove Swift 5.1 from podspec swift versions\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SourceKittenFramework'\n s.version = `make get_version`\n s.summary = 'An adorable little framework for interac...
ruby
chosen
[ { "from": "system", "value": "Change order of attributes in Channel model.\n" }, { "from": "human", "value": "class Channel < ApplicationRecord\n belongs_to :category\n has_many :shows\n has_many :schedules, through: :shows\n validates :name, presence: true, uniqueness: true\nend\n" }, {...
ruby
chosen
[ { "from": "system", "value": "Fix beaker tests (they were using deprecated parameters)\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe \"filebeat class\" do\n\n package_name = 'filebeat'\n service_name = 'filebeat'\n\n context 'default parameters' do\n\n let...
ruby
chosen
[ { "from": "system", "value": "Apply 'classic' sass config setting for generating line comments\n" }, { "from": "human", "value": "if CompassRails.rails4?\n module Sprockets\n class SassTemplate < Tilt::Template\n def evaluate(context, locals, &block)\n # Use custom importer that ...
ruby
chosen
[ { "from": "system", "value": "Add a test for when a blank postcode is submitted\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"gds_api/test_helpers/mapit\"\n\ndescribe CoronavirusLocalRestrictionsController do\n include GdsApi::TestHelpers::Mapit\n include GdsApi::TestHe...
ruby
chosen
[ { "from": "system", "value": "Increase test coverage requirement from 80% to 100%\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'minitest/rg'\n\nSimpleCov.minimum_coverage_by_file 80\nSimpleCov.start do\n add_filter '/test/'\nend\n\nrequire 'minitest/autorun'\nrequire 'mocha/m...
ruby
chosen
[ { "from": "system", "value": "Fix for latest version of nulldb\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'active_record'\n\n{\n \"nulldb\" => \"active_record/connection_adapters/nulldb_adapter\",\n \"expectations\" => \"expectations\"\n}.each do |gem_name, require_arg|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix raise error on test due to bug of rails generator\n" }, { "from": "human", "value": "require File.expand_path(\"../../test/dummy/config/environment.rb\", __FILE__)\nActiveRecord::Migrator.migrations_paths = [File.expand_path(\"../../test/dummy/db/migrate\", __FI...
ruby
chosen
[ { "from": "system", "value": "Use redis-cli to shutdown redis server\n\nIt would appear that the process name as reported by ps has changed, so\nwe weren't getting a pid to use for kill. This should be more\nfool-proof.\n" }, { "from": "human", "value": "dir = File.dirname(File.expand_path(__FIL...
ruby
chosen
[ { "from": "system", "value": "Add support for testing against Oracle using Ruby OCI8\n" }, { "from": "human", "value": "require 'test/unit'\r\nrequire 'batch/database/schema'\r\nrequire 'java'\r\nrequire 'C:/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6.jar'\r\n\r\n\r\nclass TestSchema < Test::...
ruby
chosen
[ { "from": "human", "value": "Add folder with examples for testing\n" }, { "from": "gpt", "value": "ActiveAdmin.register AdminUser do\n permit_params :email, :password, :password_confirmation\n\n index do\n selectable_column\n id_column\n column :email\n column :current_sign_in_at\n...
ruby
chosen
[ { "from": "system", "value": "ENHANCE: Add active to campus factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :campus do\n campus_name = ['Melbourne', 'Sydney', 'Perth', 'Hobart'].sample\n campus_abbreviation = campus_name[0...3]\n\n name campu...
ruby
chosen
[ { "from": "system", "value": "Return if no answer type\n" }, { "from": "human", "value": "module SectionsAndQuestionsShared\n\n def self.append_features(base)\n super\n self.class_eval do\n\n def questionnaire\n self.questionnaire_part.root.questionnaire\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Convert to next and early return on non-cron resources\n\nReindent to suit the change\n" }, { "from": "human", "value": "PuppetLint.new_check(:no_cron_resources) do\n def check\n resource_indexes.each do |resource|\n if resource[:type].value == 'cron'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue where unset, undefaulting settings could raise error.\n" }, { "from": "human", "value": "module RspecApiDocumentation\n class Configuration\n def self.add_setting(name, opts)\n define_method(\"#{name}=\") { |value| settings[name] = value }\n ...
ruby
chosen
[ { "from": "system", "value": "Fix registration of apps by non-admin users\n" }, { "from": "human", "value": "class AppsController < ApplicationController\n before_action :authenticate_user!\n before_filter :find_app, only: [:edit, :show, :setup, :wait, :update, :destroy]\n\n def index\n au...
ruby
chosen
[ { "from": "system", "value": "Check if admin user is signed in for caching.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n\n caches_action :index, :expires_in => 1.hour,\n :unless => lambda { user_signed_in? || admin_signed_in? },\n ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to no longer require httpclient; use stdlib instead\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'high_level_browse/version'\n\nGem::Sp...
ruby
chosen
[ { "from": "human", "value": "Add spec for new command config.\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')\n\ndescribe \"Config command\" do\n context \"config\" do\n it \"should report success\" do\n response, exit_status = ca...
ruby
chosen
[ { "from": "system", "value": "Use a regexp to match the inspect output instead of deviating on rbx\n" }, { "from": "human", "value": "shared :method_to_s do |cmd|\n describe \"Method##{cmd}\" do\n it \"returns a string representing the method\" do\n compliant_on :ruby, :jruby do\n ...
ruby
chosen
[ { "from": "human", "value": "Add SweepDataService to connect to Faraday and pull in the data\n" }, { "from": "gpt", "value": "class SweepDataService\n def initialize\n @response = Faraday.get('https://data.cityofchicago.org/resource/waad-z968.json')\n end\n\n def json_response\n JSON.pa...
ruby
chosen
[ { "from": "system", "value": "Fix error message in Sidekiq.\n" }, { "from": "human", "value": "class AvatarPurgeWorker\n\n include Sidekiq::Worker\n\n sidekiq_options :queue => :high\n sidekiq_options :retry => false\n\n def perform(record_id,klass)\n _klass = klass.constantize\n recor...
ruby
chosen
[ { "from": "system", "value": "Update wording in test to match updates in form UI\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.feature 'Admin creates a plot' do\n context 'when logged in' do\n let(:user) { create(:user, :admin) }\n\n before do\n sign_in(user)\n ...
ruby
chosen
[ { "from": "human", "value": "Test case for user view\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe \"users/index\", type: :view do\n before(:each) do\n assign(:users, [\n User.create!(\n :username => \"name\",\n :name => \"Name\",\n :role...
ruby
chosen
[ { "from": "system", "value": "Set admin attribute if we get it from the server.\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class Doorkeeper < OmniAuth::Strategies::OAuth2\n # change the class name and the :name option to match y...
ruby
chosen
[ { "from": "system", "value": "Use posts scope to determine the correct total count of posts\n" }, { "from": "human", "value": "module Schnitzelpress\n module Actions\n module Blog\n extend ActiveSupport::Concern\n\n included do\n get '/' do\n render_blog\n en...
ruby
chosen
[ { "from": "system", "value": "Use ip automatically if public hostname is nil.\n" }, { "from": "human", "value": "require 'net/ssh'\nrequire 'net/ssh/gateway'\n\nclass Aerosol::Connection\n include Dockly::Util::DSL\n include Dockly::Util::Logger::Mixin\n\n logger_prefix '[aerosol connection]'...
ruby
chosen
[ { "from": "system", "value": "[TTPLAT-1117] Add legal name to organization factories.\n" }, { "from": "human", "value": "FactoryGirl.define do\n\n factory :organization do\n customer_id { 1 }\n address1 { '100 Main St' }\n city { 'Harrisburg' }\n state { 'PA' }\n zip { '17120' }\...
ruby
chosen
[ { "from": "system", "value": "Add spec for showing a customer's orders\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'Customers', type: :request do\n describe 'GET /customers' do\n it 'successful request' do\n get '/api/customers'\n expect(response).to...
ruby
chosen
[ { "from": "human", "value": "Create specs for join game\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nRSpec.describe JoinGame, type: :service do\n fixtures :users, :games\n\n let(:game) { Game.create! }\n let(:user) { users(:user1) }\n let(:service) { JoinGame.new(game: ...
ruby
chosen
[ { "from": "system", "value": "Fix error messages for be_at\n" }, { "from": "human", "value": "RSpec::Matchers.define :be_now do\n match do |actual|\n actual.to_i == Time.zone.now.to_i\n end\n\n failure_message_for_should do |actual|\n actual = 'nil' unless actual\n \"expected that #{...
ruby
chosen
[ { "from": "system", "value": "Set default config to hash instead of string\n" }, { "from": "human", "value": "class AddDefaultConfigToApplication < ActiveRecord::Migration\n def change\n add_column :applications, :default_config, :jsonb, default: '{}'\n add_column :application_instances, ...
ruby
chosen
[ { "from": "system", "value": "Upgrade PhpStorm EAP to 141.891\n" }, { "from": "human", "value": "cask :v1 => 'phpstorm-eap' do\n version '141.792'\n sha256 'a4cbd4f72f2b7edad5a39381850a5ea33991b83331401a383f2807120dff8f4d'\n\n url \"http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}...
ruby
chosen
[ { "from": "system", "value": "Refactor methods in CLI class\n" }, { "from": "human", "value": "require 'thor'\n\nmodule CodeclimateCi\n class CLI < Thor\n method_option :codeclimate_api_token, required: true\n method_option :repo_id, required: true\n method_option :branch_name, require...
ruby
chosen
[ { "from": "system", "value": "Fix sporadic failures caused by timing\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Sidekiq::LimitFetch::Global::Monitor do\n let(:global) { true }\n let(:monitor) { described_class.start! ttl, timeout }\n let(:ttl) { 2 }\n let(:queue) { ...
ruby
chosen
[ { "from": "human", "value": "Make tmp group writable after deploy.\n" }, { "from": "gpt", "value": "Capistrano::Configuration.instance(:must_exist).load do\n after \"deploy:finalize_update\", \"app:permissions\"\n\n namespace :app do\n desc <<-DESC\n Change application permissions.\n\n...
ruby
chosen
[ { "from": "system", "value": "Add bundler gem test to rbenv compile spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'rbenv::compile', :type => :define do\n let(:user) { 'tester' }\n let(:ruby_version) { '1.9.3-p125' }\n let(:title) { \"rbenv::compile::...
ruby
chosen
[ { "from": "system", "value": "Add integration tests for advanced search\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"capybara/minitest\"\n\nclass AdvancedSearchTest < SystemTest\n include ESHelper\n\n setup do\n headless_chrome_driver\n\n visit advanced_search_pa...
ruby
chosen
[ { "from": "system", "value": "Add test for UseRoaming no\n" }, { "from": "human", "value": "service_name = case os[:family]\nwhen 'ubuntu', 'debian'\n 'ssh'\nelse\n 'sshd'\nend\n\ndescribe service(service_name) do\n it { should be_enabled }\n it { should be_running }\nend\n\ndescribe port(22...
ruby
chosen
[ { "from": "system", "value": "Update test for change to suspension message\n\nUpdate the test for the change made to the suspension message made in https://github.com/alphagov/signonotron2/commit/68514ef43b71f5e645c597d3b2f3202cf207c732" }, { "from": "human", "value": "require 'test_helper'\n \n...
ruby
chosen
[ { "from": "system", "value": "Update integration test as button label had changed\n" }, { "from": "human", "value": "require 'integration_test_helper'\n\nclass GuideProgressTest < ActionDispatch::IntegrationTest\n\n test \"should update progress of a guide\" do\n without_metadata_denormalisa...
ruby
chosen
[ { "from": "system", "value": "Switch order of deletions around\n" }, { "from": "human", "value": "namespace :after_party do\n desc 'Deployment task: remove_old_email_data'\n task remove_old_email_data: :environment do\n puts \"Running deploy task 'remove_old_email_data'\"\n\n Email.delet...
ruby
chosen
[ { "from": "system", "value": "Stop mutating input in LocalizedNumber.parse\n\nPreviously, LocalizedNumber.parse would perform it's gsub!\nreplacements directly on the string passed in.\n" }, { "from": "human", "value": "module Spree\n class LocalizedNumber\n # Given a string, strips all non-...
ruby
chosen
[ { "from": "system", "value": "Move report details above the gobal time method\n" }, { "from": "human", "value": "require 'yaml'\nrequire 'json'\n\nmodule Knapsack\n class Presenter\n class << self\n def report_yml\n Knapsack.tracker.spec_files_with_time.to_yaml\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add CSS to precompile, now it's not added to application.css by the installer\n" }, { "from": "human", "value": "module NotifyUser\n class Engine < ::Rails::Engine\n \trequire 'active_model_serializers'\n require 'urbanairship'\n\n config.generators do |g|\n...
ruby
chosen
[ { "from": "system", "value": "Revert \"Add a 'kind' parameter when registering calendars.\"\n\nThese artefacts should be registered as custom applications, and should\nbe passed through as such to Rummager. The actual fix for the reported\nproblem of these being displayed as custom applications on the publi...
ruby
chosen
[ { "from": "system", "value": "Use page with editable element\n" }, { "from": "human", "value": "require 'spec_helper'\nmodule Locomotive\n describe PageEntity do\n subject { PageEntity }\n\n attributes =\n %i(\n title\n slug\n parent_id\n position\n ...
ruby
chosen
[ { "from": "system", "value": "9775: Add basic question_search filter specs\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\nfeature \"question search\", js: true do\n include_context \"search\"\n\n let!(:mission) { get_mission }\n let!(:question1...
ruby
chosen
[ { "from": "system", "value": "Disable Abc cop on event builder\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass AssignmentsIcs\n def initialize(assignments)\n @assignments = assignments\n end\n\n def output\n calendar.to_ical\n end\n\n private\n\n def calenda...
ruby
chosen
[ { "from": "system", "value": "Fix searches that used to employ entity matching" }, { "from": "human", "value": "module DC\n module Search\n\n class Field\n\n HAS_WHITESPACE = /\\s/\n\n attr_reader :kind, :value\n\n def initialize(kind, value)\n @kind, @value = kind.stri...
ruby
chosen
[ { "from": "system", "value": "Watch for changes in eastwood initializer\n" }, { "from": "human", "value": "module Eastwood\n class Engine < Rails::Engine\n\n initializer 'eastwood.setup' do |app|\n app.assets.context_class.instance_eval do\n include Eastwood::Context\n end\n...
ruby
chosen
[ { "from": "system", "value": "Convert id to BSON before loading" }, { "from": "human", "value": "require 'sunspot'\nrequire 'mongoid'\nrequire 'sunspot/rails'\n\n# == Examples:\n#\n# class Post\n# include Mongoid::Document\n# field :title\n# \n# include Sunspot::Mongoid\n# searchable do\...
ruby
chosen
[ { "from": "system", "value": "Add rake task to refresh oldest promo\n" }, { "from": "human", "value": "namespace :frankiz do\n task :refresh_promo, [:promo] => :environment do |_, args|\n fkz = FrankizLdap.new\n fkz.crawl_promo(args[:promo])\n end\n\n task :associate_accounts, [:promo] ...
ruby
chosen
[ { "from": "system", "value": "Add file to load path\n" }, { "from": "human", "value": "class TictactoeRules\n\n attr_reader :desc\n\n WIN_COMBOS = [[0,1,2],[3,4,5],[6,7,8],\n [0,3,6],[1,4,7],[2,5,8],\n [0,4,8],[2,4,6]]\n\n def initialize\n @desc = {\n ...
ruby
chosen
[ { "from": "system", "value": "Fix shadowing bug in the test suite.\n\nA small piece has been left out from the last refactoring, so the\n`fixture_module` function was actually shadowed by a variable; this broken all\nthe tests for the amended file.\n" }, { "from": "human", "value": "require 'tes...
ruby
chosen
[ { "from": "system", "value": "Annotate Sentry reports with version and app\n" }, { "from": "human", "value": "# frozen-string-literal: true\n\nRaven.configure do |config|\n config.dsn = 'https://1150348b449a444bb3ac47ddd82b37c4:5fd368489fe44c0f83f1f2e5df10a7ef@sentry.io/251669'\n config.curren...
ruby
chosen
[ { "from": "system", "value": "Add missing end on if else clause\n" }, { "from": "human", "value": "module TracksHelper\n\n def event_data_for(key)\n session[:event][key.to_sym] || session[:event][key.to_s]\n end\n\n def gender(user)\n if user.gender.present?\n I18n.t(\"tracking.use...
ruby
chosen
[ { "from": "system", "value": "Update user info from social network on login\n" }, { "from": "human", "value": "class Authentication < ActiveRecord::Base\n\n serialize :auth\n\n belongs_to :user\n\n validates :provider, :uid, presence: true\n validates :uid, uniqueness: { scope: :provider...
ruby
chosen
[ { "from": "system", "value": "Fix on case when null was returned\n" }, { "from": "human", "value": "class MessageParser\n def initialize(text, trigger_word)\n self.text = text\n self.trigger_word = trigger_word\n end\n\n def recipient_name\n beginning = trigger_word.size\n remaini...
ruby
chosen
[ { "from": "system", "value": "Remove contact name/title, and add affiliation string to Person\n" }, { "from": "human", "value": "require \"edition\"\nrequire 'attachable'\n\nclass PersonEdition < Edition\n include Attachable\n\n # type (Staff / Trainer / Member / Start-up / Artist): applied b...
ruby
chosen
[ { "from": "system", "value": "Add paper trail to responsibilities.\n" }, { "from": "human", "value": "class Responsibility < ActiveRecord::Base\n belongs_to :problem\n belongs_to :organization, :polymorphic => true\n validates_presence_of :organization_id, :message => I18n.translate('problems...
ruby
chosen