conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add request to notification when request is created\n"
},
{
"from": "human",
"value": "class RequestsController < ApplicationController\n def create\n @request = Request.new(job_id: params[:job_id], client_id: current_user.id)\n job = Job.find(params[:job_id]... | ruby | chosen |
[
{
"from": "human",
"value": "Add a new formula for PSPP\n\nPSPP is the GNU reimplementation of SPSS, a package for doing\nstatistical analysis. This formula adds support for the GUI and\ncommand-line pspp tools.\n\nCloses #539.\n"
},
{
"from": "gpt",
"value": "require 'formula'\n\nclass Pspp < F... | ruby | chosen |
[
{
"from": "system",
"value": "Add user_update_permission to list of defaults"
},
{
"from": "human",
"value": "require \"doorkeeper/models/application\"\n\nclass ::Doorkeeper::Application < ActiveRecord::Base\n has_many :permissions, :dependent => :destroy\n has_many :supported_permissions, :de... | ruby | chosen |
[
{
"from": "system",
"value": "Check that a comment exists when featuring a confession\n"
},
{
"from": "human",
"value": "class Cell < ActiveRecord::Base\n acts_as_list\n\n belongs_to :confession\n\n delegate :excerpt, :body, :published_at, to: :confession\n\n validates :confession, presence:... | ruby | chosen |
[
{
"from": "system",
"value": "Add one-to-many relationship between User and AuthToken\n"
},
{
"from": "human",
"value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_aut... | ruby | chosen |
[
{
"from": "system",
"value": "Add an internal Exceptions base class\n"
},
{
"from": "human",
"value": "module Cyclid\n # Module for the Cyclid API\n module API\n # Error codes, for REST etc. statuses\n module Errors\n # Identifiers for HTTP JSON error bodies\n module HTTPErrors... | ruby | chosen |
[
{
"from": "human",
"value": "Add test case for the RootPopulator class\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\nclass RootPopulatorTest < ActiveSupport::TestCase\n def setup\n @user = User.new\n @args = ActiveSupport::HashWithIndifferentAccess.new(\n model: @user,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Delete duplicate attributes in rabl templates.\n"
},
{
"from": "human",
"value": "extends \"api/v1/places/index\"\n\nchild :ownerships do\n attributes :user_id, :name\n attributes :contact_by_phone, :contact_by_email\n attributes :email, :phone, :if => lambda { |... | ruby | chosen |
[
{
"from": "system",
"value": "Set 404.html as the 404 error page\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'sinatra'\n\nget '/index.html' do\n\terb :'index.html'\nend\n\nget '/projects.html' do\n\terb :'projects.html'\nend\n\nget '/skills.html' do\n\terb :'skills.html'\nend\... | ruby | chosen |
[
{
"from": "system",
"value": "Fix reference to missing method in AccountCreationWorker\n"
},
{
"from": "human",
"value": "class AccountCreationWorker\n include Sidekiq::Worker\n\n def perform(id)\n\n @user = User.find(id)\n\n # send email, subscriptions\n @user.send_welcome_email\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Disable failing code on private message worker\n\nWas failing in the `Resque.logger` line for any private message sent.\nCommented it and the other lines that were not being used.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n# This file is part of Mco... | ruby | chosen |
[
{
"from": "system",
"value": "Change default value of the gtm_id config option to nil"
},
{
"from": "human",
"value": "module Layer\n module Handler\n \n class Engine < ::Rails::Engine\n initializer \"layer_handler.action_view\" do |app|\n ActiveSupport.on_load :action_view do... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a bug with GlobalID\n"
},
{
"from": "human",
"value": "require 'redis'\nrequire 'global_id'\nrequire 'logger'\n\nrequire_relative 'queue_manager/configuration'\nrequire_relative 'queue_manager/daemon'\nrequire_relative 'queue_manager/util'\nrequire_relative 'que... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) reverse it\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/557a2c136b19113912000010\n\n# --- iteration 1 ---\ndef reverse_it(data)\n if data.is_a?(String)\n data.to_s.reverse\n elsif data.is_a?(Integer)\n data.to_s.reverse.to... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bad merge of sapi\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: wt_streamingapi\n# Attributes:: default\n#\n# Copyright 2012, Webtrends\n#\n# All rights reserved - Do Not Redistribute\n#\n\ndefault['wt_streamingapi']['user'] = \"web... | ruby | chosen |
[
{
"from": "system",
"value": "Convert admin controller tests to request type\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\ndescribe AdminController do\n let(:admin) { create(:admin) }\n let(:user) { create(:user) }\n\n describe '#index' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add version for nokogiri 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 'crossdomain/version'\n\nGem::Specification.new do |spec|\n spec.nam... | ruby | chosen |
[
{
"from": "system",
"value": "Remove sbJson reader test that pulls extent from ScienceBase\n"
},
{
"from": "human",
"value": "# MdTranslator - minitest of\n# reader / sbJson / module_sbJson\n\n# History:\n# Stan Smith 2017-06-19 original script\n\nrequire_relative 'sbjson_test_parent'\nrequire... | ruby | chosen |
[
{
"from": "system",
"value": "Allow multiple stack destruction at once. Include option to disable polling\n"
},
{
"from": "human",
"value": "require 'chef/knife/cloudformation_base'\n\nclass Chef\n class Knife\n class CloudformationDestroy < Knife\n\n include KnifeCloudformation::KnifeB... | ruby | chosen |
[
{
"from": "system",
"value": "Create parent dotfiles dirs if they don't exist\n\nPrevents errors such as ~/.gconf sub-dirs not existing.\n"
},
{
"from": "human",
"value": "define :dotfile_install do\n require 'pathname'\n\n source = File.join(REAL_HOME, params[:name])\n target = File.jo... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor iteration to use a method object instead of a proc\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule Devtools\n class Project\n class Initializer\n\n # Imports all devtools rake tasks into a project\n class Rake\n\n extend ... | ruby | chosen |
[
{
"from": "human",
"value": "Add campfire json stream example\n"
},
{
"from": "gpt",
"value": "require 'rubygems'\nrequire 'json'\n \n# sudo gem install twitter-stream -s http://gemcutter.org\n# http://github.com/voloko/twitter-stream\nrequire 'twitter/json_stream'\n \n$messages = []\n \ndef run... | ruby | chosen |
[
{
"from": "system",
"value": "Remove bogus template_engine option in config generator\n"
},
{
"from": "human",
"value": "module ActiveEnum\n module Generators\n class InstallGenerator < Rails::Generators::Base\n desc \"Copy ActiveEnum default files\"\n source_root File.expand_path(... | ruby | chosen |
[
{
"from": "system",
"value": "Set the first user as active\n"
},
{
"from": "human",
"value": "require 'playhouse/context'\n\n# Constructs a client for the Google Apps privileged APIs\n# The +:user+ actor is tested to be a Google Apps admin of the domain\nclass GetGoogleAppsDomain < Playhouse::Co... | ruby | chosen |
[
{
"from": "system",
"value": "Resolve a circular dependency in indexing worker.\n"
},
{
"from": "human",
"value": "require \"sidekiq\"\nrequire \"config\"\nrequire \"sidekiq_json_encoding_patch\"\nrequire \"failed_job_worker\"\n\nmodule Elasticsearch\n class BulkIndexWorker\n include Sidekiq... | ruby | chosen |
[
{
"from": "system",
"value": "Create new Sprockets::Context for haml\n\n- fixes asset tags (maybe?)\n- Context methods like logical_path are available\n"
},
{
"from": "human",
"value": "require 'haml'\nrequire 'tilt'\n\nmodule HamlAssets\n class HamlSprocketsEngine < Tilt::Template\n attr_ac... | ruby | chosen |
[
{
"from": "system",
"value": "Use stubs to test GnomeKeyring.find_items_sync\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\ndescribe GnomeKeyring do\n describe \".find_items_sync\" do\n it \"returns a tuple of result code and result list\" do\n code, list = GnomeKeyring.fin... | ruby | chosen |
[
{
"from": "system",
"value": "Add a rake task for setting up the reporting template\n"
},
{
"from": "human",
"value": "# desc \"Explaining what the task does\"\n# task :genigames_connector do\n# # Task goes here\n# end\n"
},
{
"from": "gpt",
"value": "namespace :genigames do\n des... | ruby | chosen |
[
{
"from": "system",
"value": "Drop spraycan from apartment elevator\n"
},
{
"from": "human",
"value": "module Apartment\n module Elevators\n # Provides a rack based db switching solution based on subdomains\n # Assumes that database name should match subdomain\n class Subdomain\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow assets to preserve their object key\n"
},
{
"from": "human",
"value": "#------------------------------------------------------------------------------\n#\n# TransamObjectKey\n#\n# Adds a unique object key to a model\n#\n#---------------------------------------... | ruby | chosen |
[
{
"from": "system",
"value": "Update PS3 Media Server Cask to use SHA256"
},
{
"from": "human",
"value": "class Ps3MediaServer < Cask\n url 'http://downloads.sourceforge.net/project/ps3mediaserver/pms-1.90.1-setup-macosx.tar.gz'\n homepage 'http://www.ps3mediaserver.org/'\n version '1.90.1'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"(PDB-4232) Pin apt module to 6.2.1 when installing puppetDB\"\n"
},
{
"from": "human",
"value": "\nmatching_puppetdb_platform = puppetdb_supported_platforms.select { |r| r =~ master.platform }\nskip_test unless matching_puppetdb_platform.length > 0\n\n\ntes... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for creating a project that isn't allowed\n"
},
{
"from": "gpt",
"value": "require_relative 'spec_helper'\n\ndescribe 'Noodle' do\n it \"should fail to create a node with the same name as an existing node\" do\n post '/nodes/pigglywiggly.example.com', '{... | ruby | chosen |
[
{
"from": "system",
"value": "Add user to project factory definition.\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n\tfactory :project do\n\t\ttitle \"Great American Novel\"\n\t\twordcount_goal 10\n\t\tgoal_time_limit 40\n\t\tgoal_deadline_date {'2015-12-01'}\n\t\tactive true\n\t\tcu... | ruby | chosen |
[
{
"from": "system",
"value": "Update stack spec to not use cedar-14\n"
},
{
"from": "human",
"value": "require_relative \"../spec_helper\"\n\ndescribe \"Stack Changes\" do\n xit \"should reinstall gems on stack change\" do\n app = Hatchet::Runner.new('default_ruby', stack: \"heroku-16\").set... | ruby | chosen |
[
{
"from": "human",
"value": "Add Cucumber class for running cucumber\n"
},
{
"from": "gpt",
"value": "require_relative 'blocking_process'\n# Run Cucumber Class\nclass CucumberBDD < BlockingProcess\n @command = nil\n @platform = nil\n\n def initialize(platform, appium_server_url)\n @platfor... | ruby | chosen |
[
{
"from": "system",
"value": "Remove and 301 redirect trailing slashes in URLs\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler/setup'\n\nBundler.require(:default)\n\n# The project root directory\nroot = ::File.dirname(__FILE__)\n\n# Code highlighting\nrequire 'pygments'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Move time parsing for window out into its own method\n"
},
{
"from": "human",
"value": "class Api::V1::OnDutyFirmsController < Api::V1::ApiController\n def show\n organisations_on_duty = OnDutyLocator.new(\n requested_time,\n rota_slots_for_location\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Hide styleguide route in production\n"
},
{
"from": "human",
"value": "class StyleguideGenerator < Rails::Generators::Base\n source_root File.expand_path('../templates', __FILE__)\n\n def create_controller\n copy_file 'styleguide_controller.rb', 'app/controller... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rackup so it uses the builder\n"
},
{
"from": "human",
"value": "env = ENV['RACK_ENV'] || 'production'\n\nrequire File.expand_path('../config/application', __FILE__)\nrun PakyowApplication::Application.stage(env)\n"
},
{
"from": "gpt",
"value": "requ... | ruby | chosen |
[
{
"from": "system",
"value": "Add extra method to validate local + domain email when it exists\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire 'mail'\n\nmodule ActiveModel\n module Validations\n class EmailValidator < EachValidator\n attr_reader :record, :attribute... | ruby | chosen |
[
{
"from": "system",
"value": "Allow --force through the model generator\n"
},
{
"from": "human",
"value": "module WitBot\n module Generators\n class ModelGenerator < Rails::Generators::Base\n source_root File.expand_path('../templates', __FILE__)\n argument :user_model, type: :stri... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor AutolinkFilterTest to use Minitest\n"
},
{
"from": "human",
"value": "require \"test_helper\"\n\nHttpsFilter = HTML::Pipeline::HttpsFilter\n\nclass HTML::Pipeline::AutolinkFilterTest < Test::Unit::TestCase\n def filter(html, base_url=\"http://github.com\")... | ruby | chosen |
[
{
"from": "system",
"value": "Add nokogiri gem for dev\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'hyperloop/version'\n\nGem::Specification.new do |spec|\n spec.name = ... | ruby | chosen |
[
{
"from": "system",
"value": "Update SSH config help to properly reflect \"--host\" usage.\n"
},
{
"from": "human",
"value": "require 'optparse'\n\nrequire \"vagrant/util/safe_puts\"\n\nmodule VagrantPlugins\n module CommandSSHConfig\n class Command < Vagrant.plugin(\"1\", :command)\n i... | ruby | chosen |
[
{
"from": "system",
"value": "Set a default for the \"gui\" option for VirtualBox\n"
},
{
"from": "human",
"value": "module VagrantPlugins\n module ProviderVirtualBox\n class Config < Vagrant.plugin(\"2\", :config)\n attr_reader :customizations\n\n # If set to `true`, then VirtualB... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Sensu Metric Handler helper class\n"
},
{
"from": "human",
"value": "require 'influxdb-lineprotocol-writer'\nrequire 'sensu-handler'\nrequire 'json'\n\nmodule InfluxDB\n module LineProtocolWriter\n class Metric\n class Handler < Sensu::Handler\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix podspec for version 1.0"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'TTOpenInAppActivity'\n s.version = '1.0'\n s.license = 'MIT'\n s.summary = 'TTOpenInAppActivity is a UIActivity subclass that provides an \"Open ... | ruby | chosen |
[
{
"from": "system",
"value": "Include specs in the gem.\n"
},
{
"from": "human",
"value": "require File.expand_path('lib/resqued/version', File.dirname(__FILE__))\nGem::Specification.new do |s|\n s.name = 'resqued'\n s.version = Resqued::VERSION\n s.summary = s.description = 'Daemon of res... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unneeded alias, simplify namespace for class\n"
},
{
"from": "human",
"value": "module Arel # :nodoc:\n module Visitors # :nodoc:\n # Different super-class under JRuby JDBC adapter.\n PostGISSuperclass = if defined?(::ArJdbc::PostgreSQL::BindSubstitu... | ruby | chosen |
[
{
"from": "system",
"value": "Update leiningen on the fly\n\nNote that we the version to update to is fixed at this time.\n"
},
{
"from": "human",
"value": "require 'travis/build/script/shared/jdk'\n\nmodule Travis\n module Build\n class Script\n class Clojure < Script\n include ... | ruby | chosen |
[
{
"from": "human",
"value": "[log] Make sure errors fit in the log messages table.\n"
},
{
"from": "gpt",
"value": "Sequel.migration do\n up do\n alter_table :log_messages do\n set_column_type :message, :text\n end\n end\n\n down do\n alter_table :log_messages do\n set_colu... | ruby | chosen |
[
{
"from": "system",
"value": "Convert more hash syntax to hashrockets\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n# This file is auto-generated from the current state of the database. Instead\n# of editing this file, please use the migrations feature of Active Record to\n# incrementall... | ruby | chosen |
[
{
"from": "human",
"value": "Use regex to check permutations\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/ruby\n# coding: utf-8\n\nrequire 'test/unit'\n\n## https://stackoverflow.com/questions/3101366/regex-to-match-all-permutations-of-1-2-3-4-without-repetition\nclass TestPermutationRegex < Test... | ruby | chosen |
[
{
"from": "system",
"value": "Remove hardcoded values for GetDocumentController so it works with\npassed values.\n"
},
{
"from": "human",
"value": "class GetController < ApplicationController\n # Eg http://localhost:3000/openapi/eldis/get/documents/A64559/full\n def documents\n service = Do... | ruby | chosen |
[
{
"from": "human",
"value": "Add spec for news_item_archive_links helper method.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nmodule Refinery\n module News\n describe ItemsHelper do\n describe '#news_item_archive_links' do\n before do\n 2.times { FactoryGirl... | ruby | chosen |
[
{
"from": "human",
"value": "Add a test for govuk:export_mainstream_taxons\n"
},
{
"from": "gpt",
"value": "require \"rails_helper\"\nrequire \"gds_api/test_helpers/search\"\n\nRSpec.describe \"govuk:export_content_by_organisations\", type: :task do\n include RakeTaskHelper\n include ::GdsApi:... | ruby | chosen |
[
{
"from": "system",
"value": "Update image info when url changed\n"
},
{
"from": "human",
"value": "require 'active_support/concern'\n\nmodule ImageFile\n extend ActiveSupport::Concern\n\n included do\n before_validation :detect_image_attributes\n\n validates :url, presence: true\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add summary and description for 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 'debug_extras/version'\n\nGem::Specification.new do |spec|\n sp... | ruby | chosen |
[
{
"from": "system",
"value": "Use let() instead of let!()\n\nThis commit changes the sample gcloud integration test from using let!()\n(which is evaluated immediately and allows for value changes between\ntests) to let() (which is lazy-evaluted and memoized). Unless there's\na reason for allowing the value ... | ruby | chosen |
[
{
"from": "system",
"value": "Use git to include files in gem\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"devise/oauth/version\"\n\nGem::Specification.new do |s|\n s.name = \"devise_oauth\"\n s.version = Devise::Oauth::VERSION\n s.... | ruby | chosen |
[
{
"from": "system",
"value": "Update govuk front end toolkit\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'govuk_template/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Use strings for the git identities\n"
},
{
"from": "human",
"value": "class CreateGitIdentities < ActiveRecord::Migration\n def change\n create_table :git_identities do |t|\n t.text :name, null: false\n t.text :email, null: false\n t.references :c... | ruby | chosen |
[
{
"from": "system",
"value": "Clean a migration to make it a lightyear faster\n"
},
{
"from": "human",
"value": "class AddCardTypeToCard < ActiveRecord::Migration\n def fix_isic_card_number card\n return if !card.isic? || card.academic_year != Member.current_academic_year\n Member.unscope... | ruby | chosen |
[
{
"from": "system",
"value": "Allow push gem to any host"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kanaveral/version'\n\nGem::Specification.new do |spec|\n spec.name = ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the projects directory to be ~/Projects\n"
},
{
"from": "human",
"value": "# This file will be loaded by config/basic early in a Boxen run. Use\n# it to provide any custom code or behavior your Boxen setup requires.\n\n# Change the prefix boxen is installed to.\... | ruby | chosen |
[
{
"from": "human",
"value": "Create Budget Poll offline/online vote feature test\n"
},
{
"from": "gpt",
"value": "require \"rails_helper\"\n\nfeature \"BudgetPolls\", :with_frozen_time do\n let(:budget) { create(:budget, :balloting) }\n let(:poll) { create(:poll, :current) }\n let(:booth) { c... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for :to_s transformer class name\n"
},
{
"from": "human",
"value": "describe 'transformer_key_to_s' do\n moneta_build do\n Moneta.build do\n use :Transformer, key: :to_s\n adapter :Memory\n end\n end\n\n moneta_loader{ |value| value }\n\n mon... | ruby | chosen |
[
{
"from": "human",
"value": "Add unit test for remote folders command\n"
},
{
"from": "gpt",
"value": "module Imap::Backup\n describe CLI::Remote do\n subject { described_class.new }\n\n let(:connection) do\n instance_double(Account::Connection, account: account, folder_names: %w[foo... | ruby | chosen |
[
{
"from": "human",
"value": "Test saving the dependent models\n"
},
{
"from": "gpt",
"value": "require_relative '../test_helper'\n\nmodule ActionText\n class ModelTest < ActiveSupport::TestCase\n test \"saving content\" do\n message = Message.create!(subject: \"Greetings\", content: \"<... | ruby | chosen |
[
{
"from": "system",
"value": "Use instance_exec to invoke the lambda callback\n"
},
{
"from": "human",
"value": "module ActionCable\n module Channel\n\n class Base\n include Callbacks\n\n on_subscribe :start_periodic_timers\n on_unsubscribe :stop_periodic_timers\n\n attr_... | ruby | chosen |
[
{
"from": "system",
"value": "Index page link to 'Clients' now works.\n\nPreviously linked to non-existant '/clients.html'\n"
},
{
"from": "human",
"value": "module UrlHelpers\n\n PAGES = %w{\n clients\n conversations\n groups\n posts\n users\n }\n\n FRONT_PAGE_SECTIONS = %w{\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix not entirely removal of negative interest and fees\n"
},
{
"from": "human",
"value": "module Tufy\n module Fields\n module Account\n class BuildInterestAndFeesField < BuildField\n expects :raw_data\n promises :transformed_data\n\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Remove validaiton from system config table\n"
},
{
"from": "human",
"value": "class SystemConfig < ActiveRecord::Base\n \n #------------------------------------------------------------------------------\n # Overrides\n #------------------------------------------... | ruby | chosen |
[
{
"from": "system",
"value": "Add context method to team ALI codes\n"
},
{
"from": "human",
"value": "class TeamAliCode < ActiveRecord::Base\n # Add the nested set behavior to this model so it becomes a tree\n acts_as_nested_set\n \n # default scope\n default_scope { where(:active =... | ruby | chosen |
[
{
"from": "system",
"value": "Add code to capture token required error\n"
},
{
"from": "human",
"value": "class LtiLaunchesController < ApplicationController\n include Concerns::CanvasSupport\n include Concerns::LtiSupport\n\n layout \"client\"\n\n skip_before_action :verify_authenticity_tok... | ruby | chosen |
[
{
"from": "system",
"value": "Add county accessor for map quest results\n"
},
{
"from": "human",
"value": "require 'geocoder/results/base'\n\nmodule Geocoder::Result\n class Mapquest < Base\n def latitude\n @data[\"latLng\"][\"lat\"]\n end\n\n def longitude\n @data[\"latLng\"... | ruby | chosen |
[
{
"from": "system",
"value": "Add imagemagick as a requirement in the 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 'icon_generator/version'\n\nGem::Specification.new do |sp... | ruby | chosen |
[
{
"from": "system",
"value": "Add the Appraisal gem as a development dependency\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = \"json_spec\"\n gem.version = \"1.0.1\"\n\n gem.authors = [\"Steve Richert\"]\n gem.email = [\"ste... | ruby | chosen |
[
{
"from": "system",
"value": "Enable logging in sinatra app.\n"
},
{
"from": "human",
"value": "require \"sinatra\"\nrequire \"sinatra/reloader\"\nrequire \"sinatra/respond_with\"\n\nrequire \"sprockets\"\nrequire \"sass\"\nrequire \"coffee_script\"\n\nrequire \"mongo_browser/middleware/sprocket... | ruby | chosen |
[
{
"from": "system",
"value": "Add more methods to Client::Cases\n"
},
{
"from": "human",
"value": "module OmnideskApi\n class Client\n module Cases\n def cases(options = {})\n get 'cases.json', options\n end\n\n def case(case_id, options = {})\n get \"cases/#{cas... | ruby | chosen |
[
{
"from": "system",
"value": "Fix critical double quote bug\n"
},
{
"from": "human",
"value": "# $:.unshift File.dirname(__FILE__) \n$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$:.unshift(File.join(File.dirname(__FILE__), '..'))\n\nENV[\"RACK_ENV\"] ||= \"development\"\n\nrequire... | ruby | chosen |
[
{
"from": "system",
"value": "Configure a specific port for Docker Compose\n"
},
{
"from": "human",
"value": "workers Integer(ENV['WEB_CONCURRENCY'] || 2)\nthreads_count = Integer(ENV['MAX_THREADS'] || 5)\nthreads threads_count, threads_count\n\npreload_app!\n\nrackup DefaultRackup\nport ... | ruby | chosen |
[
{
"from": "system",
"value": "Set the locale only if user responds to it\n"
},
{
"from": "human",
"value": "class Admin::BaseController < ActionController::Base\n\n render_inheritable\n\n include Typus::Authentication::const_get(Typus.authentication.to_s.classify)\n\n before_filter :set_model... | ruby | chosen |
[
{
"from": "system",
"value": "Remove forgery protection from update action\n"
},
{
"from": "human",
"value": "class Api::PapersController < ApplicationController\n def index\n @papers = filtered_papers\n render json: @papers, each_serializer: Api::PaperSerializer\n end\n\n def show\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use rails API base controller\n"
},
{
"from": "human",
"value": "module Api::V1\n\nclass ApiController < ActionController::Base\n\n class BadToken < StandardError; end\n\n before_action :authenticate_user!\n\n helper_method :current_user\n def current_user\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add Libraries for testing and comment policyfiles\n\nFor now we haven't released `policyfiles` and the `Berksfile` was re\nintroduced so we are going to comment it for now till we are ready to\nuse it.\n\nAdded Libraries for testing\n"
},
{
"from": "human",
"value":... | ruby | chosen |
[
{
"from": "system",
"value": "Move require to in if ~ end\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nrequire 'bundler/setup'\nrequire 'coveralls'\nrequire 'space2underscore'\n\nCoveralls.wear! if ENV['COVERALLS']\nBundler.setup\n\nRSpec.configure do |config|\n config.order = 'random'... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the NameError in specs\n"
},
{
"from": "human",
"value": "require 'simplecov'\nrequire 'scrutinizer/ocular'\n\nScrutinizer::Ocular.watch!\n\nif Scrutinizer::Ocular.should_run? || ENV[\"COVERAGE\"]\n if Scrutinizer::Ocular.should_run?\n SimpleCov.formatter = ... | ruby | chosen |
[
{
"from": "system",
"value": "Update distributions used by unit tests\n"
},
{
"from": "human",
"value": "# Encoding: utf-8\n# frozen_string_literal: true\nrequire 'chefspec'\nrequire 'chefspec/berkshelf'\nrequire 'fauxhai'\nChefSpec::Coverage.start!\n\nrequire 'chef/application'\n\n# rubocop:dis... | ruby | chosen |
[
{
"from": "system",
"value": "Set 0600 permissions on test_credentials pre-test\n\nThe RSpec tests utilize the `test_credentials` file as a sample\ncredential file. Git does not manage granular file permissions,\nonly the execute and symlink bits. So in order to give this file\nthe 0600 permissions that rub... | ruby | chosen |
[
{
"from": "system",
"value": "provisioners/docker: Check if epel-release is installed on RedHat-ian guests before attempting installation [GH-2649]\n"
},
{
"from": "human",
"value": "module VagrantPlugins\n module Docker\n module Cap\n module Redhat\n module DockerInstall\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor optimal_move to take in board and rules as parameters\n"
},
{
"from": "human",
"value": "class CompPlayer\n\n def minimax(board, rules, increment = 10)\n return 1000 if rules.won?(board, \"X\")\n return -1000 if rules.won?(board, \"O\")\n return 0... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug where outputted YAML was no good\n"
},
{
"from": "human",
"value": "file node['remote_syslog2']['config_file'] do\n content node['remote_syslog2']['config'].to_yaml\n mode '0644'\n notifies :restart, 'service[remote_syslog2]', :delayed\nend"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Make upsert method a bit more easy to read\n"
},
{
"from": "human",
"value": "module ActiveRecordUpsert\n module ActiveRecord\n module RelationExtensions\n def upsert(existing_attributes, upsert_attributes, wheres) # :nodoc:\n im = arel_table.create_... | ruby | chosen |
[
{
"from": "human",
"value": "[importer] Add acceptance spec for MapInfo files\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\n# encoding: utf-8\ngem 'minitest'\nrequire 'minitest/autorun'\nrequire_relative '../../lib/importer/runner'\nrequire_relative '../../lib/importer/job'\nrequire_rela... | ruby | chosen |
[
{
"from": "system",
"value": "Add Rake as development dependency\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'pry-rescue'\n s.version = '1.1.1'\n s.summary = 'Open a pry session on any unhandled exceptions'\n s.description = 'Allows you ... | ruby | chosen |
[
{
"from": "system",
"value": "Add a couple of controller specs for disabled user registration.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe RegistrationsController do\n\n before do\n request.env['devise.mapping'] = Devise.mappings[:user]\n end\n\n describe \"#create... | ruby | chosen |
[
{
"from": "system",
"value": "Normalize payload keys to strings and refactor.\n"
},
{
"from": "human",
"value": "module Replaceable\n extend ActiveSupport::Concern\n\n class_methods do\n def create_or_replace(payload)\n item = self.lock.find_or_initialize_by(content_id: payload[:conten... | ruby | chosen |
[
{
"from": "system",
"value": "Remove attr_accessible for rails 4.\n"
},
{
"from": "human",
"value": "module Spree\n class PaymentMethod::Coinbase < PaymentMethod\n preference :api_key, :string, default: nil\n\n # TODO: Rails 4 doesn't like attr_accessible\n attr_accessible :preferred_a... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.