conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Select PostCaller on `:post` method.\n"
},
{
"from": "human",
"value": "require 'uri'\n\nmodule Hets\n class Caller\n include UriFetcher\n\n STRING_RESPONSE = {}\n TEMPFILE_RESPONSE = {write_file: true, file_type: Tempfile}\n\n attr_accessor :hets_insta... | ruby | chosen |
[
{
"from": "system",
"value": "Add internal spec case for expect_offense with described_class::MSG\n\nDetect specs using the new expect_offense syntax with described_class::MSG.\n\nNOTE: Using strip_indent for the inner heredoc to prevent its annotation\nbeing recognised at the outer level.\n"
},
{
"... | ruby | chosen |
[
{
"from": "system",
"value": "Change named parameters to options hash\n"
},
{
"from": "human",
"value": "require 'whatsapp/request/base'\n\nmodule WhatsApp\n module Request\n\n class Code < WhatsApp::Request::Base\n IDENTITY = 'abcdef0123456789'\n\n def initialize(country_code, num... | ruby | chosen |
[
{
"from": "system",
"value": "Add a few more routes\n"
},
{
"from": "human",
"value": "require 'openssl'\nrequire 'base64'\nrequire 'json'\nrequire 'httparty'\n\nrequire 'powerschool/client'\nclass Powerschool\n attr_accessor :client\n\n def initialize(api_credentials)\n @client = Client.ne... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure script tag is valid syntax\n\nThis was breaking layout for me in chrome and safari\n"
},
{
"from": "human",
"value": "require 'rack'\n\nmodule Rack\n class Livejs\n\n attr_reader :app\n\n def initialize(app, options = {})\n @app = Rack::URLMap.... | ruby | chosen |
[
{
"from": "system",
"value": "Add development dependencies to gemspec\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'net/ntp/next/version'\n\n\nGem::Specification.new do |... | ruby | chosen |
[
{
"from": "system",
"value": "Use curl rather than wget.\n\nIt's on both OS X and Ubuntu boxes by default.\n"
},
{
"from": "human",
"value": "module Tango\n module Fetch\n\n def fetch(url)\n shell(\"wget\", \"--progress=bar:force\", \"--continue\", url)\n end\n\n end\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Add rake task for import factions\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace :eve do\n desc 'Import EveOnline Races'\n task races: :environment do\n ActiveRecord::Base.transaction do\n Eve::Race.destroy_all\n\n Races... | ruby | chosen |
[
{
"from": "system",
"value": "Make iteration variable express intent\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\nclass Timer\n def initialize(minutes, messages=nil)\n @minutes = minutes\n @messages = messages\n end\n\n def start\n alert_start\n count_down\n play_d... | ruby | chosen |
[
{
"from": "system",
"value": "Fix cache key for person pages\n"
},
{
"from": "human",
"value": "module QuotesHelper\n def cache_key_for_quotes\n count = Quote.count\n max_updated_at = Quote.maximum(:updated_at).utc.to_s\n \"quotes/all-#{count}-#{max_updated_at}\"\n end\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Remove a hard dependency on the bundler gem, since it is baked into ruby 2.6"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'engine_cart/version'\n\nGem::... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless check. We have commenting policy!\n"
},
{
"from": "human",
"value": "class BuildRunner\n pattr_initialize :payload\n\n def run\n if repo && opened_merge_request? && !runned_merge_request?\n repo.builds.create!(\n violations: violation... | ruby | chosen |
[
{
"from": "system",
"value": "Fix name of Signon environment variable\n\nThis isn't prefixed with `SIGNON`.\n"
},
{
"from": "human",
"value": "GDS::SSO.config do |config|\n config.user_model = 'User'\n config.oauth_id = ENV['SIGNON_OAUTH_ID']\n config.oauth_secret = ENV['SIGNON_OAUTH_SE... | ruby | chosen |
[
{
"from": "system",
"value": "Remove bower clean command due to bug\n"
},
{
"from": "human",
"value": "BowerRails.configure do |bower_rails|\n # Tell bower-rails what path should be considered as root. Defaults to Dir.pwd\n bower_rails.root_path = Dir.pwd\n\n # Invokes rake bower:install befo... | ruby | chosen |
[
{
"from": "system",
"value": "Add inflection to ensure Avalon::RDFVocab works with zeitwerk\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection rules using the following format. Inflections\n# are locale specific, and you may def... | ruby | chosen |
[
{
"from": "system",
"value": "Add some tests for StackOverflow request URL patterns\n"
},
{
"from": "human",
"value": "require_relative 'spec_helper'\nrequire 'service/stack_overflow'\n\ninclude Service\n\ndescribe StackOverflow, '.fetch' do\n describe \"responses\" do\n let(:endpoint) { \"h... | ruby | chosen |
[
{
"from": "human",
"value": "Add a simple test for the None authenticator\n"
},
{
"from": "gpt",
"value": "require 'client_helper'\n\ndescribe Cyclid::Client::Api::Basic do\n context 'passing through requests' do\n let :config do\n dbl = instance_double(Cyclid::Client::Config)\n al... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to measure longest redis block times\n"
},
{
"from": "gpt",
"value": "# Runs a mild benchmark and prints out the average time a call to 'throttle!' takes.\n\nrequire 'prorate'\nrequire 'benchmark'\nrequire 'redis'\nrequire 'securerandom'\n\ndef average_ms(... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for destroy request\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'RubyRabbitmqJanus::RRJ' do\n describe '.response', type: :request, level: :base, name: :destroy, destroy: false do\n let(:type) { 'ba... | ruby | chosen |
[
{
"from": "system",
"value": "Fix missing subfolder in QLMarkdown Cask\n"
},
{
"from": "human",
"value": "cask :v1 => 'qlmarkdown' do\n version '1.3.4'\n sha256 'a290edf5b6124cbd4e526217e0979a9011c8ef3b964a33458f5063d51a9b15f2'\n\n url \"https://github.com/toland/qlmarkdown/releases/download/... | ruby | chosen |
[
{
"from": "system",
"value": "Set task's state to \"finished\" eventually\n\nWe were setting task's state to \"provisioned\" but that is not a final\nstate so it doesn't get recognized by the Request which always assumes\nthat task's final state be \"finished\".\n\nSigned-off-by: Miha Pleško <e42a14dbca5c09... | ruby | chosen |
[
{
"from": "system",
"value": "Fix entry point test definition\n"
},
{
"from": "human",
"value": "require_relative '../test_helper'\nrequire 'hyperclient/entry_point'\n\nmodule Hyperclient\n describe EntryPoint do\n let(:entry_point) do\n EntryPoint.new 'http://my.api.org'\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use be_a assertion for Integer\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\nrequire \"jwt_utils\"\n\nRSpec.describe JWTUtils do\n\n let(:payload) { { some: \"payload\" } }\n let(:jwt_with_expiration) { described_class.encode payload: payload }\n le... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for animal model\n"
},
{
"from": "gpt",
"value": "require \"rails_helper\"\n\nRSpec.describe Animal, :type => :model do\n before(:all) do\n dog = Animal.create(breed_id: 1, name: \"doge\", color: \"gold\", additional_notes: \"additional notes\", age: 3)... | ruby | chosen |
[
{
"from": "human",
"value": "Add the gemspec to hoptoad.\n"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = %q{rack_hoptoad}\n s.version = \"0.1.7\"\n\n s.required_rubygems_version = Gem::Requirement.new(\">= 0\") if s.respond_to? :required_... | ruby | chosen |
[
{
"from": "system",
"value": "Update the spec to reflect Drop class changes\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nmodule Archloot\n describe Drop do\n let(:basic_drop) { FactoryGirl.build :drop }\n it \"carries information about the drop\" do\n expect(basic_drop... | ruby | chosen |
[
{
"from": "human",
"value": "Add a spec to test that mailin does not produce any output. This is important as under some MTA configurations, any output will result in a bounce message being sent to the original mail sender.\n"
},
{
"from": "gpt",
"value": "require File.expand_path(File.dirname(_... | ruby | chosen |
[
{
"from": "system",
"value": "Validate that rspec test of firefox fails\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'Mozilla Firefox' do\n before(:all) do\n @selenium = Selenium::WebDriver.for(:remote, url: \"http://localhost:4446/wd/hub\", desired_capabilities: :fir... | ruby | chosen |
[
{
"from": "system",
"value": "Change to implement bare action view to drive test urls expansion\n"
},
{
"from": "human",
"value": "class DummyView < ActionView::Base\n include Loaf::ViewExtensions\n attr_reader :_breadcrumbs\n\n def url_for(*); end\n def current_page?(*); end\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Fix query builder specs by including :order => nil\"\n\nThis reverts commit 3fafe3986911848ebceb606aba6f498d85eb423b.\n"
},
{
"from": "human",
"value": "require \"#{File.dirname(__FILE__)}/../spec_helper\"\n\ndescribe ScopedSearch::QueryBuilder do\n\n befo... | ruby | chosen |
[
{
"from": "system",
"value": "Handle multiple drush installation paths\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: drush\n# Recipe:: default\n#\n# Copyright (c) 2014 The Authors, All Rights Reserved.\n\ninclude_recipe \"composer\"\n\nexecute \"install-drush\" do\n command \"composer... | ruby | chosen |
[
{
"from": "system",
"value": "Update Firefox URL to latest version.\n"
},
{
"from": "human",
"value": "dmg_package \"Firefox\" do\n source \"http://download.mozilla.org/?product=firefox-17.0&os=osx&lang=en-US\"\n checksum \"abd7e8a4da8faf815d0bd96a6b1a6492e630c73433522c0c3dfd671f46cc2236\"\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove that WebSocketServer autoload since we don't use it anymore.\n"
},
{
"from": "human",
"value": "module Travis\n autoload :Buildable, 'travis/buildable'\n autoload :Builder, 'travis/builder'\n autoload :Config, 'travis/config'\n autoload :WebSocketSer... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure the hook method is properly commented\n"
},
{
"from": "human",
"value": "require 'date'\nrequire 'time'\nrequire 'bigdecimal'\nrequire 'bigdecimal/util'\n\n# Base module which adds Attribute API to your classes\nmodule Virtus\n\n # Represents an undefined... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for 1.9 != dispatching to ==.\n"
},
{
"from": "human",
"value": "require File.expand_path('../../../spec_helper', __FILE__)\n\nruby_version_is \"1.9\" do\n describe \"BasicObject#!=\" do\n it \"is a public instance method\" do\n BasicObject.should ... | ruby | chosen |
[
{
"from": "human",
"value": "Add rspec test to make sure kerberos reauth with 18 second sleep works\n"
},
{
"from": "gpt",
"value": "# This test may only be meaningful with kerberos auth\n# Against server 2012, a kerberos connection will require reauth (get a 401)\n# if there are no requests for... | ruby | chosen |
[
{
"from": "human",
"value": "Create new detailed guide categories for oil & gas\n\nThis migration creates eight new detailed guide categories for the Oil\nand Gas sector, which will be used to push the correct industry_sector\ntags into Panopticon.\n"
},
{
"from": "gpt",
"value": "def oil_and_ga... | ruby | chosen |
[
{
"from": "system",
"value": "Correct 'overriding_check.rb' to output message only if not blank\n\nversion=0.7.2.5\nscript/test/stream_editor_test.rb\n- 'stream_editor.rb' was moved to directory script/base.\n"
},
{
"from": "human",
"value": "#! /bin/env ruby\n\nrequire 'test/unit'\nrequire 'tem... | ruby | chosen |
[
{
"from": "system",
"value": "Use rroonga method for latest grouping\n\nrroonga 3.0.4 has been released!!!\n"
},
{
"from": "human",
"value": "module Feedcellar\n class GroongaSearcher\n class << self\n def search(database, words, options)\n feeds = database.feeds\n feeds =... | ruby | chosen |
[
{
"from": "system",
"value": "Add hacks to make to_json work\n"
},
{
"from": "human",
"value": "require File.join(File.dirname(__FILE__), 'common')\nrequire File.join(File.dirname(__FILE__), 'pure/parser')\nrequire File.join(File.dirname(__FILE__), 'pure/generator')\n\nmodule JSON\n # This modu... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure preview domain is the consistant\n"
},
{
"from": "human",
"value": "describe PagesHelper do\n class Tester\n include PagesHelper\n end\n\n context 'new record' do\n let(:new_record) { true }\n let(:expected) { { dough_component: 'MirrorInputVal... | ruby | chosen |
[
{
"from": "system",
"value": "Write a dummy spec for credit invoices\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Jortt::Client::Invoice do\n let(:invoice) do\n described_class.new(\n double(base_url: 'foo', app_name: 'app', api_key: 'secret'),\n 'bar',\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic RSpec for testing the CLI class\n\nHandle the command line calls to the CLI class with RSpec\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\nrequire 'mini_transformer'\nrequire 'mini_transformer/cli'\n\ndescribe \"CLI\" do\n it \"should check for a... | ruby | chosen |
[
{
"from": "system",
"value": "Remove spec test to verify nginx start (which we no longer do)\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\ndescribe 'et_nginx::default' do\n before do\n stub_command('which nginx').and_return(nil)\n end\n\n let(:chef_run) do\n ChefSpec::SoloRunn... | ruby | chosen |
[
{
"from": "system",
"value": "Delete invalid join records before migrating to promise_connections.\n"
},
{
"from": "human",
"value": "class AddPromiseConnections < ActiveRecord::Migration\n def up\n create_table :promise_connections do |t|\n t.string :status\n t.integer :promise_i... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure library files are included in the gem\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = 'mdv'\n s.version = '0.1.5'\n\n s.summary = 'Simple Markdown Viewer'\n s.description = 'Quickly view markdown... | ruby | chosen |
[
{
"from": "system",
"value": "Use -V for thin in example comments\n"
},
{
"from": "human",
"value": "require \"rubygems\"\nrequire \"bundler\"\nBundler.setup(:default, :example)\n\nrequire 'cramp'\nrequire 'http_router'\nrequire 'active_support/json'\n\nclass TimeController < Cramp::SSE\n on_st... | ruby | chosen |
[
{
"from": "system",
"value": "Update Podspec for swift to prepare v3.3.3\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\ts.name = \"IQKeyboardManagerSwift\"\n\ts.version = \"3.3.2\"\n\ts.summary = \"Codeless drop-in universal library allows to prevent issues of keyboard sliding up and... | ruby | chosen |
[
{
"from": "system",
"value": "Switch the maintainer over to Chef Software\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n"
},
{
"from": "human",
"value": "name 'logrotate'\nmaintainer 'Steven Danna'\nmaintainer_email 'steve@chef.io'\nlicense ... | ruby | chosen |
[
{
"from": "system",
"value": "Add git cookbook to the dependencies.\n"
},
{
"from": "human",
"value": "name 'taskwarrior'\nmaintainer 'YOUR_COMPANY_NAME'\nmaintainer_email 'YOUR_EMAIL'\nlicense 'All rights reserved'\ndescription 'Installs/Configures taskwarrior'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Return right mime type for SVG.\n"
},
{
"from": "human",
"value": "module Travis::Api::App::Responders\n class Badge < Image\n def format\n 'svg'\n end\n\n def apply\n set_headers\n send_file(filename, type: :svg, last_modified: last_modifie... | ruby | chosen |
[
{
"from": "system",
"value": "Fix rubocop offense: Use 0o for octal literals\n"
},
{
"from": "human",
"value": "package 'unzip' unless platform?('windows', 'mac_os_x')\n\ndirs = %w(config server)\ndirs.push('bin', 'log') if platform?('windows')\n\ndirs.each do |dir|\n directory \"#{selenium_hom... | ruby | chosen |
[
{
"from": "system",
"value": "Stop service as soon as an old version is found (updating has started)\n"
},
{
"from": "human",
"value": "install = node['remote_syslog2']['install']\nbin_file = \"#{install['bin_path']}/#{install['bin']}\"\n\ninstall['old_bins'].each do |old_bin_file|\n file \"#{i... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for the games list\n"
},
{
"from": "gpt",
"value": "require 'discordrb/games'\n\ndescribe Discordrb::Games do\n describe Discordrb::Games::Game do\n it 'should initialize without errors' do\n hash = {\n id: 123,\n name: 'Pokémon Super... | ruby | chosen |
[
{
"from": "system",
"value": "Correct reporting of responses from server without project status; usually well-formed XHTML.\n\ngit-svn-id: 6356d16c5fcd314faaf1b00f846dba9475d041eb@85 fc4f70da-8335-0410-99e3-8b437148c6d8\n"
},
{
"from": "human",
"value": "require 'sinatra'\r\n\r\n$KCODE = 'u' if ... | ruby | chosen |
[
{
"from": "system",
"value": "Tweak lecture list code to return different stuff depending on input\n"
},
{
"from": "human",
"value": "require 'json'\nrequire 'net/http'\nrequire 'active_support/core_ext/date/conversions'\n\nclass LectureList\n \n def self.update\n \n json = Net::HTTP.get... | ruby | chosen |
[
{
"from": "system",
"value": "Add development dependency on Rake.\n"
},
{
"from": "human",
"value": "require './lib/rack/canonical_host/version'\n\nGem::Specification.new do |gem|\n gem.name = 'rack-canonical-host'\n gem.version = Rack::CanonicalHost::VERSION\n gem.summary = 'Rack middleware ... | ruby | chosen |
[
{
"from": "system",
"value": "Use grep's --count option instead of piping to wc\n"
},
{
"from": "human",
"value": "module Specjour\n module CPU\n # copied from github.com/grosser/parallel\n def self.cores\n case RUBY_PLATFORM\n when /darwin/\n `hwprefs cpu_count`.to_i\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add the `browscapper:convert` Rake task.\n"
},
{
"from": "human",
"value": "desc \"Converts a browscap file to another format\"\ntask \"browscapper:dump\" do\n require File.join(File.dirname(__FILE__), %w{ lib browscapper })\n\n if !ENV['IN'] || !ENV['OUT']\n p... | ruby | chosen |
[
{
"from": "system",
"value": "Add configuration block for VehicleData app_key & secret. "
},
{
"from": "human",
"value": "require 'vehicle_data/version'\nrequire 'typhoeus'\nrequire 'cgi'\nrequire 'base64'\nrequire 'openssl'\nrequire 'uri'\nrequire 'json'\n\n\nmodule VehicleData\n class Base\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Handle zanders' weird format edgecases\n"
},
{
"from": "human",
"value": "module Zanders\n class Base\n\n def self.connect(options = {})\n requires!(options, :username, :password)\n\n Net::FTP.open(Zanders.config.ftp_host, options[:username], options[:... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for repo name in repl set connection\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'replica set connections' do\n with_running_replica_set do\n it 'should connect the replica set' do\n DataMapper.setup(\n :replica_set_conne... | ruby | chosen |
[
{
"from": "system",
"value": "Modify a test following implementation\n"
},
{
"from": "human",
"value": "require_relative 'helper'\nrequire 'nokogiri'\nrequire 'epub/constants'\nrequire 'epub/maker/ocf'\n\nclass TestMakerOCF < Test::Unit::TestCase\n def setup\n @container = EPUB::OCF::Contain... | ruby | chosen |
[
{
"from": "system",
"value": "Make a method that gets rid warns against letters\n"
},
{
"from": "human",
"value": "require_relative 'in_out'\n\nclass Sanitizer\n attr_accessor :input\n\n def initialize(input)\n @input = input\n end\n\n def strip_spaces_off\n @input = @input.strip\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Remove duplicate log message for OS_VERSION\n"
},
{
"from": "human",
"value": "require 'serverspec'\nrequire 'rspec/retry'\nrequire 'spec_config'\nrequire 'spec_autoload'\nrequire 'spec_helper'\n\nprint \"Serverspec configuration\\n\"\nprint \"----------------------... | ruby | chosen |
[
{
"from": "system",
"value": "Remove collect due to policy error\n"
},
{
"from": "human",
"value": "module Api\n module V1\n module Frontend\n class QuestionsController < ApiApplicationController\n respond_to :json\n \n def index\n instrument = current_proj... | ruby | chosen |
[
{
"from": "system",
"value": "Add another test for negative array index\n"
},
{
"from": "human",
"value": "class MyLib\n def test_negative_array_index\n #This should not cause an error, but it used to\n [][-1]\n end\nend\n"
},
{
"from": "gpt",
"value": "class MyLib\n def tes... | ruby | chosen |
[
{
"from": "system",
"value": "Add update_only on calculator attribute assignment\n\nThis allows us to change the type and assign attributes to the\ncalculator at the same time. Otherwise it would attempt to build a\ncalculator (with base class Spree::Calculator) when an id wasn't\nspecified.\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Order word suggestions are recommended based on Levenshtein.distance.\n"
},
{
"from": "human",
"value": "require 'did_you_mean/levenshtein'\n\nmodule DidYouMean\n class WordCollection\n include Enumerable\n attr_reader :words\n\n def initialize(words)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add attr_accessible to Alternative's selected_by_default attribute\n\n(ActionItem3262)\n"
},
{
"from": "human",
"value": "class CustomFormsPlugin::Alternative < ActiveRecord::Base\n set_table_name :custom_forms_plugin_alternatives\n\n validates_presence_of :label\... | ruby | chosen |
[
{
"from": "system",
"value": "Add single_content_for helper for use in activity partials\n"
},
{
"from": "human",
"value": "# Provides a shortcut from views to the rendering method.\nmodule PublicActivity\n # Module extending ActionView::Base and adding `render_activity` helper.\n module ViewH... | ruby | chosen |
[
{
"from": "system",
"value": "Use build.root instead of root in verbose output of Task::PublishPDF\n"
},
{
"from": "human",
"value": "module Texas\n module Build\n module Task\n class PublishPDF < Base\n\n def master_file\n build.master_file\n end\n\n def b... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - divisibility by 7\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/55e6f5e58f7817808e00002e\n# --- iteration 1 ---\n@count = 0\n\ndef seven(m)\n y, x = [m.to_s[-1], m.to_s[0...-1]].map(&:to_i)\n new_m = x - 2*y\n if m.to_s.size <... | ruby | chosen |
[
{
"from": "system",
"value": "Use standard quotes not %q{}\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'slack/post/version'\n\nGem::Specification.new do |spec|\n\tspec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Make tests work in Travis during a PR build :/\n"
},
{
"from": "human",
"value": "require 'ploy/command/publish'\n\ndescribe Ploy::Command::Publish do\n describe \"#run\" do\n it \"will run Publisher#publish with correct arguments and return true\" do\n pub... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor to use shared examples\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Record do\n\n subject { Record.new(['-a']) }\n\n it { should respond_to(:cmd) }\n it { should respond_to(:args) }\n it { should respond_to(:parse) }\n\n describ... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to make graph from datatypes_conf.xml\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\nrequire 'libxml'\nrequire 'graphviz'\n\ninclude LibXML\n\ndoc = XML::Parser.file(\"#{ARGV[0]}\").parse\n\ng = GraphViz.new( :G, :type => :digraph )\n\nparent_node... | ruby | chosen |
[
{
"from": "system",
"value": "Allow options on the get_cache class method.\n"
},
{
"from": "human",
"value": "module HasLocalCache\n\n module RequestCache\n\n def self.reset_request_cache\n Thread.current[:request_cache] = nil\n end\n\n def self.get_cache(key, &block)\n rv = ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unused method, even it was confusing\n"
},
{
"from": "human",
"value": "module Irrc\n module Connecting\n private\n\n def connection\n @connection\n end\n\n def connection=(connection)\n @connection = connection\n end\n\n def conn... | ruby | chosen |
[
{
"from": "system",
"value": "Remove commented code, use neater syntax for accessing Spree config var\n"
},
{
"from": "human",
"value": "\nclass ProducerMailer < Spree::BaseMailer\n\n def order_cycle_report(producer, order_cycle)\n @producer = producer\n @coordinator = order_cycle.coordin... | ruby | chosen |
[
{
"from": "system",
"value": "Remove the requirement of an item on ItemAssets to allow them to be saved before the item is saved\n"
},
{
"from": "human",
"value": "module Tenon\n class ItemAsset < ActiveRecord::Base\n # Validations\n validates_presence_of :asset\n validates_presence_of... | ruby | chosen |
[
{
"from": "system",
"value": "Add email and message to permitted parameters\n"
},
{
"from": "human",
"value": "class BookingPolicy < ApplicationPolicy\n def create?\n true\n end\n\n def update?\n super || record.restaurant == user&.restaurant\n end\n\n def permitted_attributes\n ba... | ruby | chosen |
[
{
"from": "system",
"value": "Add title sanitizer and link split.\n"
},
{
"from": "human",
"value": "class ImportStories\n require 'rss'\n require 'open-uri'\n\n def call(reset = false)\n cleanup if reset\n\n import_stories\n end\n\n private\n\n def cleanup\n Story.delete_all\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Fix - Fix admin/event meta image display\n"
},
{
"from": "human",
"value": "class Admin::EventsController < AdminController\n\n expose :events, -> { Event.all.order(created_at: :desc).paginate(:page => params[:page], per_page: 30) }\n expose :event\n\n def index\... | ruby | chosen |
[
{
"from": "system",
"value": "Create helper to hide gift fields if it's not a gift\n"
},
{
"from": "human",
"value": "module Spree\n module BaseHelper\n\n def item_shipping_address(item)\n address = tag(:br)\n address << content_tag(:b, t(:ship_to, scope: :subscriptions))\n ad... | ruby | chosen |
[
{
"from": "system",
"value": "Fix envelope deletion detection in indexer notification callback\n"
},
{
"from": "human",
"value": "require 'active_support/concern'\nrequire 'notify_gremlin_indexer'\n\n# When included schedule for indexing by Gremlin.\nmodule GremlinIndexable\n extend ActiveSuppo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix old price not getting formatted proper\n"
},
{
"from": "human",
"value": "Spree::Variant.class_eval do\n\n include ActionView::Helpers::NumberHelper\n\n def to_hash\n price = self.prices.find_by(currency: Spree::Config[:presentation_currency]).display_price... | ruby | chosen |
[
{
"from": "system",
"value": "Move attribute changes to after_replace_fields\n\nFor some reason, before_create was not keeping the attribute changes.\n"
},
{
"from": "human",
"value": "class Api::V1::PostResource < JSONAPI::Resource\n before_create :set_author_as_current_user\n before_update :... | ruby | chosen |
[
{
"from": "system",
"value": "Set some class level variables to help with column sorts on people page\n"
},
{
"from": "human",
"value": "class PeopleController < ApplicationController\n before_filter :find_person, :only => [:show, :tweetstream]\n \n def index\n @page_title = t('people')\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update test search to make status check pass\n\nThe status controller used to look for an organization called \"InnVision\", but that organization's name has been updated. I changed the search to look for keyword \"maceo\", which returns one of our dummy test locations.\n"
},... | ruby | chosen |
[
{
"from": "system",
"value": "Fix typo in the tests\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe Bable do\n it \"has a version number\" do\n expect(Bable::VERSION).to be_truthy\n end\n\n describe \".index\" do\n it \"instantiate the default index if no args\" d... | ruby | chosen |
[
{
"from": "system",
"value": "Format Command Line Tools Lion\n"
},
{
"from": "human",
"value": "class CommandLineToolsLion < Cask\n url 'http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg'\n homepage 'https://developer.apple.com/xcode/downloads/'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add tag stanza to Firefox Developer Edition\n"
},
{
"from": "human",
"value": "cask :v1 => 'firefoxdeveloperedition' do\n version :latest\n sha256 :no_check\n\n url \"https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=osx&lang=en-US\"\n homepage ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove deprecated has_rdoc= from gemspec"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"ahn_hoptoad/version\"\n\nGem::Specification.new do |s|\n s.name = \"ahn_hoptoad\"\n s.version ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix invoker needing input manager\n"
},
{
"from": "human",
"value": "require_relative 'Trick'\nrequire_relative 'ruby-util'\n\nclass Invoker\n attr_accessor :input_manager, :current_trick, :menu_state\n\n def initialize\n @input_manager = InputManager.new\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add 'b' options to File.open\n"
},
{
"from": "human",
"value": "module Tobacco\n class Exhaler\n attr_accessor :content, :filepath\n\n def initialize(content = '', filepath = '')\n self.content = content\n self.filepath = filepath\n end\n\n de... | ruby | chosen |
[
{
"from": "system",
"value": "Remove git dependency from Homebrew Formula\n"
},
{
"from": "human",
"value": "class GitReq < Formula\n desc \"Check out merge requests from your GitLab/GitHub hosted repositories with ease!\"\n homepage \"https://arusahni.github.io/git-req/\"\n url \"https://git... | ruby | chosen |
[
{
"from": "system",
"value": "Load only necessary files for the analyze unit tests\n\nPlease, sir. May I have some more files?\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\ndescribe \"sudokuru_unit_analyze\" do\n\n def capture_stdout(&block)\n original_stdout = $stdout\n $st... | ruby | chosen |
[
{
"from": "system",
"value": "Add test to Queue to stay green\n"
},
{
"from": "human",
"value": "require File.expand_path(\"../helper\", __FILE__)\n\ncontext \"Queue\" do\n\n setup do\n end\n\nend"
},
{
"from": "gpt",
"value": "require File.expand_path(\"../helper\", __FILE__)\n\nc... | ruby | chosen |
[
{
"from": "system",
"value": "Add a doc comment to ProgressReporter\n"
},
{
"from": "human",
"value": "# Copyright 2010-present Greg Hurrell. All rights reserved.\n# Licensed under the terms of the BSD 2-clause license.\n\nmodule CommandT\n class ProgressReporter\n SPINNER = %w[^ > v <]\n\n ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.