conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Support HTML escape for JRuby\n" }, { "from": "human", "value": "# frozen_string_literal: true\nunless /java/ === RUBY_PLATFORM # exclude JRuby\n require 'hamlit/hamlit' # depends on C-ext defines Hamlit::Utils first for now\nend\n\nmodule Hamlit\n module Utils\n ...
ruby
chosen
[ { "from": "system", "value": "Clear out the FG definitions if they are already defined so there is no duplicate definition error\n" }, { "from": "human", "value": "require \"base_spec_helper\"\nrequire \"active_record\"\nrequire \"factory_girl\"\nrequire \"faker\"\nrequire \"protected_attributes...
ruby
chosen
[ { "from": "system", "value": "Add specs for page creation\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'pages#index' do\n\n before :each do\n create_logged_in_user\n visit georgia.search_pages_url\n end\n\n describe 'create' do\n\n context 'with a valid title'...
ruby
chosen
[ { "from": "system", "value": "Add integration test for disconnecting after calling a prepared statement\n" }, { "from": "human", "value": "require File.join(File.dirname(File.expand_path(__FILE__)), 'spec_helper.rb')\n\ndescribe Sequel::Database do\n specify \"should provide disconnect function...
ruby
chosen
[ { "from": "system", "value": "Fix broken command line app.\n" }, { "from": "human", "value": "require 'meetupanator/app'\nrequire 'meetupanator/event_finder'\nrequire 'meetupanator/event_list_file_writer'\nrequire 'meetupanator/meetup_api'\nrequire 'meetupanator/version'\nrequire 'meetupanator/i...
ruby
chosen
[ { "from": "system", "value": "Check if Rails is being used and the right version before inserting the middleware.\n" }, { "from": "human", "value": "require 'caulfield/middleware'\n\nmodule Caulfield\n class << self\n delegate :reset, :request, :env, \n :status, :headers, :body,\n ...
ruby
chosen
[ { "from": "system", "value": "Load tasks from the constant file name\n" }, { "from": "human", "value": "require \"remindice/version\"\nrequire \"thor\"\n\nmodule Remindice\n class Commands < Thor\n end\nend\n" }, { "from": "gpt", "value": "require \"remindice/version\"\nrequire \"t...
ruby
chosen
[ { "from": "system", "value": "Improve tor spect test slightly\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('tor') do\n it { should be_installed }\nend\n\ndescribe file('/etc/tor/torrc') do\n it { should be_file }\n its(:content) { should match /SocksPort 0/ }\n...
ruby
chosen
[ { "from": "system", "value": "Add tests for repo class\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'consular::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": "Set up basic `round` factories.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Round do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Round do\n ...
ruby
chosen
[ { "from": "system", "value": "Create two different execute fns for debugging\n" }, { "from": "human", "value": "class CreatePopularityFunction < ActiveRecord::Migration\n # Popularity: log2 of the votes cast, plus the seconds since 1 Jan 2014 divided by 45000 (10x slower than reddit's)\n def u...
ruby
chosen
[ { "from": "system", "value": "Simplify uniq call w/ symbol-to-proc\n" }, { "from": "human", "value": "class Image < ActiveRecord::Base\n\n EMPTY_REPO = '<none>'\n\n attr_accessor :is_official\n attr_accessor :is_trusted\n attr_accessor :star_count\n\n has_and_belongs_to_many :templates\n\n ...
ruby
chosen
[ { "from": "system", "value": "users: Modify catch-all policy to actually work\n" }, { "from": "human", "value": "class ApplicationPolicy < ActionPolicy::Base\n # make :manage? a real catch-all\n alias_rule :index?, :create?, to: :manage?\nend\n" }, { "from": "gpt", "value": "class ...
ruby
chosen
[ { "from": "system", "value": "[CSC] Add test for render with nonsymbol keys\n" }, { "from": "human", "value": "class OtherController < ApplicationController\n def test_locals\n render :locals => { :input => params[:user_input] }\n end\n\n def test_object\n render :partial => \"account\"...
ruby
chosen
[ { "from": "system", "value": "Print out view spec filename\n" }, { "from": "human", "value": "module RealWorldRails\n module Inspectors\n\n class ViewSpecsInspector < Inspector\n\n inspects :specs, %r{/views?/}\n\n end\n\n end\nend\n" }, { "from": "gpt", "value": "module...
ruby
chosen
[ { "from": "system", "value": "Add full text search description for now in the gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'morpheus/version'\n\nGem::Specification.new do |sp...
ruby
chosen
[ { "from": "system", "value": "Update sqwish test (need to reload templates)" }, { "from": "human", "value": "require File.expand_path('../test_helper', __FILE__)\n\nclass SqwishTest < UnitTest\n setup do\n app.assets.css_compression :sqwish, :strict => true\n end\n\n teardown do\n app.a...
ruby
chosen
[ { "from": "system", "value": "Include year that is passed from params. (When quotas are duplicated for a new year, that year will not be in the array of years, until they have been copied. This way the interface shows it nevertheless, otherwise users might think it didn't work)\n" }, { "from": "huma...
ruby
chosen
[ { "from": "system", "value": "Make venues index use params[:type], like events in admin view\n" }, { "from": "human", "value": "class Admin::VenuesController < AdminController\n respond_to :html, :json\n\n include SquashManyDuplicatesMixin # provides squash_many_duplicates\n\n def index\n ...
ruby
chosen
[ { "from": "system", "value": "Add safe operator & for capitalizing params\n" }, { "from": "human", "value": "class Api::V0::UsersController < Api::V0::ApiController\n\n def me\n respond_with current_user\n end\n\n def search\n @users = User.where(\"first_name LIKE ? or username LIKE ? o...
ruby
chosen
[ { "from": "system", "value": "Implement friendly find in Api::V1::UsersController.\n" }, { "from": "human", "value": "class Api::V1::UsersController < ApiController\n before_action :set_user, except: [:create, :current]\n\n def show\n authorize @user\n render json: @user\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Update an individual transaction (e.g. description)" }, { "from": "human", "value": "class TransactionsController < ApplicationController\n respond_to :json\n\n before_filter only: [:index] do\n get_to_from\n end\n \n def index\n transactions = Transactio...
ruby
chosen
[ { "from": "system", "value": "Update the code that reloads plugin app directories to more robust code\n" }, { "from": "human", "value": "# Settings specified here will take precedence over those in config/environment.rb\n\n# In the development environment your application's code is reloaded on\n...
ruby
chosen
[ { "from": "system", "value": "Add default URL options for Devise mailer\n" }, { "from": "human", "value": "Rails.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 reload...
ruby
chosen
[ { "from": "system", "value": "Fix Heroku deployment build error\n" }, { "from": "human", "value": "Rails.cache.clear\nRails.logger.info \"** Cleared the Rails cache.\"\nputs \"** Cleared the Rails cache.\" if Rails.env.development?\n" }, { "from": "gpt", "value": "`mkdir -p tmp/cache...
ruby
chosen
[ { "from": "system", "value": "Remove inflector rule that makes commits uncountable\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection rul...
ruby
chosen
[ { "from": "system", "value": "Print usage on wrong parameters\n" }, { "from": "human", "value": "# Copyright © 2011-2012, Esko Luontola <www.orfjackal.net>\n# This software is released under the Apache License 2.0.\n# The license text is at http://www.apache.org/licenses/LICENSE-2.0\n\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Add rspec as a development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/sg_node_mapper/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Chris Mytton\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Add user create unsuccessful path test\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe UsersController do\n describe 'GET#new' do\n it 'creates a new user' do\n get :new\n expect(assigns(:user)).to be_a(User)\n end\n end\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add tests for encodings of objects to Space keys, hashes, and objects.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nshared_examples_for 'a convertable object' do |object, expected|\n it 'can be converted into a SpaceObject::Base via #to_space_object' do...
ruby
chosen
[ { "from": "system", "value": "Replace beanstalk-client dependency with beaneater\n" }, { "from": "human", "value": "require File.expand_path('lib/beantool', File.dirname(__FILE__))\n\nGem::Specification.new do |gem|\n gem.name = 'beantool'\n gem.description = %q{}\n gem.summary = %...
ruby
chosen
[ { "from": "system", "value": "Set field to test that a string is returned\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Bitsy\n describe PaymentDepotSerializer do\n\n let(:payment_depot) do\n build_stubbed(:payment_depot, address: \"89s8x8\", min_payment: 2.0)\n ...
ruby
chosen
[ { "from": "system", "value": "Exit on PG connection failure\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nrequire 'pg'\nrequire 'rack'\nrequire 'rack/contrib'\nrequire 'json'\nBundler.require :default, (ENV['RACK_ENV'] || 'development').to_sym\n\n# Basic Sinatra app t...
ruby
chosen
[ { "from": "system", "value": "Check geometry type directly in user db\n" }, { "from": "human", "value": "module AcceptanceHelpers\n\n def geometry_type_for(runner)\n result = runner.results.first\n table_name = result.tables.first\n schema = result.schema\n\n @db[%Q{\n ...
ruby
chosen
[ { "from": "system", "value": "Add test for failed password edit\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass UsersControllerTest < ActionController::TestCase\n setup do\n @user = users(:one)\n session[:user_id] = @user.id\n end\n\n test \"should get new\" do\n ge...
ruby
chosen
[ { "from": "system", "value": "Improve signal handling test case.\n" }, { "from": "human", "value": "# gratuitous tests to ensure code coverage\nrequire 'test_common'\n\nclass Nada\n include Bud\n\n state do\n table :num, [:num]\n end\n\n bloom do\n num <= (1..5).map{|i| [i]}\n end\nen...
ruby
chosen
[ { "from": "system", "value": "Stop CMN test from failing on Windows.\n" }, { "from": "human", "value": "require 'rbconfig'\nmodule TestLiveCMN\n unless Config::CONFIG['host_os'] =~ /mswin|mingw/\n def test_live_cmn\n flat_dct = IO.read('data/noyes/dct.dat').unpack 'g*'\n dct =[]\n ...
ruby
chosen
[ { "from": "system", "value": "Add new assertions to Rutty::Consts test for new constants\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestConsts < Test::Unit::TestCase\n context \"The Rutty::Consts module\" do\n should \"have all the constants set\" do\n assert_not_nil R...
ruby
chosen
[ { "from": "system", "value": "Delete test.db before the tests\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start\n\nbase = __FILE__\n$:.unshift(File.join(File.dirname(base), '../lib'))\n\nrequire 'rails'\nrequire 'rails/test_help'\nrequire 'test/unit'\nrequire 'active_record...
ruby
chosen
[ { "from": "system", "value": "Add pride to minitest helper.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'rex'\n\nrequire 'minitest/autorun'\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __F...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded layout call in blog controller\n" }, { "from": "human", "value": "class BlogController < ApplicationController\n layout 'application'\n before_filter :find_post, only: [:show]\n\n def index\n @posts = BlogPost.all\n end\n\n def show\n if s...
ruby
chosen
[ { "from": "system", "value": "Order posts by updated date\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def index\n @challenges = Challenge.opened\n @posts = player_signed_in? ? Post.all : Post.public_only\n end\n\n def rules\n md = Redcarpet::Mark...
ruby
chosen
[ { "from": "system", "value": "Load homepage asciicast in before_filter\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n def show\n @title = \"Share Your Terminal With No Fuss\"\n\n if home_asciicast_id = CFG['HOME_CAST_ID']\n asciicast = Asciicast.fin...
ruby
chosen
[ { "from": "system", "value": "Index firms with a `advises_on_investments` flag.\n" }, { "from": "human", "value": "class FirmSerializer < ActiveModel::Serializer\n self.root = false\n\n attributes :_id,\n :registered_name,\n :postcode_searchable,\n :options_when_paying_for_care,\n ...
ruby
chosen
[ { "from": "system", "value": "Make the git cloning metal test check that the actual filename returned is correct - not only that it is set\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), \"..\", \"test_helper\")\n\nclass GitHttpCloningTest < ActionController::Integra...
ruby
chosen
[ { "from": "system", "value": "Put Caulfield at the start of the middleware stack, so it can catch headers after they've been processed by ActionDispatch.\n" }, { "from": "human", "value": "require 'caulfield/middleware'\n\nmodule Caulfield\n class << self\n def method_missing(method, *args, ...
ruby
chosen
[ { "from": "system", "value": "Change internal name: consumer -> sink\n" }, { "from": "human", "value": "require 'parallel'\nrequire 'datapipes/composable'\nrequire 'datapipes/source'\nrequire 'datapipes/tube'\nrequire 'datapipes/sink'\nrequire 'datapipes/pipe'\nrequire 'datapipes/version'\n\nThr...
ruby
chosen
[ { "from": "system", "value": "Make sure FTP works behind firewalls.\n" }, { "from": "human", "value": "require 'rubygems' if RUBY_VERSION < '1.9'\nrequire 'net/ftp'\n\nmodule Metar\n\n class Raw\n\n class << self\n\n @connection = nil\n\n def cache_connection\n @connection =...
ruby
chosen
[ { "from": "system", "value": "Remove old either_result_matcher monkey-patch require" }, { "from": "human", "value": "require \"rack/csrf\"\nrequire \"dry/web/application\"\nrequire \"either_result_matcher/either_extensions\"\nrequire_relative \"container\"\nrequire \"roda_plugins\"\n\nmodule Mai...
ruby
chosen
[ { "from": "system", "value": "Use Yahoo! Finance ticker symbol style\n" }, { "from": "human", "value": "module Tdx\n class Stock\n def initialize(symbol)\n @symbol = symbol\n end\n\n def quotes(time_step = 240)\n case time_step\n when 5\n file = Data::File.open(\"...
ruby
chosen
[ { "from": "system", "value": "Add strong params for financial reports\n" }, { "from": "human", "value": "class Admin::FinancialReportsController < Admin::BaseController\n before_filter :load_organisation\n before_filter :load_financial_report, only: [:edit, :update, :destroy]\n \n def new\n ...
ruby
chosen
[ { "from": "system", "value": "Change active computers listing in Index Electronics\n" }, { "from": "human", "value": "class Electronics::ElectronicsController < ApplicationController\n\n def index\n add_breadcrumb \"Electronics\", electronics_root_path\n @computers = Computer.where(slug: ...
ruby
chosen
[ { "from": "system", "value": "Change plans module seed to only import SDGs vocabulary but not create custom field\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoSeeds\n class Recipe\n\n def self.run(site)\n # Create sdg vocabulary\n return if sit...
ruby
chosen
[ { "from": "human", "value": "Create script for generating sponsor files\n\nThis ruby script basically reads in a city config file and creates the sponsor file associated with it. It will NOT create the images, naturally, but this will make it somewhat easier.\n\n\nFormer-commit-id: 4c9503f6a12b3c0eac0eb1e46...
ruby
chosen
[ { "from": "system", "value": "Correct deficit of unused steam in merit order\n\nCurtailmentAdapter adjusts the demand assigned for electricity networks\nin order to prevent unwanted import from occurring. This compensation is\nnow required with the heat network where there is no dispatchable\nimport.\n\nCor...
ruby
chosen
[ { "from": "system", "value": "Raise the deployment target to 10.8 because of a used NSNib method.\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n\n spec.name = 'KSPAutomaticHeightCalculationTableCellView'\n\n spec.version = '1.0.0'\n\n spec.authors = {'Konstantin Pavlikhin' => 'k...
ruby
chosen
[ { "from": "system", "value": "Update CitA CSV parsing script\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'csv'\nrequire 'geocoder'\nrequire 'json'\n\nlocations = []\n\n# \"REGION\",\"DELIVERY BUREAU\",\"PRIMARY CONTACT\",\"POSTAL ADDRESS\",\"Phone number\"\nCSV.foreach('cit...
ruby
chosen
[ { "from": "system", "value": "Bump to 1.0.0.rc5: Point to ohm 1.0.0.rc4.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"ohm-contrib\"\n s.version = \"1.0.0.rc4\"\n s.summary = %{A collection of decoupled drop-in modules for Ohm.}\n s.description = %{Includes a ...
ruby
chosen
[ { "from": "system", "value": ":star: Add @fabn to the authors list" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n#\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire 'sanitize/rails/version'\n\nGem::Specification.new do |s|\n s.name = \"sanitize-rails\"\n s.versi...
ruby
chosen
[ { "from": "system", "value": "Change homepage link to github source\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n\ts.name = %q{sass-timestamp}\n\ts.version = \"0.0.1.alpha.1\"\n\ts.date = %q{2014-08-12}\n\ts.license = 'MIT'\n\ts.summary = %q{SASS compile timestamp function}\...
ruby
chosen
[ { "from": "system", "value": "BAU: Fix for translations being on a separate thread\n\nIn dev env the eager_load is set to false which causes the\napp the hang when it looses the reference to the TransactionTranslationResponse class. This is a quick fix.\n" }, { "from": "human", "value": "Rails.a...
ruby
chosen
[ { "from": "system", "value": "Add unscoped call for users\n" }, { "from": "human", "value": "module UserImpersonate\n module ApplicationHelper\n def current_staff_user\n return unless session[:staff_user_id]\n staff_finder_method = config_value(UserImpersonate::Engine.config, :staf...
ruby
chosen
[ { "from": "system", "value": "Use custom logger to extract metrics instead of statsd logger\n" }, { "from": "human", "value": "require 'resque'\nrequire 'resque/failure/base'\nrequire 'resque/failure/multiple'\nrequire 'resque/failure/redis'\n\n# Load automatically all resque files from lib/resq...
ruby
chosen
[ { "from": "system", "value": "Make the default door status manager URI a valid one\n" }, { "from": "human", "value": "# Pesho instance for door status updates\nRails.application.config.door_status_manager = ActiveSupport::OrderedOptions.new\nRails.application.config.door_status_manager.host = ':...
ruby
chosen
[ { "from": "system", "value": "Add 9.6 to postgresql alternate versions\n\nand bump the default from 9.1 => 9.3\n" }, { "from": "human", "value": "include_attribute 'travis_build_environment'\n\ndefault['postgresql']['default_version'] = '9.1'\ndefault['postgresql']['alternate_versions'] = %...
ruby
chosen
[ { "from": "system", "value": "Tag git config specs to be skipped on precise\n\nuntil the behavior can be backported\n" }, { "from": "human", "value": "require 'support'\n\ndescribe 'git installation' do\n describe package('git') do\n it { should be_installed }\n end\n\n describe command('g...
ruby
chosen
[ { "from": "system", "value": "Fix specs, do not output the metadata.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndef mov_file\n path = File.expand_path('../../file.mov', __FILE__)\n pending \"Please create mov file #{path}\" if !File.file?(path)\n path\nend\n\ndescribe MediaIn...
ruby
chosen
[ { "from": "system", "value": "Add an additional project as a sanity check\n" }, { "from": "human", "value": "require 'allen/dsl'\n\ninclude Allen::DSL\n\ndescribe Allen::DSL do\n\n it \"can configure the client\" do\n settings do\n client \"RichMahogany\"\n root_dir { \"path/to/roo...
ruby
chosen
[ { "from": "system", "value": "Set model top level constant earlier in spec, fixing association issues\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'sequel'\nrequire 'logger'\n\nRSpec.configure do |c|\n c.around(:each) do |example|\n db.transaction(:rollback=>:always){exampl...
ruby
chosen
[ { "from": "system", "value": "Fix mocha puking all over itself under 1.9\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'mocha'\n\n# disable warnings in compat specs.\n$VERBOSE = nil\n\n$:.unshift File.dirname(File.dirname(__FILE__)) + \"/lib\"\n\nENV['RACK_ENV'] ||= 'test'\n\nre...
ruby
chosen
[ { "from": "system", "value": "Update ckeditor assets precompile directive\n\nCKEditor is not working, hoping this will fix it.\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# yo...
ruby
chosen
[ { "from": "system", "value": "Update required Ruby version 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 'omniauth/version'\n\nGem::Specification.new do |spec|\n spec.ad...
ruby
chosen
[ { "from": "system", "value": "Fix CI/CD bridge variables unit test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Ci::Bridge do\n set(:project) { create(:project) }\n set(:pipeline) { create(:ci_pipeline, project: project) }\n\n let(:bridge) do\n create(:ci_bridge, pi...
ruby
chosen
[ { "from": "system", "value": "Add specs for extension and log callback in bindings\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Rdkafka::Bindings do\n it \"should load librdkafka\" do\n expect(Rdkafka::Bindings.ffi_libraries.map(&:name).first).to include \"librdkafk...
ruby
chosen
[ { "from": "system", "value": "Add Rails as development dependency\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'sprockets-redirect'\n s.version = '0.1.0'\n s.date = '2011-09-15'\n\n s.homepage = \"https://github.com/sikachu/sprockets-redirect\"\n...
ruby
chosen
[ { "from": "system", "value": "Stop scanning subdirectories under app/models.\n" }, { "from": "human", "value": "# NOTE: only doing this in development as some production environments (Heroku)\n# NOTE: are sensitive to local FS writes, and besides -- it's just not proper\n# NOTE: to have a dev-mo...
ruby
chosen
[ { "from": "system", "value": "Fix reference to task object\n" }, { "from": "human", "value": "module Zensana\n class Asana\n class Project\n include Zensana::Asana::Access\n\n def self.list\n # NOTE: this is a class variable so the list\n # is calculated only once for...
ruby
chosen
[ { "from": "system", "value": "Write comment explaining why test is probably failing\n" }, { "from": "human", "value": "require_relative '../cookie'\n\nRSpec.describe \"Cookie\" do\n\n it \"can interpret the Cookie header\" do\n string = CIPHER.encrypt(\"foo=bar; cat=dog\")\n cookie = Cook...
ruby
chosen
[ { "from": "human", "value": "Write tests for extenssts for extension\n" }, { "from": "gpt", "value": "require 'bundler/setup'\nrequire 'rspec'\nrequire 'sartre'\n\ndescribe Sartre do\n subject do\n class MyObject\n attr_accessor :property\n\n def attribute\n true\n end\...
ruby
chosen
[ { "from": "system", "value": "Add chefspec coverage w/ fancy filter" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'chefspec'\nrequire 'chefspec/berkshelf'\n\nrequire 'chef/application'\n\nRSpec.configure do |config|\n # Default platform used\n config.platform = 'ubuntu'\n\n # ...
ruby
chosen
[ { "from": "system", "value": "Enable setting of HostName and User via environment variables\n" }, { "from": "human", "value": "require 'serverspec'\nrequire 'net/ssh'\nrequire 'yaml'\n\nproperties = YAML.load_file('properties.yml')\n\nset :backend, :ssh\n\nif ENV['ASK_SUDO_PASSWORD']\n begin\n...
ruby
chosen
[ { "from": "system", "value": "Put `Coveralls.wear!` before app code is required\n\nThat's what the docs say to do, anyway.\nhttps://coveralls.io/docs/ruby\n" }, { "from": "human", "value": "require 'right_hook'\nrequire 'right_hook/app'\nrequire 'right_hook/authenticated_client'\nrequire 'right_...
ruby
chosen
[ { "from": "system", "value": "Update FakeWeb URI to ChannelAdvisor V6 API\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler/setup'\nrequire 'channeladvisor'\nrequire 'fakeweb'\n\nDir[File.dirname(__FILE__) + \"/support/**/*.rb\"].each {|f| require f}\n\nRSpec.configure do |...
ruby
chosen
[ { "from": "system", "value": "Drop connection before each example.\n" }, { "from": "human", "value": "$:.unshift File.expand_path('..', __FILE__)\n$:.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'rubygems'\nrequire 'bundler'\nBundler.setup(:test)\n\nrequire 'rspec'\nrequire 'rspec/...
ruby
chosen
[ { "from": "system", "value": "Fix uninitialized instance variable warning\n" }, { "from": "human", "value": "require 'bundler'\nBundler.setup\n\nbegin\n require 'coveralls'\n Coveralls.wear!\nrescue LoadError\nend\n\nrequire 'with_model'\nRSpec.configure do |config|\n config.extend WithModel\...
ruby
chosen
[ { "from": "system", "value": "Remove missed require of pry-debugger\n" }, { "from": "human", "value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file using `require \"...
ruby
chosen
[ { "from": "system", "value": "Enable pry dbg binding into guard/rspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'sncf_api'\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire...
ruby
chosen
[ { "from": "system", "value": "Configure of gems for coverage\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'space2underscore'\nBundler.setup\n\nRSpec.configure do |config|\n config.order = 'random'\n config.expect_with :rspec do |rspec|\n rspec.syntax = :expect\n end\...
ruby
chosen
[ { "from": "system", "value": "Remove redundant RSpec config option\n\ntreat_symbols_as_metadata_keys_with_true_values is now always true (and\nsetting it to false has no effect).\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear!\n\nRSpec.configure do |config|\n config.trea...
ruby
chosen
[ { "from": "system", "value": "Use an in-memory sqlite3 database for testing\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + \"/../lib/integrity\"\nrequire \"rubygems\"\nrequire \"spec\"\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + \"/../lib/in...
ruby
chosen
[ { "from": "system", "value": "Use Spider.locale instead of Locale.current[0] to avoid errors on Windows" }, { "from": "human", "value": "module Spider\n \n class Request\n attr_accessor :action, :params, :cookies, :env, :protocol,\n :format, :session, :user_id, ...
ruby
chosen
[ { "from": "system", "value": "Deploy to the correct ruby version 2.6.0\n" }, { "from": "human", "value": "# config valid only for current version of Capistrano\nlock '3.6.1'\n\nset :application, 'anniecodes'\nset :repo_url, 'https://github.com/anniecodes/annie.codes.git'\n\nset :user, \"deploy\"...
ruby
chosen
[ { "from": "system", "value": "Change root to be the items search view\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n resources :schools, only: [:show]\n\n resources :items, only: [:show, :index]\n\n resources :points, only: [:show], constraints: { id: /[^\\/]+/ }\n\ne...
ruby
chosen
[ { "from": "system", "value": "Add /api to controller path\n" }, { "from": "human", "value": "Sprangular::Engine.routes.draw do\n scope module: 'sprangular' do\n root to: 'home#index'\n\n scope defaults: {format: :json} do\n post 'facebook/fetch'\n\n resources :taxonomies, only: ...
ruby
chosen
[ { "from": "system", "value": "Add feedback for password strength\n" }, { "from": "human", "value": "module Devise\n module Models\n module Strengthened\n def self.included(base)\n base.extend ClassMethods\n\n base.class_eval do\n validate :strong_enough_password?,...
ruby
chosen
[ { "from": "system", "value": "Implement supported_protocols rather than use_ssl?.\n\nThis is a better way to force HTTPS.\n" }, { "from": "human", "value": "require \"geocoder/lookups/nominatim\"\nrequire \"geocoder/results/pickpoint\"\n\nmodule Geocoder::Lookup\n class Pickpoint < Nominatim\n ...
ruby
chosen
[ { "from": "system", "value": "Decrease repository import frequency because it finished\n" }, { "from": "human", "value": "module Github\n class RepositoryImporter\n API_REQUEST_INTERVAL = 0.02\n MAX_IMPORT_COUNT = 30\n FETCH_ATTRIBUTES = %i[\n id\n name\n full_name\n ...
ruby
chosen
[ { "from": "system", "value": "CA-4261: Add new field as accessor\n" }, { "from": "human", "value": "module Lobbyist\n module V2\n\n class ScottySetting < Lobbyist::V2::Base\n attr_accessor :id, :company_id, :days, :time\n attr_accessor :upload_type, :system_enabled, :use_closed_inv...
ruby
chosen
[ { "from": "system", "value": "Delete requires for \"find\" and \"set\" in main Obs Ctrlr file\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ObservationsController < ApplicationController\n # These need to be moved into the files where they are actually used.\n requi...
ruby
chosen
[ { "from": "system", "value": "Validate time_zone before using it\n" }, { "from": "human", "value": "# TODO: Needs specs\nmodule Clockface\n class JobsPresenter < SimpleDelegator\n def period\n I18n.t(\n \"datetime.distance_in_words.x_#{job.period_units}\",\n count: job.per...
ruby
chosen