conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Update webadmin to use bundler.\n"
},
{
"from": "human",
"value": "require 'facets/kernel/ergo'\n\nRAILS_ROOT = File.dirname(File.dirname(File.expand_path(__FILE__)))\nRESTART_TXT = \"#{RAILS_ROOT}/tmp/restart.txt\"\n\ndef get_current_revision\n return `(cd #{RA... | ruby | chosen |
[
{
"from": "system",
"value": "Add some cool shortcuts for encoding"
},
{
"from": "human",
"value": "module Dragonfly\n module Config\n \n # RMagickImages is a saved configuration for Dragonfly apps, which does the following:\n # - registers an rmagick analyser\n # - registers an rma... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor ordering of GameController methods to be lifecycle order\n"
},
{
"from": "human",
"value": "class GamesController < ApplicationController\n before_filter :lookup_user\n\n def index\n @games = Game.where(pending: true)\n end\n\n def show\n @game = ... | ruby | chosen |
[
{
"from": "system",
"value": "Add notice that rate was succesfully created\n"
},
{
"from": "human",
"value": "class RatesController < ApplicationController\n def create\n value = Integer(params[:value])\n submission_id = Integer(params[:submission_id])\n user_id = current_user.id\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change test_files specification to be more precise\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/descendants_tracker/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'descendants_tracker'\n gem.v... | ruby | chosen |
[
{
"from": "system",
"value": "Reconfigure Vote controller to be DRY and accept JSON Requests from Vote Backbone model\n-Rewrite vote_params method to exclude is_upvote (allows for searching if incoming vote already exists without id)\n-Add upvote_param method that allows for setting of solely the is_upvote ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove current_user trustee constraint from channels administration.\n"
},
{
"from": "human",
"value": "class Channels::Adm::ProjectsController < Adm::BaseController\n menu I18n.t('channels.adm.menu') => Rails.application.routes.url_helpers.adm_projects_path\n\n \... | ruby | chosen |
[
{
"from": "system",
"value": "Rework model to use ActiveModel::Model instead of hacks\n"
},
{
"from": "human",
"value": "module Effective\n class StyleGuide < ActiveRecord::Base\n acts_as_asset_box :files => 1..6 if defined?(EffectiveAssets)\n\n def self.columns\n @columns ||= []\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use relative path to determine location of data file\n"
},
{
"from": "human",
"value": "require 'csv'\n\nmodule SepaClearer\n class DeutscheBundesbank\n CAPABILITIES_MAPPING = {\n service_sct: :sct,\n service_sdd: :c... | ruby | chosen |
[
{
"from": "system",
"value": "Fix some gem build warnings: add author and email, rm autorequire\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.summary = \"IBAN validator\"\n s.name = 'iban-tools'\n s.version = '0.0.1.1'\n s.requiremen... | ruby | chosen |
[
{
"from": "system",
"value": "Remove protect_from_forgery setting since our POSTs generally won't come\nfrom web forms.\n"
},
{
"from": "human",
"value": "# Filters added to this controller apply to all controllers in the application.\n# Likewise, all the methods added will be available for all ... | ruby | chosen |
[
{
"from": "system",
"value": "Change the activerecord example to use indifferent feature\n"
},
{
"from": "human",
"value": "#!ruby -I ../../lib -I lib\n\nENV['RACK_ENV'] ||= 'development'\n\nrequire 'rubygems'\nrequire 'bundler'\nBundler.setup(:default, ENV['RACK_ENV'].to_sym)\n\nrequire 'franki... | ruby | chosen |
[
{
"from": "system",
"value": "Use CLI framework in the chef-client check\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n#\n# Chef Client Plugin\n# ===\n#\n# This plugin checks to see if the OpsCode Chef client daemon is running\n#\n# Copyright 2011 Sonian, Inc.\n#\n# Released under the ... | ruby | chosen |
[
{
"from": "system",
"value": "Sort life highlights by time and show time in bubble\n"
},
{
"from": "human",
"value": "class LifeHighlightsController < MyplaceonlineController\n protected\n def insecure\n true\n end\n\n def sorts\n [\"lower(life_highlights.life_highlight_name)... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a few test names in ExceptionTest\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass ExceptionTest < BaseTest\n test 'bindings returns all the bindings of where the error originated' do\n exc = FlatFixture.new.call\n\n assert_equal 3, exc.b... | ruby | chosen |
[
{
"from": "system",
"value": "Fix strange problems with class discovering\n"
},
{
"from": "human",
"value": "module Artery\n module Config\n extend ActiveSupport::Concern\n\n included do\n class << self\n attr_accessor :message_class, :last_model_update_class, :service_name, :... | ruby | chosen |
[
{
"from": "system",
"value": "Rename next page css path\n"
},
{
"from": "human",
"value": "module Bandicoot\n module DSL\n Attribute = Struct.new(:attr_name, :css)\n\n def scrap(attr_name, css:)\n attributes.push Attribute.new(attr_name, css)\n end\n\n def attributes\n @at... | ruby | chosen |
[
{
"from": "system",
"value": "Add licenses into gemspec. For new UI of rubygems.org\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'coderwall/version'\n\nGem::Specification.new do |gem|\n gem.name ... | ruby | chosen |
[
{
"from": "human",
"value": "Add File::absolute_path? as a core_ext\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nclass File\n # determine whether a String path is absolute.\n # @example\n # File.absolute_path?('foo') #=> false\n # File.absolute_path?('/foo') #=> true\n # File... | ruby | chosen |
[
{
"from": "system",
"value": "Make Shipping optional in ItemOut\n"
},
{
"from": "human",
"value": "module CXML\n class ItemOut\n def initialize(data={})\n if data.kind_of?(Hash) && !data.empty?\n @quantity = data['quantity']\n @line_number = data['lineNumber']\n @re... | ruby | chosen |
[
{
"from": "system",
"value": "Set of documentation helpers regarding applicable version.\n\nUse as follows:\n- rename page from page.html.md to page.html.md.erb\n- enclose paragraph in <% in_version_above('0.28.0') do %> ... <% end %>\n block\n\nAlso possible to use <% in_version_at_most('0.28.0') do %> or... | ruby | chosen |
[
{
"from": "human",
"value": "Add a feature spec for building cluster in Azure\n\nMost of the content is covered in the cloud_cluster model, but there\nare a few differentiators that should be checked.\n"
},
{
"from": "gpt",
"value": "require \"rails_helper\"\nrequire \"velum/instance_type\"\n\nd... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec over new report type\n"
},
{
"from": "human",
"value": "describe Bidu::House::ReportConfig do\n let(:config) { {} }\n let(:parameters) { {} }\n let(:subject) { described_class.new(config) }\n\n describe '#build' do\n context 'when no config is given'... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce number of pending specs\n"
},
{
"from": "human",
"value": "require 'spec_helper'\ndescribe \"layouts/application\" do\n before { pending; allow(view).to receive(:current_user).and_return(current_user) }\n\n let(:admin) { false }\n let(:current_user) { mock... | ruby | chosen |
[
{
"from": "system",
"value": "Remove duplicate method calls, probably from a bad merge\n"
},
{
"from": "human",
"value": "require 'bosh/dev/infrastructure'\nrequire 'bosh/dev/pipeline'\n\nmodule Bosh::Dev\n class BatHelper\n attr_reader :infrastructure\n\n def initialize(infrastructure)\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a potential timeout in `Gitlab::Logger.read_latest`\n\nIf this method was called for a file that didn't exist, we attempted to\nfirst `build` it. But if the file wasn't writeable, such as a symlink\npointing to an unmounted filesystem, the method would just hang and\neventu... | ruby | chosen |
[
{
"from": "system",
"value": "Update imminence API to use GdsApi\n"
},
{
"from": "human",
"value": "require 'json_utils'\n\nclass ImminenceApi\n\n include JsonUtils\n\n def initialize(endpoint)\n @endpoint = endpoint\n end\n\n def api_url(type,lat,lon,limit=5)\n \"#{@endpoint}/places/#... | ruby | chosen |
[
{
"from": "system",
"value": "Fix conditions in if statement for prettify option.\n"
},
{
"from": "human",
"value": "require 'net/http'\nrequire 'net/https'\nrequire 'uri'\nrequire 'json'\n\ndef rest_request(endpoint, href, options)\n uri = URI.join(endpoint, href)\n puts \"[GET] #{uri}\" if o... | ruby | chosen |
[
{
"from": "system",
"value": "Set state and share URL\n"
},
{
"from": "human",
"value": "require 'apple-news/article/attachments'\nrequire 'apple-news/article/persistence'\n\nmodule AppleNews\n class Article\n extend Forwardable\n\n include Attachments\n include Persistence\n includ... | ruby | chosen |
[
{
"from": "system",
"value": "Change implementation to avoid alias_method_chain\n"
},
{
"from": "human",
"value": "module AttrCleaner\n module Model\n extend ActiveSupport::Concern\n\n included do\n alias_method_chain :write_attribute, :cleaner\n class_attribute :attr_cleaners\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use explicit Java modules, to simplify accessing cue packages from both Module-level and instance-level methods; added TODOs\n"
},
{
"from": "human",
"value": "require 'java'\n\n# TODO Where should this REALLY go?\n# TODO How to load cue.language.jar when you're a g... | ruby | chosen |
[
{
"from": "system",
"value": "Call `to_s` on key before looking for it in cookies hashes.\n"
},
{
"from": "human",
"value": "module CookieMonster\n class Jar < Base\n attr_reader :request, :response\n\n def initialize(options)\n @request = options.delete(:request)\n @response = ... | ruby | chosen |
[
{
"from": "system",
"value": "Use html_safe to make tabnav work with Rails3.\n"
},
{
"from": "human",
"value": "module Tabnav\n class Navbar\n def initialize(template, params, options = {}) # :nodoc:\n @template = template\n @params = params\n @html_options = options\n @t... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"limit the size of the EM threadpool.\"\n\nThis reverts commit 85adceda36f8a68b3fc9a9aa0efb419a8a595812.\n"
},
{
"from": "human",
"value": "require 'eventmachine'\nrequire 'em-http-request'\n\nmodule GnipStream\n class Stream\n\n attr_accessor :headers, ... | ruby | chosen |
[
{
"from": "system",
"value": "Use String literal instead of using a class method\n\nThe class method string definition is not needed here, so it can be removed.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Liquid\n # Assign sets a variable in your template.\n #\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Set Sequel's timezones to UTC\n"
},
{
"from": "human",
"value": "require \"sequel\"\n\nSequel.extension :inflector\n\nrequire 'sequel/plugins/serialization'\n\nSequel::Plugins::Serialization.register_format(\n :ojson,\n lambda { |v| Yajl::Encoder.new.encode(v) },\... | ruby | chosen |
[
{
"from": "system",
"value": "Use magazine strategy if forking not available.\n\nTODO: add check for JRuby. It will NOT work with magazine.\n"
},
{
"from": "human",
"value": "class Spork::RunStrategy\n attr_reader :test_framework\n @@run_strategies = []\n\n def initialize(test_framework)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make the list test idiomatic ruby\n\nUse .each instead of for...in; don't use parentheses at the end of method calls that don't have arguments\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass ListTest < Test::Unit::TestCase\n def setup\n Clever.... | ruby | chosen |
[
{
"from": "system",
"value": "Change repos dir to arb review dir on filer\n"
},
{
"from": "human",
"value": "class Commit < ActiveRecord::Base\n validates_format_of :sha1, :with => /^[a-z0-9]+$/\n validates_length_of :sha1, :is => 40\n\n def check_valid\n if ! self.valid?\n throw Exce... | ruby | chosen |
[
{
"from": "system",
"value": "Add bill association to activities\n"
},
{
"from": "human",
"value": "module ClioClient\n\n class Activity < Resource\n\n set_attributes(id: {type: :int, readonly: true},\n created_at: {type: :datetime, readonly: true}, \n ... | ruby | chosen |
[
{
"from": "system",
"value": "Validate that the restroom's floor and building match up.\n"
},
{
"from": "human",
"value": "class Toilet < ApplicationRecord\n validates :slug, uniqueness: {:scope => [:building_id, :floor_id]}, length: {maximum: 200}\n validates :gender, presence: true\n valida... | ruby | chosen |
[
{
"from": "system",
"value": "Set watchOS deployment target in podspec\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"FileKit\"\n s.version = \"1.5.0\"\n s.summary = \"Simple and expressive file management in Swift.\"\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Send all data on client connection.\n"
},
{
"from": "human",
"value": "require 'em-websocket'\nrequire 'json'\n\nmodule StripMem\n class WebSocket\n def initialize(channel)\n @channel = channel\n end\n\n def run!\n EventMachine::WebSocket.start(:... | ruby | chosen |
[
{
"from": "system",
"value": "Load env vars before bundle\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task to backfill sandbox_urls\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\ndef generate_generic_sandbox_url(assignment)\n # If there's already a sandbox_url, do nothing\n return false if assignment.sandbox_url\n\n wiki = assignment.wi... | ruby | chosen |
[
{
"from": "system",
"value": "Use interpolation with the --optimize argument\n"
},
{
"from": "human",
"value": "require 'image_optim/worker'\n\nclass ImageOptim\n class Worker\n # http://www.lcdf.org/gifsicle/\n class Gifsicle < Worker\n INTERLACE_OPTION =\n option(:interlace, f... | ruby | chosen |
[
{
"from": "system",
"value": "Make markdown helper safer to use\n\nAvoid exception if text is nil\n"
},
{
"from": "human",
"value": "module ApplicationHelper\n\n def home_page?\n return false if user_signed_in?\n # Using path because fullpath yields false negatives since it contains\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure that Optimizable.included is documented\n"
},
{
"from": "human",
"value": "module Veritas\n\n # Allow operations to be optimizable\n module Optimizable\n include Immutable\n\n def self.included(descendant)\n descendant.extend ClassMethods\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix `CommentSmile` notification type not being returned\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass Appendable::Reaction < Appendable\n # rubocop:disable Rails/SkipsModelValidations\n after_create do\n Notification.notify parent.us... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for StampFile's behavior in markup and write phases\n"
},
{
"from": "gpt",
"value": "require 'support/test_case'\nrequire 'support/fixture_config'\nrequire 'jekyll/minibundle/stamp_file'\n\nmodule Jekyll::Minibundle::Test\n class StampFileTest < TestCase\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add --- filter for adding filenames to code examples\n"
},
{
"from": "human",
"value": "class ParseInfoBoxes < Nanoc::Filter\n\n identifier :parse_info_boxes\n\n def run(content, params={})\n content = content.gsub(/^!!!\\n(.*?)!!!/m) do\n generate_div(\"w... | ruby | chosen |
[
{
"from": "system",
"value": "Add some libs: pry, kaminari, sass-rails\n\nAdds sass-rails since it was needed to run tests, and pry for\ndevelopment/debugging purposes.\n"
},
{
"from": "human",
"value": "module Blog\n class Engine < ::Rails::Engine\n isolate_namespace Blog\n end\nend\n"
}... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor specs to make better spec output\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'splunk_conf' do\n\n context 'basic test' do\n stanza = 'monitor:///foo/bar/baz.log'\n let(:title) { stanza }\n let(:params) do {\n :confi... | ruby | chosen |
[
{
"from": "human",
"value": "Add integration tests for metric listing.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nmodule Librato\n describe Metrics do\n before(:all) { prep_integration_tests }\n\n describe \"#list\" do\n\n before(:all) do\n delete_all_metrics\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add some failing tests for the KeyStream class\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nmodule Pontifex\n describe KeyStream do\n describe \"#new\" do\n let(:key_stream) { KeyStream.new }\n it \"creates a representation of a deck of car... | ruby | chosen |
[
{
"from": "system",
"value": "Make explicit the reference to standard Hash"
},
{
"from": "human",
"value": "require 'hashie/hash_extensions'\n\nmodule Hashie\n # A Hashie Hash is simply a Hash that has convenience\n # functions baked in such as stringify_keys that may\n # not be available in ... | ruby | chosen |
[
{
"from": "system",
"value": "Update Akonadi formula to 1.3.0.\n"
},
{
"from": "human",
"value": "require 'formula'\n\nclass Akonadi <Formula\n url 'http://download.akonadi-project.org/akonadi-1.2.1.tar.bz2'\n homepage 'http://pim.kde.org/akonadi/'\n md5 'f9c1d000844f31c67360078ddf60bec2'\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Return the filename if the ID3 tags have no title."
},
{
"from": "human",
"value": "require 'mp3info'\n\nmodule Playa\n class Track\n def initialize(file)\n @file = file\n end\n\n def attributes\n {\n filename: filename,\n tit... | ruby | chosen |
[
{
"from": "system",
"value": ":wrench: Determine MIME type from file content by determine_mime_type\nFix for shrine gem warning\n"
},
{
"from": "human",
"value": "class OutcomeUploader < Shrine\n plugin :delete_promoted\n plugin :validation_helpers\n\n Attacher.validate do\n validate_max_s... | ruby | chosen |
[
{
"from": "system",
"value": "Address a bug where as_json triggered thumb, url(:thumb) on Document\n"
},
{
"from": "human",
"value": "class RedactorRails::Document < RedactorRails::Asset\n mount_uploader :data, RedactorRailsDocumentUploader, :mount_on => :data_file_name\n\n def url_content\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update AttachmentReplacementIdUpdaterTest to stub worker\n\nWe've extracted the logic of this service listener into the\nAssetManagerAttachmentReplacementIdUpdateWorker. Update the tests so\nthat we simply assert that the worker has been called if the\nconditions are met.\n"
... | ruby | chosen |
[
{
"from": "system",
"value": "Return Activity.none when user is not found\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Api\n module Internal\n class ActivitiesController < Api::Internal::ApplicationController\n def index(username: nil, page: nil)\n r... | ruby | chosen |
[
{
"from": "system",
"value": "Fix warnings about overly strict dependencies now.\n"
},
{
"from": "human",
"value": "$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'mgit/version'\n\nGem::Specification.new do |s|\n s.name = 'mgit'\n s.version = MGit::VERSION\n s.license... | ruby | chosen |
[
{
"from": "system",
"value": "Add the routing test for root path\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass StaticPagesControllerTest < ActionDispatch::IntegrationTest\n def setup\n @base_title = 'Ruby on Rails Tutorial Sample App'\n end\n\n test \"should get home\" ... | ruby | chosen |
[
{
"from": "system",
"value": "Use the Rake FileUtils methods, now that we're hooking the verbose output.\n"
},
{
"from": "human",
"value": "require 'rubygems/tasks/build/task'\n\nrequire 'rubygems/builder'\nrequire 'fileutils'\n\nmodule Gem\n class Tasks\n module Build\n #\n # The ... | ruby | chosen |
[
{
"from": "system",
"value": "Add Woff2 to relative assets extension"
},
{
"from": "human",
"value": "# Relative Assets extension\nclass Middleman::Extensions::RelativeAssets < ::Middleman::Extension\n option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif .ttf .otf .woff), 'List of ex... | ruby | chosen |
[
{
"from": "system",
"value": "Rename straggling logs API config key\n"
},
{
"from": "human",
"value": "require 'travis/logs_api'\nrequire 'travis/services/base'\n\nmodule Travis\n module Services\n class FindLog < Base\n register :find_log\n\n def run(options = {})\n return ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary only condition of ProjectsControllerPatch\n"
},
{
"from": "human",
"value": "module Pwfmt::ProjectsControllerPatch\n extend ActiveSupport::Concern\n\n included do\n before_render :load_wiki_format, only: [:edit, :settings, :show]\n before_... | ruby | chosen |
[
{
"from": "human",
"value": "Add integration test to find some potential n+1 queries\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nrequire(\"test_helper\")\n\n# Discover potential n+1 issues by running some requests with bullet gem\nclass NPlusOneTest < IntegrationTestCase\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add authorised field to person and update current persons to authorised\n"
},
{
"from": "gpt",
"value": "class AddAuthorisedToPerson < ActiveRecord::Migration\n def self.up\n add_column :people, :authorised_account, :boolean, :default => false\n #Authorise all... | ruby | chosen |
[
{
"from": "system",
"value": "Correct ambiguous notion of \"BIC codes\" to \"BIC subjects\"\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bibliography/version'\n\nGem::Specificatio... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - always perfect\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/always-perfect/\n# --- iteration 1 ---\ndef check_root(str)\n return \"incorrect input\" unless /\\A-?\\d+,-?\\d+,-?\\d+,-?\\d+\\z/ === str\n nums = str.split(\",\").... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up owner and slug representation\n"
},
{
"from": "human",
"value": "module Bitbucket\n module Representation\n class Repo < Representation::Base\n attr_reader :owner, :slug\n\n def initialize(raw)\n super(raw)\n\n if full_name && fu... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor fragment to call super only once\n\nAs suggested by @kirel\n"
},
{
"from": "human",
"value": "module CacheComment\n module FragmentHelper\n\n def write_fragment(key, content, options = nil)\n comment = CommentFormatter.new(fragment_cache_key(key), ... | ruby | chosen |
[
{
"from": "system",
"value": ":anchor: Add an accessor for the timestamp\n"
},
{
"from": "human",
"value": "module Discordrb::Webhooks\n # An embed is a multipart-style attachment to a webhook message that can have a variety of different purposes and\n # appearances.\n class Embed\n def in... | ruby | chosen |
[
{
"from": "system",
"value": "Fix missing coma in argumentError raising for gitsubmodule changelog\n"
},
{
"from": "human",
"value": "# coding: utf-8\nrequire 'chef/log'\nrequire_relative 'changelog'\n\nclass KnifeChangelog\n class GitSubmodule < Changelog\n\n def run(submodules)\n rais... | ruby | chosen |
[
{
"from": "system",
"value": "Expand tests for LinkSnpPhenotype worker\n\nSigned-off-by: Vivek Rai <4b8b65dd320e6035df8e26fe45ee3876d9e0f96b@gmail.com>\n"
},
{
"from": "human",
"value": "RSpec.describe LinkSnpPhenotype do\n subject do\n end\n\n describe 'scoring' do\n it 'returns a non-neg... | ruby | chosen |
[
{
"from": "system",
"value": "Use decompression options available on hosted env\n\nWas getting this error trying to restore on\na hosted env (alpine image):\n```\ngunzip: unrecognized option: -3\nBusyBox v1.30.1 (2019-10-26 11:23:07 UTC) multi-call binary.\n\nUsage: gunzip [-cfkt] [FILE]...\n\nDecompress FI... | ruby | chosen |
[
{
"from": "system",
"value": "Create Simulator with a finite loop that receives commands\n"
},
{
"from": "human",
"value": "module ToyRobotSimulator\n class Simulator\n end\nend\n"
},
{
"from": "gpt",
"value": "module ToyRobotSimulator\n class Simulator\n attr_accessor :control... | ruby | chosen |
[
{
"from": "system",
"value": "Send friend data to view.\n"
},
{
"from": "human",
"value": " class ValuesController < ApplicationController\n include IndexHelper\n def show\n moreValues = Value.all.shuffle[0..50]\n render partial: '/values/possiblevalues', locals: {moreValues: moreValues}... | ruby | chosen |
[
{
"from": "system",
"value": "Update SalesPage Factor for about_owner\n\nAdd the about_owner attribute to the SalesPage factory.\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :sales_page do\n club\n\n benefit1 { Faker::Lorem.words(rand(5) + 1).join \" \" }\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add beginning of test for view of new comment page\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe 'Comments Panel' do\n\tit \"user can see comments on queried translation\" do\n\t\tpending\n\tend\n\n\tcontext \"when logged in\" do\n\t\tit \"us... | ruby | chosen |
[
{
"from": "human",
"value": "Add async call for event dispatch.\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nmodule FiniteMachine\n # An asynchronouse call representation\n class AsyncCall\n include Threadable\n\n attr_threadsafe :context\n\n attr_threadsafe :callable\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Competition: Remove old associations with matches and participations.\n"
},
{
"from": "human",
"value": "# lib/frecon/models/competition.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n# This fi... | ruby | chosen |
[
{
"from": "system",
"value": "Sort the world's largest decency list\n\n\nFormer-commit-id: 621e939f456552867f7cd8495a5bfe213e601e3e [formerly 680a1090acf5d9055a7dad3b355f0ece318eed46] [formerly 2634e22baf3c2391edd2a20b8ca2d399ef72c485 [formerly 730a14160af3b916bf94cdfb66d290091832424d [formerly 3221e9898200... | ruby | chosen |
[
{
"from": "system",
"value": "Fix group visibility level migration in case all visibility levels are restricted\n"
},
{
"from": "human",
"value": "# Create visibility level field on DB\n# Sets default_visibility_level to value on settings if not restricted\n# If value is restricted takes higher ... | ruby | chosen |
[
{
"from": "system",
"value": "Replace `create` with `build_stubbed` in coordinator model specs\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\nmodule OrderManagement\n module Stock\n describe Coordinator do\n let!(:order) { create(:order_with... | ruby | chosen |
[
{
"from": "system",
"value": "Add TestReadMap and several test methods\n"
},
{
"from": "human",
"value": "require_relative \"test_helper\"\n\n\n"
},
{
"from": "gpt",
"value": "require_relative \"test_helper\"\n\nclass TestReadMap < Poke::Test\n\n def setup\n @object = Object.new\... | ruby | chosen |
[
{
"from": "system",
"value": "Add more documentation for Shorthand [ci skip]\n"
},
{
"from": "human",
"value": "class QueryableArray < Array\n module Shorthand\n # If +key+ is a +Hash+ or an +Array+ containing one\n # then it acts like an alias for +find_by+ or +find_all+ respectively. It... | ruby | chosen |
[
{
"from": "system",
"value": "Set default http header via overriding http methods\n"
},
{
"from": "human",
"value": "require \"rspec/default_http_header/version\"\n\nmodule Rspec\n module DefaultHttpHeader\n # Your code goes here...\n end\nend\n"
},
{
"from": "gpt",
"value": "re... | ruby | chosen |
[
{
"from": "system",
"value": "Use flat_map instead of map followed by flatten\n\nNot only is this more idiomatic, [it's also better performance wise!][1]\n\n[1]: http://gistflow.com/posts/578-use-flat_map-instead-of-map-flatten\n"
},
{
"from": "human",
"value": "require \"pathname\"\n\nmodule Ru... | ruby | chosen |
[
{
"from": "system",
"value": "Move `export` sub to beginning\n\nThis makes the global nature of the sub more apparent\n"
},
{
"from": "human",
"value": "# Maintained by:\n# Paul Cochrane @paultcochrane paul@liekut.de\n\nmodule Travis\n module Build\n class Script\n class Perl6 < Sc... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - parsing prices\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/56833b76371e86f8b6000015/\n# --- iteration 1 ---\nclass String\n def to_cents\n /\\A\\$(?<dols>\\d+)\\.(?<cents>\\d{2})\\z/ =~ self ? (dols + cents).to_i : nil\n e... | ruby | chosen |
[
{
"from": "human",
"value": "Add Teams UD feature spec\n"
},
{
"from": "gpt",
"value": "require 'spec_helper.rb'\n\nfeature 'Creating editing and deleting a team', js: true do\n let(:tournament1){ FactoryGirl::create(:tournament)}\n let(:tournament2){ FactoryGirl::create(:tournament)}\n let(:... | ruby | chosen |
[
{
"from": "system",
"value": "Fix incorrect model name on GroupUser to get test to run\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe GroupsUser do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n"
},
{
"from": "gpt",
"value": "require 'spec_he... | ruby | chosen |
[
{
"from": "system",
"value": "Update HandbrakeCLI Nightly to v6822svn\n\nHandBrakeCLI Nightly v6822svn built 2015-01-28.\n"
},
{
"from": "human",
"value": "cask :v1 => 'handbrakecli-nightly' do\n version '6782svn'\n sha256 'a661254da12a5fcaaab80b822bed78e8e000800042380bf3ccdfacf017cdb7fa'\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove last vestiges of logstasher config\n\nIt's now handled by govuk_app_config and we should have removed it when we\nupgraded to 1.0.0, but the documentation was unclear.\n"
},
{
"from": "human",
"value": "FinderFrontend::Application.configure do\n config.cache... | ruby | chosen |
[
{
"from": "system",
"value": "Add comment about middleware change for rails 3\n"
},
{
"from": "human",
"value": "# Settings specified here will take precedence over those in config/environment.rb\n\n# The production environment is meant for finished, \"live\" apps.\n# Code is not reloaded betwee... | ruby | chosen |
[
{
"from": "system",
"value": "Update go env in verity config\n"
},
{
"from": "human",
"value": "name \"datadog-verity\"\ndefault_version \"last-stable\"\n\nbuild do\n command \"go get github.com/DataDog/verity\"\n command \"cd $GOPATH/src/github.com/DataDog/verity\"\n command \"go build -o... | ruby | chosen |
[
{
"from": "system",
"value": "Change single to double quotes in mindjet-mindmanager url\n"
},
{
"from": "human",
"value": "cask :v1 => 'mindjet-mindmanager9' do\n version '9.6.510'\n sha256 '23e2e2e3f712bc9d58b4a826abc3fb50ffac0134e93c4db9e055fa4874fe12d1'\n\n url 'http://download.mindjet.com... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.