conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Correct Taxons spec test for updating a taxon\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Taxonomies and taxons\", :js => true do\n stub_authorization!\n\n it \"admin should be able to edit taxon\" do\n\n visit spree.new_admin_taxonom...
ruby
chosen
[ { "from": "system", "value": "Change gem email to software-signing@phusion.nl so that it's consistent with the GPG signing key.\n" }, { "from": "human", "value": "source_root = File.expand_path(File.dirname(__FILE__))\n$LOAD_PATH.unshift(\"#{source_root}/lib\")\nrequire 'phusion_passenger'\nPhus...
ruby
chosen
[ { "from": "system", "value": "Remove newline for 'image me' command\n" }, { "from": "human", "value": "require 'google-search'\n\nmodule Slacker\n class Images < Plugin\n\n def pattern\n /image(\\s?me)?/\n end\n\n def respond (text, user_name, channel_name, timestamp)\n addre...
ruby
chosen
[ { "from": "system", "value": "Add spec for to_hash method\n" }, { "from": "human", "value": "require_relative '../lib/statistics'\n\ndescribe Workerholic::Statistics do\n it 'initializes attributes with without an argument' do\n statistics = Workerholic::Statistics.new\n expect(statistics...
ruby
chosen
[ { "from": "system", "value": "Make sure that create records before making test requests\n" }, { "from": "human", "value": "RSpec.describe FilesController do\n before do\n sign_in create(:user)\n end\n\n describe 'GET /files' do\n before do\n get :index, site_id: site.id\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Test admin functions for viewing users.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe UsersController do\n before :all do\n @model = User\n end\n\n before :all do\n @user = Factory :user\n end\n\n context \"as an admin\" do\n end\n...
ruby
chosen
[ { "from": "human", "value": "Add routing specs for sponsorships\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe 'Sponsorships routing', type: :routing do\n specify { expect(post: '/admin/sponsors/1/sponsorships?orphan_id=1').to be_routable }\n specify { expect(put: '/admin/...
ruby
chosen
[ { "from": "system", "value": "Change podspec version to 2.0.1" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"ParallaxHeader\"\n s.version = \"2.0.0\"\n s.summary = \"Simple way to add parallax header to scrollView/tableView\"\n s.description = \"The Par...
ruby
chosen
[ { "from": "system", "value": "Delete unnecessary instructions in Twelve Days test\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire_relative 'twelve_days'\n\nclass TwelveDaysTest < Minitest::Test\n # This test is an acceptance test.\n #\n # If you find it difficult to wor...
ruby
chosen
[ { "from": "system", "value": "Clear docs using start callback.\n" }, { "from": "human", "value": "require 'rspec/core/formatters/base_formatter'\n\nmodule RspecApiDocumentation\n class ApiFormatter < RSpec::Core::Formatters::BaseFormatter\n def initialize(output)\n super(output)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add coveralls as a development dependency, only load it for Travis\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nbegin\n require 'pry'\nrescue LoadError\nend\n\nbegin\n require 'coveralls'\n Coveralls.wear!\nresc...
ruby
chosen
[ { "from": "system", "value": "Whitelist the University of Singapore (nus.edu.sg) the the disposable email fetcher\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire \"yaml\"\n\nrequire \"json\"\nrequire \"net/http\"\n\nwhitelisted_domains = %w(poczta.onet.pl fastmail.fm hushmail.c...
ruby
chosen
[ { "from": "system", "value": "Modify patch of ActiveRecord ConnectionHandler.\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'active_support/concern'\nrequire 'motel/connection_adapters'\n\nmodule Motel\n module ActiveRecord\n module ConnectionHandler\n extend Activ...
ruby
chosen
[ { "from": "system", "value": "Fix for project tab visibility\n" }, { "from": "human", "value": "Redmine::Plugin.register :redmine_statistics do\r\n name 'Statistics for FORGE Support project'\r\n author 'Ilkka Koutonen'\r\n description 'This plugin shows issue statistics from FORGE Support pr...
ruby
chosen
[ { "from": "system", "value": "Remove hidden secret injection into stackfile\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule KumoDockerCloud\n module StackFile\n def self.create_from_template(stack_template, config, env_vars)\n parsed = YAML.load(ERB.new(stack_template).resul...
ruby
chosen
[ { "from": "system", "value": "Support deletion of all attributes\n\nIn some situation it is necessary to clear all attributes of a specified\nsection. Add that feature\n" }, { "from": "human", "value": "class Puppet::Util::NimsoftSection\n\n attr_accessor :parent, :name, :children, :attributes\...
ruby
chosen
[ { "from": "system", "value": "Remove explicit need for Heroku authentication.\n\nWhen using the deploy key, we don't need to authenticate against their API, the key itself should be sufficient." }, { "from": "human", "value": "module DPL\n class Provider\n module Heroku\n class GitDeplo...
ruby
chosen
[ { "from": "system", "value": "Simplify the Rails 3 detection" }, { "from": "human", "value": "module SitemapGenerator\n module Utilities\n extend self\n\n # Copy templates/sitemap.rb to config if not there yet.\n def install_sitemap_rb(verbose=false)\n if File.exist?(File.join(RAI...
ruby
chosen
[ { "from": "system", "value": "Fix a bug about user data model for admins\n" }, { "from": "human", "value": "# This class format user properties for json output\n#\n# @author Eric Fehr (ricofehr@nextdeploy.io, github: ricofehr)\nclass UserSerializer < ActiveModel::Serializer\n attributes :id, :e...
ruby
chosen
[ { "from": "system", "value": "Make PostTag not have a user\n" }, { "from": "human", "value": "class PostTag < ApplicationRecord\n belongs_to :post, inverse_of: :post_tags, optional: false\n belongs_to :user, optional: false\n belongs_to :tag, optional: false\n belongs_to :setting, foreign_ke...
ruby
chosen
[ { "from": "system", "value": "Move EventQueue to the correct WebsocketRails module.\n" }, { "from": "human", "value": "class EventQueue\n\n attr_reader :queue\n\n def initialize\n @queue = []\n end\n\n def enqueue(event)\n @queue << event\n end\n alias :<< :enqueue\n\n def last\n ...
ruby
chosen
[ { "from": "system", "value": "Use .example file in tests\n" }, { "from": "human", "value": "class Settings < Settingslogic\n source \"#{Rails.root}/config/settings.yml\"\n namespace Rails.env\nend\n" }, { "from": "gpt", "value": "class Settings < Settingslogic\n source \"#{Rails.r...
ruby
chosen
[ { "from": "system", "value": "Add development dependency \"rspec, activerecord, sqlite3, rails\" for test\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'super_accessors/version'\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix missing Bitbucket ProjectController changes for specifying namespace/project\n" }, { "from": "human", "value": "module Gitlab\n module BitbucketImport\n class ProjectCreator\n attr_reader :repo, :namespace, :current_user, :session_data\n\n def init...
ruby
chosen
[ { "from": "system", "value": "Add unit test for PBXGroup\n\nVerify PBXGroup is an acceptable value for PBXFileReference.\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\nmodule ProjectSpecs\n describe PBXBuildFile do\n\n before do\n @file ...
ruby
chosen
[ { "from": "system", "value": "Switch raise_error specs over to old should syntax\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rspec-puppet/support'\n\ndescribe RSpec::Puppet::GenericMatchers::RaiseError do\n include RSpec::Puppet::GenericMatchers\n\n context 'with a faili...
ruby
chosen
[ { "from": "system", "value": "Update CFPropertyList dependency to ~> 2.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"fission/version\"\n\nGem::Specification.new do |s|\n s.name = \"fission\"\n s.version = Fi...
ruby
chosen
[ { "from": "system", "value": "Update rake requirement from ~> 10.0 to ~> 12.3\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\n- [...
ruby
chosen
[ { "from": "system", "value": "Add license MIT and post install message to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.absolute_path('../lib/twoffein-client/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"DSIW\"]\n gem.email...
ruby
chosen
[ { "from": "human", "value": "Add migration to update routes in db\n" }, { "from": "gpt", "value": "class ChangeAttachmentDirName < ActiveRecord::Migration\n def up\n ActiveRecord::Base.connection.execute(\"UPDATE paperclipdb SET dir_name='/paperclipdb'+dir_name\")\n end\n\n def down\n A...
ruby
chosen
[ { "from": "human", "value": "Add migratyion to fix funding requests table\n" }, { "from": "gpt", "value": "class FixFundingRequestsTable < ActiveRecord::Migration\n def change\n # Fix the column names in the funding_sources table\n rename_column :funding_requests, :funding_source_id, :fun...
ruby
chosen
[ { "from": "system", "value": "Raise an exception on a fatal js error\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass JSHintFilter < Nanoc::Filter\n requires 'jshintrb'\n\n identifier :jshint\n type :text\n\n def run(content, params={})\n report = Jshintrb.report(content)\n\n...
ruby
chosen
[ { "from": "system", "value": "Add license in gem package\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire \"./lib/injectable/version\"\n\nGem::Specification.new do |s|\n s.name = \"injectable\"\n s.version = Injectable::VERSION\n s.platform = Gem::Platform::RUBY\...
ruby
chosen
[ { "from": "system", "value": "Fix TODO items in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/interlatch/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Drew Chandler\", \"Pete Keen\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Add TODO for non-trivial HTML pages\n" }, { "from": "human", "value": "module ManBook\n class Parser\n class << self\n def parse(html_file)\n #\n # The way we extract the title is highly dependent of the concrete HTML. Yet, I found no other wa...
ruby
chosen
[ { "from": "system", "value": "Add Resque tasks to clear old jobs and stale workers\n" }, { "from": "human", "value": "require \"resque/tasks\"\nrequire \"resque/scheduler/tasks\"\n\ntask \"resque:setup\" => :environment\n" }, { "from": "gpt", "value": "require \"resque/tasks\"\nrequi...
ruby
chosen
[ { "from": "system", "value": "Clean up tasks controller spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TasksController do\n describe \"logged in user with can_only_see_watched permission\" do\n before(:each) do\n session[:user_id]=Factory(:user)\n cu\n ...
ruby
chosen
[ { "from": "system", "value": "Use git dependencies in Gemfile for llt-* gems.\n\nLater the published gems should be used. This is prepared in the\ngemspec. For local development see\nhttp://bundler.io/v1.3/bundle_config.html.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_...
ruby
chosen
[ { "from": "system", "value": "Add rake files for rubocop runner" }, { "from": "human", "value": "Cch::Runner.configure :rubocop do |runner|\n runner.watch(/\\.rb$/)\nend\n\nCch::Runner.configure :haml_lint, gem: 'haml-lint' do |runner|\n runner.watch(/\\.haml$/)\nend\n\nCch::Runner.configure :...
ruby
chosen
[ { "from": "system", "value": "Fix the gem prelude problem\n" }, { "from": "human", "value": "module Defly\n module RequirePath\n def require name, opts = {}\n require_path = nil\n\n if opts[:verbose]\n $LOAD_PATH.each do |path|\n full_path = File.join path, \"#{name...
ruby
chosen
[ { "from": "system", "value": "Fix and clean up code\n" }, { "from": "human", "value": "# Leapfrog\n\n# For Rails3.\nrequire 'active_record/base'\nrequire 'active_record/connection_adapters/abstract/schema_definitions'\nrequire 'action_controller/base'\n# Add gem 'leapfrog', require => 'active_re...
ruby
chosen
[ { "from": "system", "value": "Rename rake task to qu:work and set default queue" }, { "from": "human", "value": "namespace :qu do\n\n task :start => :environment do\n queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')\n\n Qu::Worker.new(*queues).start\n end\n\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Add my name and email.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"nagios_parser/version\"\n\nGem::Specification.new do |s|\n s.name = \"nagios_parser\"\n s.version = NagiosPars...
ruby
chosen
[ { "from": "system", "value": "Remove redundant require statement from Services module\n\nThis should have been removed as part of this commit [1].\n\n[1]: 98683b06bb3ea4aadb26d1156fbbc10178ca1b35\n" }, { "from": "human", "value": "require \"gds_api/asset_manager\"\nrequire \"gds_api/content_stor...
ruby
chosen
[ { "from": "system", "value": "Use more unusual instance variable name to avoid conflicts\n" }, { "from": "human", "value": "module Nazca\n module ViewHelpers\n def tag!(tags = {})\n @tags ||= {}\n @tags.merge!(tags)\n end\n \n def title(t)\n tag!(:title => normalize(t))...
ruby
chosen
[ { "from": "system", "value": "Use ActiveRecord::VERSION::MAJOR for version comparisons isntead of invoking :to_f on the full version String\n" }, { "from": "human", "value": "require 's3_cors_fileupload/version'\nrequire 's3_cors_fileupload/rails'\n\nmodule S3CorsFileupload\n def self.active_re...
ruby
chosen
[ { "from": "system", "value": "Read the correct sheet rows when there are more than 9 rows\n" }, { "from": "human", "value": "module Saxlsx\n class FileSystem\n\n def self.open(filename)\n begin\n file_system = self.new(filename)\n yield file_system\n ensure\n f...
ruby
chosen
[ { "from": "system", "value": "Create app path for db/secondbase. Make dir if none exists.\n" }, { "from": "human", "value": "module SecondBase\n class Railtie < Rails::Railtie\n\n rake_tasks do\n load 'secondbase/databases.rake'\n end\n\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Use eigenclass for simple syntax\n" }, { "from": "human", "value": "require 'pathname'\n\nmodule Tachikoma\n # ~/users-tachikoma-dir\n def self.root_path\n @root_path ||= Pathname.new(Dir.pwd)\n end\n\n def self.root_path=(root_path)\n @root_path = Pathnam...
ruby
chosen
[ { "from": "system", "value": "Add version attribute and begin code for filling in\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule FML\n class FMLForm\n attr_reader :form, :title, :fieldsets\n\n def initialize(form)\n parse(YAML.load(form))\n end\n\n private\n\n d...
ruby
chosen
[ { "from": "system", "value": "Update test to expect the correct return value\n" }, { "from": "human", "value": "describe ApplicationController do\n context \"Feature\" do\n Feature = ApplicationController.const_get('Feature')\n\n it \"#new_with_hash creates a Struct\" do\n expect(Fea...
ruby
chosen
[ { "from": "system", "value": "Remove seeding of transactions-explorer route.\n\nThis is no longer live, and is currently being redirected to\n/performance.\n" }, { "from": "human", "value": "######################################\n#\n# This file is run on every deploy.\n# Ensure any changes acco...
ruby
chosen
[ { "from": "human", "value": "Add migration to create SpreePurchaseOrder\n\nThis commit adds the migration that creates the Spree Purchase Order\ntable where payment information is stored\n" }, { "from": "gpt", "value": "class CreateSpreePurchaseOrder < ActiveRecord::Migration\n def change\n ...
ruby
chosen
[ { "from": "system", "value": "Fix migration so travis is happy\n" }, { "from": "human", "value": "class PopulateFeedbacksToRedis < ActiveRecord::Migration[5.2]\n def change\n Feedback.populate_redis_meta\n end\nend\n" }, { "from": "gpt", "value": "class PopulateFeedbacksToRedis ...
ruby
chosen
[ { "from": "human", "value": "Add tests to ensure critical links are on the sign up and sign in pages.\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass DeviseLayoutTest < ActionDispatch::IntegrationTest\n fixtures :all\n\n setup do \n sign_out\n end\n\n test \"Sign up and Fo...
ruby
chosen
[ { "from": "system", "value": "Update from ignore to transient due to deprecation of ignore\n" }, { "from": "human", "value": "# Referent factory\nFactoryGirl.define do\n factory :referent do\n title 'Title'\n issn '1234-6789'\n isbn '1234567890123'\n year '2014'\n volume '1'\n ...
ruby
chosen
[ { "from": "system", "value": "Clarify failure messages in hello-world\n\nThere has been some confusion as to what the point of view of the failure message is.\nIt could be seen as being from the point of view of the programmer, or from the point of\nview of the code.\n" }, { "from": "human", "va...
ruby
chosen
[ { "from": "system", "value": "Add validation on the AidStation model to ensure uniqueness of split_id/event_id combination.\n" }, { "from": "human", "value": "class AidStation < ActiveRecord::Base\n belongs_to :event\n belongs_to :split\n enum status: [:pre_open, :open, :closed, :released]\n\...
ruby
chosen
[ { "from": "system", "value": "Downgrade Gemfile to use rspec 2.99\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rappgem/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Set Swift Version support to 4.0 in the podspec file\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"AMPopTip\"\n s.version = \"3.1.3\"\n s.summary = \"Animated popover, great for subtle UI tips and onboarding.\"\n s.descri...
ruby
chosen
[ { "from": "system", "value": "Improve doc styles for ActiveModel::Conversion\n" }, { "from": "human", "value": "module ActiveModel\n # == Active Model Conversions\n #\n # Handles default conversions: to_model, to_key and to_param.\n #\n # Let's take for example this non persisted object.\n ...
ruby
chosen
[ { "from": "system", "value": "Add custom tags to api\n" }, { "from": "human", "value": "class Api::V1::ItemsController < ApplicationController\n respond_to :json, :xml\n\n def index\n @items = Item.search( *search_params(params) )\n .page(params[:page]).per(params[:per_page]).records\n...
ruby
chosen
[ { "from": "system", "value": "Change in logic. Service needs to be used in different place\n" }, { "from": "human", "value": "module Jarvis\n class SyncsController < ApplicationController\n @@brain = Brain.new(Rails.application.config.api_token)\n def create\n # This is where we'll ...
ruby
chosen
[ { "from": "system", "value": "Update conditional to use `Gem::Version` instances for version comparison\n" }, { "from": "human", "value": "if(node[:omnibus_updater][:disabled])\n Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute'\nelsif node[:platform] == \"debian\" and node[:pl...
ruby
chosen
[ { "from": "system", "value": "Create a copy of the date used to adjust for blackouts\n" }, { "from": "human", "value": "module Spree::Shipping\n class TimeAdjuster\n\n def initialize(blackout)\n @blackout = blackout\n end\n\n def adjusted_date(start, days)\n start + days_to_a...
ruby
chosen
[ { "from": "system", "value": "Add note about usage. Update recipe inclusion for cleaning\n" }, { "from": "human", "value": "include_recipe 'omnibus_updater::set_remote_path'\n\nremote_file \"chef omnibus_package_downloader[#{File.basename(node[:omnibus_updater][:full_uri])}]\" do\n path File.jo...
ruby
chosen
[ { "from": "system", "value": "Add SE chat IDs to API websocket flag logs\n\nDuplicating user_name to maintain backwards compatibility with things\nthat *probably* don't exist yet but might.\n\nAlternative to #86\n" }, { "from": "human", "value": "json.post_link flag_log.post.link\njson.user_name...
ruby
chosen
[ { "from": "system", "value": "Update Java JRE to _15\n" }, { "from": "human", "value": "dmg_package \"Java 7 Update 13\" do\n source \"https://s3.amazonaws.com/boxen-downloads/java/jre-7u13.dmg\"\n action :install\n type \"pkg\"\n package_id \"com.oracle.jre\"\nend\n\ndmg_package \"JDK 7 Upd...
ruby
chosen
[ { "from": "system", "value": "Update bundle to include basics\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ruvidding/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add tests to validate tracing modes and sample_rate\n" }, { "from": "human", "value": "require 'minitest_helper'\nrequire 'rack/test'\nrequire 'rack/lobster'\nrequire 'oboe/inst/rack'\n\nOboe::Config[:tracing_mode] = 'always'\nOboe::Config[:sample_rate] = 1e6\n \...
ruby
chosen
[ { "from": "system", "value": "Adjust method string formatting to rdoc-style\n" }, { "from": "human", "value": "require 'noted'\n\ndescribe Noted do\n describe '#configuration' do\n it 'returns a configuration object' do\n expect(Noted.configuration).to be_a Noted::Configuration\n end...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness expectation to RedditApi::Posts\n\nRedditApi::Posts#top\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe RedditApi::Posts do\n\n describe \"#top\" do\n it \"returns n top posts of a subreddit\" do\n posts_api = RedditApi...
ruby
chosen
[ { "from": "system", "value": "Add failing test with an equals sign in the key.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Shenv do\n it 'loads existing environment from file' do\n shenv_key = 'this is a shenv test'\n shenv_val = '7'\n ENV[shenv_key] = shenv_va...
ruby
chosen
[ { "from": "system", "value": "Add tests for mysql-connector-java and postgresql-jdbc packages\n\nChefSpec Coverage report generated...\n\n Total Resources: 106\n Touched Resources: 85\n Touch Coverage: 80.19%\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'hadoop::h...
ruby
chosen
[ { "from": "human", "value": "Add spec file for EmotionBank module\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe EmotionBank do\n\n\t\tlet(:output) {EmotionBank.get_term_emotions}\n\n\t\tdescribe \"when EmotionBank module is called\" do\n\t\t\tit 'returns a hash' do\n\t\t\t\t...
ruby
chosen
[ { "from": "human", "value": "Add failing request spec with redirect\n" }, { "from": "gpt", "value": "require 'helper'\n\ndescribe Gems::Request do\n after do\n Gems.reset\n end\n\n describe \"#get with redirect\" do\n before do\n # request_uri = URI.parse(\"https://rubygems.org/api...
ruby
chosen
[ { "from": "system", "value": "Add spec for order status detail\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Order, type: :model do\n customer = Customer.create(first_name: 'Jon', last_name: 'Chen')\n order = customer.orders.create\n\n it 'creates successfully' d...
ruby
chosen
[ { "from": "system", "value": "Add redirect from post route and add curly braces for hash.\n" }, { "from": "human", "value": "get '/sms' do\n erb :send_sms\nend\n\npost '/sms' do\n tip = Tips.find(rand(1..(Tips.all.length)))\n msg = \"Envirotip:\" + tip\n\n\n @client = Twilio::REST::Client.ne...
ruby
chosen
[ { "from": "system", "value": "Update validations to remove goal\n" }, { "from": "human", "value": "class Campaign < ActiveRecord::Base\n belongs_to :user\n has_one :survey\n has_and_belongs_to_many :tags\n has_attached_file :image, default_url: '/assets/placeholder.jpg'\n\n validates :title...
ruby
chosen
[ { "from": "system", "value": "Use Cloudinary helper to generate `sample_image_url`\n\nI finally figured out how to use Cloudinary code to get the Url we need.\n" }, { "from": "human", "value": "class Snapshot < ActiveRecord::Base\n belongs_to :url\n belongs_to :diffed_with_snapshot, class_name...
ruby
chosen
[ { "from": "system", "value": "Make sure the server group argument is passed when listing servers before it is validated\n" }, { "from": "human", "value": "module Brightbox\n desc 'List servers'\n arg_name '[server-id...]'\n command [:list] do |c|\n\n c.desc \"Group identifier\"\n c.flag...
ruby
chosen
[ { "from": "system", "value": "Fix indenting problem (and style tweaks)\n" }, { "from": "human", "value": "module Brightbox\n command [:users] do |cmd|\n\n cmd.desc \"Update user details\"\n cmd.arg_name \"user-id...\"\n cmd.command [:update] do |c|\n\n c.desc \"Path to public ssh ...
ruby
chosen
[ { "from": "system", "value": "Remove page header helper from bootstrap helpers.\n" }, { "from": "human", "value": "module Toolsmith\n module ViewHelpers\n module BootstrapHelpers\n FLASH_LEVELS = [:success, :error, :notice]\n\n def page_header(primary_content = nil, secondary_conte...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary spaces and use single quotes for units\n" }, { "from": "human", "value": "name :bmi\nrequire_helpers :get_field_as_float\n\nexecute do\n weight = get_field_as_float :weight_in_kg\n height = get_field_as_float :height_in_m\n\n fail FieldError.ne...
ruby
chosen
[ { "from": "system", "value": "Add Coveralls support to tests\n\nAdd code to run Coveralls when tests are run\n" }, { "from": "human", "value": "require File.expand_path('../../lib/fog/vsphere', __FILE__)\n" }, { "from": "gpt", "value": "if ENV['COVERAGE'] == 'true'\n require 'covera...
ruby
chosen
[ { "from": "system", "value": "Remove two example APIs in code\n\n1) restaurant's key deletion\n2) convert all restaurant's images to list\n\nSigned-off-by: kfei <1da1ad03e627cea4baf20871022464fcc6a4b2c4@kfei.net>\n" }, { "from": "human", "value": "class VimEat < Sinatra::Base\n\t# List all resta...
ruby
chosen
[ { "from": "system", "value": "Fix files included in gem\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"ruby_optimize/version\"\n\nGem::Specification.new do |s|\n s.name = 'ruby_optimize'\n s.version = RubyOptim...
ruby
chosen
[ { "from": "system", "value": "Use the \"is_expected.to\" RSpec syntax rather than \"should\"\n" }, { "from": "human", "value": "require 'spec_helper'\nmodule Coveralls\n module Cobertura\n describe Converter do\n let(:filename) { \"#{File.dirname(__FILE__)}/../../support/cobertura.xml\"...
ruby
chosen
[ { "from": "system", "value": "Add a test for Tempfile.create\n\nOn Ruby 2.7 this requires File.identical? to be implemented.\n" }, { "from": "human", "value": "require_relative '../test_helper'\nrequire 'tempfile'\n\n# Tempfile test class\nclass TempfileTest < Minitest::Test\n include FakeFS\n\...
ruby
chosen
[ { "from": "system", "value": "Clean up alias model test script\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass AliasTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "# Encoding: utf-8\nrequire...
ruby
chosen
[ { "from": "system", "value": "Test to verify that adding a reporter with a block works as expected\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ConfigTest < Test::Unit::TestCase\n context \"configuration\" do\n setup do\n @klass = Radar::Config\n @instance = @k...
ruby
chosen
[ { "from": "system", "value": "Remove cache files during unit test teardown\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TestCache < Minitest::Test\n include PictureTag\n include TestHelper\n\n def setup\n PictureTag.stubs(:site).returns(build_site_stub)\n\n @tested ...
ruby
chosen
[ { "from": "system", "value": "Change git path in podspec to match recommended way\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint SwiftyImageIO.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is enco...
ruby
chosen
[ { "from": "system", "value": "Add guard-rubocop as development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sloc/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Change mysqld service name to mysql-default\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"mysql spec\" do\n # mysql command\n describe command('which mysql') do\n let(:disable_sudo) { true }\n its(:exit_status) { should eq 0 }\n end...
ruby
chosen
[ { "from": "system", "value": "Test an action that actually exists\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe EventsController do\n let(:event) { FactoryGirl.create(:event) }\n let(:convention) { event.convention }\n\n setup do\n set_convention convention\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Add rake as dev dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"wriggle/version\"\n\nGem::Specification.new do |s|\n s.name = \"wriggle\"\n s.version = Wriggle::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Tweak the name of the plugin to match the patch.\n" }, { "from": "human", "value": "require 'redmine'\n\nrequire 'dispatcher'\n\nDispatcher.to_prepare :forward_to_diffs do\n require_dependency 'application_helper'\n ApplicationHelper.send(:include, DiffForward...
ruby
chosen
[ { "from": "system", "value": "Fix to_prepare to Rails 5.1/4\n" }, { "from": "human", "value": "FileUtils.mkdir_p(Rails.root.join('log/intouch')) unless Dir.exist?(Rails.root.join('log/intouch'))\n\nrequire 'intouch'\nrequire 'telegram/bot'\n\nActionDispatch::Callbacks.to_prepare do\n paths = '/...
ruby
chosen
[ { "from": "human", "value": "Add OpenZFS on OS X v1.3.0\n\nCloses #6289.\n" }, { "from": "gpt", "value": "class Openzfs < Cask\n version '1.3.0'\n sha256 'a0030181a91ecace2d31cfab26d10b2284602e2b442f71a344a9da11165cb6c7'\n\n url \"https://openzfsonosx.org/w/images/0/0d/OpenZFS_on_OS_X_#{versi...
ruby
chosen