conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add migration to update enum values of payment method\n" }, { "from": "gpt", "value": "class ChangeColumnTypeToPaymentMethodZahlenCharge < ActiveRecord::Migration\n def change\n pms = Zahlen::Charge.payment_methods\n Zahlen::Charge.select(\"*, payment_method a...
ruby
chosen
[ { "from": "system", "value": "Fix vm to instance migration\n\nSigned-off-by: Maria Shaldibina <dc03896a0185453e5852a5e0f0fab6cbd2e026ff@pivotal.io>\n" }, { "from": "human", "value": "Sequel.migration do\n change do\n alter_table(:instances) do\n add_column :vm_cid, String, unique: true\...
ruby
chosen
[ { "from": "system", "value": "Add more example docs to watcher class." }, { "from": "human", "value": "require 'watchr'\n\nmodule InfinityTest\n module Observer\n class Watchr < Base\n def initialize(continuous_test_server)\n super\n @observer = ::Watchr::Script.new\n ...
ruby
chosen
[ { "from": "system", "value": "Fix uninitialized constant error by adding require statement\n" }, { "from": "human", "value": "module Net\n class LDAP\n module AuthAdapters\n class Simple < AuthAdapter\n def bind(auth)\n user, psw = if auth[:method] == :simple\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with modifying shared shared options hash\n" }, { "from": "human", "value": "module Rack\n class Switchboard\n module StoreLoader\n protected\n def create_store(options = :memory)\n config = options || :memory\n provider, ...
ruby
chosen
[ { "from": "system", "value": "Add support for POST operations to base mixin\n" }, { "from": "human", "value": "require 'rest-client'\nrequire 'json'\n\nmodule Roadmapster\n module Wizeline\n module BaseApi\n\n BASE_ENDPOINT = \"https://<subdomain>.wizelineroadmap.com/api/\"\n\n def...
ruby
chosen
[ { "from": "system", "value": "Change Operator::Graph to just have a .new class method to add the context to the bgp operator.\n" }, { "from": "human", "value": "module SPARQL; module Algebra\n class Operator\n ##\n # The SPARQL GraphPattern `graph` operator.\n #\n # @see http://www....
ruby
chosen
[ { "from": "system", "value": "Check restricted method definitions for Event\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe LastFM::Event do\n it \"should define unrestricted methods\" do\n LastFM::Event.unrestricted_methods.should == [:get_attendees, :get_info, :get_s...
ruby
chosen
[ { "from": "system", "value": "Change rspec syntax from should to expect\n" }, { "from": "human", "value": "require 'rspec'\n\ndescribe StringCalculator do\n subject { described_class.new }\n\n it 'returns 0 if empty string provided' do\n subject.add(\"\").should eq(0)\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Allow an older version of bundler, for travis\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'nymph/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "human", "value": "Add tests for a block validation with different types\n" }, { "from": "gpt", "value": "require 'minitest_helper'\n\nclass TestBlockWithDifferentTypes < Minitest::Test\n def person_class\n Class.new do\n include Sanatio\n\n def initialize(gender)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove method_missing and dynamically create methods\n" }, { "from": "human", "value": "require 'mongoid'\n\nmodule Mongoid\n module AppSettings\n extend ActiveSupport::Concern\n\n class Record #:nodoc:\n include Mongoid::Document\n identity :type =...
ruby
chosen
[ { "from": "system", "value": "Allow to parse heroku-generated database.yml config file.\n" }, { "from": "human", "value": "namespace :gitlab do\n desc \"GITLAB | Setup production application\"\n task setup: :environment do\n setup_db\n end\n\n def setup_db\n warn_user_is_not_gitlab\n\n...
ruby
chosen
[ { "from": "system", "value": "Add password and password_confirmation attrs to UserFactory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :user do\n name 'User'\n email 'email@test.com'\n login 'user'\n \n factory :admin do\n name 'Admin'\n login 'adm...
ruby
chosen
[ { "from": "system", "value": "Add deric-zookeeper module setup to acceptance spec helper.\n\nThe acceptance test for the running druid services need a working\ninstance of zookeeper to connect to. The deric-zookeeper module is used\nto accomplish this and its utilization has been added to\nspec_helper_acce...
ruby
chosen
[ { "from": "system", "value": "Add watir alias for driver opt\n" }, { "from": "human", "value": "module WebDriverUtils\n class << self\n def require_all_pages glob_path=nil\n glob_path ||= File.join(Rake.application.original_dir, 'page', '**', '*.rb')\n Dir.glob(glob_path) { |file| ...
ruby
chosen
[ { "from": "system", "value": "Upgrade MacUpdate Desktop.app to v6.0.6\n" }, { "from": "human", "value": "cask :v1 => 'macupdate-desktop' do\n version '6.0.2'\n sha256 '1aa04e0bec920f28af5417a2b875e40af832d5303a29dca27e527e30c4db42f5'\n\n url \"http://dl.macupdate.com/MacUpdateDesktop#{version...
ruby
chosen
[ { "from": "system", "value": "Update Omnipresence Beta to version 1.4.x-r233232\n\nThis commit updates the version and sha256 stanzas.\n" }, { "from": "human", "value": "cask :v1 => 'omnipresence-beta' do\n version '1.4.x-r232733'\n sha256 'c21289a7a90b4efc8f0eb9cf3775bb4bb19145688229cd8867188...
ruby
chosen
[ { "from": "system", "value": "Use turn instead of pride to print test output\n" }, { "from": "human", "value": "require File.expand_path('../../lib/colirby.rb', __FILE__)\n\nrequire 'minitest/autorun'\nrequire 'minitest/pride'\nrequire 'webmock/minitest'\nrequire 'vcr'\n\nVCR.configure do |c|\n ...
ruby
chosen
[ { "from": "system", "value": "Use setup helper with block instead of overriding it\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass DeletionTest < ActiveSupport::TestCase\n self.use_transactional_fixtures = false # Disabled to test after_commit\n\n def setup\n super\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow setting to the empty global feature toggle list.\n" }, { "from": "human", "value": "class Admin::GlobalFeatureTogglesController < AdminController\n\n layout \"admin\"\n\n def show\n @global_features = interactor :'global_features/all'\n end\n\n def upda...
ruby
chosen
[ { "from": "system", "value": "Fix migration of customer number\n" }, { "from": "human", "value": "class AddCustomerNumber < ActiveRecord::Migration\n def up\n rename_column :customers, :id, :number\n add_column :customers, :id, :primary_key\n end\n\n def down\n remove_column :custome...
ruby
chosen
[ { "from": "human", "value": "Add neutral feedback to reputation\n" }, { "from": "gpt", "value": "class AddNeutralFeedbackToReputation < ActiveRecord::Migration\n def self.up\n add_column :reputation_ratings, :neutral_feedback, :string\n end\n\n def self.down\n remove_column :reputation_...
ruby
chosen
[ { "from": "system", "value": "Fix version ternary for Travis.\n" }, { "from": "human", "value": "$LOAD_PATH << File.dirname(__FILE__) + '/lib'\nrequire 'custom_counter_cache/version'\n\nspec = Gem::Specification.new do |s|\n s.name = 'custom_counter_cache'\n s.version = CustomCounterCache::VER...
ruby
chosen
[ { "from": "system", "value": "Change duplicate data with a variable\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'data_mapper'\nrequire 'dm-sqlite-adapter'\nrequire 'roo'\n\nDataMapper::setup(:default, \"sqlite3://#{Dir.pwd}/users_mareta.db\")\n\nclass User\n include DataMapper...
ruby
chosen
[ { "from": "system", "value": "Write out directive as first line of script file\n" }, { "from": "human", "value": "require 'sinatra'\n\nget '/' do\n \"Invoke a specific utility endpoint.\"\nend\n\nget '/echofile' do\n halt 404 if params[:content].nil? or params[:file].nil?\n content_type \"tex...
ruby
chosen
[ { "from": "system", "value": "Test initializing Node with block\n" }, { "from": "human", "value": "# Copyright (C) 2016 Colin Fulton\n# All rights reserved.\n#\n# This software may be modified and distributed under the\n# terms of the three-clause BSD license. See LICENSE.txt\n# (located in root...
ruby
chosen
[ { "from": "human", "value": "Set document_type of specialist documents to be more specific\n\nSpecialist publisher has a separate document_type from schema\nname. Currently, these are set to the same thing. This\nmigration sets the document_type from details.metadata.document_type\n" }, { "from": "g...
ruby
chosen
[ { "from": "system", "value": "Support multiple calls to sanitize_attributes in same model.\n\nImplement formatable descriptions [story: #40582233]\n" }, { "from": "human", "value": "# Sanitize attributes before validation.\n#\n# Usage in model:\n#\n# sanitize_attributes :description, :document...
ruby
chosen
[ { "from": "system", "value": "Make sure 'money' is required" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire 'i18n'\n\nmodule HappyHelpers\n module Helpers\n module Numbers\n def currency(v, options = {})\n money = v.respond_to?(:to_money) ? v.to_money : Mone...
ruby
chosen
[ { "from": "human", "value": "Add Roaming host entry for Infoblox\n\nThis allows specifying DHCP options for MAC addresses without explicitly\nlocking them to a fixed address.\n" }, { "from": "gpt", "value": "module Infoblox\n # minimum WAPI version: 1.1\n class RoamingHost < Resource\n remo...
ruby
chosen
[ { "from": "system", "value": "Return error response when pattern is invalid\n" }, { "from": "human", "value": "class Blueprint < ActiveRecord::Base\n belongs_to :project\n has_many :patterns, dependent: :destroy, inverse_of: :blueprint\n accepts_nested_attributes_for :patterns\n\n validates_...
ruby
chosen
[ { "from": "system", "value": "Use more efficient JSON parser\n" }, { "from": "human", "value": "class Excursion < ActiveRecord::Base\n include SocialStream::Models::Object\n\n validates_presence_of :json\n before_save :parse_for_meta\n\n define_index do\n indexes activity_object.title\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bug not to add error\n" }, { "from": "human", "value": "class Micropost < ApplicationRecord\n belongs_to :user\n\n default_scope -> { order(created_at: :desc) }\n\n mount_uploader :picture, PictureUploader\n\n validates :user_id, presence: true\n validates ...
ruby
chosen
[ { "from": "system", "value": "Update included Yarn to latest 1.x version\n" }, { "from": "human", "value": "require 'json'\n\nclass LanguagePack::Helpers::Nodebin\n URL = \"https://nodebin.herokai.com/v1/\"\n\n def self.query(q)\n response = Net::HTTP.get_response(URI(\"#{URL}/#{q}\"))\n ...
ruby
chosen
[ { "from": "human", "value": "Create a wrapper around the graphite api\n" }, { "from": "gpt", "value": "require 'net/http'\nrequire 'json'\n\nclass GraphiteAPI\n def initialize(host, port)\n @uri = URI.parse(\"https://#{host}:#{port}\")\n @graphite = Net::HTTP.new(@uri.host, @uri.port)\n ...
ruby
chosen
[ { "from": "system", "value": "Downgrade the necessary thor version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'travis-saucelabs-api/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Make init scripts be 0755.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: dynatrace\n# Providers:: configure_init_scripts\n#\n# Copyright 2015, Dynatrace\n#\n\nuse_inline_resources\n\naction :run do\n if platform_family?('debian')\n linux_service_start_...
ruby
chosen
[ { "from": "system", "value": "Add SVN password to deplloy file!\n" }, { "from": "human", "value": "require 'mongrel_cluster/recipes'\n\nset :application, \"obra\"\nset :repository, \"svn+ssh://butlerpress.com/var/repos/racing_on_rails/trunk\"\n\nrole :app, \"app.obra.org\"\n\nset :deploy_to, \"/...
ruby
chosen
[ { "from": "system", "value": "Disable requirement that you log in to preview as that was causing problems\n" }, { "from": "human", "value": "require 'guides_front_end'\n\nclass NonAuthConstraint\n def matches?(request)\n ! request.path.match(/^\\/auth/)\n end\nend\n\nGuides::Application.rou...
ruby
chosen
[ { "from": "system", "value": "Add rota para post de subscribe\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n resources :winners\n get 'activities/index'\n\n mount Commontator::Engine => '/commontator'\n resources :images\n resources :albums\n resources :links, :path=...
ruby
chosen
[ { "from": "system", "value": "Add missing route for error pages\n" }, { "from": "human", "value": "Devcon::Application.routes.draw do\n\n mount Ckeditor::Engine => '/ckeditor'\n\n devise_for :users\n resources :users, :only => [:show]\n\n devise_scope :user do\n get 'login', :to => 'devis...
ruby
chosen
[ { "from": "system", "value": "Add route to fetch FAQs based on id and token\n\nAlso move the `root` directive out of the `devise_scope`.\n" }, { "from": "human", "value": " Rails.application.routes.draw do\n\n devise_for :users\n devise_scope :user do\n \t# get \"/\" => \"devis...
ruby
chosen
[ { "from": "system", "value": "Change root of application for authenticated user\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n devise_for :users\n get 'welcome/index'\n root 'welcome#index'\n\n resources :docs\nend\n" }, { "from": "gpt", "value": "Rails.app...
ruby
chosen
[ { "from": "system", "value": "Create articles as a resource\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 can have the...
ruby
chosen
[ { "from": "system", "value": "Add spec for confirming sub app mounting within app works\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe 'Subapps', :cannon_app do\n before(:each) do\n admin_app = Cannon::App.new(binding)\n admin_app.get('/login') do |request, res...
ruby
chosen
[ { "from": "system", "value": "Define 2.0.0 as minimum Ruby version" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'redis/rails/instrumentation/version'\n\nGem::Specification.new do |sp...
ruby
chosen
[ { "from": "system", "value": "Fix Travis builds on Ruby 1.9\n\nThe mime-types gem versions 3+ no longer supports Ruby < 2.0.\nThis sets a version constraint for Ruby versions less than 2.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/phantomjs/ver...
ruby
chosen
[ { "from": "system", "value": "Fix for default item model\n\ngit-svn-id: 40f48ef6be603b97d118b87e4ef5b23ea6e9fa7c@199 ac1452a4-9358-4c15-a3b0-de1119e254d8\n" }, { "from": "human", "value": "class ItemDefault < ActiveRecord::Base\n include AuthUtilities\n\n acts_as_authorization_object\n\n has_...
ruby
chosen
[ { "from": "system", "value": "Fix for missing apt-transport-http package under ubuntu\n" }, { "from": "human", "value": "#\n# Author:: Douglas Triggs (<doug@getchef.com>)\n# Copyright:: Copyright (c) 2014 Chef Software, Inc.\n#\n# All Rights Reserved\n#\n\ncase node['platform_family']\nwhen 'deb...
ruby
chosen
[ { "from": "human", "value": "Add automation engine service model for SwiftManager\n\nOmitted from prior commits.\n\n\n(transferred from ManageIQ/manageiq@14399372b77ba247d65d4d1800473ba09562e121)\n" }, { "from": "gpt", "value": "module MiqAeMethodService\n class MiqAeServiceManageIQ_Providers_S...
ruby
chosen
[ { "from": "system", "value": "Fix aliases in /etc/hosts for machines using a DNS suffix other than '.local'\n" }, { "from": "human", "value": "#\n# Cookbook Name:: hosts\n# Recipe:: default\n#\n# Copyright 2013, Continuuity, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Licens...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for BeerSmith2.\n" }, { "from": "human", "value": "cask 'beersmith2' do\n version '2.2.12'\n sha256 'e4aa64af9e9c65e0cfe132de67ab580d0c3b2f527d598fcda0d9b2cc84b74da6'\n\n url \"https://s3.amazonaws.com/BeerSmith2-2/BeerSmith#{version.gsub...
ruby
chosen
[ { "from": "system", "value": "Upgrade Opera Beta.app to v29.0.1795.35\n" }, { "from": "human", "value": "cask :v1 => 'opera-beta' do\n version '29.0.1795.30'\n sha256 '6ef44a4236ad4f29bfc2c66bc8b542fb583fb50fb7c267fbd4777ccaca59adcb'\n\n url \"http://get.geo.opera.com/pub/opera-beta/#{version...
ruby
chosen
[ { "from": "system", "value": "Remove last remaining page cache\n" }, { "from": "human", "value": "class ThemeController < ContentController\n def stylesheets\n render_theme_item(:stylesheets, params[:filename], 'text/css; charset=utf-8')\n end\n\n def javascript\n render_theme_item(:jav...
ruby
chosen
[ { "from": "human", "value": "[TTPLAT-633] Add data migration for filterable class name in audits.\n" }, { "from": "gpt", "value": "class AddFilterableClassNameToAudits < ActiveRecord::DataMigration\n def up\n if SystemConfig.transam_module_loaded? :audit\n Audit.where(class_name: \"Asse...
ruby
chosen
[ { "from": "system", "value": "Add csrf protection to API endpoints\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n include Authenticatable\n include ErrorHandler\n\n protect_from_forgery with: :null_session\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Add Pundit Exception rescue to ApplicationController\n\nUpdates the application controller to rescue pundit expections and\nredirects the user to the login page. We'll refactor this soon to make\nthe redirects more relevant to where they originated.\n" }, { "from": "hum...
ruby
chosen
[ { "from": "system", "value": "Remove date query from version collections\n" }, { "from": "human", "value": "class ContractorsController < ApplicationController\n def index\n @contractors = Contractor.all.sort { |a, b| b.total_est_contract_value <=> a.total_est_contract_value }\n @contract...
ruby
chosen
[ { "from": "system", "value": "Fix MH postback of rtmp url in a production environment\n" }, { "from": "human", "value": "require 'net/http/digest_auth'\n\nclass DerivativesController < ApplicationController\n\n # before_filter :enforce_access_controls\n # load_and_authorize_resource\n \n skip...
ruby
chosen
[ { "from": "system", "value": "Fix online listeners calculation formula\n" }, { "from": "human", "value": "require 'cache_lock'\n\nclass Json::StatusController < ApplicationController\n layout false\n\n def index\n items = {}\n\n CacheLock.synchronize(:status) do\n items = Rails.cach...
ruby
chosen
[ { "from": "human", "value": "Add spec for data migration of one column to shared examples\n" }, { "from": "gpt", "value": "# it tests data migration for one column\n# Example:\n# include_examples \"column migration\", :type, :ExtManagementSystem, [\"Old Data Field\", \"New Data Field\"]\nshared_...
ruby
chosen
[ { "from": "system", "value": "Update test to use new sign in helpers\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.feature \"User views a list of solicitors\" do\n scenario \"on their dashboard\" do\n expected_solicitor_names = \"Bob Smith\", \"Andy Brown\"\n\n sign...
ruby
chosen
[ { "from": "system", "value": "Add missing platform setting in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = 'feedzirra'\n s.version = '0.0.24'\n\n s.authors = ['Paul Dix']\n s.date = '2009-02-19'\n s.email = 'paul...
ruby
chosen
[ { "from": "system", "value": "Make fake logger class more like Rails\n" }, { "from": "human", "value": "# These classes mimic the state when Loglevel is initialized in a script in\n# config\\initializers in a Rails app. We also include the HttpLogger class.\nclass MyLogDevice\n attr_reader :fil...
ruby
chosen
[ { "from": "system", "value": "Revert \"Re-enable rdiscount extensions test\"\n\nThis reverts commit 0bb17fff6bd1197909f1e49bceba91d84529f03a.\n\nStill flaky?!\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'helper'\n\nclass Nanoc::Filters::RDiscountTest < Nanoc::Test...
ruby
chosen
[ { "from": "system", "value": "Change the invalid migration message to live in a method\n\nThe reasoning for this is that RSpec spits out the failing line in\naddition to the message. Since the long string is part of the line, it\nappears \"twice\" in the RSpec message which is confusing. By moving it\nint...
ruby
chosen
[ { "from": "system", "value": "Fix spec change due to RSpec update.\n\nRSpec mocks interface has changed - rspec_verify removed.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'cucumber/rb_support/rb_language'\n\nmodule Cucumber\n describe 'Pending' do\n\n before(:each)...
ruby
chosen
[ { "from": "system", "value": "Add an extra resolve for nidhogg\n" }, { "from": "human", "value": "name \"lysator\"\ndescription \"Role applied to all servers at Lysator\"\n\ndefault_attributes(\n :accounts => {\n :users => {\n :aoh => { :status => :administrator },\n :lysroot => { ...
ruby
chosen
[ { "from": "system", "value": "Add version constraints to 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 'rsscache/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "unit-test: Add test for mailman class\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'mailman' do\n\n let :params do\n { :password => 'password', :admin_email => 'admin@email.com' }\n end\n\n it 'installs mailman' do\n is_expected.to cont...
ruby
chosen
[ { "from": "system", "value": "Make komzpa an admin on cmok\n" }, { "from": "human", "value": "name \"datahata\"\ndescription \"Role applied to all servers at DataHata\"\n\ndefault_attributes(\n :networking => {\n :nameservers => [\n \"31.130.200.2\"\n ],\n :roles => {\n :exte...
ruby
chosen
[ { "from": "system", "value": "Allow access to mysql from other instances\n" }, { "from": "human", "value": "#\n# Cookbook Name:: mysql_part\n# Recipe:: create_database\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n\ninclude_recipe 'database::mysql'\n...
ruby
chosen
[ { "from": "system", "value": "Change Search docs URI to docs.chef.io" }, { "from": "human", "value": "module ChefAPI\n class Resource::Search < Resource::Base\n collection_path '/search/:index'\n\n schema do\n attribute :total, type: Integer\n attribute :start, type: Integer\n ...
ruby
chosen
[ { "from": "system", "value": "Mark args as non executable\n" }, { "from": "human", "value": "module DeepCover\n class Node\n class Arg < Node\n has_child name: Symbol\n def executable?\n false\n end\n end\n Kwarg = Arg\n\n class Restarg < Node\n has_child ...
ruby
chosen
[ { "from": "system", "value": "Tweak to generator output file" }, { "from": "human", "value": "module Inuit\n module Rails\n VERSION = \"6.0.0.beta.5\"\n end\nend\n" }, { "from": "gpt", "value": "module Inuit\n module Rails\n VERSION = \"6.0.0.beta.6\"\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Correct the require not to use relative path\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire File.expand_path('../lib/activesupport-db-cache', __FILE__)\n\nGem::Specification.new do |gem|\n gem.a...
ruby
chosen
[ { "from": "system", "value": "Mark test as pending :/\n" }, { "from": "human", "value": "module Rambo\n module RamlModels\n class Headers\n attr_accessor :headers\n\n def initialize(headers)\n @headers = headers\n end\n\n def add(hash)\n headers.merge!(hash)...
ruby
chosen
[ { "from": "system", "value": "Add the link order to additional links\n" }, { "from": "human", "value": "module Parted\n def indexable_content\n if latest_edition\n latest_edition.parts.inject([super]) { |acc, part|\n acc.concat([part.title, govspeak_to_text(part.body)])\n }....
ruby
chosen
[ { "from": "system", "value": "Change pg_search from pg_search_scope to multisearchable against\n" }, { "from": "human", "value": "class School < ActiveRecord::Base\n\thas_many :programs\nend\n" }, { "from": "gpt", "value": "class School < ActiveRecord::Base\n\tinclude PgSearch\n\n\th...
ruby
chosen
[ { "from": "human", "value": "Add tests for sessions controller; all tests pass\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe SessionsController, type: :controller do\n let!(:user) { build(:user) }\n\n context \"GET #new)\" do\n it \"responds successfully with an ...
ruby
chosen
[ { "from": "human", "value": "Put back rake task that was used in migration. Oops.\n" }, { "from": "gpt", "value": "namespace :onebody do\n\n desc 'Move existing pictures and files to new locations for OneBody 2.0.0.'\n task :move_to_paperclip => :environment do\n require 'fileutils'\n pa...
ruby
chosen
[ { "from": "system", "value": "Fix test suite for Ruby 2.4 compatibility.\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'simplecov'\nformatters = [ SimpleCov::Formatter::HTMLFormatter ]\n\nif ENV['TRAVIS']\n require 'coveralls'\n formatters << Coveralls::SimpleCov::F...
ruby
chosen
[ { "from": "human", "value": "yacs: Add helper to create tmp dirs in rspec\n" }, { "from": "gpt", "value": "require 'tmpdir'\n\nshared_context :uses_tmp_dir do\n around do |example|\n Dir.mktmpdir('yacs-rspec-') do |dir|\n @tmp_dir = dir\n example.run\n end\n end\n\n attr_reade...
ruby
chosen
[ { "from": "system", "value": "Move repo name into 'event' field, use generic 'GitHub' for application name.\nPotentially helpful for easy redirection to iOctocat (possibly also to the specific repo in the future).\n" }, { "from": "human", "value": "service :prowl do |data, payload|\n url = URI....
ruby
chosen
[ { "from": "system", "value": "Allow passing a param to change the filename of the conf file.\n" }, { "from": "human", "value": "# Defines a user_ulimit modification\n# Sample:\n#\n# depends 'ulimit'\n#\n# user_ulimit \"tomcat\" do\n# filehandle_limit 8192\n# process_limit 61504\n# memory_limi...
ruby
chosen
[ { "from": "system", "value": "Make epic_issues relative_position migration more robust\n\nIf someone installed EE, then downgraded to CE before this column was\nadded, upgrading to the latest version of CE will fail:\n\n1. We have a backport migration for the entire EE schema but the table\n `epic_issues`...
ruby
chosen
[ { "from": "system", "value": "Fix failing spec for generic feature button with disable\n" }, { "from": "human", "value": "describe ApplicationHelper::Button::GenericFeatureButtonWithDisable do\n let(:view_context) { setup_view_context_with_sandbox({}) }\n let(:record) { FactoryGirl.create(:vm_...
ruby
chosen
[ { "from": "system", "value": "Add debug switch to test environment.\n" }, { "from": "human", "value": "require 'xpool'\nrequire 'minitest/mock'\nrequire 'test/unit'\n" }, { "from": "gpt", "value": "require 'xpool'\nrequire 'minitest/mock'\nrequire 'test/unit'\nXPool.debug = ENV.has_k...
ruby
chosen
[ { "from": "system", "value": "Add before filter to warn users that are not already authenticated\n" }, { "from": "human", "value": "# Filters added to this controller apply to all controllers in the application.\n# Likewise, all the methods added will be available for all controllers.\n\nclass A...
ruby
chosen
[ { "from": "system", "value": "Create a sign-in action with a token\n" }, { "from": "human", "value": "module SessionsHelper\nend\n" }, { "from": "gpt", "value": "module SessionsHelper\n \n def sign_in(user)\n remember_token = User.new_remember_token\n cookies.permanent[rememb...
ruby
chosen
[ { "from": "human", "value": "Make sure user_guide is only accessible to authenticated users\n" }, { "from": "gpt", "value": "require \"test_helper\"\n\n=begin\n\n What's being tested here?\n\n - Access to user_guide.\n - ...\n\n=end\n\nclass Admin::BaseControllerTest < ActionController::T...
ruby
chosen
[ { "from": "human", "value": "Add a balanced consumer example\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift(File.expand_path(\"../../lib\", __FILE__))\n\nrequire \"kafka\"\n\nKAFKA_CLIENT_CERT = ENV.fetch(\"KAFKA_CLIENT_CERT\")\nKAFKA_CLIENT_CERT_KEY = ENV.fetch(\"KAFKA_CLIENT_CERT_KEY\")\n...
ruby
chosen
[ { "from": "system", "value": "Add sorted question link details\n" }, { "from": "human", "value": "module SessionHelper\n def find_question(recent_question, id)\n recent_questions.each do |question|\n if question.questionId == id\n return question\n end\n end\n end\nend\n...
ruby
chosen
[ { "from": "system", "value": "Attach user on devise sign up and added ability to specify visit model\n" }, { "from": "human", "value": "require \"addressable/uri\"\nrequire \"browser\"\nrequire \"geocoder\"\nrequire \"referer-parser\"\nrequire \"request_store\"\nrequire \"ahoy/version\"\nrequire...
ruby
chosen
[ { "from": "system", "value": "Use Celluloid::Group for defining the test node\n" }, { "from": "human", "value": "# The DCell specs start a completely separate Ruby VM running this code\n# for complete integration testing using 0MQ over TCP\n\nrequire 'rubygems'\nrequire 'bundler'\nBundler.setup\...
ruby
chosen
[ { "from": "human", "value": "Add indexes for unique attributes\n" }, { "from": "gpt", "value": "class AddMissingUniqueIndexesForUniqueAttributes < ActiveRecord::Migration[5.0]\n def change\n tables = {\n spree_countries: [:name, :iso_name],\n spree_option_types: [:name],\n spr...
ruby
chosen
[ { "from": "system", "value": "Add instrumentor to debug BitBucket issues.\n" }, { "from": "human", "value": "require 'base64'\nrequire 'json'\n\nmodule BackupGitBucket\n module HTTPTools\n def basic_auth(username, password)\n credentials = Base64.encode64(\"#{username}:#{password}\").st...
ruby
chosen
[ { "from": "system", "value": "Add a nil-check when fetching a year\n\nSome of the movies on the site may have no year specified. Check is required to not fail on these." }, { "from": "human", "value": "require 'open-uri'\nrequire 'net/http'\nrequire 'nokogiri'\n\nmodule CanHazPoster\n class Gra...
ruby
chosen
[ { "from": "system", "value": "Complete nested data solution pair challenge\n" }, { "from": "human", "value": "# RELEASE 2: NESTED STRUCTURE GOLF\n# Hole 1\n# Target element: \"FORE\"\n\narray = [[1,2], [\"inner\", [\"eagle\", \"par\", [\"FORE\", \"hook\"]]]]\n\n# attempts:\n# ===================...
ruby
chosen