conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use COALESCE in case there are no posts in a topic\n"
},
{
"from": "human",
"value": "class MigrateWordCounts < ActiveRecord::Migration\n def up\n\n disable_ddl_transaction\n\n post_ids = execute(\"SELECT id FROM posts WHERE word_count IS NULL LIMIT 500\").ma... | ruby | chosen |
[
{
"from": "system",
"value": "Move Baler::Parser methods into a class << self block"
},
{
"from": "human",
"value": "module Baler\n module Parser\n autoload :Document, File.dirname(__FILE__) + '/parser/document'\n autoload :Collection, File.dirname(__FILE__) + '/parser/collection'\n au... | ruby | chosen |
[
{
"from": "system",
"value": "Declare as subclass of Rails::Engine\n"
},
{
"from": "human",
"value": "require \"sprint/rails/version\"\n\nmodule Sprint\n module Rails\n # Your code goes here...\n end\nend\n"
},
{
"from": "gpt",
"value": "require \"sprint/rails/version\"\n\nmodul... | ruby | chosen |
[
{
"from": "system",
"value": "Exclude test/vendor when building a gem. [ci skip]\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rubyfox/sfsobject/version'\n\nGem::Specific... | ruby | chosen |
[
{
"from": "system",
"value": "Add a bit of text to the rotating hmans example."
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\nrequire 'bundler/setup'\nBundler.require\n\nclass Hmans < Schnitzel::Node\n def setup\n @sprite = Schnitzel::Sprite.new file: File.join(__FILE__, '../assets/im... | ruby | chosen |
[
{
"from": "system",
"value": "Use of custom objects is not necessary here\n"
},
{
"from": "human",
"value": "require File.expand_path('../lib/faraday_middleware/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.add_dependency 'faraday', ['>= 0.7.4', '< 0.9']\n spec.add_development... | ruby | chosen |
[
{
"from": "system",
"value": "Add a break condition here too.\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift('lib')\nrequire 'spyglass'\n\ninclude Spyglass\n\nputs <<-eos\nWARNING: This demo might not work well with cameras that do auto-exposure.\n If you can, disable those featur... | ruby | chosen |
[
{
"from": "system",
"value": "Add note about factory being invalid sometimes\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n factory :check_in_form do\n transient do\n signature_required? { CheckInForm::SHIFT_ACTIONS.include? action }\n end\n\n name { Faker::Name.name }... | ruby | chosen |
[
{
"from": "system",
"value": "Update Cocapods version to 0.1.3\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"GoogleMediaFramework\"\n s.version = \"0.1.2\"\n s.summary = \"A simple video player framework and UI. Integrates easily with the Google IMA SD... | ruby | chosen |
[
{
"from": "system",
"value": "Include base command helper to pass tests\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ninclude Serverspec::Helper::Attributes\n\ndescribe 'Attributes Helper' do\n before :all do\n attr_set :role => 'proxy'\n end\n subject { attr }\n it { should... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a bug which some text has not changed into correct language.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Api\n module Internal\n class ApplicationController < ActionController::Base\n include ControllerCommon\n includ... | ruby | chosen |
[
{
"from": "system",
"value": "Set mate, getter returns String of mate.\n"
},
{
"from": "human",
"value": "describe USI::Resource::Score do\n describe '#cp' do\n let(:score) { USI::Resource::Score.new(args) }\n\n context '`cp` is included' do\n let(:args) { [\"cp\", \"-1521\"] }\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Handle warnings from changing ARGV\n"
},
{
"from": "human",
"value": "# coding: utf-8\nrequire File.dirname(__FILE__) + \"/spec_helper\"\nrequire \"tempfile\"\n\ndescribe CLI do\n it \"should fail on an invalid subcommand\" do\n ARGV = [\"invalid\"]\n lambda ... | ruby | chosen |
[
{
"from": "system",
"value": "Make script accept more than one directory or file\n"
},
{
"from": "human",
"value": "IO.write(\n \"leak_summary.txt\",\n Dir.glob(\"#{ARGV[0]}/*\").map do |f|\n IO.readlines(f).map do |e|\n s = e.strip.split\n puts \"Null password in #{f}! Count: #{s... | ruby | chosen |
[
{
"from": "system",
"value": "Remove explicit index tracking of NodeSet.\n\nInstead the various nodes can use NodeSet#index (aka Array#index) instead. This\nhas a slight performance overhead on very large (millions) of nodes but should\nbe fine in most other cases.\n"
},
{
"from": "human",
"valu... | ruby | chosen |
[
{
"from": "system",
"value": "Build parse tree on Engine initialization\n\n`Sass::Engine.to_tree` apparently generates a new parse tree each time.\nIn order to save some processing time, initialize the parse tree only\nonce.\n\nChange-Id: Idadd6d6f3653684ced13fde824e1c7c9f45fa703\nReviewed-on: https://gerri... | ruby | chosen |
[
{
"from": "system",
"value": "Write test for bookmarks controller - create action.\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass BookmarksControllerTest < ActionController::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n"
},
{
"from": "gpt",
... | ruby | chosen |
[
{
"from": "system",
"value": "Use opiniated(:believes) instead of people_believes\n"
},
{
"from": "human",
"value": "class EvidenceDeletable\n attr_reader :evidence, :believable, :creator_id\n\n def initialize evidence, type, believable, creator_id\n @evidence = evidence\n @type = type\n... | ruby | chosen |
[
{
"from": "system",
"value": "Check if realm mapping is selected\n"
},
{
"from": "human",
"value": "class Admin::RealmMappingsController < ApplicationController\n before_filter :require_user\n\n def new\n require_privilege(Privilege::CREATE, Realm)\n @realm_target = RealmBackendTarget.ne... | ruby | chosen |
[
{
"from": "system",
"value": "Update each spec to be self-contained.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Levenshtein do\n before(:each) do\n @fixtures = [\n [\"hello\", \"hello\", 0],\n [\"hello\", \"helo\", 1],\n [\"hello\", \"jello\", 1],\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change default Redis.new to Redis.connect.\n"
},
{
"from": "human",
"value": "require \"redis\"\nrequire \"nest\"\n\nmodule Ost\n VERSION = \"0.0.1\"\n TIMEOUT = ENV[\"OST_TIMEOUT\"] || 2\n\n class Queue\n attr :ns\n\n def initialize(name)\n @ns = Nest... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with new version of faye"
},
{
"from": "human",
"value": "if defined? ActionDispatch::Routing\n\n module ActionDispatch::Routing\n class Mapper\n\n def faye_server(mount_path, options={}, &block)\n\n defaults = {\n :mount => mount_... | ruby | chosen |
[
{
"from": "system",
"value": "Add same convenience methods on instance as kenny g class\n"
},
{
"from": "human",
"value": "require_relative 'game'\nrequire_relative 'game_play'\nrequire_relative '../players/player'\n\nclass GameSetup < Game\n def initialize(game_factory: GamePlay,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add some additional methods to HaDevice\n"
},
{
"from": "human",
"value": "module MiOS\n module Services\n module HaDevice1\n def self.extended(base)\n base.instance_variable_set(\"@hadevice1_urn\", \"urn:micasaverde-com:serviceId:HaDevice1\")\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use a custom exception handler in the new Test::Unit adapter.\n\n* It turns out that Test::Unit::AssertionFailedError is derived from\n StandardError; whereas MiniTest::Assertion is derived from Exception.\n* I had been telling Mocha::ExpectationErrorFactory to use\n Test::Un... | ruby | chosen |
[
{
"from": "human",
"value": "Make an Encoder module patterned after the Decoder, extract encoding logic from Message instance\n"
},
{
"from": "gpt",
"value": "module Protobuf\n class Message\n module Encoder\n\n def self.encode(stream, message)\n message.each_field_for_serializat... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor defaulting to support files for style and layout\n"
},
{
"from": "human",
"value": "module Rpub\n module CompilationHelpers\n def create_book\n book = Book.new(layout, config)\n markdown_files.each(&book.method(:<<))\n book\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove warning about task creation without matching desc\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nrequire 'public_suffix'\n\nmodule Spontaneous::Cli\n class Generate < ::Thor\n include Spontaneous::Cli::TaskUtils\n include Thor::Actions\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Revert accidental copy and paste\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nmodule Api\n module Admin\n # Used by admin subscription form\n # Searches for a ship and bill addresses for the customer\n # where they are not already explicitly... | ruby | chosen |
[
{
"from": "system",
"value": "Convert from instance to class methods\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\nVIDEO_EXTENSION=\".MP4\"\nOUTPUT_NAME = \"merged.MP4\"\nDRY_RUN = false\n\nclass VideoMerger\n def merge\n files = find_files_to_merge\n input_list = create_input... | ruby | chosen |
[
{
"from": "system",
"value": "Update path fot phpmig files\n"
},
{
"from": "human",
"value": "module Capistrano\n class FileNotFound < StandardError\n end\nend\n\nnamespace :phpmigration do\n desc \"Supervisor commands (Start/Stop/Restart/Reread/Update)\"\n\n task :status do\n set :proces... | ruby | chosen |
[
{
"from": "system",
"value": "Fix : generate jsonp for har reader\n"
},
{
"from": "human",
"value": "class Pages::AssetsController < ApplicationController\n before_action :authenticate_user!, except: [:show]\n\n def index\n @page = Page.find(params[:page_id])\n return not_found! unless c... | ruby | chosen |
[
{
"from": "system",
"value": "Fix spec to test wording in Top\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.feature \"Top\", type: :feature do\n describe \"GET /\" do\n scenario \"Each section should exist\" do\n visit \"/\"\n expect(page).to have_title 'CoderD... | ruby | chosen |
[
{
"from": "system",
"value": "Add one more route using ERB to the app.\n"
},
{
"from": "human",
"value": "require \"#{File.dirname(__FILE__)}/lib/dolphy\"\n\napp = DolphyApplication.app do\n puts \"Inside run DolphyApplication whatever\"\n get '/hello' do\n haml :index, :body => \"hello\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Test for supported flash message names\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nclass ViewHelpersTester\n extend RailsBootstrapAlerts::ViewHelpers\nend\n\ndescribe RailsBootstrapAlerts::ViewHelpers do\n describe '#flash_class' do\n it 'Return... | ruby | chosen |
[
{
"from": "system",
"value": "Remove DummyApp migration code that targets Rails < 5.2\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule DummyApp\n module Migrations\n extend self\n\n # Ensure database exists\n def database_exists?\n ActiveRecord::Base.conn... | ruby | chosen |
[
{
"from": "system",
"value": "Add I18n for preview label\n"
},
{
"from": "human",
"value": "class TelegramLiveSenderWorker\n include Sidekiq::Worker\n\n def perform(issue_id, journal_id, recipient_ids)\n logger.debug \"START for issue_id #{issue_id}\"\n\n Intouch.set_locale\n\n issue ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix remove_column where a column type was given\n"
},
{
"from": "human",
"value": "class AddDownloadsToVersions < ActiveRecord::Migration\n def self.up\n add_column :versions, :downloads_count, :integer, :default => 0\n end\n\n def self.down\n remove_column... | ruby | chosen |
[
{
"from": "system",
"value": "Fix action name translation issue\n"
},
{
"from": "human",
"value": "module ParamValidator\n module Controller\n\n def self.included( other_module )\n other_module.extend ClassMethods\n end\n\n module ClassMethods\n\n def validate_parameters( *ac... | ruby | chosen |
[
{
"from": "human",
"value": "Add a pod spec file\n"
},
{
"from": "gpt",
"value": "#\n# Be sure to run `pod spec lint XTInfiniteScrollView.podspec' to ensure this is a\n# valid spec and to remove all comments including this before submitting the spec.\n#\n# To learn more about Podspec attribut... | ruby | chosen |
[
{
"from": "human",
"value": "Add solutions for fibonacci seq (iter and rec) and mergesort\n"
},
{
"from": "gpt",
"value": "def fibs(num)\n curr = 0\n next_num = 1\n temp = 0\n while (num -= 1) > 0 do\n temp = curr + next_num\n curr = next_num\n next_num = temp\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to avoid bundler whining about missing desc and summary\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/soft_service/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = \"soft_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix VPC example to use aws_subnet\n"
},
{
"from": "human",
"value": "require 'chef/provisioning/aws_driver'\nwith_driver 'aws'\n\nwith_data_center 'eu-west-1' do\n aws_vpc \"provisioning-vpc\" do \n cidr_block \"10.0.1.0/24\"\n end\n\n subnet \"provisioning-vp... | ruby | chosen |
[
{
"from": "system",
"value": "Clarify Fetcher spec and check Fetcher content\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe(RSSCache::Fetcher) do\n let(:last_modified_feed_url) { 'http://example.com/mock-rss-304.xml' }\n let(:etag_feed_url) { 'http://example.com/mock-atom... | ruby | chosen |
[
{
"from": "system",
"value": "Fix MapcappedVisualizationUpdater, ignore mapcaps in export\n"
},
{
"from": "human",
"value": "require_relative '../../app/services/carto/visualizations_export_service_2'\n\nmodule Carto\n module MapcappedVisualizationUpdater\n include VisualizationsExportServic... | ruby | chosen |
[
{
"from": "system",
"value": "Add generic compile and clean tasks\n"
},
{
"from": "human",
"value": "namespace :pipeline do\n def load_apps\n require File.expand_path('config/boot.rb', Rake.application.original_dir)\n end\n\n def send_to_pipeline(method, *args) \n Padrino.mounted_apps.e... | ruby | chosen |
[
{
"from": "system",
"value": "Break pagination loop if result is empty\n\nHaven't really tested this, just spotted it as I came here to grab the ShopifyAPI pagination code. :)"
},
{
"from": "human",
"value": "module SpreeShopifyImporter\n module Connections\n class Base\n class << self\... | ruby | chosen |
[
{
"from": "system",
"value": "Update Dropbox cask to 2.0.10\n"
},
{
"from": "human",
"value": "class Dropbox < Cask\n url 'https://d1ilhw0800yew8.cloudfront.net/client/Dropbox%202.0.6.dmg'\n homepage 'http://www.dropbox.com/'\n version '2.0.6'\n sha1 '28bec064ddbd3321266cb734dc275eeb6bc12f52... | ruby | chosen |
[
{
"from": "human",
"value": "Add initial version of ModMove\n\nhttps://github.com/keith/ModMove/\n"
},
{
"from": "gpt",
"value": "cask :v1 => 'modmove' do\n version '1.0.0'\n sha256 '1d0cc13c38a4f76ae4f3a5d24c31553d4607c2d180ec1cdc93b43ee8787fe679'\n\n url \"https://github.com/keith/modmove/r... | ruby | chosen |
[
{
"from": "system",
"value": "Fix homepage to use SSL in TagoMan Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n"
},
{
"from": "human",
"value": "cask :v1 => 'tagoman' do\n version :latest\n sha256 :... | ruby | chosen |
[
{
"from": "system",
"value": "Change to latest version of Torpedo.\n\nUpdate to HTTP instead of HTTPS.\n"
},
{
"from": "human",
"value": "class Torpedo < Cask\n url 'http://usetorpedo.com/downloads/mac/Torpedo-1.2.2.app.zip'\n homepage 'https://usetorpedo.com'\n version '1.2.2'\n sha256 '72f... | ruby | chosen |
[
{
"from": "system",
"value": "Add validation to blood drives\n"
},
{
"from": "human",
"value": "class BloodDrive\n include Mongoid::Document\n include Mongoid::Timestamps\n has_many :donations, as: :eventable\n\n field :location, type: String\n field :date, type: DateTime\n field :descript... | ruby | chosen |
[
{
"from": "system",
"value": "Change the order of the event creation to satisfy the needs of the failing Event.all code\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire \"rails_helper\"\n\nRSpec.describe EventsController, type: :controller do\n describe \"#index\" do\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic group controller specs."
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe GroupsController do\n\n let(:group) { Fabricate(:group) }\n\n describe 'when one exists' do\n render_views\n\n before(:each) do\n @request.host = \"#{group... | ruby | chosen |
[
{
"from": "human",
"value": "Add integration test for aggregate command\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\nENV['ADAPTER'] = 'cassandra'\n\ndescribe 'aggregate support' do\n before :all do\n setup_keyspace\n adapter.execute(\"\"\"\n CREATE T... | ruby | chosen |
[
{
"from": "human",
"value": "Add unit test for link resource\n"
},
{
"from": "gpt",
"value": "require 'itamae'\n\nmodule Itamae\n describe Resource::Link do\n let(:recipe) { double(:recipe) }\n\n subject(:resource) do\n described_class.new(recipe, \"name\") do\n to \"/path/to/... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless gem from gemspec\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'relationize/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Component=>System in dummy app\n"
},
{
"from": "human",
"value": "module Persistence\n class Container < Dry::Component::Container\n configure do |config|\n config.root = Pathname(__dir__).join('persistence')\n config.name = :persistence\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Correct strftime for press page spec\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nfeature \"Press\" do\n scenario \"viewing page\" do\n visit press_path\n expect(page).to have_content \"Press\"\n end\n\n scenario \"viewing article\" do\n 5... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bad multi-line split from previous commit\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe TreeHelper do\n describe 'flatten_tree' do\n let(:project) { create(:project) }\n\n before do\n @repository = project.repository @commit = ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor dictionary spec to gain an understanding\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Zxcvbn::Matchers::Dictionary do\n let(:matcher) { described_class.new('english', dictionary) }\n let(:dictionary) { Zxcvbn::Data.new.ranked_dicti... | ruby | chosen |
[
{
"from": "system",
"value": "Include the Makefile as part of the gem.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'csg'\n s.version = '0.0.0'\n s.summary = \"A fast library for Constructive Solid Geometry\"\n s.description = s.summary\n s.authors = [... | ruby | chosen |
[
{
"from": "system",
"value": "Change to show objects count\n"
},
{
"from": "human",
"value": "require 'finite_machine'\n\n3.times do\n puts\n\n GC.start\n\n gc_before = GC.stat\n objects_before = ObjectSpace.count_objects[:T_OBJECT]\n p objects_before\n\n 1_000.times do\n FiniteMachine.... | ruby | chosen |
[
{
"from": "system",
"value": "Use locale on option parsing\n"
},
{
"from": "human",
"value": "require 'set'\nrequire 'pp'\nrequire 'optparse'\nrequire_relative 'scp-article-loader'\nrequire_relative 'roff-builder'\n\noption = {\n :locale => \"www\"\n}\nOptionParser.new do |opt|\n opt.on('-l', ... | ruby | chosen |
[
{
"from": "system",
"value": "Add more tests for ListPoint\n"
},
{
"from": "human",
"value": "require 'minitest_helper'\n\nmodule SlideHero\n describe ListPoint do\n it \"takes text and an animation on initialization\" do\n line_point = ListPoint.new(\"point!\", animation: nil)\n l... | ruby | chosen |
[
{
"from": "system",
"value": "Add admin status default false\n"
},
{
"from": "human",
"value": "class CreateTeachers < ActiveRecord::Migration\n def change\n create_table :teachers do |t|\n t.string :name\n t.string :email\n t.string :password_digest\n t.boolean :admin\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Add support '.mdwn' as markdown file extension.\n\nCloses #33.\n"
},
{
"from": "human",
"value": "require 'redcarpet'\n\n#\n# Thanks to Steve Klabnik for his blog post about Redcarpet renderers.\n# See http://blog.steveklabnik.com/posts/2011-12-21-redcarpet-is-aweso... | ruby | chosen |
[
{
"from": "system",
"value": "Implement the gateway endpoint (even though WS is currently unimplemented)\n"
},
{
"from": "human",
"value": "require 'sinatra/base'\n\nrequire 'rest/helpers'\n\nrequire 'common/model'\nrequire 'common/patches'\nrequire 'common/util'\n\nmodule Ldash\n class RestSer... | ruby | chosen |
[
{
"from": "system",
"value": "Revert change to load path\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'button_like_a_link/version'\n\nGem::Specification.new do |spec|\n spec.nam... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor refresh in gend image pages controller.\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\n# Generated (meme) image pages controller.\nclass GendImagePagesController < ApplicationController\n include GendImagesHelper\n\n def show\n @gend_image = G... | ruby | chosen |
[
{
"from": "system",
"value": "Set bunny version to be at least 1.6.3\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'thrifty_bunny/version'\n\nGem::Specification.new do |spec|\n spe... | ruby | chosen |
[
{
"from": "system",
"value": "Build a return string in parts instead of explicitly switching\n"
},
{
"from": "human",
"value": "module Fizzbuzz\n extend self\n\n def fb_value(n)\n divisible_by_three = (n % 3).zero?\n divisible_by_five = (n % 5).zero?\n\n if divisible_by_three && divi... | ruby | chosen |
[
{
"from": "system",
"value": "Remove first guess from while loop\n"
},
{
"from": "human",
"value": "solution = 1 + rand(1000)\nguesses = []\nputs solution # This statement is temporary while I test the game.\nputs \"Guess what number I'm thinking of. It's between 1 and 1000\"\nguess = gets.to_i\... | ruby | chosen |
[
{
"from": "system",
"value": "Add test cases for CFI sorting rules\n"
},
{
"from": "human",
"value": "require_relative 'helper'\nrequire 'epub/cfi'\n\nclass TestCFI < Test::Unit::TestCase\n def test_escape\n assert_equal '^^', EPUB::CFI.escape('^')\n end\n\n def test_unescape\n assert_e... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the gemspec for padrino 0.11.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = \"padrino_bootstrap_forms\"\n s.version = \"0.0.2\"\n s.authors = [\"Seth Vargo\", \"Skye Shaw\"]\n s.email\t= \"skye.shaw@gmail.com\"\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add attr_reader :logger on StdoutAdapter\n"
},
{
"from": "human",
"value": "module Foreman\n module Logging\n class StdoutAdapter\n attr_reader :multiplexer\n\n def initialize\n @logger = ::Logger.new(STDOUT)\n @logger.datetime_format = \... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for checking genres\n"
},
{
"from": "human",
"value": "require 'gpsoauth'\n\nmodule GoogleMusicApi\n class MobileClient\n\n SERVICE = 'sj'\n APP = 'com.google.android.music'\n CLIENT_SIGNATURE = '38918a453d07199354f8b19af05ec6562ced5788'\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Simplify EventReporter class by removing nested formatter class\n"
},
{
"from": "human",
"value": "require 'json'\nrequire 'net/http'\nrequire 'net/https'\n\nclass GraphiteClient\n class EventReporter\n def initialize(graphite_server_events_url, opts={})\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add updated summary and description to the .gemspec.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"capistrano-ec2tag\"\n s.version = \"0.0.1\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Include Enumerable module into UserCollectionProxy instead of defining map\n"
},
{
"from": "human",
"value": "require 'intercom/user_resource'\nrequire 'intercom/flat_store'\nrequire 'intercom/social_profile'\n\nmodule Intercom\n # A collection of your Users from I... | ruby | chosen |
[
{
"from": "system",
"value": "Add work type definitions to generic work model\n"
},
{
"from": "human",
"value": "# Generated via\n# `rails generate curation_concerns:work GenericWork`\nclass GenericWork < ActiveFedora::Base\n include ::CurationConcerns::WorkBehavior\n include ::CurationConcer... | ruby | chosen |
[
{
"from": "system",
"value": "Allow to use the latest bundler\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'flagship/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Update pod spec to version 0.3.0\n"
},
{
"from": "human",
"value": "#\n# Be sure to run `pod lib lint McPicker.podspec' to ensure this is a\n# valid spec before submitting.\n#\n\nPod::Spec.new do |s|\n s.name = 'McPicker'\n s.version = '0.2.0'... | ruby | chosen |
[
{
"from": "system",
"value": "Add bundler logging when falling back on default dependencies\n"
},
{
"from": "human",
"value": "require 'engine_cart/params'\n\nmodule EngineCart\n def self.gemfile_stanza_check_line\n \"engine_cart stanza: 0.8.0\"\n end\n\n def self.gemfile_stanza_text\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Set parsed results to instance variables of Statement in parse_link()\n"
},
{
"from": "human",
"value": "# statement.rb\n\nmodule SecStatementParser\n\n class Statement\n include SecStatementFields\n include Debug\n\n\n attr_reader(:symbol,:urls)\n\n @@... | ruby | chosen |
[
{
"from": "system",
"value": "Support for globally frozen string literals\n"
},
{
"from": "human",
"value": "\nclass SimpleCov::Formatter::Console\n module BlockOutput\n\n # format per-file results output as plain text blocks\n def output(files, root)\n blocks = []\n files.each ... | ruby | chosen |
[
{
"from": "system",
"value": "Declare methods before using it\n"
},
{
"from": "human",
"value": "module FFI::Libvirt\n extend FFI::Library\n ffi_lib FFI::Libvirt::library_path\n\n def self.library_path\n 'libvirt.so.0'\n end\n\n #int\tvirGetVersion(unsigned long * libVer, const char * ty... | ruby | chosen |
[
{
"from": "system",
"value": "Use guard clause to check for hash\n"
},
{
"from": "human",
"value": "module Locotimezone\n class Configuration\n attr_accessor :google_api_key\n attr_reader :attributes\n \n def initialize\n @attributes = {\n latitude: :latitude,\n l... | ruby | chosen |
[
{
"from": "human",
"value": "Add regression tests for devise emails\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\n\ndescribe Devise::Mailer do\n let(:user) { mock_model(User, email: \"foo@bar.com\") }\n describe \"#confirmation_instructions\" do\n let(:mail) { Devise::Mailer.con... | ruby | chosen |
[
{
"from": "human",
"value": "Remove server information ruby script\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/ruby\n\n\nrequire 'yaml'\n\nRAILS_ROOT = File.dirname(__FILE__) + \"/..\"\n\n# We may not have a workling Webiva install, so \ndef run_db_command(command)\n system(\"mysql\",'-u',@use... | ruby | chosen |
[
{
"from": "system",
"value": "Add token to all get request via class variable on module\n"
},
{
"from": "human",
"value": "module NikePlus\n module HTTPUtils\n def post_request(url, body)\n Excon.post(url,\n body: URI.encode_www_form(body),\n headers: { '... | ruby | chosen |
[
{
"from": "system",
"value": "Improve output readibility for featured stories.\n"
},
{
"from": "human",
"value": "class NprTodaysNews::CLI\n def run\n get_newslist\n print_stories\n end\n\n def get_newslist\n puts \"These are today's top stories on NPR:\"\n NprTodaysNews::Scraper.... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for ruby 2.5.0\n"
},
{
"from": "human",
"value": "require 'oakdex/pokedex/base'\n\nmodule Oakdex\n module Pokedex\n # Represents the move of a Pokemon\n class Move < Base\n json_folder 'move'\n translate :names, :name\n translate :d... | ruby | chosen |
[
{
"from": "system",
"value": "Test SAVE, BGSAVE and LASTSAVE going through Redis::Distributed\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nrequire File.expand_path(\"./helper\", File.dirname(__FILE__))\nrequire File.expand_path(\"./redis_mock\", File.dirname(__FILE__))\n\nrequire \"re... | ruby | chosen |
[
{
"from": "human",
"value": "Add pending state in tests, any idea how to test integration with Zeus?\n"
},
{
"from": "gpt",
"value": "require File.expand_path(\"../test_helper\", __FILE__)\n\ndescribe \"zeus-parallel_tests\" do\n it 'should be tested' do\n skip(\"any ideas how to test this?\... | ruby | chosen |
[
{
"from": "system",
"value": "Use safe_yaml to load user input from minibundle block\n\nThis is what Jekyll uses internally to load YAML input. It's good idea\nto use it here as well for consistency and safety.\n"
},
{
"from": "human",
"value": "require 'yaml'\nrequire 'jekyll/minibundle/asset_f... | ruby | chosen |
[
{
"from": "system",
"value": "Remove misleading default comment about db:setup.\n"
},
{
"from": "human",
"value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside th... | ruby | chosen |
[
{
"from": "human",
"value": "Add implementation for HTTP basic auth\n"
},
{
"from": "gpt",
"value": "module Scanny\n module Checks\n class HTTPBasicAuthCheck < Check\n def pattern\n [\n pattern_basic_auth,\n pattern_http_authentication\n ].join(\"|\")\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add roles to user seed\n"
},
{
"from": "human",
"value": "u = User.new\nu.email=\"user@example.com\"\nu.password=u.password_confirmation=\"password\"\nu.save!\n\na = AdminUser.new\na.email=\"admin@example.com\"\na.password=u.password_confirmation=\"password\"\na.sav... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Fix test git path\"\n\nThis reverts commit 0dabf67379b316d3a7267be22eca47f29890d287.\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass RepoTest < ActiveSupport::TestCase\n def test_sync_ranks\n Repo.new(\"#{Rails.root}/.git\").send(:sync... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.