conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change User model based on new implementation of votes.\n\nDeleted the before_save callback. It doesn't make sense to do this.\n\nIncluded the correct associations in User.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n before_save :count_vote...
ruby
chosen
[ { "from": "system", "value": "Append Jader views path to app.config instead of using a controller before filter\n" }, { "from": "human", "value": "require 'sprockets'\nrequire 'sprockets/engines'\n\nmodule Jader\n class Engine < Rails::Engine\n initializer \"jade.configure_rails_initializati...
ruby
chosen
[ { "from": "system", "value": "Add Marin Usalj to contributors in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Kiwi'\n s.version = '2.1'\n s.summary = 'A Behavior Driven Development library for iOS and OS X.'\n s.homepage = 'htt...
ruby
chosen
[ { "from": "system", "value": "Fix a typo in filename\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'liquid_code'\n s.version = '0.1.0'\n s.date = '2016-06-18'\n s.summary = \"Generate QR codes with rounded corners\"\n s.description = \"Thi...
ruby
chosen
[ { "from": "system", "value": "Add `mysql2` and `pg` to development dependencies\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = \"lita-markov\"\n spec.version = \"1.3.0\"\n spec.authors = [\"Dirk Gadsden\"]\n spec.email = [\"dirk...
ruby
chosen
[ { "from": "system", "value": "Update podspec to the latest release" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Ogra\"\n s.version = \"1.2\"\n s.summary = \"Provides the ability to convert from a model object into an Argo JSON representation...
ruby
chosen
[ { "from": "system", "value": "Fix clojars push script to look in the correct place.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nDir[\"target/*\"].each do |dir|\n if File.directory?(dir) \n puts \"Processing #{dir}...\"\n Dir.chdir(dir) do\n if File.exists?(\"project.clj...
ruby
chosen
[ { "from": "human", "value": "Add some documentation for TagLib::MPEG::File\n" }, { "from": "gpt", "value": "module TagLib::MPEG\n class File\n # Load an MPEG file.\n #\n # @param [String] filename\n # @param [Boolean] read_properties if audio properties should be\n # ...
ruby
chosen
[ { "from": "human", "value": "Add integration spec for interactors calling commands and queries\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\nrequire 'pavlov'\n\ndescribe \"Pavlov interactors\" do\n before do\n stub_const \"SecureRandom\", double(uuid: '1234')\n $redi...
ruby
chosen
[ { "from": "system", "value": "Increment test coverage for generate subscription products task\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire \"rake\"\n\ndescribe 'subscriptions', sidekiq: :fake do\n before do\n SpreeRandomSubscriptions::Engine.load_tasks\n Rake::Task.de...
ruby
chosen
[ { "from": "system", "value": "Change logic test for GeojsonServiceSpec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe GeojsonService do\n describe '.toGeoJsonPolygon' do\n\n let(:to_polygon_return) {\n {\n geo: {\n type: \"Polygon\",\n ...
ruby
chosen
[ { "from": "human", "value": "Add example showing an AFK bot\n" }, { "from": "gpt", "value": "# Built to be run as a cron job every few minutes or so, however can be easily\n# adapted to run with just a loop, and sleep after each run.\n# Could be much more advanced by using a built in storage of ...
ruby
chosen
[ { "from": "human", "value": "Create script for mapped tags\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire File.expand_path('../config/environment', __dir__)\n\nrequire 'trollop'\n\noptions = Trollop.options(ARGV) do\n banner \"USAGE: #{__FILE__} -c|--commit\\n\" \\\n \"E...
ruby
chosen
[ { "from": "system", "value": "Raise if sfcc lib not found\n" }, { "from": "human", "value": "require 'mkmf'\n# $CFLAGS = \"#{$CFLAGS} -Werror\"\n\nhave_library('cmpisfcc', 'NewCIMCEnv')\n#find_header 'cimc.h', '/usr/include/cimc'\nfind_header 'cmci.h', '/usr/include/CimClientLib'\ncreate_makefil...
ruby
chosen
[ { "from": "system", "value": "Remove stuff not used by production\n" }, { "from": "human", "value": "# These values override defaults set in prey_fetcher.rb.\n# These are only loaded in production.\nPREYFETCHER_CONFIG_PRODUCTION_RB = {\n # Regular app config\n :app_asset_domain => 'static.prey...
ruby
chosen
[ { "from": "system", "value": "Allow any rails version over 4.1.\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'rocket_job_mission_control/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification...
ruby
chosen
[ { "from": "system", "value": "Install to ec2 user crontab\n" }, { "from": "human", "value": "#\n# Updates the crontab using wheneverize\n#\n\nafter \"deploy:symlink\", \"deploy:update_crontab\"\n\nnamespace :deploy do\n desc \"Update the crontab file\"\n task :update_crontab, :roles => :db do\...
ruby
chosen
[ { "from": "system", "value": "Set fixture paths for unit tests\n\nThis change defines manifest_dir and module_path expicitly in unit\ntests so that modules installed under fixtures directory is properly\nloaded.\n\nCloses-Bug: #1930403\nChange-Id: Idc7a8a5b663d1cccb54ff1f62e975582c81d9f82\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Update shared spec load path to be simpler\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'backports'\n\nbegin\n require 'rspec' # try for RSpec 2\nrescue LoadError\n require 'spec' # try for RSpec 1\n RSpec = Spec::Runner\nend\n\nrequire 'virt...
ruby
chosen
[ { "from": "human", "value": "Add integration tests using POSTMARK_API_TEST key.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"Sending emails with Postmark\" do\n subject { Postmark::ApiClient.new(\"POSTMARK_API_TEST\") }\n\n context \"Mail::Message delivery\" do\n let...
ruby
chosen
[ { "from": "system", "value": "Use SHA256 instead of outdated SHA1\n" }, { "from": "human", "value": "cask :v1 => 'font-menlo-powerline' do\n url 'https://gist.github.com/raw/1627888/c4e92f81f7956d4ceaee11b5a7b4c445f786dd90/Menlo-ForPowerline.ttc.zip'\n homepage 'https://powerline.readthedocs.o...
ruby
chosen
[ { "from": "human", "value": "Add HotS Replay Uploader 2.0.0\n" }, { "from": "gpt", "value": "cask :v1 => 'hots-replay-uploader' do\n version '2.0.0'\n sha256 'c0d5775c47b2c57a2b63bddbbb7f4c380874cb37c277b4477491fe4d7be875e2'\n\n url \"https://github.com/eivindveg/HotSUploader/releases/downloa...
ruby
chosen
[ { "from": "system", "value": "Support for reporting successful Chef runs\n" }, { "from": "human", "value": "require 'hipchat'\n\n#\n# Provides a Chef exception handler so you can send information about\n# chef-client failures to a HipChat room.\n#\n# Docs: http://wiki.opscode.com/display/chef/Ex...
ruby
chosen
[ { "from": "system", "value": "Add missing licence text to Utils.rb\n" }, { "from": "human", "value": "module Racket\n # Collects utilities needed by different objects in Racket.\n class Utils\n # Builds and returns a path in the file system from the provided arguments. The first element\n ...
ruby
chosen
[ { "from": "system", "value": "Test valid token and song URL are retrieved\n" }, { "from": "human", "value": "require File.expand_path(\"./helper\", File.dirname(__FILE__))\n\ndescribe 'Client' do\n context 'initialization' do\n it 'should have a valid session' do\n @gs = Grooveshark::Cl...
ruby
chosen
[ { "from": "system", "value": "Add a few more specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'source install' do\n let(:chef_run) do\n runner = ChefSpec::Runner.new(platform: 'ubuntu', version: '12.04')\n runner.node.set['nrpe']['install_method'] = 'source'\n ...
ruby
chosen
[ { "from": "system", "value": "Change the logger setup to a before(:each) block\n" }, { "from": "human", "value": "$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$:.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire 'example'\n\nRSpec.configure do |config|\n config.before(:al...
ruby
chosen
[ { "from": "system", "value": "Use the new 'dm-core/spec/setup' file.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\n\nbegin\n Bundler.setup(:runtime, :test)\nrescue Bundler::BundlerError => e\n STDERR.puts e.message\n STDERR.puts \"Run `bundle install` to install mi...
ruby
chosen
[ { "from": "system", "value": "Add simplecov to spec helper\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'ruuid/mongoid'\n" }, { "from": "gpt", "value": "require 'simplecov'\nSimpleCov.start do\n add_filter '/spec/'\nend\n\n$L...
ruby
chosen
[ { "from": "system", "value": "Fix CI on itamae 1.10.4+\n\nhttps://github.com/itamae-kitchen/itamae/commit/aea48c1bf0f5958184bc27feecc9045d1689f6ee" }, { "from": "human", "value": "require 'serverspec'\nrequire 'docker'\n\nset :backend, :docker\n\nset :docker_image, ENV['DOCKER_IMAGE']\nset :dock...
ruby
chosen
[ { "from": "system", "value": "Add Coverall and Codeclimate report\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'forgery'\n\nrequire 'simplecov'\nrequire 'simplecov-rcov'\n\n## Configure SimpleCov\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatt...
ruby
chosen
[ { "from": "system", "value": "Update rubocop-govuk requirement from = 4.7.0 to = 4.8.0\n\nUpdates the requirements on [rubocop-govuk](https://github.com/alphagov/rubocop-govuk) to permit the latest version.\n- [Release notes](https://github.com/alphagov/rubocop-govuk/releases)\n- [Changelog](https://github....
ruby
chosen
[ { "from": "system", "value": "Update rspec requirement from ~> 3.9.0 to ~> 3.10.0\n\nUpdates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.\n- [Release notes](https://github.com/rspec/rspec/releases)\n- [Commits](https://github.com/rspec/rspec/compare/v3.9.0...v3.1...
ruby
chosen
[ { "from": "system", "value": "Check pictures when generate index.js\n" }, { "from": "human", "value": "\nclass Shja::Html\n attr_reader :movies\n attr_reader :target_dir\n\n def initialize(movies: movies, target_dir: target_dir)\n @movies = movies\n @target_dir = target_dir\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make it work on Windows, where you can trust everyone to have HOME set. When HOME was nil, it would try addition with nil." }, { "from": "human", "value": "require 'digest/md5'\nrequire File.join(File.dirname(__FILE__), '../lib/aaf_auto_rebuild')\n\nSTORE = ENV['HO...
ruby
chosen
[ { "from": "system", "value": "Use the plain old regexp syntax\n" }, { "from": "human", "value": "require_relative 'test_case'\nrequire 'minitest/fail'\n\nmodule Minitest\n class FailTest < TestCase\n def test_fail_eh\n fail_off!\n refute Fail.fail?\n end\n\n def test_fail_ban...
ruby
chosen
[ { "from": "system", "value": "Add test for to_l method and refactor old tests.\n" }, { "from": "human", "value": "require 'color'\n\nRSpec.describe Color, \"#to_s\" do\n it \"converts the color to a string with r, g, b (in that order)\" do\n color = Color.new 1, 2, 3\n expect(color.to_s)....
ruby
chosen
[ { "from": "system", "value": "Use capybara-screenshot for integration test\n\nSigned-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire_relative '../config/environment'\nrequire 'test/unit/rails/...
ruby
chosen
[ { "from": "system", "value": "Use recommended way to load Coveralls\n" }, { "from": "human", "value": "begin\n require 'coveralls'\n Coveralls.wear!\nrescue LoadError\n warn 'warning: coveralls gem not found; skipping Coveralls'\nend\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE_...
ruby
chosen
[ { "from": "system", "value": "Add bundler as a development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/simple_oauth/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.add_development_dependency 'mocha', '~> 0.9'\n spec.a...
ruby
chosen
[ { "from": "system", "value": "Add test for AuthorizationCode::RefreshToken model\n" }, { "from": "human", "value": "require 'helper'\nrequire 'deviantart'\n\ndescribe DeviantArt::Client do\n before(:all) do\n @da, @credentials = create_da\n end\n describe '#refresh_access_token' do\n be...
ruby
chosen
[ { "from": "human", "value": "Revert \"remove erubis test (let tilt handle this)\"\n\nThis reverts commit 3ac8cb76da7f91dc93eb533c1b063592cb80f2b9.\n\nOops. I meant to take this out after adding the development\ndependencies. I still don't think it would be a bad idea to remove\nthe template-engine specific ...
ruby
chosen
[ { "from": "system", "value": "Add command to start test reporter\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire \"rails/test_help\"\nrequire \"shoulda-context\"\nrequire \"codeclimate-test-repor...
ruby
chosen
[ { "from": "system", "value": "Reset . What gem is doing this?\n" }, { "from": "human", "value": "require \"bundler/setup\"\nrequire \"flipflop\"\nrequire \"minitest/autorun\"\n" }, { "from": "gpt", "value": "require \"bundler/setup\"\nrequire \"flipflop\"\nrequire \"minitest/autorun\...
ruby
chosen
[ { "from": "system", "value": "Add SimpleCov configuration, to run coverage locally as well as Coveralls.io\n" }, { "from": "human", "value": "$:.unshift(File.dirname(File.dirname(File.expand_path(__FILE__))) + '/lib')\nrequire \"rubygems\"\nrequire \"test/unit\"\nrequire \"coveralls\"\nCoveralls...
ruby
chosen
[ { "from": "system", "value": "Update development gem major versions\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"isbm-adaptor/version\"\n\nGem::Specification.new do |s|\n s.name = \"isbm-adaptor\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "chore(storage): Update samples to minimize IAM permission requirements\n\n" }, { "from": "human", "value": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the...
ruby
chosen
[ { "from": "system", "value": "Use Paperclip adapter to get the file instead of the URL\n" }, { "from": "human", "value": "class Photo < ActiveRecord::Base\n has_attached_file :photo, styles: {\n medium: '300x300>',\n thumb: '100x100>'\n }\n\n validates_attachment_content_type :photo, co...
ruby
chosen
[ { "from": "system", "value": "Update runtime zip with manifest file so that it will load\n" }, { "from": "human", "value": "# Microsoft Visual C++ redistributable\n\nname \"vc_redist\"\ndefault_version \"90\"\n\n# TODO: same for 32 bits\n# source :url => \"https://s3.amazonaws.com/dd-agent-omnib...
ruby
chosen
[ { "from": "system", "value": "Include details of page that generated the error in any exceptions\n" }, { "from": "human", "value": "module Spontaneous::Publishing::Steps\n class RenderRevision < BaseStep\n\n def call\n @progress.stage(\"rendering\")\n render_pages\n commit\n ...
ruby
chosen
[ { "from": "human", "value": "Add SequenceController with skeletal actions\n" }, { "from": "gpt", "value": "# Controller for nucleotide Sequences\n#\n# Actions\n#\n# add_sequence:: Create new sequence and add to Observation\n# destroy_sequence:: Destroy sequence\n# edit_sequence:...
ruby
chosen
[ { "from": "system", "value": "Refactor explicit alias method Card.deck -> Card.all\n" }, { "from": "human", "value": "class Card < ActiveRecord::Base\n has_many :actions, :dependent => :delete_all\n\n RANKS = %w( 2 3 4 5 6 7 8 9 10 jack queen king ace ).freeze\n SUITS = %w( hearts spades dimo...
ruby
chosen
[ { "from": "system", "value": "Use the type_for_attribute helper instead of direct hash access\n" }, { "from": "human", "value": "module DeprecationMixin\n extend ActiveSupport::Concern\n\n module ClassMethods\n private\n\n def deprecate_belongs_to(old_belongs_to, new_belongs_to)\n d...
ruby
chosen
[ { "from": "system", "value": "Add aws_role to district serializer\n" }, { "from": "human", "value": "class DistrictSerializer < ActiveModel::Serializer\n attributes :name, :region, :vpc_id, :public_elb_security_group, :private_elb_security_group,\n :instance_security_group, :ecs_ser...
ruby
chosen
[ { "from": "system", "value": "Add require path and files to gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'turtleshell'\n s.version = '0.1.0'\n s.date = '2013-11-05'\n s.summary = 'A ruby wrapper for librtlsdr'\n s.description = 'turtleshell is an inter...
ruby
chosen
[ { "from": "system", "value": "Change development dependency to Rails 3.0" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"rails_db_views/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification....
ruby
chosen
[ { "from": "system", "value": "Configure the logger class, not the instance\n" }, { "from": "human", "value": "require 'logger'\n\nmodule Combi\n def self.logger\n @logger ||= create_logger\n end\n\n def self.logger=(logger)\n @logger = logger\n end\n\n protected\n\n def self.create_l...
ruby
chosen
[ { "from": "system", "value": "Modify sqlserver driver so that it does not attempt to add username/password if the domain is specified. Specifying the domain attempts to use integrated security and there must not be any username or password specified for integrated security.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Support \"no order guarantee Route53 record value\"\n" }, { "from": "human", "value": "module Awspec::Type\n class Route53HostedZone < ResourceBase\n def resource_via_client\n @resource_via_client ||= find_hosted_zone(@display_name)\n end\n\n def id\n...
ruby
chosen
[ { "from": "system", "value": "Fix a bug in the Client\n\n`uri` is not defined here. Let's just default to always connecting on\nHTTPS. This is an SSL API afterall.\n" }, { "from": "human", "value": "require \"net/http\"\nrequire \"uri\"\nrequire \"ostruct\"\nrequire \"json\"\n\nclass ApiClient\n...
ruby
chosen
[ { "from": "system", "value": "Update turkish word recognition benchmark\n" }, { "from": "human", "value": "require 'benchmark'\nrequire 'turkish_stemmer'\n\nBenchmark.bmbm(7) do |x|\n x.report('regex') do\n 10000.times { \"aaaaaaaaaa\" =~ /^[#{TurkishStemmer::ALPHABET}]+$/ }\n end\n\n x.re...
ruby
chosen
[ { "from": "system", "value": "Remove NOT from transitionToAuth value\n" }, { "from": "human", "value": "require 'yaml'\nrequire_relative 'mongo_cluster/security'\nrequire_relative 'mongo_cluster/storage'\nrequire_relative 'mongo_cluster/replica_set'\nrequire_relative 'helpers/service'\n\nmodule ...
ruby
chosen
[ { "from": "system", "value": "Fix a warning that is for a redefined method\n\nFor example:\n\n```\n$ RUBYOPT=-w ruby -rgit_diff -e ''\n/home/pocke/.gem/ruby/2.4.0/gems/git_diff-0.3.0/lib/git_diff/diff.rb:17: warning: method redefined; discarding old stats\n```\n" }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Make sure the query string is always in the same order.\n" }, { "from": "human", "value": "require 'cgi'\n\nclass Hash\n def to_query\n query = []\n self.each_pair do |key,value|\n query << \"#{key}=#{CGI::escape(value.to_s)}\"\n end\n query.join('...
ruby
chosen
[ { "from": "system", "value": "Remove named parameters from tests to support ruby 1.9.3\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CloudFlareLocalizable do\n class MockController < ActionController::Base\n include CloudFlareLocalizable\n\n def initialize(country_c...
ruby
chosen
[ { "from": "system", "value": "Add return response if no song found\n" }, { "from": "human", "value": "require 'rapgenius'\n\nclass Lyric\n include Cinch::Plugin\n\n match /(lyric) (.+)/, prefix: /^(\\.)/\n match /(help lyric)$/, method: :help, prefix: /^(\\.)/\n\n def execute(m, command, lyr...
ruby
chosen
[ { "from": "system", "value": "Add specs demonstrating permutation not generated\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ::DarrylJenks::Permutable do\n\n context \"#each_permutation\" do\n it \"send back permutations to 'hello world' with dashes\" do\n test =...
ruby
chosen
[ { "from": "system", "value": "RSpec/LetBeforeExamples: Move let before the examples in the group.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\nmodule Socializer\n RSpec.describe VERSION do\n it { is_expected.to be_a String }\n it { is_exp...
ruby
chosen
[ { "from": "system", "value": "Remove quotes on class name\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/spec_helper'\n\nMERB_BIN = File.dirname(__FILE__) + \"/../../../bin/merb\"\n\ndescribe \"Merb::Config\" do\n before do\n ARGV.replace([])\n Merb::Server.should_r...
ruby
chosen
[ { "from": "system", "value": "Resolve rubocop warnings in the serverspec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe service('sssd') do\n it { should be_enabled }\n it { should be_running }\nend\n\ndescribe package('sssd') do\n it { should be_installed }\nend\n\nif %w...
ruby
chosen
[ { "from": "system", "value": "Use DateTime instead of Date\n" }, { "from": "human", "value": "class BattlesController < ApplicationController\n def index\n @battles = Battle.order(\"updated_at desc\").where(\"updated_at > ?\", Date.today - 3.days).includes(:arena).page params[:page]\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add show action to report controller" }, { "from": "human", "value": "class ReportsController < ApplicationController\n\n before_action :authenticate_user\n\n def index\n @reports = Report.all\n end\n\n def show\n end\n\n def new\n @report = Report.new\n...
ruby
chosen
[ { "from": "human", "value": "Make RSpec tasks less noisy\n\nRSpec tasks list every spec file by default. This is largely useless and\ndistracts from the salient detail, to wit, did the specs pass?\n" }, { "from": "gpt", "value": "if defined? RSpec\n require 'rspec/core/rake_task'\n\n task(:spe...
ruby
chosen
[ { "from": "system", "value": "Change guard to not install on 'windows' systems\n" }, { "from": "human", "value": "#\n# Cookbook Name:: build\n# Recipe:: default\n#\n# Copyright:: Copyright (c) 2015 Chef Software, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache Licen...
ruby
chosen
[ { "from": "system", "value": "Fix wrong varname in gemspec.\n\nGee! Copy pasted from other project...\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'wptemplates/version'\n\nGem::Spe...
ruby
chosen
[ { "from": "system", "value": "Clean db before whole suite\n" }, { "from": "human", "value": "if ENV['COVERAGE']\n require 'simplecov'\n SimpleCov.start 'rails' do\n add_group \"Decorators\", \"app/decorators\"\n end\nend\n\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../../co...
ruby
chosen
[ { "from": "system", "value": "Adjust mutant monkeypatch not to trigger on unsupported rubies\n" }, { "from": "human", "value": "require 'devtools'\nrequire 'status'\n\n# Mutant monkey patch\nrequire 'mutant'\n# TODO: Remove this with newer mutant!\nmodule Mutant\n class Matcher\n class Objec...
ruby
chosen
[ { "from": "system", "value": "Fix logger for tests (in case we want to use it)\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'activesupport-db-cache'\nrequire 'timecop'\n\nrequire \"sqlite3\"\nActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'db/t...
ruby
chosen
[ { "from": "system", "value": "Add require rails/application in prefork spork block\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'spork'\n\nSpork.prefork do\n # This file is copied to spec/ when you run 'rails generate rspec:install'\n ENV[\"RAILS_ENV\"] ||= 'test'\n # Use of...
ruby
chosen
[ { "from": "system", "value": "Change to use new api\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HT...
ruby
chosen
[ { "from": "system", "value": "Load development dependencies and ActiveRecord for tests.\n" }, { "from": "human", "value": "require 'bundler'\n\nBundler.require :default, :test\n\nCombustion.initialize!\n\nrequire 'rspec/rails'\n\nRSpec.configure do |config|\n config.use_transactional_fixtures =...
ruby
chosen
[ { "from": "system", "value": "Sort methods in alphabetical order\n" }, { "from": "human", "value": "# Artwork objects contains all needed information of track's artwork\nclass Artwork\n def initialize(track)\n @track = track\n end\n\n def url\n hash = @track.hash\n url =\n if ha...
ruby
chosen
[ { "from": "system", "value": "Use the static plugin to set a default path for assets\n" }, { "from": "human", "value": "require \"bugsnag\"\n\nmodule AppPrototype\n class Application < Roda\n use Bugsnag::Rack\n\n plugin :error_handler\n\n route do |r|\n r.run Main::Application.fr...
ruby
chosen
[ { "from": "system", "value": "Add deprecation test for Migration.latest_version\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'spec_helper'\n\ndescribe ActiveRecord::Migration do\n\n let (:latest) {\n if Gem::Requirement.new(\"~> 5.0.0\").satisfied_by?(::ActiveRecord.version)...
ruby
chosen
[ { "from": "system", "value": "Fix for exception when no unit price\n" }, { "from": "human", "value": "class InvoicingLineItem < ActiveRecord::Base\n acts_as_line_item\n before_save :ensure_tax_amount\n belongs_to :ledger_item, class_name: 'InvoicingLedgerItem'\n\n default_scope { order(:cre...
ruby
chosen
[ { "from": "system", "value": "Use new RSpec 3 syntax.\n" }, { "from": "human", "value": "require 'fast_stack'\n\n\ndescribe String do\n\n it \"works for c mode\" do\n s = FastStack.profile(1, :c) do\n t = Time.new\n while (Time.new - t) < 0.01 do\n \"nothing\"\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Remove trailing whitespace from description\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\ndescribe \"Enumerator#size\" do\n it \"returns same value if set size is an Integer\" do\n Enumerator.new(100) {}.size.sh...
ruby
chosen
[ { "from": "system", "value": "Use HTTP to download RVM installer to work around Linux-specific HTTPS download issues with curl\n\nIt may be an rvm.beginrescueend.com certificate issue, however, I am getting obscure curl issues while installing Ruby 1.9.3\non Linux that point at a potential CA bundle differe...
ruby
chosen
[ { "from": "system", "value": "Put kiex install output in a fold\n" }, { "from": "human", "value": "module Travis\n module Build\n class Script\n class Elixir < Erlang\n DEFAULTS = {\n elixir: '1.0.2',\n otp_release: '17.4'\n }\n\n def export\n ...
ruby
chosen
[ { "from": "system", "value": "Set signonotron to use a secure cookie in production\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nSignonotron2::Application.config.session_store :cookie_store, key: '_signonotron2_session'\n\n# Use the database fo...
ruby
chosen
[ { "from": "system", "value": "Update rails requirement from >= 4.2, < 6 to >= 4.2, < 7\n\nUpdates the requirements on [rails](https://github.com/rails/rails) to permit the latest version.\n- [Release notes](https://github.com/rails/rails/releases)\n- [Commits](https://github.com/rails/rails/compare/v4.2.0.....
ruby
chosen
[ { "from": "system", "value": "Allow to provide the API client id and secrets separately\n" }, { "from": "human", "value": "module Api\n class BaseController < ActionController::Base\n include Cacheable\n include Paginable\n\n before_action :authenticate_api_client\n\n def index\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure block_connection is resetted.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), \"..\", \"lib\"))\n\nrequire \"bundler\"\nBundler.setup\nrequire \"typhoeus\"\nrequire \"rspec...
ruby
chosen
[ { "from": "system", "value": "Allow to logout from Spotify\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\t\n\tdef new\n\t\tredirect_to '/auth/spotify'\n\tend\n\n\tdef create\n\t\tuser = nil\n\t\tuser = User.find_or_create_with_auth_hash(auth_hash) if auth_...
ruby
chosen
[ { "from": "system", "value": "Rename some variables in the sessions controller.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n before_filter :check_session, except: :destroy\n\n def create\n session_username = params[:session][:username]\n user = Us...
ruby
chosen
[ { "from": "system", "value": "Add unit specs for Spree::Admin::NavigationHelper\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Spree\n module Admin\n describe NavigationHelper do\n describe \"klass_for\" do\n it \"returns the class when present\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add a spec for the user view\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'users/show.html.erb' do\n\n before do\n allow(view).to receive(:signed_in?).and_return(true)\n allow(view).to receive(:current_user).and_return(stub_model(User, us...
ruby
chosen
[ { "from": "system", "value": "Mark podspec to be using ARC\n\nBefore this commit the pod was using ARC, but not declaring it in the pod spec file lead to leaks" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'BNHtmlPdfKit'\n s.version = '0.1.2'\n s.platform =...
ruby
chosen
[ { "from": "system", "value": "Update Control Flow Triangle Assignment\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 # Your code goes here!\nend" }, { "from": "gpt", "value": "# I work...
ruby
chosen
[ { "from": "system", "value": "Update agent buttons depending on context\n" }, { "from": "human", "value": "class AgentsController < MyplaceonlineController\n def may_upload\n true\n end\n\n def before_show_view\n true\n end\n\n def use_custom_heading\n true\n end\n \n def custom...
ruby
chosen