conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "[NetKVM] Fix a typo in test log parser script to enable its execution on Linux as well\n"
},
{
"from": "human",
"value": "#!/ust/bin/ruby\n\nif ARGV[0].to_s == \"\"\n print \"error: syntax netperf_log_parser <filename>\\n\"\n exit\nend\n\nprint \"Parsing: \" + ARG... | ruby | chosen |
[
{
"from": "system",
"value": "Update migration to use appropriate version of HTMLFormatter\n"
},
{
"from": "human",
"value": "class AddRawContents < ActiveRecord::Migration[5.2]\n ANNOTATABLES = [Case, TextBlock]\n\n def up\n create_table :raw_contents do |t| \n t.text :content\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add tags and tag_list to list serializer.\n"
},
{
"from": "human",
"value": "class ListSerializer < ActiveModel::Serializer\n # embed :ids, include: true\n attributes :id, :title, :description, :public\n has_one :user\n has_many :list_items\nend\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Update the tag link in the podspec.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"PHSideScrollingImagePicker\"\n s.version = \"1.0.1\"\n s.summary = \"iOS 7-style Image Picker\"\n s.description = <<-DESC\nA horizontally ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix DEPRECATION WARNING on render with format included template name.\n\nDEPRECATION WARNING: Passing the format in the template name is\ndeprecated. Please pass render with :formats => [:html] instead.\n"
},
{
"from": "human",
"value": "class AboutController < Appl... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unused actions and use helper for finding a beginner level language\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n def index\n @users = User.all\n end\n\n def new\n @user = User.new\n @countries_select_array =... | ruby | chosen |
[
{
"from": "system",
"value": "Allow an admin to delete a user\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n http_basic_authenticate_with name: \"bender\", password: Setting.admin_password, if: :needs_authetication?, except: [:index, :show, :new, :create]\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add a before_action to find the request, and a before_action to verify\nthat the current user is associated with the request.\n"
},
{
"from": "human",
"value": "class VotesController < ApplicationController\n def create\n @vote = Vote.new(vote_params)\n if @v... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we properly create symlinks in feature\n"
},
{
"from": "human",
"value": "require 'fileutils'\nrequire 'tempfile'\nrequire 'tmpdir'\n\nGiven /^an empty home directory$/ do\n @homedir = Dir.mktmpdir\nend\n\nAnd /^an empty config directory$/ do\n @configdi... | ruby | chosen |
[
{
"from": "system",
"value": "Add test-unit gem to development dependencies\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"fluent-plugin-keep-forward\"\n s.version = \"0.1.8\"... | ruby | chosen |
[
{
"from": "system",
"value": "Add Puppet to gemspec dependencies\n\nWe need Puppet 2.7 and later for Faces support.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'puppet-syntax/vers... | ruby | chosen |
[
{
"from": "system",
"value": "Check if authn:whoami actually raises error when not logged in.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Conjur::Command::Authn do\n context logged_in: false do\n describe_command 'authn:whoami' do\n it \"errors out\" do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix syntax in product factory\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :product do\n title 'My favorite product'\n\n trait :with_stock\n stocks { FactoryGirl.build_list(:stock, 1) }\n end\nend\n"
},
{
"from": "gpt",
"... | ruby | chosen |
[
{
"from": "system",
"value": "Add an association to service factory\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :web_service, class: 'Service' do\n name \"web\"\n cpu 128\n memory 128\n public true\n end\nend\n"
},
{
"from": "gpt",
"value": "Facto... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.1.4 to 0.1.5\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.1.4'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP client'\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove double semicolons from class names\n"
},
{
"from": "human",
"value": "module AuthorizationHelper\n def not_authorized_message(action, object)\n case action\n when :update, :vet, :destroy, :edit, :pick\n _('Sorry, you may not %{verb} this %{object}... | ruby | chosen |
[
{
"from": "system",
"value": "Add scopes for deleted not deleted to the archived mixing\n\nAdd scopes for deleted not deleted to the archived mixin, we\nshould always use a scope, rather than a specific query.\n"
},
{
"from": "human",
"value": "module ArchivedMixin\n extend ActiveSupport::Conce... | ruby | chosen |
[
{
"from": "system",
"value": "Add answer to my_soulution for 4.3\n"
},
{
"from": "human",
"value": "# Define an Empty Method\n\n# I worked on this challenge [by myself, with: ].\n\n\n# Your Solution Below"
},
{
"from": "gpt",
"value": "# Define an Empty Method\n\n# I worked on this c... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug after refactoring method name in AA NewsletterSetting resource\n"
},
{
"from": "human",
"value": "#\n# == NewsletterSettingDecorator\n#\nclass NewsletterSettingDecorator < ApplicationDecorator\n include Draper::LazyHelpers\n delegate_all\n\n def send_welc... | ruby | chosen |
[
{
"from": "system",
"value": "Correct path to github repo in gemspec"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"blox\"\n gem.authors = [\"Kim Burgestrand\"]\n gem.email = [\"kim@burgestrand.se\"]\n gem.s... | ruby | chosen |
[
{
"from": "system",
"value": "Add the correct actions to the controller.\n"
},
{
"from": "human",
"value": "class HomeController < ApplicationController\n def index\n if current_user.company == nil\n redirect_to new_user_company_path\n else\n @invoices = current_user.company.get... | ruby | chosen |
[
{
"from": "system",
"value": "Add command to add decision file with authentication\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule LicenseFinder\n module CLI\n class InheritedDecisions < Base\n extend Subcommand\n include MakesDecisions\n\n desc 'lis... | ruby | chosen |
[
{
"from": "system",
"value": "Include original URL in CMA import log\n"
},
{
"from": "human",
"value": "class CmaImportAttributeMapper\n def initialize(create_document_service)\n @create_document_service = create_document_service\n end\n\n def call(data)\n document = create_document_ser... | ruby | chosen |
[
{
"from": "system",
"value": "Remove signup and login links, until clients have a need for them\n"
},
{
"from": "human",
"value": "class Views::LoggedOut::Index < Views::Base\n def content\n full_row {\n h1(\"LoggedOut#index\")\n p(\"Find me in app/views/logged_out/index.html.erb\"... | ruby | chosen |
[
{
"from": "system",
"value": "Use Camel-Cased header names in the specs.\n"
},
{
"from": "human",
"value": "require 'spidr/page'\n\nrequire 'spec_helper'\n\nshared_examples_for \"Page\" do\n it \"should have a status code\" do\n @page.code.should be_integer\n end\n\n it \"should have a bod... | ruby | chosen |
[
{
"from": "human",
"value": "Add root account id to master_courses_master_templates\n\nCloses PLAT-6672\nflat=none\n\nTest Plan:\n- Verify migrations run\n- Verify you can set the root_account_id on a MasterCourses::MasterTemplate\n- Verify MasterCourses::MasterTemplates always live on the same shard as\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure view helpers work in production\n"
},
{
"from": "human",
"value": "SwitchUser.setup do |config|\n config.available_users = { :user => lambda { User.order(:email) } }\n config.controller_guard = lambda { |current_user, request| current_user.try(:admin?) }... | ruby | chosen |
[
{
"from": "system",
"value": "Enhance verb.json test to check that the first infinitive is correct.\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\nrequire_relative 'spec_helper'\n\ndescribe \"Grokily\" do\n\n it \"redirects to Github on root\" do\n get '/'\n last_response.should be... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for removing by score.\n"
},
{
"from": "human",
"value": "require File.dirname(__FILE__) + '/spec_helper.rb'\n\ndescribe \"redis zsets\" do\n\n it \"should compose correctly\" do\n z = RedisSortedSet.new(\"set1\")\n\n z << [ [2, \"timothy\"], [1, \"a... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration to support legacy stores with deleted variants and line items\n\nFixes #4178\n"
},
{
"from": "human",
"value": "class AddLineItemIdToSpreeInventoryUnits < ActiveRecord::Migration\n def change\n # Stores running the product-assembly extension alread... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for creating new submission with invalid parameters\n"
},
{
"from": "human",
"value": "require \"rails_helper\"\n\nRSpec.describe SubmissionsController, type: :controller do\n describe \"GET #new\" do\n\n it \"returns http success\" do\n get :new\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add fonticon spec for TreeNode::ScanItemSet\n"
},
{
"from": "human",
"value": "require 'shared/presenters/tree_node/common'\n\ndescribe TreeNode::ScanItemSet do\n pending 'add some tests here (will require a factory too)'\nend\n"
},
{
"from": "gpt",
"va... | ruby | chosen |
[
{
"from": "system",
"value": "Test adapters with unsupported rubies.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Sloth::Adapters do\n describe '.adapter' do\n before { stub_const \"RUBY_ENGINE\", engine }\n\n context 'with MRI (Ruby or REE)' do\n let(:engine)... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests to check if a new label is added\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\nfeature 'Issue Sidebar', feature: true do\n let(:project) { create(:project) }\n let(:issue) { create(:issue, project: project) }\n let!(:user) { create(:user)}\n... | ruby | chosen |
[
{
"from": "system",
"value": "Set dev env to send email\n"
},
{
"from": "human",
"value": "# Settings specified here will take precedence over those in config/environment.rb\n\n# In the development environment your application's code is reloaded on\n# every request. This slows down response tim... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error in migration causing a \"unknown key: name\" exception.\n"
},
{
"from": "human",
"value": "class AddCurrencyCodeOptionToPaypalGateway < ActiveRecord::Migration\n def self.up\n currency_code = GatewayOption.create(:name => \"currency_code\",\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix broken spec checking for extinct element\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\n# This test serves as a regression test for a bug that caused an error\n# message to be shown by JavaScript when the source branch was deleted.\n# Please do not... | ruby | chosen |
[
{
"from": "human",
"value": "Update committee_id primary and foreign keys to bigint\n"
},
{
"from": "gpt",
"value": "class ChangeCommitteeIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :committees, :id, :bigint\n\n change_column :committee_members, :committee_id, :bigi... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless field in PhysicalRack\n"
},
{
"from": "human",
"value": "class PhysicalRack\n include Mongoid::Document\n\n field :id, type: Integer\n field :name, type: String\n field :site_id, type: Integer\n field :site_name, type: String\n field :status, ty... | ruby | chosen |
[
{
"from": "system",
"value": "Fix config reset in ruby-2.0\n"
},
{
"from": "human",
"value": "module Pakyow\n module Config\n class Base\n @@configs = {}\n def self.register_config(name, klass)\n @@configs[name] = klass\n\n define_singleton_method name do\n @... | ruby | chosen |
[
{
"from": "system",
"value": "Include category name and id in emission sub category response\n"
},
{
"from": "human",
"value": "module Api\n module V1\n module Data\n module AgricultureProfile\n class EmissionSubcategorySerializer < ActiveModel::Serializer\n has_one :emi... | ruby | chosen |
[
{
"from": "system",
"value": "Remove nil values from matching properties\n"
},
{
"from": "human",
"value": "require 'rubygems'\n\ngem 'dm-core', '=0.9.0'\nrequire 'data_mapper'\n\nmodule DataMapper\n module Timestamp\n def self.included(base)\n base.before(:save, :update_timestamp_prope... | ruby | chosen |
[
{
"from": "system",
"value": "Rename private method for better intention\n"
},
{
"from": "human",
"value": "module BaseballStats\n module Calculators\n class ImprovedBattingAverage\n attr_accessor :csv, :year\n\n def initialize(raw_data, year)\n raise NoStatsToCalculateError... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test to target the correct element\n"
},
{
"from": "human",
"value": "require_relative '../page'\n\nmodule UI::Pages\n class Home < UI::Page\n set_url '/{locale}'\n\n element :strapline, '.home-feature__content h1'\n element :feature_list, '.home-featu... | ruby | chosen |
[
{
"from": "system",
"value": "Correct bug, where we have twice the bars added to render\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n# Copyright 2008, 2009, 2010 Boris ARZUR\n#\n# This file is part of Kemuri.\n#\n# Kemuri is free software: you can redistribute it and/or modify\... | ruby | chosen |
[
{
"from": "system",
"value": "Convert boolean to string for scenario matching\n"
},
{
"from": "human",
"value": "require 'httparty'\nrequire 'test/unit/assertions'\n\nWorld(Test::Unit::Assertions)\n\nGiven(/^A server \"(.*?)\" with access enabled to \"(.*?)\" with \"(.*?)\"$/) do |host, user, pa... | ruby | chosen |
[
{
"from": "system",
"value": "Fix *Multiple IDs found with provided prefix* error\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n#\n# Author:: Xabier de Zuazo (<xabier@zuazo.org>)\n# Copyright:: Copyright (c) 2015-2016 Xabier de Zuazo\n# License:: Apache License, Version 2.0\n#\n# License... | ruby | chosen |
[
{
"from": "system",
"value": "Update log message not to assume database\n\nIf the database is not what we expect, we want to hear about it in the log message instead of being told we’re trying to write to production.\n"
},
{
"from": "human",
"value": "module Stagehand\n module Connection\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Make SSL verification check optional and enabled by default (forcefully disabled before)\n"
},
{
"from": "human",
"value": "module WatchmonkeyCli\n module Checkers\n class SslExpiration < Checker\n self.checker_name = \"ssl_expiration\"\n\n def enqueue... | ruby | chosen |
[
{
"from": "system",
"value": "Include the connection module after defining the work callback\n"
},
{
"from": "human",
"value": "module ActionCable\n module Server\n # Worker used by Server.send_async to do connection work in threads. Only for internal use.\n class Worker\n include Ac... | ruby | chosen |
[
{
"from": "system",
"value": "Update Podspec for 1.0.0 release\n"
},
{
"from": "human",
"value": "# Copyright (c) 2015 spotxchange. All rights reserved.\n#\n# Be sure to run `pod spec lint' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# see http://gui... | ruby | chosen |
[
{
"from": "system",
"value": "Use coveralls_reborn to send coverage reports to Coveralls\n\ncoveralls gem, provided by coveralls officially, has been out of date.\n"
},
{
"from": "human",
"value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\nrequire 'docx/version'\n\nGem::Specification.ne... | ruby | chosen |
[
{
"from": "system",
"value": "Add Email Alert API to Services\n\nWe want to be able to unsubscribe users when a specialist\ntopic is archived.\n\nRequired bearer tokens set up in https://github.com/alphagov/govuk-secrets/pull/1298\n"
},
{
"from": "human",
"value": "require \"gds_api/publishing_a... | ruby | chosen |
[
{
"from": "system",
"value": "Support for headers and proxy\n"
},
{
"from": "human",
"value": "require 'openssl'\n\nmodule AnsibleTowerClient\n class Connection\n attr_reader :connection\n\n def initialize(options = nil)\n raise \"Credentials are required\" unless options[:username] ... | ruby | chosen |
[
{
"from": "system",
"value": "Use class_name instead of name for Hubspot events\n"
},
{
"from": "human",
"value": "require 'hubspot/events_api'\n\nmodule Carto\n module Tracking\n module Services\n module Hubspot\n def report_to_hubspot\n return unless ::Hubspot::EventsA... | ruby | chosen |
[
{
"from": "system",
"value": "Migrate BlockNesting cop to Parser 2.0.0.beta8\n\nWe need to catch the newly added `while_post` and `until_post` nodes.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule Rubocop\n module Cop\n module Style\n # This cop checks for excessive nest... | ruby | chosen |
[
{
"from": "system",
"value": "Call URI.open() rather than open()\n\nUse of open() without URI was deprecated in ruby 2.7 and removed in 3.0\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire \"open-uri\"\nrequire \"nokogiri\"\n\nmodule TransitionConfig\n class TNATimest... | ruby | chosen |
[
{
"from": "system",
"value": "Add essential fields into info hash\n"
},
{
"from": "human",
"value": "require \"omniauth-oauth2\"\nrequire \"oauth2\"\n\nmodule OmniAuth\n module Strategies\n class Nctu < OmniAuth::Strategies::OAuth2\n OAuthUrl = \"https://id.nctu.edu.tw\"\n\n option... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unused Product SLUG constant\n"
},
{
"from": "human",
"value": "module Tiqets\n module Resources\n module Product\n SLUG = 'products'.freeze\n\n def find_product(id)\n response = get(\"products/#{id}\", 'product')\n Product.new(res... | ruby | chosen |
[
{
"from": "system",
"value": "Create example for email validation\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\nrequire \"rails_helper\"\nrequire \"usuario\"\n\ndescribe Usuario do\n\tcontext \"validations\" do\n\t\tit \"requite email to be set\"\n\n\t\tit \"requite name to be set\... | ruby | chosen |
[
{
"from": "system",
"value": "Add special case for bracket in url\n"
},
{
"from": "human",
"value": "class Asset < ActiveRecord::Base\n belongs_to :item\n\n before_validation :set_metadata\n\n scope :videos, -> { where(\"mime like 'video%'\") }\n\n class << self\n def help_text\n <<-... | ruby | chosen |
[
{
"from": "system",
"value": "Remove version for objective-zip dependency\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\n s.name = \"Simple-KML\"\n s.version = \"0.1.0\"\n s.summary = \"Simple KML is a simple & lightweight parsing library for KML written in Objec... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration class to be compatible with Rails versions < 5\n"
},
{
"from": "human",
"value": "class CreateArticles < ActiveRecord::Migration[5.1]\n def change\n create_table :articles do |t|\n t.string :title\n t.text :text\n\n t.timestamps\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add license and update description\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"fluent-plugin-logtank-http\"\n gem.version = '0.0.1'\n\n gem.authors = [\"Peter Grman\"]\n gem.... | ruby | chosen |
[
{
"from": "system",
"value": "Fix example for Rails 3.1\n\nAvoid using has_key? as it is not available on 3.1.\n"
},
{
"from": "human",
"value": "require \"helper\"\n\nclass ReservedTest < MiniTest::Unit::TestCase\n\n include FriendlyId::Test\n\n class Journalist < ActiveRecord::Base\n exte... | ruby | chosen |
[
{
"from": "system",
"value": "Install thor and add description\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'goku/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Move session secret out of source control. Duh.\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will ... | ruby | chosen |
[
{
"from": "human",
"value": "Add text tests (fail now due to header issue)\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\ncontext \"Text\" do\n test \"line breaks\" do\n assert_xpath \"//br\", render_string(\"Well this is +\\njust fine and dandy, isn't it?\"), 1\n end\n\n test \... | ruby | chosen |
[
{
"from": "system",
"value": "Use dash-options in search command\n"
},
{
"from": "human",
"value": "require 'nehm/tracks_view_command'\n\nmodule Nehm\n\n class SearchCommand < TracksViewCommand\n\n def initialize\n super\n end\n\n def execute\n @query = @options[:args].join('... | ruby | chosen |
[
{
"from": "system",
"value": "Update YAML engine check for new Ruby versions\n\nOn Ruby 2.2.1, '::YAML' returns the class Psych, which has no ::ENGINE\nconstant defined.\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nmodule PaperTrail\n module Serializers\n module YAML\n extend se... | ruby | chosen |
[
{
"from": "system",
"value": "Revert the change to the default timeout\n"
},
{
"from": "human",
"value": "require 'timeout'\nrequire 'protobuf/logger'\nrequire 'protobuf/rpc/rpc.pb'\nrequire 'protobuf/rpc/buffer'\nrequire 'protobuf/rpc/error'\nrequire 'protobuf/rpc/stat'\nrequire 'protobuf/rpc/c... | ruby | chosen |
[
{
"from": "system",
"value": "Tweak the tempfile usage of Pygmentize\n"
},
{
"from": "human",
"value": "module Rembrandt\n module Engines\n class Pygmentize\n def highlight(input, language)\n tmp_file = File.open(\"./tmp/colorize_temp\", \"w\")\n tmp_file.write(input)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Define the name of the module\n"
},
{
"from": "human",
"value": "# coding: utf-8\nPod::Spec.new do |s|\n s.name = \"FTFountain\"\n s.version = \"2.3\"\n s.summary = \"Pluggable data sources and adapters for manag... | ruby | chosen |
[
{
"from": "system",
"value": "Fix auto-created query for central producer nodes\n"
},
{
"from": "human",
"value": "module Atlas\n class Node::CentralProducer < Node::Demand\n # Public: The query used to extract a demand from the central producers\n # CSV data.\n #\n # Returns a stri... | ruby | chosen |
[
{
"from": "system",
"value": "Add proper level of semantic versioning to dependencies\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"subdivision_select/version\"\n\n# Describe your gem and declare its dependencies:\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task to reindex SOLR based on a list of URIs from Fedora\n"
},
{
"from": "gpt",
"value": "#\n# Some helper tasks to SOLR index regeneration\n#\n\nrequire 'active_fedora/solr_service'\n\nnamespace :libraetd do\n\n namespace :solr do\n\n desc \"Regenerate th... | ruby | chosen |
[
{
"from": "human",
"value": "Add external images from the entire page.\n"
},
{
"from": "gpt",
"value": "module LinkPreview\n class ExternalImage < ExternalResource\n attr_reader :image_path\n\n def self.parse(uri, document)\n document.css(\"img\").collect { |image|\n self.new(... | ruby | chosen |
[
{
"from": "system",
"value": "Use the reflection class's connection when calling explain for compat with per-class databases / active_record_shards\n"
},
{
"from": "human",
"value": "require 'active_record/associations/preloader'\n\nmodule PredictiveLoad\n class PreloadLog < ActiveRecord::Assoc... | ruby | chosen |
[
{
"from": "system",
"value": "Add .rb suffix in migration\n"
},
{
"from": "human",
"value": "require 'rails/generators/active_record'\n\nmodule ActiveRecord\n module Generators\n class DeviseSmsAuthenticatableGenerator < ActiveRecord::Generators::Base\n source_root File.expand_path(\"..... | ruby | chosen |
[
{
"from": "system",
"value": "Fix description for Base test\n"
},
{
"from": "human",
"value": "require 'helper'\nrequire 'deviantart'\nrequire 'deviantart/base'\n\ndescribe DeviantArt::Base do\n describe 'DeviantArt::Base' do\n before do\n @base = DeviantArt::Base.new({})\n end\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Replace the EDN parser with the EDNT parser at load time\n"
},
{
"from": "human",
"value": "require 'edn'\nrequire 'edn_turbo/version'\nrequire 'edn_turbo/edn_parser'\nrequire 'edn_turbo/edn_turbo'\n\nmodule EDNT\n # instantiate a parser (defined in the C-side) and... | ruby | chosen |
[
{
"from": "human",
"value": "Add the main class using the different features\n\nAdded the ThemeExtractor class which will use the TextRazor API and the\ncustom dbpedia graph based labeling library\n"
},
{
"from": "gpt",
"value": "module ThemeExtractor\n\t# parse the text, extract the entities an... | ruby | chosen |
[
{
"from": "system",
"value": "Remove redundant exception wrapper from HttpLoader\n"
},
{
"from": "human",
"value": "module Loaders\n class HttpLoader < Base\n def call\n url = feed.url\n raise \"#{self.class.name} requires valid feed url\" unless url.present?\n\n RestClient.ge... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for API call for organisations.\n"
},
{
"from": "human",
"value": "class Organization < ActiveRecord::Base\n validates :name, presence: true, uniqueness: true\n validates :ebu_id, presence: true, uniqueness: true\n \n has_many :users, foreign_key: 'organiz... | ruby | chosen |
[
{
"from": "system",
"value": "Fix SingleValue nil value check\n\nresult can be nil, but so can the value field.\n"
},
{
"from": "human",
"value": "class SingleValue < ActiveRecord::Base\n @@mutex = Mutex.new\n\n def self.update(value)\n subclass_name = self.name\n single_value = nil\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Check the task is already exists or not and print it\n"
},
{
"from": "human",
"value": "require \"remindice/version\"\nrequire \"thor\"\n\nmodule Remindice\n TASK_FILENAME = File.expand_path(\"~/.reamindice_tasks\")\n\n class << self\n def tasks\n @@tasks.... | ruby | chosen |
[
{
"from": "system",
"value": "Implement method to get controller and action from url path\n"
},
{
"from": "human",
"value": "require \"simplemvc/version\"\n\nmodule Simplemvc\n class Application\n def call(env)\n [ 200, { \"Content-Type\" => \"text/html\" }, [\"Hello\"] ]\n end\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Change to pass in environment.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'tty/color/support'\nrequire 'tty/color/mode'\nrequire 'tty/color/version'\n\nmodule TTY\n # Responsible for checking terminal color support\n #\n # @api public\n modu... | ruby | chosen |
[
{
"from": "system",
"value": "Remove activesupport from the dev dependancies as done in liquid gem.\n\nThis was only needed to allow the liquid benchmarks to be run, but now they\ndon't depend on active support.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib',... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo on gemspec summary.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \"tilt-mote\"\n spec.ver... | ruby | chosen |
[
{
"from": "system",
"value": "Move MechanizeTest out of its enclosing module.\n"
},
{
"from": "human",
"value": "require File.join(File.dirname(__FILE__), 'cucumber')\n\nrequire 'mechanize'\nrequire 'logger'\n\nmodule Castanet::Cucumber\n ##\n # Provides helpers & a DSL for testing a deployed ... | ruby | chosen |
[
{
"from": "human",
"value": "Add ruby wrapper to make sure we allocate/deallocate the c classes properly."
},
{
"from": "gpt",
"value": "\n\nrequire 'ext/gecode/dep_gecode'\n\nmodule DepSelector\n class GecodeWrapper\n attr_reader :gecode_problem\n\n # This insures that we properly deallo... | ruby | chosen |
[
{
"from": "system",
"value": "Add Metrics of HBase replication\n"
},
{
"from": "human",
"value": "require 'hadoop_metrics2/api'\n\nmodule HBaseMetrics\n class RegionServer\n include HadoopMetrics2::API\n\n def extract_region(target)\n ret = { 'regions' => [] }\n target.each do ... | ruby | chosen |
[
{
"from": "system",
"value": "Check to see if the module we're actually working with is loaded (in case only pieces of ActiveRecord are loaded)."
},
{
"from": "human",
"value": "module RSpec\n module Rails\n if defined?(ActiveRecord)\n module FixtureSupport\n extend ActiveSupport... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor AliasMethodChain: invert control structures, extract helper"
},
{
"from": "human",
"value": "module SLG\n module Meta\n module AliasMethodChain\n def self.trace!(traced_method)\n alias_and_trace = alias_and_trace_proc(traced_method)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove redundant attribute methods from dummy user\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass DummyUser < ActiveRecord::Base\n attr_accessor :alchemy_roles, :name\n\n def self.logged_in\n []\n end\n\n def self.admins\n [first... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to calling read_fixture, rename the categories, and have the test site scan its files.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(__dir__)\n\nrequire 'helper'\n\ndescribe 'Post' do\n subject do\n filename = '201... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecation messages caused by our login support helper for request specs\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nmodule RequestSpecHelper\n def sign_in(user)\n post \"/users/sign_in\", user: { email: user.email, password: user.pass... | ruby | chosen |
[
{
"from": "system",
"value": "Remove using view_namespace for rendering\n"
},
{
"from": "human",
"value": "module AlterMvc::Presenters::Helper\n\n def render_view(name, view_context, options = {})\n view_context.render(build_render_params(name, options)).html_safe\n end\n\n def build_rende... | ruby | chosen |
[
{
"from": "system",
"value": "Remove error suppressing code - not needed for Qt 4.8\n"
},
{
"from": "human",
"value": "require 'sfl'\n\nmodule Capybara::Poltergeist\n class Client\n PHANTOM_SCRIPT = File.expand_path('../client/compiled/main.js', __FILE__)\n\n attr_reader :thread, :pid, :e... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.