conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add allow_if to authenticity token\n" }, { "from": "human", "value": "require 'rack/protection'\n\nmodule Rack\n module Protection\n ##\n # Prevented attack:: CSRF\n # Supported browsers:: all\n # More infos:: http://en.wikipedia.org/wiki/Cros...
ruby
chosen
[ { "from": "human", "value": "Create comments controller with some notes\n" }, { "from": "gpt", "value": "class CommentsController < ApplicationController\n before_action :set_comment, only: [:show, :edit, :update, :destroy]\n\n # do we need this?\n # def index\n # @comments = Comment.all\n...
ruby
chosen
[ { "from": "system", "value": "Fix bug in exercise controller\n" }, { "from": "human", "value": "class ExerciseController < ApplicationController\n\tskip_before_filter :verify_authenticity_token\n before_filter :cors_preflight_check\n after_filter :cors_set_access_control_headers\n\n\tdef index...
ruby
chosen
[ { "from": "system", "value": "Add ENV values we expect in drone container\n" }, { "from": "human", "value": "#\n# Cookbook Name:: drone\n# Spec:: container\n#\n\nrequire 'spec_helper'\n\ndescribe 'drone::container' do\n context 'When all attributes are default, on an unspecified platform' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add authentication check to services\n" }, { "from": "human", "value": "class ServicesController < ApplicationController\n before_action :set_service, only: [:show, :edit, :update]\n\n def index\n @services = Service.all\n end\n\n def new\n @service = Serv...
ruby
chosen
[ { "from": "system", "value": "Fix default redirect if already logged in\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n before_action :check_accounts_enabled\n\n def create\n if logged_in?\n redirect_to default_redirect_path\n return\n end\...
ruby
chosen
[ { "from": "system", "value": "Add API handling to session login\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def login\n end\n\n def begin\n user = Session.login_by_username_or_email(params[:user_input])\n\n if user && user.authenticate(params[...
ruby
chosen
[ { "from": "human", "value": "Add gist to render bootstrap-style errors on forms\n" }, { "from": "gpt", "value": "# From: https://gist.github.com/bogdanconstantinescu/2645498\n\nActionView::Base.field_error_proc = Proc.new do |html_tag, instance|\n html = %(<div class=\"field_with_errors\">#{htm...
ruby
chosen
[ { "from": "system", "value": "Use API key from ENV\n" }, { "from": "human", "value": "require 'minitest/autorun'\n\nrequire 'fuzzy_io'\nrequire 'fuzzy_io/version'\n\nAPI_KEY = \"AAAABBBBB\"\nAGENT_ID = \"CCCCDDDD\"\n\nclass TestFuzzyIo < MiniTest::Unit::TestCase\n\n def setup\n @account = Fu...
ruby
chosen
[ { "from": "system", "value": "Use wt_haproxy as cookbook name instead of haproxy\n\n\nFormer-commit-id: 88afa05ed72046d35b251a7a14887b91b8790235 [formerly 4d5596a4cbe4bb5af10cb24205a9b2d0d9b3c07c] [formerly bc7f30c4c916a3d7b31498cb0e9505dbd37e12c1 [formerly 2f80096a9841f987de90caf9331fb92419edde55]]\nFormer...
ruby
chosen
[ { "from": "system", "value": "Remove bug tracker from gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"split/export/version\"\n\nGem::Specification.new do |s|\n s.name = \"split-export\"\n s.version = Spl...
ruby
chosen
[ { "from": "system", "value": "Fix bug in the rendering of the student profile\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>" }, { "from": "human", "value": "class AlumniController < ApplicationController\n def index\n end\n\n def show\n \t@thisID = p...
ruby
chosen
[ { "from": "system", "value": "Fix bug on destroying VPS\n" }, { "from": "human", "value": "require 'libvirt'\nrequire 'singleton'\n\n# dom.xml\n# dom.destroy\n# dom.reboot\n# dom.start\n# dom.stop\n\nmodule Antir\n module Engine\n module Hypervisor\n class DomainHandler\n include...
ruby
chosen
[ { "from": "system", "value": "Add method comments to `Production::WeightedChoices`\n" }, { "from": "human", "value": "module Calyx\n module Production\n class WeightedChoices\n def self.parse(productions, registry)\n weights_sum = productions.reduce(0) do |memo, choice|\n ...
ruby
chosen
[ { "from": "system", "value": "Update to Devise 1.1 stable route generation\n" }, { "from": "human", "value": "require 'action_dispatch/routing/mapper'\n\nmodule ActionDispatch::Routing\n class Mapper\n protected\n \n def devise_cas(mapping, controllers)\n # service endpoint for CAS ...
ruby
chosen
[ { "from": "system", "value": "Remove empty strings as well\n" }, { "from": "human", "value": "module Renalware\n class Address < ActiveRecord::Base\n validates_presence_of :street_1\n validates_with AddressValidator\n\n def self.reject_if_blank\n Proc.new do |attrs|\n !%i(s...
ruby
chosen
[ { "from": "system", "value": "Add helper method for replacing the old foreign_keys with cascading deletes.\n" }, { "from": "human", "value": "# Since we've designed metrics/docs tables to revolve around\n# the pods table, but be independent of each other, we can\n# run all trunk migrations first...
ruby
chosen
[ { "from": "system", "value": "Update the Signing Key for Percona Debian and Ubuntu Packages\n\nSee: https://www.percona.com/blog/2016/10/13/new-signing-key-for-percona-debian-and-ubuntu-packages/\n" }, { "from": "human", "value": "#\n# Cookbook Name:: percona\n# Attributes:: package_repo\n#\n\nd...
ruby
chosen
[ { "from": "system", "value": "Support Test::Unit distributed in ruby 1.8.3.\n\n* subversion/bindings/swig/ruby/test/run-test.rb: Pass $0 instead of false\n as the first argument of Test::Unit::AutoRunner.run when using Test::Unit\n is the one that distributed in ruby 1.8.3.\n\n\ngit-svn-id: f8a4e5e023278d...
ruby
chosen
[ { "from": "system", "value": "Fix directory for tiny stack\n\n[#168707057]\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nstack = ENV['STACK']\n\nbuildpacks_ci_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))\nstacks_dir = File.expand_path(File....
ruby
chosen
[ { "from": "human", "value": "Add RFC822 specification for validating an email address.\n" }, { "from": "gpt", "value": "# encoding: binary\n#\n# RFC822 Email Address Regex\n# --------------------------\n# \n# Originally written by Cal Henderson\n# c.f. http://iamcal.com/publish/articles/php/pars...
ruby
chosen
[ { "from": "system", "value": "Sort id's in licence query for cache efficiency.\n" }, { "from": "human", "value": "require_relative 'base'\nrequire_relative 'part_methods'\n\nclass GdsApi::Publisher < GdsApi::Base\n\n def publication_for_slug(slug, options = {})\n return nil if slug.nil? or s...
ruby
chosen
[ { "from": "system", "value": "Fix skip check at comment update for kibela\n" }, { "from": "human", "value": "module Idobata::Hook\n class Kibela < Base\n screen_name 'kibe.la'\n icon_url hook_image_url('icon.png')\n template_name { \"#{action}.html.haml\" }\n before_render do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix executable assertion in ToyRobotTest\n" }, { "from": "human", "value": "require 'minitest/autorun'\n\nmodule ToyRobot\n class ToyRobotTest < MiniTest::Unit::TestCase\n def test_that_it_is_executable\n assert `bin/toyrobot < data/example_input_a.txt`\n ...
ruby
chosen
[ { "from": "system", "value": "Add permitted attributes for webmoney\n" }, { "from": "human", "value": "Spree::CheckoutController.class_eval do\n def permitted_source_attributes\n super.push(permitted_komoju_konbini_attributes)\n super.push(permitted_komoju_banktransfer_attributes)\n su...
ruby
chosen
[ { "from": "system", "value": "Disable connecting to a database on precompile\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '...
ruby
chosen
[ { "from": "system", "value": "Fix OR expressions where the left side is true\n\nTrueClass does not respond to `#empty?`, which makes `foo || bar` where foo resolves to true fail." }, { "from": "human", "value": "module JMESPath\n # @api private\n module Nodes\n class Or < Node\n def in...
ruby
chosen
[ { "from": "system", "value": "Revert breaking change that renames default config file name\n" }, { "from": "human", "value": "module Curator\n class Railtie < Rails::Railtie\n initializer \"railtie.configure_rails_initialization\" do |app|\n Curator.configure(:riak) do |config|\n ...
ruby
chosen
[ { "from": "system", "value": "Update to work with latest bleak-house.\n" }, { "from": "human", "value": "def start_dike\n require 'dike'\n Thread.new do\n Dike.logfactory File.join(File.dirname(__FILE__), *%w[.. .. logs])\n loop do\n Dike.finger\n sleep(1)\n end\n end\nend\...
ruby
chosen
[ { "from": "system", "value": "Fix falsy \"enabled\" flag being ignored\n\nBecause of using the `||=` operator, falsy values for `enabled` were\r\nbeing ignored and overwritten when the `server` flag existed.\r\n\r\nFor mnemosyne.yml files like the following:\r\n\r\n common: &common\r\n server: amqp:...
ruby
chosen
[ { "from": "system", "value": "Raise exceptions in dev/test if incorrect or missing translation keys are encountered\n" }, { "from": "human", "value": "I18n.enforce_available_locales = true\n" }, { "from": "gpt", "value": "I18n.enforce_available_locales = true\n\n# raise exceptions wh...
ruby
chosen
[ { "from": "human", "value": "Add a plugin fixture for testing\n" }, { "from": "gpt", "value": "Nark::Plugin.define :request_times do |plugin|\n plugin.variables :last_request_time => nil\n\n plugin.add_hook :before_call do |env|\n @start_time = Time.now\n end\n\n plugin.add_hook :after_ca...
ruby
chosen
[ { "from": "system", "value": "Remove Useless Rescue In Shared Context\n\nThese style of rescues are relatively useless and they make Rubocop a\nvery unhappy customer. Cleaned up for code cleanliness and to make all\nthe Cops happy.\n" }, { "from": "human", "value": "RSpec.shared_context 'shopify...
ruby
chosen
[ { "from": "system", "value": "Refactor color code hash creation.\n" }, { "from": "human", "value": "require \"minimal_logging/version\"\n\nmodule MinimalLogging\n\n class << self\n attr_accessor :app\n attr_accessor :color_codes\n\n def setup(app)\n self.app = app\n self.colo...
ruby
chosen
[ { "from": "system", "value": "Make the help output prettier; highlight the cmd.\n" }, { "from": "human", "value": "require \"pry-vterm_aliases/version\"\nrequire \"pry\"\n\nunless ::RbConfig::CONFIG[\"host_os\"] =~ /mswin|mingw32/\n class Pry\n module VTermAliases\n class << self\n ...
ruby
chosen
[ { "from": "system", "value": "Fix redirection after creating the Post\n" }, { "from": "human", "value": "module CrowdblogCore\n class PostsController < ApplicationController\n respond_to :html, :json\n cache_sweeper :post_sweeper\n\n def index\n @posts = Post.scoped_for(current_u...
ruby
chosen
[ { "from": "system", "value": "Update Kpoppin plugin (new source url)\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Cinch\n module Plugins\n class Kpoppin\n include Cinch::Plugin\n\n match /(kpoppin)$/\n match /(help kpoppin)$/, method: :he...
ruby
chosen
[ { "from": "system", "value": "Prepare 2.0.0 release with Rails 4 support\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'immortal'\n s.version = '1.0.5'\n s.authors =...
ruby
chosen
[ { "from": "system", "value": "Remove rescue and let it fail\n\nLetting it fail, we get a useful stack trace that will point us to the \nright direction.\n" }, { "from": "human", "value": "namespace :base_path do\n desc \"Edits the base_path of a document, given its content_id and the new base_p...
ruby
chosen
[ { "from": "system", "value": "Include spec/ when calling rcov.\n\nThis is needed because spec_helper is required without the full path now.\n" }, { "from": "human", "value": "begin\n require 'metric_fu'\n MetricFu::Configuration.run do |config|\n config.rcov[:test_files] = 'spec/**/*_spec.r...
ruby
chosen
[ { "from": "human", "value": "Add a Game List model for parsing the config file\n" }, { "from": "gpt", "value": "module Saves\n class GameList\n include Enumerable\n\n attr_reader :games\n attr_reader :games_data\n\n def initialize(games_data = [])\n @games_data = games_data\n ...
ruby
chosen
[ { "from": "system", "value": "Fix copy and paste error\n" }, { "from": "human", "value": "module Helpers\n module GraphiteHelpers\n require 'socket'\n def graphite_plot(logString)\n if Deployinator.graphite_host\n s = TCPSocket.new(Deployinator.graphite_host,Deployinator.graphit...
ruby
chosen
[ { "from": "human", "value": "Add migration to support percentage coupon.\n" }, { "from": "gpt", "value": "class AddDiscountTypeAndDiscountPercentToCoupons < ActiveRecord::Migration\n def change\n add_column :couponable_coupons, :discount_type, :string, :null => false, :default => \"dollars\"...
ruby
chosen
[ { "from": "human", "value": "Add a test for the windows install\n" }, { "from": "gpt", "value": "control 'commands should exist' do\n describe command('node -v') do\n its('exit_status') { should eq 0 }\n end\n\n describe command('npm -v') do\n its('exit_status') { should eq 0 }\n end\n...
ruby
chosen
[ { "from": "system", "value": "Document proper concurrent-ruby version dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'diameter'\n s.version = '0.2.0pre2'\n s.licenses = ['MIT']\n s.summary = \"Pure-Ruby Diameter stack\"\n s.authors ...
ruby
chosen
[ { "from": "system", "value": "Increase request cap for facebook scraper\n" }, { "from": "human", "value": "require 'forwardable'\nrequire 'mechanize'\nrequire_relative 'crawler'\n\nclass ShortCrawler < Crawler\n extend Forwardable\n\n def_delegators :@extractor,\n :initial_urls, :next_page,...
ruby
chosen
[ { "from": "system", "value": "[PH][99263050] OnePlatform: Load tests under certain host dir in before_run hook\n" }, { "from": "human", "value": "module Autobots\n class Runner\n\n attr_accessor :options\n @after_hooks = []\n\n def self.after_run(&blk)\n @after_hooks << blk\n e...
ruby
chosen
[ { "from": "system", "value": "Fix regression in model class checking\n" }, { "from": "human", "value": "module Cave\n class ModelForm < Form\n def self.model klass=nil\n @@model ||= klass\n end\n\n def initialize instance=nil, attrs={}\n (instance, attrs = nil, instance) if i...
ruby
chosen
[ { "from": "system", "value": "Refactor BulkCreateTube to use BulkAction.\n" }, { "from": "human", "value": "require 'lims-core/actions/action'\nrequire 'lims-laboratory-app/laboratory/tube'\nrequire 'lims-laboratory-app/laboratory/tube/create_tube'\n\nmodule Lims::LaboratoryApp\n module Laborat...
ruby
chosen
[ { "from": "system", "value": "Add directory to Gzip ignores\nWithout \"assets/\", mm build would error and complain that the @bourbon import in site.css could not be found\n" }, { "from": "human", "value": "activate :directory_indexes\n\nset :relative_links, true\nset :haml, { format: :html5 }\n...
ruby
chosen
[ { "from": "system", "value": "Rename file to execute in.\n" }, { "from": "human", "value": "# http://charliepark.org/tags-in-jekyll/\n# Creates a directory for each tag in website and creates an 'index.html' file in it. In each 'index.html' file, it plugs in the 'tag_index.html' template.\nmodul...
ruby
chosen
[ { "from": "system", "value": "Update the bundler development gem dependency\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"fair_dice_roll\"\n spec.version = \"4.0.0\"\n\n spec.author = \"Steve Richert\"\n spec.email = \"...
ruby
chosen
[ { "from": "system", "value": "Update HaltDomain action to only forcibly halt domain\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'log4r'\n\nmodule VagrantPlugins\n module ProviderLibvirt\n module Action\n # Halt the domain.\n class HaltDomain\n ...
ruby
chosen
[ { "from": "system", "value": "Allow overriding of asset host using ENV var.\n" }, { "from": "human", "value": "Publisher::Application.configure do\n # Settings specified here will take precedence over those in config/environment.rb\n\n # In the development environment your application's code i...
ruby
chosen
[ { "from": "system", "value": "Use better name when pulling switcheroo\n" }, { "from": "human", "value": "PaperTrail.config.track_associations = false\n\nmodule PaperTrail\n def self.with_actor(actor)\n current_actor = self.actor\n self.whodunnit = actor\n yield\n self.whodunnit = cu...
ruby
chosen
[ { "from": "human", "value": "Add my original hangman written during interview\n" }, { "from": "gpt", "value": "# HangMan that I first wrote in my interview\n\nclass HangMan\n require 'SecureRandom'\n\n def initialize\n @lives = 8\n @wrong_letters = []\n\n all_words = File.new('words.t...
ruby
chosen
[ { "from": "system", "value": "Disable transactions for integration tests.\n\nCapybara/webkit tests don't play well with transactional fixtures since\nthey run in a separate process and therefore don't see db writes that\nare in a different transaction. Set use_transactional_fixtures to false\nand use the tr...
ruby
chosen
[ { "from": "system", "value": "Fix running functional tests with vagrant\n\nThe tests were unable to SSH to the vagrant boxes without the password\n" }, { "from": "human", "value": "class VagrantWrapper\n class << self\n def hosts\n @vm_hosts ||= begin\n result = {}\n\n box...
ruby
chosen
[ { "from": "system", "value": "Use dashes for new lines\n\n<*> replace the filter character with a delimiter\n" }, { "from": "human", "value": "require \"chronicle/version\"\nrequire \"git\"\n\nmodule Chronicle\n class Generator\n def initialize\n @git = Git.open(Dir.pwd)\n @char = ...
ruby
chosen
[ { "from": "system", "value": "Use a more realistic event pattern\n\nThis is an anonymised version (don't want anyone having out instance ID\nright?) of one of our patterns.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass Convection::Model::Template::Resource\n describe EventsR...
ruby
chosen
[ { "from": "system", "value": "Fix api-umbrella process stop sometimes taking a long time.\n" }, { "from": "human", "value": "Delayed::Worker.destroy_failed_jobs = false\n\nif(Rails.env.test?)\n # Check for jobs more frequently in the test environment to cut down on wait\n # times for integrati...
ruby
chosen
[ { "from": "system", "value": "Change to stop loading vector.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'equatable'\nrequire 'pastel'\nrequire 'tty-color'\nrequire 'tty-cursor'\nrequire 'tty-command'\nrequire 'tty-editor'\n#require 'tty-file'\nrequire 'tty-pager'\nrequire 't...
ruby
chosen
[ { "from": "human", "value": "Add Zmb class and socket manager system\n" }, { "from": "gpt", "value": "class Zmb\n require 'socket'\n \n def initialize\n @plugins = {'core/zmb' => self}\n @sockets = Hash.new\n end\n \n def run\n begin\n while 1\n socket_select(timeout)\...
ruby
chosen
[ { "from": "system", "value": "Support for new hash syntax\n\n* support for json as well\n" }, { "from": "human", "value": "require 'cuba'\nrequire 'cuba/render'\nrequire 'json'\n\nCuba.plugin Cuba::Render\n\nCuba.define do\n\n on get do\n on root do\n input = hash = ''\n on param('...
ruby
chosen
[ { "from": "system", "value": "Add vendor/images to asset lookup path\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Katex\n # Registers KaTeX fonts, stylesheets, and javascripts with Rails.\n class Engine < ::Rails::Engine\n initializer 'katex.assets' do |app|\n ...
ruby
chosen
[ { "from": "system", "value": "Enable xrange and yrange options\n" }, { "from": "human", "value": "module Nyaplot\n class Plot\n include Jsonizable\n\n define_properties(Array, :diagrams)\n define_group_properties(:options, [:width, :height, :margin, :xrange, :yrange, :x_label, :y_label...
ruby
chosen
[ { "from": "system", "value": "Add cached stops and error messages to shared files\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nlock '3.8.1'\n\nset :application, 'bojangles'\nset :repo_url, 'git@github.com:umts/bojangles.git'\nset :branch, :master\nset :deploy_to, \"/srv/#{...
ruby
chosen
[ { "from": "system", "value": "Remove rescue from channels subscribers\n" }, { "from": "human", "value": "class Channels::ChannelsSubscribersController < Channels::BaseController\n inherit_resources\n load_and_authorize_resource\n actions :show, :destroy, :create\n\n # We use show as create t...
ruby
chosen
[ { "from": "system", "value": "Add version constraints to gemspec.\n\nRubyGems was whining when I went to build the gem because of the limited\nversion constrains on the various development dependencies. Also I've\nupdated the description in the gemspec.\n" }, { "from": "human", "value": "# codin...
ruby
chosen
[ { "from": "human", "value": "Define rake task wich starts Untied::Worker\n" }, { "from": "gpt", "value": "require \"untied\"\nrequire \"untied/worker\"\n\nnamespace :untied do\n desc \"Starts untied's worker\"\n task :work do\n AMQP.start do |connection|\n channel = AMQP::Channel.new(...
ruby
chosen
[ { "from": "human", "value": "Add autrun.rb which test.rb loads.\n" }, { "from": "gpt", "value": "$TEST_SUITE = [] unless defined?($TEST_SUITE)\n\nat_exit {\n if RUBY_VERSION < '1.9'\n require 'test/runner'\n else\n require_relative 'runner'\n end\n\n suite = $TEST_SUITE\n options = ...
ruby
chosen
[ { "from": "system", "value": "Fix bug in search 'where' query by using indexed method\n\nThe query was not returning correct results because the target\ndata was not in the index.\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n def search\n @q = params[:q]...
ruby
chosen
[ { "from": "system", "value": "Allow messages through so login isn't broken\n" }, { "from": "human", "value": "Merb.logger.info(\"Compiling routes...\")\nMerb::Router.prepare do\n # RESTful routes\n resources :posts, :controller=>PostController\n resources :categories, :controller=>CategoryCon...
ruby
chosen
[ { "from": "system", "value": "Update json to disable warning to those using the packager\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sinatra_asset_packager/version'\n\n...
ruby
chosen
[ { "from": "system", "value": "Add a dummy route to keep the healthcheck happy\n" }, { "from": "human", "value": "AssetManager::Application.routes.draw do\n\nend\n" }, { "from": "gpt", "value": "AssetManager::Application.routes.draw do\n\n # Temporary dummy route to keep healthcheck ...
ruby
chosen
[ { "from": "system", "value": "Change root based on whether or not the user is signed in\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n devise_for :users\n get 'login/index'\n root 'login#index'\n\n resources :costs\n resources :incomes\n resources :categories\n re...
ruby
chosen
[ { "from": "system", "value": "Add test for OSTYPE macro on FreeBSD\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'sendmail::mc::ostype' do\n context 'on Debian' do\n let(:title) { 'debian' }\n\n it {\n should contain_concat__fragment('sendmail_mc-ostype-debian'...
ruby
chosen
[ { "from": "system", "value": "Fix playback spec - use \"expect\" syntax\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'Asciicast playback', :js => true, :slow => true do\n\n let(:asciicast) { create(:asciicast) }\n\n describe \"from fixture\" do\n before do\n @o...
ruby
chosen
[ { "from": "system", "value": "Update for Node v4.8.1 and v6.10.1\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Node 4.x\nif property[:name] =~ /v4./\n describe command('node -v') do\n its(:stdout) { should contain('v4.8.0') }\n end\nend\n\n# Node 6.x\nif property[:name] =~ /...
ruby
chosen
[ { "from": "system", "value": "Make output a little purtier\n" }, { "from": "human", "value": "RSpec.shared_examples \"validate valid parameter\" do |validator_class, parameter|\n context parameter.to_s do\n subject(:valid_parameter_validator) { validator_class.new('name', validator_definitio...
ruby
chosen
[ { "from": "system", "value": "Refactor: Use `most_recent` instead of `last` on consultations\n" }, { "from": "human", "value": "module API\n class ConsultationsController < BaseController\n def last\n consultation = patient.consultations.last\n render json: consultation\n end\n\...
ruby
chosen
[ { "from": "human", "value": "Add comments controller and index method.\n" }, { "from": "gpt", "value": "class CommentsController < ApplicationController\n include AuthsHelper\n\n def index(commentable_id, commentable_type)\n @comments = Comment.where(commentable_id: commentable_id, commenta...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warnings in GenericSessionMixin\n" }, { "from": "human", "value": "module Mixins\n module GenericSessionMixin\n\n private\n\n def get_session_data\n prefix = self.class.session_key_prefix\n @title = respond_to?(:title) ? title ...
ruby
chosen
[ { "from": "human", "value": "Add new MainstreamCategory for UK Export Finance\n" }, { "from": "gpt", "value": "puts 'Creating MainstreamCategory for UK Export Finance'\nMainstreamCategory.create!( parent_title: 'Imports and exports',\n parent_tag: 'business/imports-exp...
ruby
chosen
[ { "from": "system", "value": "Move furbies from let block to method\n" }, { "from": "human", "value": "describe 'neo4j installation' do\n describe command('which neo4j') do\n its(:stdout) { should match 'bin/neo4j' }\n end\n\n describe 'neo4j commands', sudo: true do\n let(:furbies) { r...
ruby
chosen
[ { "from": "system", "value": "Add reset method to Hero to completely heal after a game or test." }, { "from": "human", "value": "module Heroclix\r\n class Hero\r\n attr_reader :name, :description, :clicks\r\n \r\n def initialize(name, combat_values, description = nil)\r\n @name, @...
ruby
chosen
[ { "from": "system", "value": "Add :domain options to RowScale\n" }, { "from": "human", "value": "module Nyaplot\n class RowScale\n include Nyaplot::Base\n type :row_scale\n required_args :data, :column, :range\n end\n\n class DataFrameScale\n include Nyaplot::Base\n type :df_sc...
ruby
chosen
[ { "from": "system", "value": "Move options initialization to a separate method\n" }, { "from": "human", "value": "require 'rack'\n\nmodule Rack\n class Revision\n File = ::File\n @@revision = nil\n\n def initialize(app, options={})\n @options = {\n :header => options[:hea...
ruby
chosen
[ { "from": "system", "value": "Add support for rspec 3+\n\nAlias new rspec matcher protocol names (rspec 3+) to the old (rspec 2). From https://www.relishapp.com/rspec/rspec-expectations/docs/changelog:\n\nUpdate matcher protocol and custom matcher DSL to better align with the newer expect syntax. If you wan...
ruby
chosen
[ { "from": "system", "value": "Add spec for tags removal from Ansible Playbook summary page\n" }, { "from": "human", "value": "describe AnsiblePlaybookController do\n include CompressedIds\n\n before do\n EvmSpecHelper.create_guid_miq_server_zone\n login_as FactoryGirl.create(:user_admin)...
ruby
chosen
[ { "from": "human", "value": "Add feature spec for action caching of taxon and properties endpoints\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"spec_helper\"\n\nfeature \"Shops caching\", js: true, caching: true do\n include WebHelper\n include UIComponentHelper\...
ruby
chosen
[ { "from": "system", "value": "Add magical incantation to session store config for subdomain cookies.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nCyclescape::Application.config.session_store :cookie_store, key: '_cyclekit_session'\n\n# Use the...
ruby
chosen
[ { "from": "system", "value": "Add presence validation to Import\n\n```\n*An* `ActiveRecord::StatementInvalid` *occurred while* `POST </settings/import>` *was processed by* `imports#create`\nException\n----------------\nPG::NotNullViolation: ERROR: null value in column \"type\" violates not-null constraint\...
ruby
chosen
[ { "from": "system", "value": "Add association to music for Season\n" }, { "from": "human", "value": "class Season < ActiveRecord::Base\n validates :name, presence: true\n validates :start, presence: true\n validates :expiry, presence: true\n validate :start_must_be_before_expiry\n\n def sta...
ruby
chosen
[ { "from": "system", "value": "Change gem homepage to github repository\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n\n # Common informations\n spec.name = 'infopen-docker'\n spec.version = '0.1.0'\n spec.date = '2015-12-06'\n spec.summary ...
ruby
chosen
[ { "from": "system", "value": "Remove deprecated solaris compiler config.\n" }, { "from": "human", "value": "# Disable git caching\n# ------------------------------\n# use_git_caching false\n\n# Enable S3 asset caching\n# ------------------------------\nuse_s3_caching true\ns3_access_key ENV['AW...
ruby
chosen
[ { "from": "system", "value": "Change MountVmwareSharedFolder to use symlinks.\n\nThe vmhgfs mount only ever seems to mount the virtual directory and\nnever any of its subdirectories. So instead of trying to mount them in\nthe desired path we instead mount on /mnt/hgfs and then symlink the\nnamed directories...
ruby
chosen
[ { "from": "system", "value": "Use no_timeout for search queries\n\nThis won't remove the underlying problem, but will at least help me diagnose what's going on\n" }, { "from": "human", "value": "class AddressesController < ApplicationController\n respond_to :json, :html\n\n before_filter :buil...
ruby
chosen
[ { "from": "system", "value": "Improve data-load being sent to client\n" }, { "from": "human", "value": "class DashboardController < ApplicationController\n before_action :authorize\n helper_method :days_till_water\n\n def index\n puts(current_user.id)\n @user = User.find(current_user.id...
ruby
chosen
[ { "from": "system", "value": "Add correct redirect after denuncia and add additional strong params for items.\n" }, { "from": "human", "value": "class DenunciasController < ApplicationController\n def create\n @denuncia = Denuncia.new(denuncia_params)\n\n respond_to do |format|\n if ...
ruby
chosen