conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update podspec to suppress ARC in generated source files using the current CocoaPods syntax\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Slash\"\n s.version = \"0.1.3\"\n s.summary = \"A simple, extensible, language for s...
ruby
chosen
[ { "from": "human", "value": "Test parsing dodgy HTML attributes\n" }, { "from": "gpt", "value": "# encoding: UTF-8\nrequire File.dirname(__FILE__) + '/helper'\n\n# Random tests for specific issues.\n#\n# The test suite will be cleaned up at some point soon.\nclass TestMisc < Test::Unit::TestCase...
ruby
chosen
[ { "from": "system", "value": "Switch to a different subject post, add tests for previous and next posts and the inspect method, switch to the simpler write method.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(__dir__)\n\nrequire 'helper'\n\ndescribe 'Pos...
ruby
chosen
[ { "from": "system", "value": "Handle databases specified by URL.\n" }, { "from": "human", "value": "class Combustion::Database::Reset\n UnsupportedDatabase = Class.new StandardError\n\n def self.call\n new.call\n end\n\n def initialize\n ActiveRecord::Base.configurations = YAML.load(\n...
ruby
chosen
[ { "from": "system", "value": "Add deprecation warning to @repeat_arguments hook\n" }, { "from": "human", "value": "After do\n remove_doubles if doubled?\nend\n\nBefore('@repeat_arguments') do\n @repeat_arguments = true\nend\n" }, { "from": "gpt", "value": "After do\n remove_double...
ruby
chosen
[ { "from": "system", "value": "Fix missing space in results.\n" }, { "from": "human", "value": "module Checky\n def self.register(klass)\n (class << self; self; end).instance_eval do\n define_method klass.dsl_method do |*args|\n checks << klass.new(*args)\n end\n end\n en...
ruby
chosen
[ { "from": "system", "value": "Add yardoc and remove unnecessary ['abc'].\n" }, { "from": "human", "value": "module Guard\n class RSpectacle\n\n class Humanity\n\n def success\n pick [\n 'How cool, all works!',\n 'Awesome, all passing!',\n 'Well done, ma...
ruby
chosen
[ { "from": "system", "value": "Use status value to get http status in symbol\n" }, { "from": "human", "value": "module Rambulance\n class ExceptionsApp < ActionController::Base\n def self.call(env)\n action(:render_error).call(env)\n end\n\n def render_error\n @_status ...
ruby
chosen
[ { "from": "system", "value": "Include the block if one is given\n" }, { "from": "human", "value": "require 'redis'\n\n# Instrument Redis time\nclass Redis::Client\n class << self\n attr_accessor :query_time, :query_count\n end\n self.query_count = 0\n self.query_time = 0\n\n def call_wit...
ruby
chosen
[ { "from": "system", "value": "Truncate tables for full load.\n" }, { "from": "human", "value": "namespace :import do\n namespace :full do\n task :run, [:force] => :environment do |t, args|\n if Date.today.day == 1 || args[:force]\n load_event = ClinicalTrials::LoadEvent.create(\n...
ruby
chosen
[ { "from": "system", "value": "Move builder.build! into before(:all) block for PDf\n\n[#52758883]\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Polytexnic::Builders::Pdf do\n before(:all) { generate_book }\n after(:all) { remove_book }\n\n describe \"#build!\" do\n s...
ruby
chosen
[ { "from": "system", "value": "Fix typos in this old file\n" }, { "from": "human", "value": "namespace :development do\n desc 'Load sample usage data for 3 schools'\n\n desc 'Load banes-default-calendar'\n task load_banes_default_calendar: [:environment] do\n england = CalendarArea.where(ti...
ruby
chosen
[ { "from": "system", "value": "Add additional test for truncation/deparsing.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe PgQuery, '#truncate' do\n it 'omits target list' do\n query = 'SELECT a, b, c, d, e, f FROM xyz WHERE a = b'\n expect(described_class.parse(quer...
ruby
chosen
[ { "from": "system", "value": "Test for font getting built.\n" }, { "from": "human", "value": "describe \"Font Attribute\" do\n\n before do\n @builder = MotionMastr::Builder.new\n end\n\n it \"should return nil if given nil\" do\n @builder.font_attribute(nil).should == nil\n end\n\n it...
ruby
chosen
[ { "from": "system", "value": "Use a sub-class of Rails::Application for 1.8.7.\n" }, { "from": "human", "value": "require 'proffer'\n\nrequire 'action_controller/railtie'\nrequire 'rails/test_unit/railtie'\n\nClass.new(Rails::Application) do\n config.active_support.deprecation = :stderr\nend.in...
ruby
chosen
[ { "from": "human", "value": "Add test around send_in_background and timeouts\n\nUnfortunately this just triggers a timeout, doesn't actually confirm it\nwill time out. But confirms that the behaviour when a time out _does_\nhappen is correct\n" }, { "from": "gpt", "value": "require_relative '../...
ruby
chosen
[ { "from": "system", "value": "Fix general case of to_json for model objects.\n" }, { "from": "human", "value": "module Bra\n module Models\n # Internal: An object in the BRA model.\n class ModelObject\n # Public: Allows read access to the object's name.\n attr_reader :name\n\n ...
ruby
chosen
[ { "from": "system", "value": "Mark the release of 0.8.3 [ci skip]\n" }, { "from": "human", "value": "module ActiveAttr\n # Complete version string\n # @since 0.1.0\n VERSION = \"0.8.2\"\nend\n" }, { "from": "gpt", "value": "module ActiveAttr\n # Complete version string\n # @sinc...
ruby
chosen
[ { "from": "system", "value": "Add stub_authorization to admin/shipping_methods controller spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::Admin::ShippingMethodsController do\n \n # Regression test for #1240\n it \"should not hard-delete shipping methods\" do\n...
ruby
chosen
[ { "from": "system", "value": "Add a friendly inspect output\n" }, { "from": "human", "value": "module BorderPatrol\n class Point < Struct.new(:x, :y)\n alias :latitude :y\n alias :latitude= :y=\n alias :lat :y\n alias :lat= :y=\n\n alias :longitude :x\n alias ...
ruby
chosen
[ { "from": "system", "value": "Rename `smell_location` method to `smell_locations`\n" }, { "from": "human", "value": "require \"rubycritic/smell\"\n\nmodule Rubycritic\n module SmellAdapter\n\n class Flog\n HIGH_COMPLEXITY_SCORE_THRESHOLD = 25\n VERY_HIGH_COMPLEXITY_SCORE_THRESHOLD ...
ruby
chosen
[ { "from": "system", "value": "Handle facebook channel update asynchronously\n" }, { "from": "human", "value": "class FacebookPageChannel < Channel\n def service_id_name\n 'Page name'\n end\n\n def icon\n 'facebook'\n end\n\n def posts\n client.get_object(\"#{service_identifier}/pos...
ruby
chosen
[ { "from": "system", "value": "Update Redis documentation (up to 3.2.4)\n" }, { "from": "human", "value": "module Docs\n class Redis < UrlScraper\n self.type = 'redis'\n self.release = 'up to 3.2.2'\n self.base_url = 'http://redis.io/commands'\n self.links = {\n home: 'http://re...
ruby
chosen
[ { "from": "system", "value": "Allow everyone to read shared documents\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initialize(user)\n if user\n # Document\n can [:read, :open], Document.shared\n can [:index, :list, :create, :new, :a...
ruby
chosen
[ { "from": "system", "value": "Allow admit to manage everything" }, { "from": "human", "value": "# CanCan Abilities\n#\n# See the wiki for details:\n# https://github.com/ryanb/cancan/wiki/Defining-Abilities\n\nclass Ability\n include CanCan::Ability\n\n def initialize(user = User.new)\n can ...
ruby
chosen
[ { "from": "system", "value": "Add validations to Comment class\n" }, { "from": "human", "value": "class Comment < ActiveRecord::Base\n belongs_to :user\n belongs_to :commentable, polymorphic: true\n has_many :votes, as: :votable\nend\n" }, { "from": "gpt", "value": "class Comment ...
ruby
chosen
[ { "from": "system", "value": "Add appraisal gem as a development dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'sql_tagger'\n s.version = IO.read('VERSION').chomp\n s.authors = ['Toby Hsieh']\n s.homepage = 'https://github.com/SlideShareInc/sql_tagger...
ruby
chosen
[ { "from": "system", "value": "Enforce Hem's spec constraints on hem in gem mode\n\nThis is so that it requiring it's dependencies respects its own constraints on them\n" }, { "from": "human", "value": "if defined?(Bundler)\n Bundler.with_clean_env do\n exec [$PROGRAM_NAME,$PROGRAM_NAME], *AR...
ruby
chosen
[ { "from": "system", "value": "Implement create and update on organization users controller\n" }, { "from": "human", "value": "# coding: utf-8\nclass Admin::UsersController < ApplicationController\n ssl_required :oauth, :api_key, :regenerate_api_key\n before_filter :login_required\n before_fil...
ruby
chosen
[ { "from": "system", "value": "Use correct layout for Devise in publify_core\n" }, { "from": "human", "value": "module PublifyCore\n class Engine < ::Rails::Engine\n config.generators do |generators|\n generators.test_framework :rspec, fixture: false\n generators.fixture_replacement...
ruby
chosen
[ { "from": "system", "value": "Set website locale from Accept-Language header\n\nThis is a good option because the header is usually set by the user's\nbrowser language preferences.\n\nCode from http://guides.rubyonrails.org/i18n.html\n" }, { "from": "human", "value": "class ApplicationController...
ruby
chosen
[ { "from": "system", "value": "Add low level socket timeout for reads and writes.\n" }, { "from": "human", "value": "require 'socket'\nrequire 'digest/md5'\n\nclass Stash::Cluster\n\n @@connections = {}\n\n attr_reader :hosts\n\n def initialize(hosts)\n @hosts = hosts.map {|x|\n host, ...
ruby
chosen
[ { "from": "system", "value": "Enable basic authentication to be configured" }, { "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_forgery wi...
ruby
chosen
[ { "from": "system", "value": "ApplicationController: Replace negative logic with unless.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n include SessionsHelper\n\n def login_required\n redirect_to root_path i...
ruby
chosen
[ { "from": "system", "value": "Use rebase to bring in changes from the remote repository to avoid merge-commit-messages in your Redmine changesets\n" }, { "from": "human", "value": "require 'json'\n\nclass GithubHookController < ApplicationController\n\n def index\n payload = JSON.parse(param...
ruby
chosen
[ { "from": "system", "value": "Reduce gem package size by ignoring `__tests__` directory\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"ts_assets/version\"\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Fix view helper rubocop violations\n" }, { "from": "human", "value": "# view helpers for travel automation features\n# i.e. google map API\n#\nmodule CaseWorkers::TravelHelper\n def link_to_map(body, options = {})\n origin = options.delete(:origin)\n destinat...
ruby
chosen
[ { "from": "system", "value": "Switch to evaluate(), so we can use instance variables.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'erubis'\nrequire 'site'\n\nmodule UsesThis\n module Renderable\n def render(params = {}, body = '')\n params['site'] ||= Site.instance\...
ruby
chosen
[ { "from": "system", "value": "Remove promisekit version dependency while PK is in flux with versioning\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Segundo\"\n s.version = \"0.1.0\"\n s.summary = \"Get a leg up building iOS apps\"\n s.hom...
ruby
chosen
[ { "from": "system", "value": "Fix bug in the is_party_to method.\n\nThis method would have thrown an error if the request had no neighbors.\nThis (mis)behavior has been fixed.\n" }, { "from": "human", "value": "class Request < ActiveRecord::Base\n before_create :defaultly_unfulfilled\n\n has_m...
ruby
chosen
[ { "from": "system", "value": "Remove :each in dashboard specs as it's default value\n" }, { "from": "human", "value": "describe ReportController do\n context \"::Dashboards\" do\n before :each do\n login_as user\n @db = FactoryGirl.create(:miq_widget_set,\n ...
ruby
chosen
[ { "from": "system", "value": "Remove attribute for Test1 as its nolonger required with the latest application_wlp code\n" }, { "from": "human", "value": "# Cookbook Name:: wlp-samples\n# Attributes:: default\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u...
ruby
chosen
[ { "from": "system", "value": "Send support emails to onboarding instead of Jenna\n" }, { "from": "human", "value": "default['et_upload']['api_url'] = 'https://api.evertrue.com'\ndefault['et_upload']['support_email'] = 'jenna@evertrue.com'\n" }, { "from": "gpt", "value": "default['et_...
ruby
chosen
[ { "from": "system", "value": "Update FreeTDS v0.99 current version.\n" }, { "from": "human", "value": "\nICONV_VERSION = ENV['TINYTDS_ICONV_VERSION'] || \"1.14\"\nICONV_SOURCE_URI = \"http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz\"\n\nOPENSSL_VERSION = ENV['TINYTDS_OPENSSL...
ruby
chosen
[ { "from": "system", "value": "Fix adding AssociationLength to autoload\n" }, { "from": "human", "value": "[:email, :association_length, :inn, :money, :slug, :url].each do |name|\n autoload :\"#{name.classify}Validator\", \"#{name}_validator\"\nend\n\nrequire 'active_model' # why i need do it?\n...
ruby
chosen
[ { "from": "system", "value": "Add rake as a dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lunartic/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "human", "value": "Add a controller test for displaying the lookup\n\nCo-authored-by: Leena Gupte <95ff60c7d7e33c5bbd817e4643a0ea35251cc1c8@digital.cabinet-office.gov.uk>\n" }, { "from": "gpt", "value": "require \"test_helper\"\n\ndescribe CoronavirusLocalRestrictionsController do\n d...
ruby
chosen
[ { "from": "system", "value": "Change gemspec for new version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'matchete'\n s.version = '0.0.1'\n s.platform = Gem::Platform::RU...
ruby
chosen
[ { "from": "system", "value": "Make page numbers rounded and awesome.\n" }, { "from": "human", "value": "\n# vim: et\n\nrequire_relative 'backprint'\n\nmodule Io::Creat::Slipstick::Backprints\n\n class PageNoBackprint < Backprint\n\n public\n def sett ( text ) @text = text end\n\n publi...
ruby
chosen
[ { "from": "system", "value": "Deploy with the new origin\n" }, { "from": "human", "value": "# Activate and configure extensions\n# https://middlemanapp.com/advanced/configuration/#configuring-extensions\n\nactivate :autoprefixer do |prefix|\n prefix.browsers = \"last 2 versions\"\nend\n\n# Layo...
ruby
chosen
[ { "from": "system", "value": "Add serving of assets and index\n" }, { "from": "human", "value": "run Rack::Directory.new('.')" }, { "from": "gpt", "value": "require 'sprockets'\nenvironment = Sprockets::Environment.new\nenvironment.append_path('javascripts')\nenvironment.append_path(...
ruby
chosen
[ { "from": "system", "value": "Update Tinkey URL and SHA-256 hash for Tink 1.7.0.\n\nPiperOrigin-RevId: 467283778\n" }, { "from": "human", "value": "# A Homebrew formula for Tinkey on Linux and macOS.\n# Usage:\n# brew tap google/tink https://github.com/google/tink\n# brew install tinkey\n\nclass...
ruby
chosen
[ { "from": "system", "value": "Fix to the spec -- no longer expect gcc-c++\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe_recipe \"ark::default\" do\n\n def node_attributes\n { :platform => \"centos\", :version => \"5.10\" }\n end\n\n let(:expected_packages) do\n ...
ruby
chosen
[ { "from": "human", "value": "Add metrics plugin for kegbot\n" }, { "from": "gpt", "value": "#! /usr/bin/env ruby\n#\n# kegbot-metrics\n#\n# DESCRIPTION:\n# Output kegerator metrics from Kegbot\n#\n# OUTPUT:\n# metric-data\n#\n# PLATFORMS:\n# Linux\n#\n# DEPENDENCIES:\n# gem: sensu-plugin...
ruby
chosen
[ { "from": "system", "value": "Add header to user model test\n" }, { "from": "human", "value": "# Encoding: utf-8\nrequire 'test_helper'\n\nclass UserTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "# Encoding:...
ruby
chosen
[ { "from": "system", "value": "Update Firefox CN to version 42.0\n" }, { "from": "human", "value": "cask :v1 => 'firefox-cn' do\n version '41.0.2'\n sha256 '0d763d1d7841396a5c3e8d29d7ec8b387e7a8f942b32002d427e236ab8d9e676'\n\n url \"https://download.mozilla.org/?product=firefox-#{version}-SSL&...
ruby
chosen
[ { "from": "system", "value": "Upgrade Opera Beta.app to 28.0.1750.36\n" }, { "from": "human", "value": "cask :v1 => 'opera-beta' do\n version '27.0.1689.44'\n sha256 'a07580830e9b772ef6644d34c84b260fb17ea592f50b6d4a36fa3ffa6bdc4b0b'\n\n url \"http://get.geo.opera.com/pub/opera-beta/#{version}...
ruby
chosen
[ { "from": "system", "value": "Use the pdns/authoritative attribute namespace" }, { "from": "human", "value": "#\n# Cookbook Name:: pdns\n# Recipe:: server\n#\n# Copyright 2010, Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exce...
ruby
chosen
[ { "from": "system", "value": "Change from reduce to inject for ruby 1.8.5 compat\n" }, { "from": "human", "value": "module Puppet::Util::Puppetdb\n class Blacklist\n\n BlacklistedEvent = Struct.new(:resource_type, :resource_title, :status, :property)\n\n # Initialize our blacklist of even...
ruby
chosen
[ { "from": "system", "value": "Add a License to gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'colossus/version'\n\nGem::Specification.new do |s|\n s.name = \"colossus\"\n s.version = Colossus::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Create inbox,outbox, and trashcan routes.\n" }, { "from": "human", "value": "class MailConversationsController < ApplicationController\n\n def index\n @mailbox_conversations = current_user.mailbox.conversations\n end\n\n def new\n @recipients = Guide.where....
ruby
chosen
[ { "from": "system", "value": "Make rugged dependency more strict.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"rugged_adapter/version\"\n\nGem::Specification.new do |s|\n s.name = \"gollum-rugged_adapter\"\n s.ve...
ruby
chosen
[ { "from": "system", "value": "Bump gem version to 0.0.7\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \"popularity_contest\"\n sp...
ruby
chosen
[ { "from": "system", "value": "Set required version of SimpleCov\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bashcov/version'\n\nGem::Specification.new do |gem|\n gem.n...
ruby
chosen
[ { "from": "system", "value": "KeePassX: Add name and update URL & homepage" }, { "from": "human", "value": "cask :v1 => 'keepassx0' do\n version '0.4.3'\n sha256 '15ce2e950ab78ccb6956de985c1fcbf11d27df6a58ab7bf19e106f0a1dc2fedd'\n\n url \"http://downloads.sourceforge.net/keepassx/KeePassX-#{v...
ruby
chosen
[ { "from": "system", "value": "Fix test for jruby support\n" }, { "from": "human", "value": "require File.expand_path('../test_helper', __FILE__)\n\nclass IgnoreTest < UnitTest\n class App < UnitTest::App\n register Sinatra::AssetPack\n\n assets do\n js :main, '/main.js', %w[/js/*.js]...
ruby
chosen
[ { "from": "system", "value": "Change homepage to https instead of http\n" }, { "from": "human", "value": "Pod::Spec.new do |f|\n\n f.name = 'Fingertips'\n f.version = '0.3.0'\n\n f.summary = 'Touch indicators on external displays for iOS applications.'\n f.description = 'A UIWindow su...
ruby
chosen
[ { "from": "system", "value": "Tweak to make root route work in presence of a prefix path.\n" }, { "from": "human", "value": "RepertoireFacetingExample::Application.routes.draw do\n\n path_prefix = RepertoireFacetingExample::Application.config.repertoire_assets.path_prefix\n\n scope \"(/#{path_...
ruby
chosen
[ { "from": "system", "value": "Add category paths to routing\n" }, { "from": "human", "value": "ActionController::Routing::Routes.draw do |map|\n map.connect 'everything/graph',:controller=>'account',:action=>'graph',:account=>'everything'\n map.connect 'everything/report',:controller=>'account...
ruby
chosen
[ { "from": "system", "value": "Change incorrect route mapper from 'destroy' to 'delete.'\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n # root to #index action of global controller\n root 'welcome#index'\n\n # login (sessions) routes with named helpers\n get '/login' =>...
ruby
chosen
[ { "from": "system", "value": "Test reporter must be added before, to correctly send test coverage\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire \"rails/test_help\"\nrequire \"shoulda-context\"\...
ruby
chosen
[ { "from": "system", "value": "Add minimum ruby version in gemspec\n" }, { "from": "human", "value": "require File.expand_path('../lib/paperclip/deflater/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = \"paperclip-deflater\"\n gem.version = Paperclip::Deflater::VE...
ruby
chosen
[ { "from": "system", "value": "Validate presence of choices unless ending.\n" }, { "from": "human", "value": "class Situation < ActiveRecord::Base\n validates :title, presence: true\n validates :sit_rep, presence: true\nend\n" }, { "from": "gpt", "value": "# class ChoicesSetUnlessEn...
ruby
chosen
[ { "from": "system", "value": "Refactor creation of property by using first_or_create instead of condition based creation\n" }, { "from": "human", "value": "module Spree\n class ProductProperty < Spree::Base\n acts_as_list scope: :product\n\n belongs_to :product, touch: true, class_name: '...
ruby
chosen
[ { "from": "system", "value": "Fix checksum in Google Japanese IME Dev build\n" }, { "from": "human", "value": "cask :v1 => 'google-japanese-ime-dev' do\n version 'dev'\n sha256 'd3f786d3462e0294f29bc1f8998163489f812a1ae650661e9a26a92b731c2ef8'\n\n url 'https://dl.google.com/japanese-ime/dev/G...
ruby
chosen
[ { "from": "system", "value": "Set rake version to lower than 11.0\n\nThis is due to incompatibility of a newer rack with rspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pgbundl...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for clean_cocoapods_cache action.\n" }, { "from": "gpt", "value": "describe Fastlane do\n describe Fastlane::FastFile do\n describe \"Clean Cocoapods Cache Integration\" do\n it \"default use case\" do\n result = Fastlane::FastFile.new....
ruby
chosen
[ { "from": "human", "value": "Create the test when receive an override parameter\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'pry'\n\nmodule CorreiosSigep\n module Builders\n module XML\n describe Request do\n describe '.build_xml' do\n let(:request) {...
ruby
chosen
[ { "from": "system", "value": "Remove variable time in tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe SpecialistDocumentsHelper do\n describe '#nice_date_format' do\n\n before :all do\n @time = Time.now.getutc.to_s\n end\n\n it 'should return a string wi...
ruby
chosen
[ { "from": "system", "value": "Use data_sources instead of tables\n\nFixes deprecation warning\n" }, { "from": "human", "value": "if ENV[\"TRAVIS\"] && RUBY_VERSION.match(\"2.1.\")\n require \"coveralls\"\n Coveralls.wear!\nend\n\nrequire \"minitest/autorun\"\nrequire \"mocha/mini_test\"\nrequi...
ruby
chosen
[ { "from": "system", "value": "Set feed status to green when parsing feeds returns 304\n" }, { "from": "human", "value": "require \"feedzirra\"\n\nrequire_relative \"../repositories/story_repository\"\nrequire_relative \"../repositories/feed_repository\"\nrequire_relative \"../commands/feeds/find...
ruby
chosen
[ { "from": "system", "value": "Remove .get, .put, .post methods in favour of .make." }, { "from": "human", "value": "module Troo\n module API\n class Request\n class << self\n def get(urn, query = {})\n new(:get, urn, query).response\n end\n\n def post(urn, ...
ruby
chosen
[ { "from": "human", "value": "Add unit test for previous commit\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\nrequire \"spec_helper\"\nrequire \"bundler/installer/gem_installer\"\n\nRSpec.describe Bundler::GemInstaller do\n let(:installer) { instance_double(\"Installer\") }\n ...
ruby
chosen
[ { "from": "system", "value": "Add single_quad definition for ansible tower jobs\n" }, { "from": "human", "value": "module ManageIQ::Providers::AnsibleTower\n class AutomationManager::JobDecorator < MiqDecorator\n def self.fonticon\n 'ff ff-stack'\n end\n end\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Update tests with new location header\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'bundler/setup'\nrequire 'date'\nrequire 'mechanize'\n\ndomain = ARGV[0]\n\nputs \">> Checking #{domain} at #{Time.now}\"\n\nmech = Mechanize.new\n\nif ENV['AUTH_...
ruby
chosen
[ { "from": "human", "value": "Add migration to fix Highway Code change note data\n\nThis is the first part of the fix for the problem described in issue\n #861.\n\nThere are unexpected updates listed for The Highway\nCode[1] against 1 March 2017.\n\nWe expect to see \"Annex 5 Penalties\" with a single change...
ruby
chosen
[ { "from": "system", "value": "Add to so that require'ing spec_helper works\n" }, { "from": "human", "value": "require \"spec_helper\"\n\n$:.unshift File.dirname(__FILE__) + \"/../ext/balance_tags_c\"\nrequire \"balance_tags_c.so\"\n\ndescribe \"BalanceTagsCExtension\" do\n describe \"text with...
ruby
chosen
[ { "from": "system", "value": "Use connection validation for pooled connections\n\nThis will address issues seen in production with RDS\nclosing connections to the database after a time (reasonably) and the\nlocal application not correctly restoring them before use.\n" }, { "from": "human", "valu...
ruby
chosen
[ { "from": "system", "value": "Enable iframe support on Heroku rails\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundl...
ruby
chosen
[ { "from": "system", "value": "Fix the Travis failures in rspec\n" }, { "from": "human", "value": "RSpec.configure do |config|\n config.before(:suite) do\n DatabaseCleaner.clean_with(:truncation)\n Rails.application.load_seed\n end\n\n config.before(:each) do |example|\n DatabaseClean...
ruby
chosen
[ { "from": "system", "value": "Use test storage for Zoo models\n" }, { "from": "human", "value": "module Zoo\n @description = \"\"\n @version = 0.1\n @path = File.dirname(__FILE__)\n include Spider::App\n \n def self.test_setup\n Spider::Model.sync_schema(self, true)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove Nokogiri usage from validated response\n" }, { "from": "human", "value": "require 'json'\nrequire 'xmlsimple'\n\nmodule Cb\n module ResponseValidator\n\n def self.validate(response)\n if response.blank? || response.response.body.blank?\n retur...
ruby
chosen
[ { "from": "system", "value": "Simplify hash-building code using reduce\n" }, { "from": "human", "value": "require 'requests'\n\nmodule USaidWat\n module Service\n class RedditService\n def user(username)\n data = {}\n %w{about comments submitted}.each do |page|\n ...
ruby
chosen
[ { "from": "system", "value": "Comment out pry, for now...\n" }, { "from": "human", "value": "require 'pry'\n\nclass Spot\n attr_reader :possible\n\n def initialize(value = nil)\n @possible = value.to_i.zero? ? (\"1\"..\"9\").to_a : [value]\n @value = value\n end\n\n def value(value)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error in AD disabled user filter\n" }, { "from": "human", "value": "module Gitlab\n module LDAP\n class Person\n AD_USER_DISABLED = Net::LDAP::Filter.ex(\"userAccountControl:1.2.840.113556.1.4.803\", 2)\n\n def self.find_by_uid(uid, adapter=...
ruby
chosen
[ { "from": "system", "value": "Remove \\n and \\t only instead of all whitespace characters\n" }, { "from": "human", "value": "module Hiraoyogi\n class Database\n def initialize(analyzer)\n @indices = {}\n @analyzer = analyzer\n end\n\n def index(url, doc)\n @indices[url]...
ruby
chosen
[ { "from": "system", "value": "Make migration add_search_to_service_version a bit more resilient\n\nOn production the extension might have been pre-installed, so we only install it\nif it doesn't exist\n" }, { "from": "human", "value": "class AddSearchToServiceVersion < ActiveRecord::Migration[5....
ruby
chosen
[ { "from": "system", "value": "Fix screenshot path using return value of `save_screenshot`\n\nSince this commit (https://github.com/jnicklas/capybara/commit/75084c59),\n`Capybara::Session#save_screenshot` depends on `Capybara.save_path` when\nfilename is a relative path.\n\nBefore:\n`Pathname(Dir.pwd).join(f...
ruby
chosen
[ { "from": "system", "value": "Replace array subclass with forwardable for just the methods we want\n" }, { "from": "human", "value": "#TODO: Array gives us too much extract specific behaviour required\nmodule Pairwise\n class TestPair < Array\n attr_reader :p1_position\n attr_reader :p2_p...
ruby
chosen
[ { "from": "system", "value": "Include rake tasks automatically in Rails\n" }, { "from": "human", "value": "module Prospector\n class Railtie < Rails::Railtie\n config.after_initialize do\n Background.enqueue unless Object.const_defined?('Rake')\n end\n end\nend\n" }, { "from...
ruby
chosen