conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Test code for accessing the Trinity DB.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/ruby\n# open mysql connection to TDB\nrequire 'rubygems'\t# 1.8 bug workaround\n\nrequire 'dbi'\nrequire '../wowfoot-ex/output/WorldMapArea.rb'\n\n#p DBI::available_drivers\n\ndbc = D... | ruby | chosen |
[
{
"from": "system",
"value": "Set capybara default wait time to 5\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass SearchWithTraitSetsTest < ActionDispatch::IntegrationTest\n fixtures :projects, :taxa, :trait_sets, :categorical_traits\n setup do\n Capybara.current_driver = ... | ruby | chosen |
[
{
"from": "system",
"value": "Add Marcelo Mita in the list of authors 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 'deathbycaptcha/version'\n\nGem::Specification.new do ... | ruby | chosen |
[
{
"from": "system",
"value": "Make CLI responsible for printing the result\n"
},
{
"from": "human",
"value": "require_relative 'math24.rb'\n\nnumbers = [6,6,8,11]\noperators = [\"+\", \"-\", \"*\", \"/\"]\nsolver = Math24.new(operators)\nsolver.numbers = numbers\nsolver.solve()"
},
{
"fr... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec for ActiveRecord integration\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nclass User < ActiveRecord::Base\n include AttrDeprecated\n\n attr_deprecated :a_deprecated_attribute\nend\n\ndescribe \"Integration with ActiveRecord\" do\n let(:user) ... | ruby | chosen |
[
{
"from": "human",
"value": "Add Clubs Controller Spec for Edit Action\n\nAdd a spec to test the Clubs controller edit action.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe ClubsController do\n let(:user) { FactoryGirl.create :user }\n\n describe \"GET 'edit'\" do\n des... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec to ensure about_us and faq pages render properly\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe HighVoltage::PagesController, '#show' do\n render_views\n\n %w(about_us faq).each do |page|\n %w(en fr pt ru).each do |locale|\n con... | ruby | chosen |
[
{
"from": "system",
"value": "Return all permissions for ad accounts from Business Manager\n"
},
{
"from": "human",
"value": "module FbGraph\n module Connections\n module UserPermissions\n def userpermissions(options = {})\n self.connection(:userpermissions, options).first\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add gemspec files to allow bundler to run from the gem"
},
{
"from": "human",
"value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'mixlib/shellout/version'\n\nGem::Specification.new do |s|\n s.name = 'mixlib-shellout'\n s.version = Mixlib::ShellOut::VER... | ruby | chosen |
[
{
"from": "human",
"value": "Add a basic activity as seed data\n"
},
{
"from": "gpt",
"value": "# setup a simple, one-page activity\nact = Lightweight::LightweightActivity.create!(:name => \"Test activity\")\npage = act.pages.create!(:name => \"Page 1\", :text => \"This is the main activity text... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic tests for Postfix filter processor.\n\nSigned-off-by: brian m. carlson <738bdd359be778fee9f0fc4e2934ad72f436ceda@crustytoothpaste.net>\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/ruby\n# encoding: UTF-8\n\n$:.unshift File.join(File.dirname(__FILE__), '..', ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix undefined method `topics' for nil:NilClass.\n"
},
{
"from": "human",
"value": "module Community\n class ForumsController < ::ActionController::Base\n layout 'community'\n\n def index\n @forums = Community::Forum.order(:sort_order).where(\"name <> 'NS... | ruby | chosen |
[
{
"from": "system",
"value": "Fix relatedcontent creation and scoring on related content controller\n"
},
{
"from": "human",
"value": "class RelatedContentsController < ApplicationController\n VALID_URL = /#{Setting['url']}\\/.*\\/.*/\n\n skip_authorization_check\n\n respond_to :html, :js\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update subject of newsletter email\n"
},
{
"from": "human",
"value": "class NewsletterMailer < ActionMailer::Base\n\n \n layout 'email_html_layout'\n default from: \"\\\"#{Settings.instance.smtp_sender_name}\\\" <#{Settings.instance.smtp_sender_email}>\"\n\n \n ... | ruby | chosen |
[
{
"from": "system",
"value": "Discard the flash at the end of the current action when rendering js.\n\nThis prevents success / error messages from appearing on the next request.\n\n@amansinghb small and subtle. thanks"
},
{
"from": "human",
"value": "class NewsletterSubscriptionsController < App... | ruby | chosen |
[
{
"from": "system",
"value": "Validate that all the needed fields are present for a TimeSpan\n"
},
{
"from": "human",
"value": "# == Schema Information\n#\n# Table name: time_spans\n#\n# id :integer not null, primary key\n# date :date\n# duration ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix extract contexts from options\n"
},
{
"from": "human",
"value": "module CanCanNamespace\n # This class is used internally and should only be called through Ability.\n # it holds the information about a \"can\" call made on Ability and provides\n # helpful met... | ruby | chosen |
[
{
"from": "system",
"value": "Check all servers for tags now, tag search seems limited.\n"
},
{
"from": "human",
"value": "require 'rightscale-api'\n\nmodule Capistrano\n\tclass Configuration\n\t\tmodule Tags\n\n\t\t\t# Associate a tag in a specific deployment with a role\n\t\t\t# Examples:\n\t\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix engagement type for Salesforce record creation\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n# frozen_string_literal: true\n\n#= Creates a new Media record in Salesforce, returning the URL of the new record\nclass CreateSalesforceMediaRecord\... | ruby | chosen |
[
{
"from": "system",
"value": "Access form information after curses screen.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\nrequire 'rubygems'\nrequire_relative '../../lib/ppcurses.rb'\n\n\n\n\ndef display_form\n\n first_name = PPCurses::InputElement.new('First Name', 10)\n last_name ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix mongo mapper test suite\n\nhttps://travis-ci.org/amatsuda/kaminari/jobs/41827391#L98\n"
},
{
"from": "human",
"value": "MongoMapper.connection = Mongo::Connection.new 'localhost', 27017\nMongoMapper.database = 'kaminari_test'\n"
},
{
"from": "gpt",
"... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for borrow direct library.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'blacklight_cornell_requests/borrow_direct'\n\ndescribe BlacklightCornellRequests::BorrowDirect do\n\n describe \"Primary availability function\" do\n\n it \"\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce paperclip version dependancy to fix identify issue with ImageMagick"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"news/version\"\n\n# Describe your gem and declare its dependencies... | ruby | chosen |
[
{
"from": "system",
"value": "Add displaying message if cocoapods is not installed\n"
},
{
"from": "human",
"value": "# coding: utf-8\nrequire 'thor'\n\nmodule Cocoapods::Search\n class Command < Thor\n map '-v' => :version,\n '--version' => :version\n\n default_command :search\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for default uploaders"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe KnowledgeBase::Configuration do\n before do\n KnowledgeBase.reset\n end\n\n it 'should be configurable' do\n subject.categories_path = :fog\n expect(subject... | ruby | chosen |
[
{
"from": "system",
"value": "Add instance method for coupon"
},
{
"from": "human",
"value": "module WoocommerceAPI\n class CouponLine < Resource\n attribute :id, Integer\n attribute :code\n attribute :amount, Decimal\n end\nend\n"
},
{
"from": "gpt",
"value": "module Wooc... | ruby | chosen |
[
{
"from": "human",
"value": "Add paternity adoption pay calculator\n\nAlmost the same logic as paternity pay but delegates to adoption\npay calculator for certain operations.\n"
},
{
"from": "gpt",
"value": "module SmartAnswer::Calculators\n class PaternityAdoptionPayCalculator < PaternityPayCa... | ruby | chosen |
[
{
"from": "system",
"value": "Remove values from returned hash.\n"
},
{
"from": "human",
"value": "class Hey::Pubsub::Event\n attr_writer :name, :metadata, :started_at, :ended_at\n\n def initialize(name:, started_at: nil, ended_at: nil, metadata: {})\n @name = name\n @started_at = starte... | ruby | chosen |
[
{
"from": "system",
"value": "Use before `each` hook instead of `all`."
},
{
"from": "human",
"value": "require 'rake'\n\nmodule RSpec::Rake\n\n module ExampleGroup\n\n def self.included(base)\n base.instance_eval do\n\n metadata[:type] = :task\n metadata[:tasks_path] ||= ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow purchased content to be downloaded again\n"
},
{
"from": "human",
"value": "module ShutterstockRuby\n # A class to hold all videos related code.\n class Videos < Connections\n\n def search(query, options = {})\n JSON.parse(get('/videos/search', { que... | ruby | chosen |
[
{
"from": "system",
"value": "Fix being able to saved cloned Objects"
},
{
"from": "human",
"value": "module Multiplay\n module WasChanged\n\n def self.included(base)\n base.send(:before_save, :store_changes)\n base.attribute_method_suffix '_was_changed?', '_before_save_was', '_bef... | ruby | chosen |
[
{
"from": "system",
"value": "Fix album import title casing\n"
},
{
"from": "human",
"value": "require \"album_set_processor\"\n\nnamespace :import do\n task :all_photos, [:path] => :environment do |t, args|\n AlbumSetProcessor.new(args.path).syncronize_photos\n end\n\n task :albums => :en... | ruby | chosen |
[
{
"from": "system",
"value": "Update the list of files in the gemspec\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'grack'\n s.version = '0.1.0'\n s.date = '2013-06-02'\n s.summary = \"This project aims to replace the builtin git-http-backend CGI handler\ndistr... | ruby | chosen |
[
{
"from": "system",
"value": "Allow association options for uploads\n"
},
{
"from": "human",
"value": "require \"s3_multipart/uploader/callbacks\"\nrequire \"s3_multipart/uploader/validations\"\nrequire 'active_support/core_ext/string'\nrequire \"digest/sha1\"\n\nmodule S3Multipart\n module Upl... | ruby | chosen |
[
{
"from": "system",
"value": "[Sass] Convert Sass::Script::Operation docs to YARD.\n"
},
{
"from": "human",
"value": "require 'sass/script/string'\nrequire 'sass/script/number'\nrequire 'sass/script/color'\nrequire 'sass/script/functions'\nrequire 'sass/script/unary_operation'\n\nmodule Sass::Sc... | ruby | chosen |
[
{
"from": "system",
"value": "Add error string for duplicate key records on Postgres.\n"
},
{
"from": "human",
"value": "require 'active_record'\n\nmodule Songkick\n module OAuth2\n module Model\n autoload :ClientOwner, ROOT + '/oauth2/model/client_owner'\n autoload :ResourceOwne... | ruby | chosen |
[
{
"from": "system",
"value": "Handle signals in consumer rake task.\n\nWhen upstart stops the worker, it sends a SIGTERM to the process. This\nis manifested in ruby as a SignalException. Unless handled, this\nexception bubbles all the way up, and it intercepted by the airbrake\nhandler, resulting in noise... | ruby | chosen |
[
{
"from": "system",
"value": "Implement error handling in get_current.\n"
},
{
"from": "human",
"value": "require \"ubuntu_unused_kernels/version\"\nrequire \"open3\"\n\nmodule UbuntuUnusedKernels\n PACKAGE_PREFIXES = %w{linux-image linux-headers}\n KERNEL_VERSION = %r{\\d+\\.\\d+\\.\\d+-\\d+}... | ruby | chosen |
[
{
"from": "system",
"value": "Expand AZ awareness to explicitly set the rack_id as an awareness attribute\n"
},
{
"from": "human",
"value": "# Add this recipe to the run list to make this node AZ aware\nnode.default[:elasticsearch][:custom_config] = {'node.rack_id' => \"#{node[:ec2][:placement_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix name of cop in disable directive\n"
},
{
"from": "human",
"value": "class LinkExpansion::EditionDiff\n attr_reader :current_edition, :version\n\n def initialize(current_edition, version: nil, previous_edition: nil)\n @current_edition = current_edition\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix\n => Exception on window close\n"
},
{
"from": "human",
"value": "module Joybox\n module Configuration\n\n class GLView < CCGLView\n\n attr_accessor :resize_to_superview\n\n def self.defaults\n {\n bounds: [[0, 0], [0, 0]],\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we pass a string to DateTime.parse.\n\nThis unbreaks type casting with time zone objects.\n"
},
{
"from": "human",
"value": "require 'active_support/time'\n\nclass Time\n def to_json(*a)\n %(\"#{as_json}\")\n end\n \n def as_json(*args)\n getutc.... | ruby | chosen |
[
{
"from": "system",
"value": "Support options on danger run for specifying the head / base commit\n"
},
{
"from": "human",
"value": "module Danger\n class Runner < CLAide::Command\n self.description = 'Run the Dangerfile.'\n self.command = 'danger'\n\n def initialize(argv)\n @dang... | ruby | chosen |
[
{
"from": "system",
"value": "Facilitate passing blocks into Buffer\n"
},
{
"from": "human",
"value": "module Flakey\n module Buffer\n include Base\n\n SHARE_URL = \"https://bufferapp.com/add\"\n\n def buffer_button(options = {})\n defaults = {\n url: default_url,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure decorators are being loaded\n"
},
{
"from": "human",
"value": "module SpreePaypalExpress\n class Engine < Rails::Engine\n engine_name 'spree_paypal_express'\n\n config.autoload_paths += %W(#{config.root}/lib)\n\n # use rspec for tests\n config... | ruby | chosen |
[
{
"from": "system",
"value": "Split DbBackup to smaller chunks\n"
},
{
"from": "human",
"value": "require 'git'\n\n\nmodule Job\n class DbBackup\n TMP = 'tmp/db-backup.sql'\n TARGET = ENV['NVST_DB_BACKUP']\n MESSAGE = ENV['NVST_DB_BACKUP_MSG']\n\n def self.perform\n db = Nvst::... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration to actually add the deleted field"
},
{
"from": "human",
"value": "require 'sequel'\n\nrequire 'ghtorrent/migrations/mysql_defaults'\n\n\nSequel.migration do\n\n up do\n puts 'Add column fake to users'\n add_column :users, :fake, TrueClass, :n... | ruby | chosen |
[
{
"from": "system",
"value": "Use File.join, URI.join does validation and {} is not valid\n"
},
{
"from": "human",
"value": "require 'uri'\n\nmodule Raml\n class Resource\n ATTRIBUTES = []\n attr_accessor :parent, :resources, :methods, :uri_partial\n\n def initialize(parent, uri_partia... | ruby | chosen |
[
{
"from": "system",
"value": "Fix ie11 can't have semicolons inside parenthesis\n"
},
{
"from": "human",
"value": "module Relax\n module Helpers\n def relax_tag\n if defined?(@relax) && @relax\n \"<script type='text/javascript'>Relax.replace(#{@relax});</script>\".html_safe\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to using `system` for running commands\n\nUsing `IO.popen()` does not forward the TTY, which prevents commands\nlike `psql` from using readline (e.g. ctrl+r). Using `system` allows\nfor readline to work without causing any other known issues.\n"
},
{
"from": "hum... | ruby | chosen |
[
{
"from": "system",
"value": "Correct mistake where stream_name is always set\n"
},
{
"from": "human",
"value": "module EventStore\n module Messaging\n module Controls\n module Writer\n def self.write(count=nil, stream_name=nil, stream_metadata: nil)\n count ||= 1\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Rake and Rspec dependancies\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-title/version'\n\nGem::Specification.new do |spec|\n spec.... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"remove the runit dependency\"\n\nThis reverts commit 4916eef5d50edaf84ec39f2e87026e080e3d1315 [formerly d6a5d91d367b9aa6bac0144542660d5a3d94d7ae] [formerly 4b48d64dcf39560f4696fe824cf335c79701a25f [formerly 586cd3dd624dfcb538acd30b7c2e19f46670025f]] [formerly ee9b210ca... | ruby | chosen |
[
{
"from": "system",
"value": "Add dependency for erlang cookbook\n"
},
{
"from": "human",
"value": "name 'opsworks_rabbitmq'\nmaintainer 'Andrew Jo'\nmaintainer_email 'andrew@verdigris.co'\nlicense 'Simplified BSD'\ndescription 'Wrapper cookbook for installing and... | ruby | chosen |
[
{
"from": "system",
"value": "Update and bump version to 0.1.0\n"
},
{
"from": "human",
"value": "maintainer \"Chris Roberts\"\nmaintainer_email \"chrisroberts.code@gmail.com\"\nlicense \"Apache 2.0\"\ndescription \"Provides and configures cgroups\"\nlong_description IO.read(... | ruby | chosen |
[
{
"from": "system",
"value": "[COOK-3452] Add support for raspbian platform\n\nSigned-off-by: Seth Vargo <81550dbf04dfd8537ff7b3c014c6fbf86e0889dc@gmail.com>\n"
},
{
"from": "human",
"value": "name \"cron\"\nmaintainer \"Opscode, Inc.\"\nmaintainer_email \"cookbooks@opscode.com... | ruby | chosen |
[
{
"from": "system",
"value": "[COOK-4328] Change depends on Partial Search to recommends. If its not there, you just can't use it as a recipe, but the provider is still useful.\n"
},
{
"from": "human",
"value": "name 'ssh_known_hosts'\nmaintainer 'Opscode, Inc.'\nmaintainer_e... | ruby | chosen |
[
{
"from": "human",
"value": "Add event_wine controller spec with edit render test\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe EventWinesController do\n\tdef stub_current_user user\n ApplicationController.any_instance.stub(:current_user) { user }\n end\n\n let(:user) ... | ruby | chosen |
[
{
"from": "system",
"value": "Add flat rate calculator traits to related factories\n"
},
{
"from": "human",
"value": "attach_per_item_trait = proc do\n trait :per_item do\n transient { amount 1 }\n calculator { build(:calculator_per_item, preferred_amount: amount) }\n end\nend\n\nFactory... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up submission migration script\n"
},
{
"from": "human",
"value": "class CreateSubmissions < ActiveRecord::Migration\n def change\n create_table :submissions do |t|\n t.string :name\n t.string :type\n t.string :hash\n t.string :imageErro... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing run-time dependency to nokogiri\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'dcs/debian/version'\n\nGem::Specification.new do |spec|\n s... | ruby | chosen |
[
{
"from": "human",
"value": "Add SolveBio Ruby cheet sheet\n"
},
{
"from": "gpt",
"value": "# Cheet sheet for SolveBio API\nrequire 'solvebio'\n\n# Load the Dataset object\ndataset = SolveBio::Dataset.retrieve('ClinVar/2.0.0-1/Variants')\n\n# Print the Dataset\nputs dataset.query()\n\n# Get help... | ruby | chosen |
[
{
"from": "system",
"value": "Add Task model to fix yaml encoding migration\n"
},
{
"from": "human",
"value": "class FixYamlEncoding < ActiveRecord::Migration\n def self.up\n fix_encoding(Block, 'settings')\n fix_encoding(Product, 'data')\n fix_encoding(Environment, 'settings')\n fi... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor to use multi-request interface\n"
},
{
"from": "human",
"value": "class User\n def self.forks username\n repos = []\n page = 1\n begin\n repos += (a = JSON.parse RestClient.get \"https://api.github.com/users/#{username}/repos?page=#{page}&per... | ruby | chosen |
[
{
"from": "system",
"value": "Stop using Nokogiri::HTML.search, instead use Nokogiri::HTML.css\n"
},
{
"from": "human",
"value": "require 'pygments.rb'\n\nmodule Lokka\n module Pygmentize\n def self.registered(app)\n app.before do\n assets_path = \"/plugin/lokka-pygmentize/assets... | ruby | chosen |
[
{
"from": "system",
"value": "Add duration and frequency to spawn seed, and activate immediately.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nRoom.find_or_initialize_by(x: 0, y: 0, z: 0).tap do |room|\n room.update(\n description: <<~DESCRIPTION.squish\n The stre... | ruby | chosen |
[
{
"from": "system",
"value": "Comment out comments_controller spec file\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Comment, type: :controller do\n\n let(:duck_user1) { double(\"User\", name: \"Daffy\", password_digest: \"123\")}\n let(:duck_user2) { double(\"Us... | ruby | chosen |
[
{
"from": "human",
"value": "Add acceptance test of dashboard links.\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe 'actions from dashboard' do\n before :each do\n @user = FactoryGirl.create(:user)\n @project = FactoryGirl.create(:project)\n FactoryGirl.create(:con... | ruby | chosen |
[
{
"from": "system",
"value": "Update gem version to 0.1.2\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nGem::Specification.new do |spec|\n spec.name = \"no-style-please\"\n spec.version = \"0.1.1\"\n spec.authors = [\"Riccardo Graziosi\"]\n spec.ema... | ruby | chosen |
[
{
"from": "system",
"value": "Add rspec case to using after for chatmessages\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nRSpec.describe Easemob::Chatlog do\n describe '#chatmessages' do\n it 'get chat messages without any argument' do\n res = Easemob.chatmessages\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for `UserBan` model\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\nRSpec.describe UserBan, type: :model do\n describe \"validations\" do\n it { should belong_to(:user) }\n it { should belong_to(:banned_b... | ruby | chosen |
[
{
"from": "human",
"value": "Move asset snippet from effective assets\n"
},
{
"from": "gpt",
"value": "if defined?(EffectiveAssets)\n module Effective\n module Snippets\n class EffectiveAsset < Snippet\n # attr_accessor :asset_id #, Integer\n # attr_accessor :html_clas... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the tests on osx\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Puppet::Parser::Functions.function(:validate_cmd) do\n let(:scope) { PuppetlabsSpec::PuppetInternals.scope }\n\n subject do\n function_name = Puppet::Parser::Functions.fun... | ruby | chosen |
[
{
"from": "system",
"value": "Test fails when extension sort does not match\n\nSigned-off-by: Radiant CMS dev team <f73d9485a052e9e946f26c8e2a718dc9d93fdd45@prime-motif.com>"
},
{
"from": "human",
"value": "require File.dirname(__FILE__) + \"/../../spec_helper\"\n\ndescribe Admin::ExtensionsCont... | ruby | chosen |
[
{
"from": "human",
"value": "Add CLI tool for Texas Instrument CC Debugger\n"
},
{
"from": "gpt",
"value": "class CcTool < Formula\n desc \"Support for Texas Instruments CC Debugger.\"\n homepage \"https://sourceforge.net/projects/cctool\"\n head \"https://github.com/dashesy/cc-tool.git\"\n\n... | ruby | chosen |
[
{
"from": "human",
"value": "Complete the Numbers to Words Challenge\n"
},
{
"from": "gpt",
"value": "# Numbers to English Words\n\n=begin\n\nPSEUDOCODE\nInput: An integer.\nOutput: A string.\nSteps:\n1. Define method 'in_words' with a parameter that takes an integer\n2. Define an 'single_nums' ... | ruby | chosen |
[
{
"from": "system",
"value": "Add Rails as a dependency"
},
{
"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 = [\"nic... | ruby | chosen |
[
{
"from": "human",
"value": "Add a test app simulating queuing time\n"
},
{
"from": "gpt",
"value": "require 'bundler/setup'\nrequire 'librato-rack'\n\n# Simulate the environment variables Heroku passes along\n# with each request\n#\nclass QueueWait\n def initialize(app)\n @app = app\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Update from ChefMetal to Chef::Provisioning\n\nSigned-off-by: David Crosby <f7d7cb7f72d0fb8b54dea8a8286127a99c2eb292@gmail.com>\n"
},
{
"from": "human",
"value": "require 'chef/provisioning/docker_driver/driver'\n\nChefMetal.register_driver_class('docker', Chef::Pro... | ruby | chosen |
[
{
"from": "system",
"value": "Use different names for each test user\n\nI found it confusing when a test comparing two users failed, and both user names were Daaaaaave\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :user do\n name \"Daaaaaaave\"\n end\n\n factory :polic... | ruby | chosen |
[
{
"from": "system",
"value": "Add sandbox because it is allowed in the client validation\n"
},
{
"from": "human",
"value": "module Rpush\n module Daemon\n module Dispatcher\n class Apnsp8Http2\n include Loggable\n include Reflectable\n\n URLS = {\n producti... | ruby | chosen |
[
{
"from": "system",
"value": "Use DateHelper to retrieve the reference date \n\nRefactor to use the new current_day function in DateHelper to reduce\nduplication of code."
},
{
"from": "human",
"value": "module SmartAnswer::Calculators\n class RatesQuery\n def self.from_file(rates_filename, ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix foreign key and unique constraints\n\n[#113954017](https://www.pivotaltracker.com/story/show/113954017)\n\nSigned-off-by: Danny Berger <8efccf38e9d8f361e1973ad644e1b1e50ad8ecfe@pivotal.io>\n"
},
{
"from": "human",
"value": "Sequel.migration do\n change do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we can use the syntax we need\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |gem|\n gem.name = 'robot_sweatshop'\n gem.version = '0.1.5'\n gem.licenses = 'MIT'\n gem.authors = ['Justin Scott']\n gem.email = 'jvsc... | ruby | chosen |
[
{
"from": "human",
"value": "Add object tests for storage.\n"
},
{
"from": "gpt",
"value": "Shindo.tests('Fog::Storage[:hp] | object requests', [:hp]) do\n\n @directory = Fog::Storage[:hp].directories.create(:key => 'fogobjecttests')\n @dir_name = @directory.identity\n\n tests('success') do\n... | ruby | chosen |
[
{
"from": "system",
"value": "Make customer balance serialize with the currency\n"
},
{
"from": "human",
"value": "class Api::Admin::CustomerSerializer < ActiveModel::Serializer\n attributes :id, :email, :enterprise_id, :user_id, :code, :tags, :tag_list, :name,\n :allow_charges, :de... | ruby | chosen |
[
{
"from": "system",
"value": "Remove before_action on action forbidding in routing\n"
},
{
"from": "human",
"value": "class Admin::LocationsController < AdminController\n before_action :set_location, only: [:edit, :destroy, :update]\n\n def index\n @locations = Location.order('created_at de... | ruby | chosen |
[
{
"from": "system",
"value": "Exclude password fields from authentication api"
},
{
"from": "human",
"value": "class AuthenticationsController < ApplicationController\n before_action :only_admins\n\n def create\n if person = Person.authenticate(params[:authentication][:email], params[:authe... | ruby | chosen |
[
{
"from": "system",
"value": "Add fields \"Today\" and \"Now\"\n"
},
{
"from": "human",
"value": "class Applicant < ActiveRecord::Base\n\n has_one :identity, dependent: :destroy\n accepts_nested_attributes_for :identity\n has_many :landlords, dependent: :destroy\n accepts_nested_attributes_f... | ruby | chosen |
[
{
"from": "system",
"value": " [CI] Fix typo for AppVeyor OpenSSL error"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'openfoodfacts'\n\nrequire 'minitest/autorun'\n\nrequire 'webmock/minitest'\nrequire 'vcr'\n\n# Avoid OpenSSL certificate v... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary properties and methods. Add possible helper methods. Not sure yet if we'll stick with using this class. Might not really be necessary or all that helpful if we have the right helpers on the BatchResult class.\n"
},
{
"from": "human",
"value": "mod... | ruby | chosen |
[
{
"from": "system",
"value": "Update font-awesome to version 4.3.0 from 4.2.0\n"
},
{
"from": "human",
"value": "cask :v1 => 'font-fontawesome' do\n version '4.2.0'\n sha256 'b68b47c5e6da744fc78393eeae0cb16e3844a76b505855c99ff50e99c680b5c0'\n\n url \"https://github.com/FortAwesome/Font-Awesom... | ruby | chosen |
[
{
"from": "system",
"value": "Add one test for event show\n"
},
{
"from": "human",
"value": "require 'rails_helper'\nrequire 'spec_helper'\n\ndescribe EventsController do\n\n describe \"#index\" do\n it \"renders the index template\" do\n expect(get :index).to render_template (:index)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use If-Modified-Since Header when refreshing feeds\n\nFetch feeds with the If-Modified-Since HTTP header set to the last refresh timestamp.\nThis should save us (and the feed providers) quite some traffic since we don't have the fetch the whole feed when the content hasn't chan... | ruby | chosen |
[
{
"from": "system",
"value": "Use monitors for handling locking and waiting\n"
},
{
"from": "human",
"value": "require 'thread'\n\nmodule Dataflow\n def self.included(cls)\n class << cls\n def declare(*readers)\n readers.each do |name|\n variable = Variable.new\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure login and register pages have certain words\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'registration with invites', :type => :feature do\n before { @onceoff = Invite.create(:description => 'Test') }\n\n it 'should let me regist... | ruby | chosen |
[
{
"from": "system",
"value": "Test for removing users from groups\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'groups' do\n before do\n sign_in(FactoryGirl.create(:admin))\n end\n\n context \"creating a group\" do\n before do\n visit root_path\n click_... | ruby | chosen |
[
{
"from": "system",
"value": "Tag addtional spec with selenium\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nfeature \"Submitting a paper\", js: true do\n before do\n sign_in_page = SignInPage.visit\n sign_in_page.sign_in author\n end\n\n let(:author) { create :user }\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix RVM single-user install file spec tests\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nrvm_init_script = File.join('', 'home', 'vagrant', '.profile' )\nrvm_default_ruby = 'ruby-2.2.2'\n\ndescribe file( rvm_init_script ) do\n it { should be_file }\n... | ruby | chosen |
[
{
"from": "system",
"value": "Remove pry-debugger as a dev dependency.\n\nIt's not a required dependency, so probaboy shouldn't be listed here...\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.