conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update bundler and rake version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'uidable/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update the URL for fetching Sidekick since they moved to Amazon S3\n" }, { "from": "human", "value": "class Sidekick < Cask\n version :latest\n sha256 :no_check\n\n url 'http://oomphalot.com/sidekick/release/Sidekick.zip'\n appcast 'http://updates.oomphalot.com/...
ruby
chosen
[ { "from": "system", "value": "Fix yet another hardcoded spec\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Henson::Source::GitHub do\n subject(:it) { described_class.new(\"foo\", \">= 0\", \"bar/puppet-foo\") }\n\n it \"can be instantiated\" do\n expect(it).to_not b...
ruby
chosen
[ { "from": "human", "value": "Add macros for devise spec testing\n" }, { "from": "gpt", "value": "module ControllerMacros\n def login_admin\n before(:each) do\n @request.env[\"devise.mapping\"] = Devise.mappings[:user]\n sign_in Factory.create(:administrator)\n end\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Make default test class data index-friendly\n" }, { "from": "human", "value": "class Book\n attr_accessor :title, :authors\n def initialize title=\"Foo Bar\", authors=[]\n @title = title\n @authors = authors\n end\nend\n" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Support remote server operation in Provision::DockerImage\n" }, { "from": "human", "value": "module Conjure\n module Provision\n class DockerImage\n attr_reader :image_name\n\n def initialize(base_image_name)\n @image_name = base_image_name\n ...
ruby
chosen
[ { "from": "system", "value": "Split `git_commit_am` and create `git_commit`\n" }, { "from": "human", "value": "module TTNT\n module GitHelper\n module_function\n\n def git_commit_am(message)\n index = @repo.index\n options = {}\n\n index.read_tree(@repo.head.target.tree) ...
ruby
chosen
[ { "from": "human", "value": "Add spec to ensure error messages are showing\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe \"medicaid/contact_social_security/edit.html.erb\" do\n before do\n controller.singleton_class.class_eval do\n def current_path\n \"/st...
ruby
chosen
[ { "from": "human", "value": "Add migration to set sale/purchase reference_number on entry if nil.\n" }, { "from": "gpt", "value": "class AddMissingReferenceNumberOnEntries < ActiveRecord::Migration\n def change\n reversible do |dir|\n dir.up do\n # update null entry reference_num...
ruby
chosen
[ { "from": "system", "value": "Add back shell out version detection\n" }, { "from": "human", "value": "module VarnishCookbook\n # Helper methods to be used in multiple Varnish cookbook libraries.\n module Helpers\n\n def percent_of_total_mem(percent)\n \"#{(node['memory']['total'][0..-3...
ruby
chosen
[ { "from": "system", "value": "Put back the gettext fuzzy/obsolete warnings\n\nBe careful: turns out that the :ignore_fuzzy flag changes the behaviour of gettext. The warnings dont show up, but the fuzzy strings get used, and theyre most often wrong!\n" }, { "from": "human", "value": "FastGettext...
ruby
chosen
[ { "from": "system", "value": "Fix uninstall script formatting in log replayer\n" }, { "from": "human", "value": "#\n# Cookbook Name:: wt_streaminglogreplayer\n# Recipe:: undeploy\n#\n# Copyright 2012, Webtrends\n#\n# All rights reserved - Do Not Redistribute\n#\n\nlog_dir = \"#{node['wt_com...
ruby
chosen
[ { "from": "system", "value": "Use a guard clause instead of wrapping the code inside a conditional expression\n" }, { "from": "human", "value": "class SearchResultsController < ApplicationController\n decorates_assigned :search_results, with: SearchResultCollectionDecorator\n\n def index\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a documentation typo and add missing documentation" }, { "from": "human", "value": "framework 'Security'\n\n# Classes, modules, methods, and constants relevant to working with the\n# Mac OS X keychain.\nmodule Keychain\n\n# Represents an entry in keychain.\nclas...
ruby
chosen
[ { "from": "system", "value": "Use Windows CRLF line endings when rendering RTF letters\n\nPreviously we were using the native default == Linux == LF\nin Pandoc which was causing problems at Batrs with the RTFs\nthey send to GPs.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\...
ruby
chosen
[ { "from": "system", "value": "Add missing @return yard tag" }, { "from": "human", "value": "module DataMapper\n class Finalizer\n\n # Object aggregating all dependent relationships for the given model\n #\n # @api private\n class DependentRelationshipSet\n include Enumerable\n\...
ruby
chosen
[ { "from": "system", "value": "Add manual exception notification in log_error\n" }, { "from": "human", "value": "# ===GLSAMaker v2\n# Copyright (C) 2009-2011 Alex Legler <a3li@gentoo.org>\n# Copyright (C) 2009 Pierre-Yves Rofes <py@gentoo.org>\n#\n# This program is free software: you can redist...
ruby
chosen
[ { "from": "system", "value": "Fix usage of BasicAuth.logged_in? method\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n protected\n\n def admin?\n BasicAuth.admin?(request)\n end\nend\n" }, { "from"...
ruby
chosen
[ { "from": "system", "value": "Use json-api adapter for error render\n" }, { "from": "human", "value": "class ApplicationController < ActionController::API\n include DeviseTokenAuth::Concerns::SetUserByToken\n\n rescue_from ActiveRecord::RecordNotFound, with: :not_found\n\n protected\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Disable sanitizing for post bodies\n" }, { "from": "human", "value": "module ChannelsHelper\n \n def format_body(post)\n text = simple_format(post.body)\n if text.length < 64000\n text = auto_link(text)\n end\n text\n end\n \n def user_link(use...
ruby
chosen
[ { "from": "system", "value": "Add dependency 'jquery-rails' for Jquery\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/china_region_fu/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Xuhao\"]\n gem.email = [...
ruby
chosen
[ { "from": "system", "value": "Add comments within the SessionsHelper to explain the methods there\n" }, { "from": "human", "value": "module SessionsHelper\n\n def log_in(user)\n session[:user_id] = user.id\n end\n\n def current_user\n @current_user ||= User.find_by(id: session[:user_id]...
ruby
chosen
[ { "from": "system", "value": "Fix broken link in timeline helper\n" }, { "from": "human", "value": "module TimelineHelper\n def timeline_content(event)\n method = \"#{event.class.name.demodulize.underscore}_timeline_content\"\n self.send(method, event) if self.respond_to? method\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Allow wp posts to call 'update_post' without saving the model\n" }, { "from": "human", "value": "module WpPost\n extend ActiveSupport::Concern\n\n included do\n serialize :acf_fields\n end\n\n # TODO (cies): rename to update_wp_post_attributes\n def update_p...
ruby
chosen
[ { "from": "system", "value": "Use a shared example within a shared example. OMG!\n" }, { "from": "human", "value": "RSpec.shared_examples 'redirects for non-users' do\n # OPTIMIZE test actions other than 'index'\n\n context 'as an admin' do\n skip\n end\n\n context 'as a guest' do\n it...
ruby
chosen
[ { "from": "system", "value": "Remove unecessary label values in favour of idLabel\n" }, { "from": "human", "value": "module Lita\n # Returns cards that are in the Confirmed column\n class NewCard\n\n def initialize(trello_client, list_id, id_labels)\n @trello_client = trello_client\n ...
ruby
chosen
[ { "from": "system", "value": "Install man pages in ~/.man\n" }, { "from": "human", "value": "require \"rbconfig\"\nrequire \"rdoc\"\nrequire \"rdoc/generator/mdoc\"\n\nmodule Rman\n class CLI\n def run\n store = RDoc::RI::Store.new(RDoc::RI::Paths.system_dir)\n store.load_all\n ...
ruby
chosen
[ { "from": "system", "value": "Quit the driver after runs." }, { "from": "human", "value": "require 'sauce_whisk'\n\nmodule Dressing\n module Runner\n class Base\n attr_reader :test\n\n def self.run(*args)\n new(*args).run\n end\n\n def initialize(test)\n @te...
ruby
chosen
[ { "from": "system", "value": "Use Range's `...` excluding the size.\n" }, { "from": "human", "value": "class Crypto\n attr_reader :plaintext\n def initialize(plaintext)\n @plaintext = plaintext\n end\n\n def normalize_plaintext\n @normalized ||= plaintext.downcase.gsub(/\\W/, '')\n en...
ruby
chosen
[ { "from": "system", "value": "Remove require 'rubygems' to be a good Ruby citizen." }, { "from": "human", "value": "require 'rubygems'\nrequire 'json'\nrequire 'cgi'\nrequire 'ym4r/google_maps/geocoding'\nrequire 'net/http'\ninclude Ym4r::GoogleMaps\n\nrequire \"#{File.dirname(__FILE__)}/sunligh...
ruby
chosen
[ { "from": "system", "value": "Add default value for config attribute.\n" }, { "from": "human", "value": "require \"lita\"\n\nmodule Lita\n module Handlers\n class Google < Handler\n URL = \"https://ajax.googleapis.com/ajax/services/search/web\"\n\n route(/^google\\s+(.+)/i, :search...
ruby
chosen
[ { "from": "system", "value": "Test contents of matcher file\n" }, { "from": "human", "value": "RSpec.describe Rambo::RSpec::MatcherFile do\n let(:matchers_path) {\n File.expand_path(\"spec/support/matchers/rambo_matchers.rb\")\n }\n\n before(:each) do\n FileUtils.mkdir_p(\"spec/support/...
ruby
chosen
[ { "from": "system", "value": "Make cache constants private in QueryModel\n" }, { "from": "human", "value": "module QML\n module Data\n # {QueryModel} provides a list model implementation with database backends like ActiveRecord.\n class QueryModel < ListModel\n\n Cache = Struct.new(:...
ruby
chosen
[ { "from": "human", "value": "Add rake task to inspect missing content_ids\n\n`rake data_hygiene:inspect_content_ids` will give you a list of\npublishing apps and the number of content items with / without\ncontent_id in the database. We'll use this to verify we're sending the\ncontent_id for all documents.\...
ruby
chosen
[ { "from": "system", "value": "Revert \"retry query on SocketError\"\n\nThis reverts commit fab9bb3bfc18d8a2aa5b6a0186616cb2f6f8394e.\n" }, { "from": "human", "value": "require 'umakadata/sparql_client'\r\nrequire 'umakadata/logging/sparql_log'\r\n\r\nmodule Umakadata\r\n\r\n module SparqlHelper...
ruby
chosen
[ { "from": "system", "value": "Use the right activesupport gem\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/vintner/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"JH. Chabran\"]\n gem.email = [\"jh@chabra...
ruby
chosen
[ { "from": "system", "value": "Apply to .js files as well\n" }, { "from": "human", "value": "require 'browserify_pipeline/transformer/base'\n\nmodule BrowserifyPipeline\n module Transformer\n class SixToFiveify < Base\n\n def initialize(command_line_options = '--extensions .browserify')\...
ruby
chosen
[ { "from": "system", "value": "Fix caching for super-long bundle URLs" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"stapler\"\n s.version = \"0.4.0\"\n s.date = Time.now.strftime('%Y-%m-%d')\n s.summary = \"Dynamic as...
ruby
chosen
[ { "from": "system", "value": "Add minitest 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 'stretch/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Add Webmock and VCR dependencies\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lyricfy/version'\n\nGem::Specification.new do |gem|\n gem.na...
ruby
chosen
[ { "from": "system", "value": "Upgrade to Rails 6 compatibility\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name = \"addresses\"\n s.authors = [\"Wilbert Ribe...
ruby
chosen
[ { "from": "system", "value": "Select only <script>'s with `src` attribute\n" }, { "from": "human", "value": "require 'nokogiri'\n\nmodule Emcee\n # ScriptProcessor scans a document for external script references and inlines\n # them into the current document.\n class ScriptProcessor\n def ...
ruby
chosen
[ { "from": "system", "value": "Fix identation and use %l in strftime\n" }, { "from": "human", "value": "class TimeService\n def initialize(calling_class)\n @gitter_bot = calling_class\n @active = false\n end\n\n def activate(active)\n # Start service, if it is not active, yet\n sta...
ruby
chosen
[ { "from": "system", "value": "Bump thor gem in gemspec to \"~> 1.0\"\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"./lib/gemdiff/version\"\n\nGem::Specification.new do |spec|\n spec.name = \"gemdiff\"\n spec.version = Gemdiff::VERSION\n spec.auth...
ruby
chosen
[ { "from": "human", "value": "Revert \"/dev/null is symbolic link on i386-solaris\"\n\nThis reverts commit 89c50a2583698b361d42584f37db7877992e1b02.\n" }, { "from": "gpt", "value": "require File.expand_path('../../../../spec_helper', __FILE__)\nrequire File.expand_path('../../../../shared/file/ze...
ruby
chosen
[ { "from": "human", "value": "Add partybus migration update db schema to 2.4.0\n\nThis adds org association and org user tables.\nIt also adds the OSC hash password types to the password_hash_type enum.\nThis is in support of upgrades from OSC.\n" }, { "from": "gpt", "value": "define_upgrade do\n...
ruby
chosen
[ { "from": "system", "value": "Refactor interview start time controller to use DefenceRequestConcern methods.\n" }, { "from": "human", "value": "class InterviewStartTimeDefenceRequestsController < BaseController\n skip_after_action :verify_authorized\n before_action :set_policy_with_context, :f...
ruby
chosen
[ { "from": "system", "value": "Set explicit methods for match route\n" }, { "from": "human", "value": "Books::Application.routes.draw do\n match \"auth/:provider/callback\" => \"sessions#create\"\n get \"auth/sign_out\" => \"sessions#sign_out\", :as => :sign_out\n\n resources :sessions, :only ...
ruby
chosen
[ { "from": "system", "value": "Add route to update main account\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n devise_for :admin_users, ActiveAdmin::Devise.config\n ActiveAdmin.routes(self)\n\n devise_for :users,\n path: \"\",\n path_names: {\n sign_in: 'login...
ruby
chosen
[ { "from": "system", "value": "Add ability to have custom path for categories\n" }, { "from": "human", "value": "Refinery::Core::Engine.routes.draw do\n\n # Frontend routes\n namespace :products, :path => Refinery::Products.shop_path do\n root to: \"products#index\", via: :get\n get '/cat...
ruby
chosen
[ { "from": "human", "value": "Add first slack bot: Toggl-Weekly\n\nToggl-Weekly os a slackbot running on blockspring. It let's me add a\nslackbot without a server and it's easily sharable so others can use it\ntoo which is awesome.\n\nWhat it does\nyou get your current weekly hourly report. So how many hours...
ruby
chosen
[ { "from": "system", "value": "Move class eval outside of loop\n" }, { "from": "human", "value": "class PopulateAlephIdFromUserAttributes < ActiveRecord::Migration\n def up\n say_with_time \"Migrating Aleph ID.\" do\n User.all.each do |user|\n User.class_eval { serialize :user_att...
ruby
chosen
[ { "from": "human", "value": "Add a `confidential` attribute to oauth applications\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass AddConfidentialToApplications < ActiveRecord::Migration[5.2]\n def change\n add_column(\n :oauth_applications,\n :confidential,\...
ruby
chosen
[ { "from": "system", "value": "Add small discriptions 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 'wak/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Mark permalink and position as protected attributes.\n" }, { "from": "human", "value": "=begin\n\n This model is used to test:\n\n - ActsAsList on resources_controller\n - Relate and unrelate for has_and_belongs_to_many.\n\n=end\n\nclass Category < ActiveReco...
ruby
chosen
[ { "from": "system", "value": "Update chef and fog dependency versions, now excludes chef 0.9.x.\n\nThis will keep the gem in line with other knife-* plugins using the fog\ngem. Upcoming changes will depend on API changes in the Chef gem\nstarting at 0.10.10.\n" }, { "from": "human", "value": "$:...
ruby
chosen
[ { "from": "system", "value": "Send back the version of the gem" }, { "from": "human", "value": "require 'net/https'\n\nmodule DeployTracking\n USE_SSL = true\n DEPLOY_TRACKING_HOST = 'deploytracking.heroku.com'\n DEPLOY_TRACKING_PATH = '/deploys'\n DEPLOY_TRACKING_PORT = 443\n\n def self.no...
ruby
chosen
[ { "from": "system", "value": "Remove `get current_example` method for RSpec 2.x\n" }, { "from": "human", "value": "require 'rspec'\n\nRSpec.configure do |config|\n config.before(:all) do\n Gnawrnip.ready!\n end\n\n # https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec.rb\n ...
ruby
chosen
[ { "from": "system", "value": "Handle more Gooru error possibilities.\n" }, { "from": "human", "value": "module Gooru\n class Response\n attr_reader :data\n\n def initialize(weary_response)\n @data = parse(weary_response.body)\n end\n\n def success?\n data.has_key?(\"error\...
ruby
chosen
[ { "from": "system", "value": "Use html_safe translated messages. This will let you use this format: \"<strong>%{attribute}</strong> %{message}\" and renders it properly\n" }, { "from": "human", "value": "module ErrorMessagesHelper\n # Render error messages for the given objects. The :message an...
ruby
chosen
[ { "from": "human", "value": "Write system tests for authentication\n" }, { "from": "gpt", "value": "require 'application_system_test_case'\n\nclass SessionsTest < ApplicationSystemTestCase\n setup do\n create :user\n end\n\n test 'redirects to login page if not authenticated' do\n visit...
ruby
chosen
[ { "from": "system", "value": "Make sure to generate the site in the test about the non-HTML files.\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestJekyllMentions < Minitest::Test\n include MentionsTestHelpers\n\n def setup\n @site = fixture_site\n @site.read\n @mentio...
ruby
chosen
[ { "from": "system", "value": "Update deployment target in pod spec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Kiwi'\n s.version = '2.2'\n s.summary = 'A Behavior Driven Development library for iOS and OS X.'\n s.homepage = 'https://g...
ruby
chosen
[ { "from": "system", "value": "Make test work regardless of environment.\n\nFor reasons that aren't quite clear to me, the server returned by\nPlek.current.find(\"contactotron\") is different on the CI server. This change\nmakes the test work there, too.\n" }, { "from": "human", "value": "require...
ruby
chosen
[ { "from": "system", "value": "Configure Sidekiq in development also\n" }, { "from": "human", "value": "if Rails.env.production? || Rails.env.staging?\n redis_jobs_url = ENV.fetch(\"OFN_REDIS_JOBS_URL\", \"redis://localhost:6381/0\")\n\n Sidekiq.configure_server do |config|\n config.redis = ...
ruby
chosen
[ { "from": "system", "value": "Change Redis namespace to match app name.\n" }, { "from": "human", "value": "require \"sidekiq\"\n\nredis_config = { namespace: \"signon_sidekiq\" }\nredis_config[:url] = ENV['REDIS_URL'] if ENV['REDIS_URL']\n\nSidekiq.configure_server do |config|\n config.redis = ...
ruby
chosen
[ { "from": "system", "value": "Bump gem version to 0.0.2\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'c7decrypt'\n s.version = '0.0.1'\n s.authors = [\"Jonathan Claudius\"]\n s.date = '2012-09-07'\n s.email = 'claudijd@yahoo.com'\n s.platform = Gem::Platform:...
ruby
chosen
[ { "from": "system", "value": "Add rspec gem to dev dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rails_reseed/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Fix spacing on good guess\n" }, { "from": "human", "value": "# Good Guess\n\n# I worked on this challenge by myself.\n\n\n# Your Solution Below\ndef good_guess?(argument)\n if argument == 42\n return true\n else\n\treturn false\n end\nend\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Enable SNMP access to naga\n" }, { "from": "human", "value": "name \"fullsave\"\ndescription \"Role applied to all servers at FullSave\"\n\ndefault_attributes(\n :hosted_by => \"FullSave\",\n :location => \"Toulouse, France\",\n :networking => {\n :nameservers...
ruby
chosen
[ { "from": "system", "value": "Add `output_capacity` to molecule nodes\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative 'node'\n\nmodule Atlas\n # Describes a Node in the molecules graph.\n class MoleculeNode\n include Node\n\n directory_name 'graphs/mo...
ruby
chosen
[ { "from": "system", "value": "Raise error if similarity value is not between 0 and 100\n" }, { "from": "human", "value": "require 'color_decomposition/version'\nrequire 'color_decomposition/quadtree/quadtree'\nrequire 'color_decomposition/image/image_reader'\n\nmodule ColorDecomposition\n def s...
ruby
chosen
[ { "from": "system", "value": "Break body type specific header appending into own function\n\nthis is done because I'm going to make it join them all with CRLFs\nin a bit, but for now just breaking things into their own methods\n\nSigned-off-by: Sam Phippen <e5a09176608998a68778e11d5021c871e8fae93c@googlemai...
ruby
chosen
[ { "from": "system", "value": "Remove unused methods in UniqueName" }, { "from": "human", "value": "# Class for generating unique file names for new messages\nclass Maildir::UniqueName\n require 'thread' # For mutex support\n require 'socket' # For getting the hostname\n class << self\n # R...
ruby
chosen
[ { "from": "system", "value": "Fix the creation of SideEffectCapPipe directly after the sources." }, { "from": "human", "value": "module Pacer\n module Core::SideEffect\n def cap\n back.chain_route :transform => :cap, :with => self\n end\n end\n\n module Transform\n module Cap\n\...
ruby
chosen
[ { "from": "system", "value": "Change rails dependency to all rails 5.o to be used\n" }, { "from": "human", "value": "# coding: utf-8\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# The gem's version number\nrequire 'seed_tray/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with the rake task\n\nAn error would be raised whenever you didn't specify the strategy.\nThis'll properly convert the strategy to a symbol only when it is\nspecified.\n" }, { "from": "human", "value": "require 'rake'\n\nnamespace :mongo_rates do\n desc '...
ruby
chosen
[ { "from": "human", "value": "Set locale of topic and user\n" }, { "from": "gpt", "value": "task :set_locales => :environment do\n Rails.logger.info(\"-------- Set locales --------\")\n Topic.all.each do |t|\n t.update!(locale: 'ja')\n end\n User.where(locale: nil).update_all(locale: \"ja\...
ruby
chosen
[ { "from": "system", "value": "Add rudimentary checks for daylight savings time zone changes." }, { "from": "human", "value": "describe :time_gmt_offset, :shared => true do\n it \"returns the offset in seconds between the timezone of time and UTC\" do\n with_timezone(\"AST\", 3) do\n Tim...
ruby
chosen
[ { "from": "system", "value": "Revert \"Move version checking into extension.\"\n\nThis reverts commit a1c17fd0d328ed6572f70853227eed0d5bf02043.\n" }, { "from": "human", "value": "require 'harfbuzz.bundle'\n\n# require 'harfbuzz/blob'\n# require 'harfbuzz/face'\n# require 'harfbuzz/font'\n# requi...
ruby
chosen
[ { "from": "system", "value": "Use `skip` instead of `pending`\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe StackerBee::Middleware::RaiseOnHTTPError do\n pending\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe StackerBee::Middleware::Ra...
ruby
chosen
[ { "from": "system", "value": "Make consistent use of single-quotes\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'spec_helper'\n\ndescribe BreweryDB::Resources::Search, :resource do\n context '#all', :vcr do\n let(:response) { described_class.new(config).all(q: 'IPA') }\n\n...
ruby
chosen
[ { "from": "system", "value": "Add passing tests; final fix\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe TagsController do\n before(:each) do\n @tag = create(:tag)\n @tag.questions << create(:question)\n end\n\n describe \"#index\" do\n it \"has a ...
ruby
chosen
[ { "from": "system", "value": "Update the spec for the attachment download.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe AttachmentsController do\n describe \"routing\" do\n before(:all) do\n @attachment = Factory.create(:attachment)\n end\n\n it \"recognize...
ruby
chosen
[ { "from": "system", "value": "Handle change in AMS 0.10.6\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\nRSpec.describe Bragi::UserSerializer do\n let(:item) { build :bragi_item, audio_identifier: '2014/01/01/blah' }\n let(:serialization) { Active...
ruby
chosen
[ { "from": "system", "value": "Update origin dependency to 1.0.0\n" }, { "from": "human", "value": "# encoding: utf-8\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire \"mongoid/version\"\n\nGem::Specification.new do |s|\n s.name = \"mongoid\"...
ruby
chosen
[ { "from": "system", "value": "Allow gemspec to use 1.x mopeds higher than 1.4\n" }, { "from": "human", "value": "# encoding: utf-8\nlib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire \"mongoid/version\"\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "human", "value": "Make htcat valid transfer source\n" }, { "from": "gpt", "value": "Sequel.migration do\n no_transaction\n\n up do\n execute \"ALTER TYPE target_type ADD VALUE 'htcat'\"\n end\n\n down do\n raise Sequel::Error, 'irreversible migration'\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add minimum ruby version requirement\n\nThis only specifies \"1.9\" rather than \"1.9.3\" since it appears\nthat JRuby in 1.9 mode reports its version as \"1.9\", without\nthe third version number segment.\n" }, { "from": "human", "value": "# encoding: utf-8\nlib = ...
ruby
chosen
[ { "from": "system", "value": "Use relative_requires for lib integrity\n" }, { "from": "human", "value": "require 'core_ext/kernel'\nrequire 'core_ext/pathname'\nrequire 'core_ext/string'\nrequire 'core_ext/array'\nrequire 'core_ext/argv'\n" }, { "from": "gpt", "value": "require_relat...
ruby
chosen
[ { "from": "system", "value": "Create site-cookbook for delete unknown user.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: mysql_cookbook\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n\nmysql_connection_info = {\n :host ...
ruby
chosen
[ { "from": "system", "value": "Fix the fix for the sshd test\n" }, { "from": "human", "value": "# Encoding: utf-8\nrequire 'spec_helper'\n\nsshd = OHAI['sshd']\nplatform_family = OHAI['platform_family']\nplatform_version = OHAI['platform_version'].to_f\nif OHAI['passwd'].key?('vagrant')\n vagran...
ruby
chosen
[ { "from": "system", "value": "Change Default Push Events and Channels\n" }, { "from": "human", "value": "require 'net/http'\n\nmodule Pushable\n require 'pushable/railtie' if defined?(Rails)\n\n extend ActiveSupport::Concern\n\n included do\n after_create :push_create\n after_update :...
ruby
chosen
[ { "from": "system", "value": "Check if action_label has a value because array contains empty strings.\n" }, { "from": "human", "value": "module ActionsHelper\n\n def action_class(persisted)\n if persisted\n 'persisted'\n else\n ''\n end\n end\n\n def action_feed_names(actio...
ruby
chosen
[ { "from": "system", "value": "Refactor JSON parsing of spec file to attr setter\n\nThis way we avoid trying to parse a file on other flows (such as service version\nupdates when its state change)\n" }, { "from": "human", "value": "class ServiceVersion < ApplicationRecord\n belongs_to :service\n...
ruby
chosen
[ { "from": "system", "value": "Update podspec file with new parameter count.\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint Currier.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# The podspec file for Currier. A generic functional currying helper.\n\nPod:...
ruby
chosen
[ { "from": "system", "value": "Fix test for kgdboc= entry in cmdline.txt\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n" }, { "from": "human", "value": "describe file('/boot/cmdline.txt') do\n it { should be_file }\n it { should be_mode 755 }\n it { should ...
ruby
chosen
[ { "from": "system", "value": "Use full-text search in controller\n" }, { "from": "human", "value": "require_dependency \"document_search_engine/application_controller\"\n\nmodule DocumentSearchEngine\n class DocumentsController < ApplicationController\n before_action :set_document, only: [:s...
ruby
chosen
[ { "from": "human", "value": "Add script to generate permitted next nodes for all flows\n\nI'm about to change all the flows to use the mechanism for automatically\ndetecting permitted next nodes. Although the existing tests, particularly\nthe regression tests should give a lot of confidence that nothing ge...
ruby
chosen
[ { "from": "system", "value": "Update podspec to remove XCTest\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'LolayKat'\n s.version = '1'\n s.summary = 'Lolay library that adds functionality typically found in UI Kit (i.e. UI Kit Kat ...
ruby
chosen