conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Include AV railtie when we're not loading full rails stack\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n<% if include_all_railties? -%>\nrequire 'rails/all'\n<% else -%>\n# Pick the frameworks you want:\n<%= comment_if :skip_ac...
ruby
chosen
[ { "from": "system", "value": "Use Ruby keyword args in DocumentAssociationMarshaller\n\nI think that using language features instead of custom code makes this\neasier to understand.\n" }, { "from": "human", "value": "class DocumentAssociationMarshaller\n def initialize(dependencies = {})\n @...
ruby
chosen
[ { "from": "system", "value": "Remove reference to deleted file\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + '/lib/'\nrequire 'jqgrid_rails/version'\nGem::Specification.new do |s|\n s.name = 'jqgrid_rails'\n s.version = JqGridRails::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Put in some tests for installing java\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'tomcat', :type => :class do\n context \"When on unsupported operating system family\" do\n let :facts do\n {\n :osfamily => 'Gentoo'\n ...
ruby
chosen
[ { "from": "human", "value": "Create find spec with test for deleted and discontinued filters\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule Spree\n describe Products::Find do\n let!(:product) { create(:product) }\n let!(:product_2) { create(:produ...
ruby
chosen
[ { "from": "system", "value": "Send the email on hit.\n" }, { "from": "human", "value": "Canary::App.controllers :page do\n\n get :index, :map => '/hit/:page_name' do\n @page_name = params[:page_name]\n render 'index'\n end\n\n # get :sample, :map => '/sample/url', :provides => [:any, :j...
ruby
chosen
[ { "from": "system", "value": "Change rule set description to string\n" }, { "from": "human", "value": "class CreateRuleSets < ActiveRecord::Migration\n def change\n create_table :qwester_rule_sets do |t|\n t.string :title\n t.string :description\n t.string :url\n t.timest...
ruby
chosen
[ { "from": "system", "value": "Set $LOADED_FEATURES and $LOAD_PATH aliases. Move '.' to end of $:.\n" }, { "from": "human", "value": "Globals = {\n :$; => nil, \n :$/ => \"\\n\", # Input record separator \n :$\\ => nil, # Output record separator\n :$> => STDOUT...
ruby
chosen
[ { "from": "system", "value": "Add drawing tests for presentation.\n" }, { "from": "human", "value": "require 'spec_helper'\ndescribe 'ApiDrawing section tests' do\n it 'ApiDrawing | GetClassType method' do\n pptx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/pptx/smoke/api_drawing/...
ruby
chosen
[ { "from": "system", "value": "Fix broken spec for Merge request > Revert modal\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'Merge request > User sees revert modal', :js do\n let(:project) { create(:project, :public, :repository) }\n let(:user) { project.creator }\n l...
ruby
chosen
[ { "from": "system", "value": "Use single quotes where appropriate.\n" }, { "from": "human", "value": "def readFile(filename)\n File.open(filename, 'r').read\nend\n\ndef sanitize(string)\n string.split(\"\\n\").sort.delete_if {|x| x.start_with?('#') || x.strip == ''}\nend\n\nipv6 = '::1 ...
ruby
chosen
[ { "from": "human", "value": "Test to verify the authorization filter on custom bbb servers controller.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe CustomBigbluebuttonServersController do\n include ActionController::AuthenticationTestHelper\n render_views\n\n before(:e...
ruby
chosen
[ { "from": "system", "value": "Update iTerm2 Beta to 2.9.20150626" }, { "from": "human", "value": "cask :v1 => 'iterm2-beta' do\n version '2.1.1'\n sha256 'b8f1bbd11cdb3e26fd9fab6971c28ebeb422361b2cc5fd6e4a843836d5dedeb0'\n\n url 'https://iterm2.com/downloads/beta/iTerm2-2_1_1.zip'\n homepage...
ruby
chosen
[ { "from": "system", "value": "Update Sketch Beta.app to version 3.2\n" }, { "from": "human", "value": "class SketchBeta < Cask\n version '3.1.1'\n sha256 '4d4785f3356079f224bd64302ab17e651ba00752e364f08f146e67196a0a0fbc'\n\n url 'https://rink.hockeyapp.net/api/2/apps/0172d48cceec171249a8d850f...
ruby
chosen
[ { "from": "system", "value": "Upgrade Vagrant Bar.app to v1.14\n" }, { "from": "human", "value": "cask :v1 => 'vagrant-bar' do\n version '1.13'\n sha256 '161ad4f4b7acbeaa76352e7a19849dd5275e4b1811caba8b853fa7964812169a'\n\n url \"https://github.com/BipSync/VagrantBar/releases/download/#{versi...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to reflect Rails 3.2 compatibility\n" }, { "from": "human", "value": "module Abracadabra\n module Rails\n VERSION = \"1.0.4\"\n end\nend\n" }, { "from": "gpt", "value": "module Abracadabra\n module Rails\n VERSION = \"1.0.5\"\n e...
ruby
chosen
[ { "from": "system", "value": "Add custom parser for the times where XML doesn't have Content-Type\n" }, { "from": "human", "value": "require 'httparty'\nrequire 'openssl'\n\nrequire 'aws/core/response'\n\n##\n# Monkey-patch body_stream usage into HTTParty\n##\nmodule HTTParty\n class Request\n ...
ruby
chosen
[ { "from": "system", "value": "Add version to comment in database\n" }, { "from": "human", "value": "class DbTasks\n class PostgresDbConfig < ActiveRecordDbConfig\n end\n\n class PostgresDbDriver < ActiveRecordDbDriver\n def create_schema(schema_name)\n if select_rows(\"SELECT * FROM I...
ruby
chosen
[ { "from": "system", "value": "Set default CLI task to weekly_commits method\n\nforgot to change it on rename\n" }, { "from": "human", "value": "require 'thor'\nrequire 'colorize'\nrequire 'active_support/all'\n\nmodule WeeklyCommits\n class CLI < Thor\n package_name 'Weekly Commits'\n def...
ruby
chosen
[ { "from": "system", "value": "Include view helper on view load.\n" }, { "from": "human", "value": "require 'wicked_pdf/pdf_helper'\nrequire 'wicked_pdf/wicked_pdf_helper'\nrequire 'wicked_pdf/wicked_pdf_helper/assets'\n\nclass WickedPdf\n if defined?(Rails.env)\n class WickedRailtie < Rails:...
ruby
chosen
[ { "from": "system", "value": "Change idouble to single quotes\n" }, { "from": "human", "value": "class Configuration\n def self.db_dir\n \"db/\"\n end\n\n def self.log_file\n 'suptasks.log'\n end\n\n def self.google_client_id\n ENV['GOOGLE_CLIENT_ID']\n end\n\n def self.google_cl...
ruby
chosen
[ { "from": "system", "value": "Remove test on Fixnum since it has been removed from Ruby 2.4\n" }, { "from": "human", "value": "class Hash\n def symbolize_keys!\n keys.each do |key|\n self[(key.to_sym rescue key)] = delete(key) if key.respond_to?(:to_sym) && !key.is_a?(Fixnum)\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add net-ssh as an explicit dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/weave/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Caleb Spare\"]\n gem.email = [\"cesp...
ruby
chosen
[ { "from": "system", "value": "Change statistic hash to object\n" }, { "from": "human", "value": "require_relative 'job_serializer'\nrequire_relative 'job_retry'\nrequire_relative 'statistics'\n\nmodule Workerholic\n class JobProcessingError < StandardError; end\n\n class JobProcessor\n def ...
ruby
chosen
[ { "from": "system", "value": "Define NT in the PublicBody Module\n" }, { "from": "human", "value": "# Add a callback - to be executed before each request in development,\n# and at startup in production - to patch existing app classes.\n# Doing so in init/environment.rb wouldn't work in developme...
ruby
chosen
[ { "from": "system", "value": "Fix RubyMotion app config integration\n" }, { "from": "human", "value": "unless defined?(Motion::Project::Config)\n raise \"This file must be required within a RubyMotion project Rakefile.\"\nend\n\nMotion::Project::App.setup do |app|\n # if Motion::Project.consta...
ruby
chosen
[ { "from": "system", "value": "Create first 0.4.0 release candidate\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nmodule Pacto\n VERSION = '0.4.0.pre'\nend\n" }, { "from": "gpt", "value": "# -*- encoding : utf-8 -*-\nmodule Pacto\n VERSION = '0.4.0.rc1'\nend\n" } ...
ruby
chosen
[ { "from": "system", "value": "Upgrade PyCharm EAP to v139.113\n" }, { "from": "human", "value": "class PycharmEap < Cask\n version '138.2401'\n sha256 '801378fffeee50f0933a309a1187f94f0bd49a3f9fc861c8144c78b57d224f38'\n\n url \"http://download.jetbrains.com/python/pycharm-professional-#{versi...
ruby
chosen
[ { "from": "system", "value": "Add tests for repo class\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'marathon::repo' do\n on_supported_os.each do |os, facts|\n context \"on #{os}\" do\n let(:facts) do\n facts\n end\n\n it { is_expected.to compile...
ruby
chosen
[ { "from": "system", "value": "Fix a double period in an error message\n" }, { "from": "human", "value": "class ApplicationsController < ApplicationController\n before_action :set_application, only: [:destroy]\n def new\n end\n\n def create\n @application = Doorkeeper::Application.new(appl...
ruby
chosen
[ { "from": "system", "value": "Refactor specs to DRY them up a bit\n\n[#26437519]\n" }, { "from": "human", "value": "require 'git_tracker/commit_message'\n\ndescribe GitTracker::CommitMessage do\n\n it \"requires path to the temporary commit message file\" do\n -> { GitTracker::CommitMessage....
ruby
chosen
[ { "from": "system", "value": "Simplify Class extensions using existing methods\n" }, { "from": "human", "value": "class Class\r\n def hierarchy\r\n sc = self.superclass\r\n return [self] if sc.nil?\r\n return sc.hierarchy.unshift(self)\r\n end\r\n\r\n def subclass_of?(c)\r\n retur...
ruby
chosen
[ { "from": "system", "value": "FIX BUG: Dup the values in the find and replacer so it doesn't affect other values\n" }, { "from": "human", "value": "module HarvesterCore\n module Modifiers\n class FindReplacer < AbstractModifier\n attr_reader :regexp, :replacement_rules\n\n def init...
ruby
chosen
[ { "from": "system", "value": "Correct Project's schema so it conforms better to Bob::Buildable's API\n" }, { "from": "human", "value": "module Integrity\n module Migrations # :nodoc:\n class InitialState < Sequel::Migration # :nodoc:\n def up\n create_table :projects do\n ...
ruby
chosen
[ { "from": "system", "value": "Update Rewards controller with new logic\n" }, { "from": "human", "value": "class RewardsController < ApplicationController\n\tbefore_action :require_login\n\tdef index\n\t\trewards = Reward.where(family_id: 1)\n\t\trender json: rewards\n\tend\n\n\tdef create\n\t\t@...
ruby
chosen
[ { "from": "system", "value": "Add name, license, vendor and zap stanzas for GOG Downloader.app\n" }, { "from": "human", "value": "cask :v1 => 'gog-downloader' do\n version '1.2_512'\n sha256 '353604a2123feacf438c6586b3ec20967dca637b0a97d36203adbc3e1dfdefce'\n\n url \"http://static.gog.com/dow...
ruby
chosen
[ { "from": "system", "value": "Make Execution of SynchronizeFeaturedCollectionWorker unique\n\nSee: https://github.com/tootsuite/mastodon/pull/7043/commits/b759b0564fc17ddf1bca06142c32d8b55578f9b4\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ActivityPub::SynchronizeFe...
ruby
chosen
[ { "from": "system", "value": "Use a more readable syntax for clicking the user destroy button.\n" }, { "from": "human", "value": "require 'rails_helper'\nrequire_relative '../../pages/login_page'\nrequire_relative '../../pages/user_page'\n\ndescribe 'destroy users' do\n let(:login_page) { Featu...
ruby
chosen
[ { "from": "system", "value": "Update request spec for pacs engine\n\nWe need to stub some class methods which the pacs engine controller\ncalls in order to assign variables for the root view.\n\nThis is a short term solution and we may want to revisit how\nwe assign these variables in pacs longer term.\n" ...
ruby
chosen
[ { "from": "system", "value": "Add tests for the petitions index page with and without criteria.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass PetitionsControllerTest < ActionController::TestCase\n def test_get\n get(:show, { :id => WeThePeopleHelper::EXAMPLE_PETITION_ID }...
ruby
chosen
[ { "from": "human", "value": "Add test file for CreateComment." }, { "from": "gpt", "value": "require_relative \"../../test_helper\"\n\nmodule Trlo\n describe CreateComment do\n describe \".for\" do\n subject { CreateComment.for(card_id) }\n\n it \"creates a comment on the card\" do...
ruby
chosen
[ { "from": "system", "value": "Use LDFLAGS rather than LIBRARY_PATH.\n\nThe MinGW-w64 toolchain currently ignores LIBRARY_PATH, causing\nbuild failures because the autotools aren't able to find the\nrequired libraries. This patch explicitly sets the library search\npaths via -L options in the LDFLAGS env var...
ruby
chosen
[ { "from": "system", "value": "Remove rake as a dep\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n$LOAD_PATH.push File.expand_path('../lib', __FILE__)\nrequire 'pronto/shellcheck_version'\nrequire 'rake'\n\nGem::Specification.new do |s|\n s.name = 'pronto-shellcheck'\n s.versi...
ruby
chosen
[ { "from": "system", "value": "Fix failing tests by adding initialization method\n" }, { "from": "human", "value": "# The Destiny module namespaces all functionality which interacts with\n# the Bungie API for Destiny (video game for PS3, PS4, Xbox 360, and Xbox One)\nmodule Destiny\n # The Desti...
ruby
chosen
[ { "from": "system", "value": "Change the homepage to my site.\n" }, { "from": "human", "value": "require File.expand_path(\"../lib/pry-vterm_aliases\", __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = \"pry-vterm_aliases\"\n spec.version = Pry::Plugins::VTerm.version\n spec.email =...
ruby
chosen
[ { "from": "system", "value": "Fix require_no_authentication error on user creation\n" }, { "from": "human", "value": "class RailsyardAuthenticationDevise::RegistrationsController < Devise::RegistrationsController\n layout \"railsyard_authentication_devise/devise\"\nend\n\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Add declarative feature block support\n\nCloses #1\n" }, { "from": "human", "value": "require 'lazy_const'\n\nclass FeatureDefinitions\n extend LazyConst\n attr_reader :test_proc\n\n def self.define_feature(name, &block)\n lazy_const(name) { new(&block) }\n e...
ruby
chosen
[ { "from": "system", "value": "Put R18n related methods into its own submodule to make it easy to override them again.\n" }, { "from": "human", "value": "# R18n localization support.\n\nrequire 'r18n-core'\n\nclass FormInput\n\n include R18n::Helpers\n \n class Parameter\n include R18n::Hel...
ruby
chosen
[ { "from": "system", "value": "Expand the users index test to test deletion\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass UsersIndexTest < ActionDispatch::IntegrationTest\n def setup\n @admin = users(:nick)\n @non_admin = users(:stephen)\n end\n\n test \"index as admi...
ruby
chosen
[ { "from": "system", "value": "Use each_line instead of lines.\n" }, { "from": "human", "value": "# -*- encoding: US-ASCII -*-\n\nmodule NethackUtils\n module Rumor\n\n # Returns a randomly chosen rumor message.\n #\n # Its reliability is detemined the optional <tt>reliability</tt> argu...
ruby
chosen
[ { "from": "human", "value": "Add test of helper generator\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRails::Generators.lookup([\"rails:helper\"])\n\ndescribe Rails::Generators::HelperGenerator, type: :generator do\n destination File.expand_path('../../../../tmp/generator', __FILE...
ruby
chosen
[ { "from": "system", "value": "Fix notifier spec to not leak state.\n\nThe replacing of the publishing_api client was not being reset after\nthis test, causing other tests run after this to fail.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nRSpec.describe PublishingAPINotifier do...
ruby
chosen
[ { "from": "system", "value": "Fix test response in publisher\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe RubyRabbitmqJanus::Rabbit::Publisher, type: :rabbit,\n name: :base_publisher do\n let(...
ruby
chosen
[ { "from": "system", "value": "Fix routing to respond to both /m and /m/\n" }, { "from": "human", "value": "class PgpIo::App < Sinatra::Application\n get \"/\" do\n erb :index, :layout => :'layouts/main'\n end\n \n get \"/about\" do\n erb :about, :layout => :'layouts/main'\n end\n\n p...
ruby
chosen
[ { "from": "human", "value": "Rename CESG device guidance slug\n\nhttps://www.pivotaltracker.com/story/show/59541766\n" }, { "from": "gpt", "value": "OLD_SLUG = 'end-user-devices-security-guidance--2'\nNEW_SLUG = 'end-user-devices-security-guidance'\n\ndocument = Document.find_by_slug(OLD_SLUG)\n...
ruby
chosen
[ { "from": "system", "value": "Use Rails3 names for ActiveRecord/Support\n" }, { "from": "human", "value": "require 'activerecord'\nrequire 'activesupport'\nrequire 'digest/md5'\n\nActiveRecord::Base.class_eval {\n Array.class_eval {\n def cache_key\n if self.empty?\n 'empty/' + s...
ruby
chosen
[ { "from": "system", "value": "Add Base.configure as instance_eval to access the DSL\n" }, { "from": "human", "value": "module Hawk\n module Model\n\n ##\n # Represents a remote entity, wrapped into a model holding each property in\n # an instance variable, casting the JSON values to da...
ruby
chosen
[ { "from": "system", "value": "Make sure the Presenters module/namespace is defined.\n" }, { "from": "human", "value": "module SpanishInquisition\n def self.load\n return if @loaded\n\n Dir[Rails.root.join('app', 'surveys', '*.rb')].each do |file|\n ActiveSupport::Dependencies.require...
ruby
chosen
[ { "from": "system", "value": "Handle dependencies without version spec better\n" }, { "from": "human", "value": "require 'spikor_forge'\nrequire 'json'\n\nclass SpikorForge::Module\n attr_reader :path, :uripath, :metadata\n\n def initialize(path, uri_root_path)\n @path = path\n @uripath ...
ruby
chosen
[ { "from": "system", "value": "Convert generator_type to a Symbol.\n" }, { "from": "human", "value": "module SSLyze\n class KeyExchange\n\n def initialize(node)\n @node = node\n end\n\n def a\n @a ||= @node['A']\n end\n\n def b\n @b ||= @node['B']\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add type to password field.\n" }, { "from": "human", "value": "class TSheets::Models::User < TSheets::Model\n field :id, :integer\n field :username, :string\n field :password\n field :email, :string\n field :first_name, :string\n field :last_name, :string\n f...
ruby
chosen
[ { "from": "system", "value": "Use repositories for OpenNebula 4.8\n" }, { "from": "human", "value": "#\n# Cookbook Name:: opennebula_ng\n# Recipe:: apt_repository\n#\n# Copyright 2014, Vaamo Finanz AG\n#\n# Licensed under the Apache License, Version 2.0 (the 'License');\n# you may not use this f...
ruby
chosen
[ { "from": "system", "value": "Clear YARD Registroy before each documenting\n" }, { "from": "human", "value": "require 'rubygems/command_manager'\nrequire 'rubygems/install_update_options'\nrequire 'rubygems/commands/yardoc_command'\n\nGem::CommandManager.instance.register_command :yardoc\n\nmodu...
ruby
chosen
[ { "from": "system", "value": "Add NOTE for User model\n" }, { "from": "human", "value": "class User\n include ActiveModel::Model\n include ActiveModel::SecurePassword\n\n has_secure_password\n\n ENCRYPTED_PASSWORD_FILE = Rails.env.test? ? \"tmp/test.txt\" : Rails.root + \"db/user.txt\"\n\n ...
ruby
chosen
[ { "from": "human", "value": "test: Add integration test for Micropost\n" }, { "from": "gpt", "value": "class MicropostsTest < ActionDispatch::IntegrationTest\n include DatabaseConfiguration\n\n setup do\n @content = \"This is micropost!!!\"\n @micropost = FactoryGirl.create(:micropost, c...
ruby
chosen
[ { "from": "system", "value": "Fix test so it passes\n" }, { "from": "human", "value": "require File.expand_path('../../unit_test_helper', __FILE__)\n\nclass InstagramTest < Test::Unit::TestCase\n def test_instagram_embed\n result = auto_html('http://instagr.am/p/WsQTLAGvx7/') { instagram }\n...
ruby
chosen
[ { "from": "system", "value": "Add test to verify that vendor-supplied openssl certs are being used\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\ndescribe 'box' do\n it 'should have a root user' do\n expect(user 'root').to exist\n end\n\n it 'should have a vagrant use...
ruby
chosen
[ { "from": "system", "value": "Fix for weird exception error\n" }, { "from": "human", "value": "# Common setup for all test files.\n\nbegin\n require 'rubygems'\n gem 'flexmock'\nrescue LoadError\n # got no gems\nend\n\nrequire 'flexmock/test_unit'\n\nif RUBY_VERSION >= \"1.9.0\"\n class Test...
ruby
chosen
[ { "from": "system", "value": "Add VERSION constant to please gem-release\n\ngem-release is looking for that constant to understand current version\nand allow bump to the new one with a command.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Spree\n def self.solidus_v...
ruby
chosen
[ { "from": "system", "value": "Add vesion specification of rspec-rails for development dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"debug_exceptions_json/version\"\n\n# Describe your gem and declare its d...
ruby
chosen
[ { "from": "system", "value": "Add Heroku as a dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/dynamo_kickstarter/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Nicholas Henry\"]\n gem.email = [\"...
ruby
chosen
[ { "from": "system", "value": "Add strong params for email curation queue items\n" }, { "from": "human", "value": "class Admin::EmailCurationQueueItemsController < Admin::BaseController\n before_filter :load_email_curation_queue_item, except: [:index]\n\n def index\n @email_curation_queue_it...
ruby
chosen
[ { "from": "system", "value": "Reduce the number of additional loads when doing topological ordering.\n" }, { "from": "human", "value": "module Course::Discussion::Post::OrderingConcern\n extend ActiveSupport::Concern\n\n # Sorts all posts in a collection in topographical order.\n #\n # By co...
ruby
chosen
[ { "from": "system", "value": "[JRO] Remove unnecessary require of pry\n" }, { "from": "human", "value": "require 'pry'\n\nmodule Thredded\n class MessageboardsController < Thredded::ApplicationController\n def index\n @messageboards = Messageboard.where(closed: false).decorate\n end\...
ruby
chosen
[ { "from": "system", "value": "Add .reload in product_carousel method to prevent query errors while using postgres\n" }, { "from": "human", "value": "module Spree\n class TaxonsController < Spree::StoreController\n include Spree::FrontendHelper\n helper 'spree/products'\n\n before_actio...
ruby
chosen
[ { "from": "system", "value": "Remove actionmailer in test setup" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"bundler/setup\"\n\nrequire \"test/unit\"\nrequire \"active_support/test_case\"\nrequire 'action_mailer/test_helper'\nBundler.require(:default, :development)\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Write gem description and summary\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ruote/synchronize/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "[CS] Remove redundant code from ArrayMatchCalculator" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Adhearsion\n class CallController\n module MenuDSL\n\n class ArrayMatchCalculator < MatchCalculator\n @array_type = nil\n\n def i...
ruby
chosen
[ { "from": "system", "value": "Test API for unauthorized access to a user's hash.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"/api/v1/users\" do\n let(:url) { \"/api/v1\" }\n\n context \"as an anonymous user\" do\n let(:token) { nil }\n\n it \"adds a new user\" ...
ruby
chosen
[ { "from": "system", "value": "Fix the `raise_error` matcher without providing a specific error\n" }, { "from": "human", "value": "require 'rails_helper'\n\nmodule Command\n describe Kill do\n\n describe '#execute' do\n subject { Kill.new('test', '1').execute }\n\n before { Process....
ruby
chosen
[ { "from": "system", "value": "Change author name in 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 'middleman-slim/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Change actual credential to fake one\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rest_client'\nrequire 'json'\n\nclass DomainCheck \n \n # Username\n @username\n\n # Password\n @password\n\n # Domain you look for\n @domain\n\...
ruby
chosen
[ { "from": "system", "value": "Fix test to expect capitalized username\n" }, { "from": "human", "value": "require 'spec_helper'\nfeature \"Auth\" do\n context \"signin\" do\n scenario \"A user can access the signin page\" do\n visit signin_path\n expect(page).to have_content(\"Sign ...
ruby
chosen
[ { "from": "system", "value": "Add a different named maps helper instead\n" }, { "from": "human", "value": "module NamedMapsHelper\n def bypass_named_maps\n mocked_response = mock\n mocked_response.stubs(code: 200, response_body: '{}')\n\n mocked_http_client = Carto::Http::Client.get('n...
ruby
chosen
[ { "from": "system", "value": "Add test for absent content and absent src\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"Scripts tests\" do\n\n it \"fails for broken external src\" do\n file = \"#{FIXTURES_DIR}/script_broken_external.html\"\n output = capture_stde...
ruby
chosen
[ { "from": "system", "value": "Check for upload widget on homepage when logged in\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'homepage behaviour', :type => :feature do\n before { visit '/' }\n it \"loads a page with the site's name\" do\n expect(page).to have_conten...
ruby
chosen
[ { "from": "human", "value": "Add shape test for presentation.\n" }, { "from": "gpt", "value": "require 'spec_helper'\ndescribe 'ApiShape section tests' do\n it 'ApiShape | GetClassType method' do\n pptx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/pptx/smoke/ApiShape/getclasstype....
ruby
chosen
[ { "from": "human", "value": "Add basic spec for next_player\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nRSpec.describe NextPlayer, type: :service do\n fixtures :all\n let(:find_next_player) { NextPlayer.new(round) }\n\n describe \"#call\" do\n before { find_next_player.cal...
ruby
chosen
[ { "from": "system", "value": "Make sure CheckBoxCollection enumerates ChecBox instances.\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('spec_helper', File.dirname(__FILE__))\n\ndescribe \"CheckBoxes\" do\n\n before :each do\n browser.goto(WatirSpec.files + \"...
ruby
chosen
[ { "from": "system", "value": "Add triangle-side challenge edit typo\n" }, { "from": "human", "value": "# I worked on this challenge [by myself, with: ].\n\n\n# Your Solution Below\n\ndef valid_triangle?(a, b, c)\n if a == 0 || b == 0 || c == 0\n return false\n\n elsif a + b < c\n return ...
ruby
chosen
[ { "from": "system", "value": "Add rocket_pants as runtime dependency" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ticket_gate/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "Copy VLC attributes into sprout-osx-apps, update to version 2.08\n" }, { "from": "gpt", "value": "node.default[\"vlc_version\"]=\"2.0.8\"\nnode.default[\"vlc_checksum\"]=\"bbfdc6d10d9f3a4d357d276d9c6db9c049e637fa2cc54fa511f0fce914a38ea0\"\n" } ]
ruby
chosen
[ { "from": "system", "value": "Set thumbnail size based on config\n" }, { "from": "human", "value": "require 'RMagick'\nrequire 'nokogiri'\ninclude Magick\n\nmodule Jekyll\n\n class ThumbGenerator < Generator\n safe true\n \n def generate(site)\n\n site.static_files.each do |file|\...
ruby
chosen
[ { "from": "system", "value": "Set fixed volume for Sonos wailer\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'sonos'\n\ndef queue_bob(speaker)\n speaker.add_to_queue \"x-sonos-spotify:spotify%3atrack%3a1Bh3GMDtYN2FB4jWp7VlrZ?sid=12&amp;flags=32\"\nend\n\nsystem = Sonos::System...
ruby
chosen
[ { "from": "system", "value": "Add gem dependencies, we will use them later\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"ellen/syoboi_calendar/version\"\n\nGem::Specification.new do |spec|\n sp...
ruby
chosen
[ { "from": "human", "value": "Add unit test for consul_exporter\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'prometheus::consul_exporter' do\n on_supported_os.each do |os, facts|\n context \"on #{os}\" do\n let(:facts) do\n facts\n end\n\n context ...
ruby
chosen
[ { "from": "system", "value": "Fix migration in case of duplicate preexisting users\n" }, { "from": "human", "value": "class CreateUserEmails < ActiveRecord::Migration[5.1]\n def up\n create_table :user_emails do |t|\n t.references :user, null: false\n t.string :email, null: false\n...
ruby
chosen
[ { "from": "system", "value": "Update specs to test if controllers return json\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CategoriesController do\n let(:category) { FactoryGirl.create(:category) }\n\n context 'GET #index' do\n it 'returns HTTP 200 status code' do\n ...
ruby
chosen
[ { "from": "system", "value": "Allow to delete event instance\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# == Schema Information\n#\n# Table name: event_instances\n#\n# id :integer not null, primary key\n# start_time :datetime\n# end_time ...
ruby
chosen
[ { "from": "system", "value": "Add default host in spec/dummy\n" }, { "from": "human", "value": "Dummy::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb\n\n # In the development environment your application's code is reloaded on\n # ...
ruby
chosen