conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove version from from bundler dependencie\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'npm/rails/version'\n\nGem::Specification.new do |spec|\n s... | ruby | chosen |
[
{
"from": "system",
"value": "Add method to render handshake response\n"
},
{
"from": "human",
"value": "module WebSocket\n class ServerHandshake < Http::Response\n\n def initialize(status = nil, version = \"1.1\", headers = {}, body = nil, &body_proc)\n @status, @version, @body, @body_... | ruby | chosen |
[
{
"from": "system",
"value": "Use defined? in Logger fixtures to avoid issues with --unguarded\n\n* --unguarded is for instance used for mspec tag --purge.\n"
},
{
"from": "human",
"value": "require 'logger'\n\nmodule LoggerSpecs\n\n def self.strip_date(str)\n str.gsub(/[A-Z].*\\[.*\\]/, \"\... | ruby | chosen |
[
{
"from": "system",
"value": "Use LinkExpansion in ExpandedLinkSet Query Presenter\n\nThis replaces the previous dual direction approaches to link expansion\nto use a single class that mediates both directions.\n"
},
{
"from": "human",
"value": "module Presenters\n module Queries\n class Exp... | ruby | chosen |
[
{
"from": "system",
"value": "Use HAR base, remove includes\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass Api::LicenseRepresenter < Roar::Decorator\n\n include Roar::Representer::JSON::HAL\n include Caches\n\n property :streamable\n property :editable\nend\n"
},
{
"fr... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for checking rbconfig strings are not frozen.\n"
},
{
"from": "human",
"value": "require_relative '../../spec_helper'\nrequire 'rbconfig'\n\ndescribe 'RbConfig::CONFIG' do\n it 'values are all strings' do\n RbConfig::CONFIG.each do |k, v|\n k.shoul... | ruby | chosen |
[
{
"from": "system",
"value": "Support Spree 1.3 in gemspec"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"spree-refinerycms-authentication\"\n gem.version = \"0.0.1\"\n gem.authors = [\"Adrian Macneil\"]\n gem... | ruby | chosen |
[
{
"from": "system",
"value": "Add new codepen embeded script url\n"
},
{
"from": "human",
"value": "module Qiita\n module Markdown\n module Embed\n module CodePen\n SCRIPT_URLS = [\n \"https://production-assets.codepen.io/assets/embed/ei.js\",\n \"https://static... | ruby | chosen |
[
{
"from": "system",
"value": "Bump cilium/ubuntu-next version to 42\n\nThis includes an updated version of cilium/iproute2 (50a9b6da)\nand bumps the net-next tree to version 5.4.\n\nSigned-off-by: Sebastian Wicki <db043b2055cb3a47b2eb0b5aebf4e114a8c24a5a@isovalent.com>\n"
},
{
"from": "human",
"... | ruby | chosen |
[
{
"from": "system",
"value": "Update ownership information in 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 'rvpacker/version'\n\nGem::Specification.new do |spec|\n spec.n... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.1.18 to 0.2.0\n[breaking change] Writer substitute interface is not entirely compatible with previous version\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-mes... | ruby | chosen |
[
{
"from": "system",
"value": "Add space before block braces\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ruby-measurement/version'\n\nGem::Specification.new do |gem|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix quotes so publishing script works\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'TrailsKit'\n s.version = '0.3.0'\n s.summary = 'Tools for representing and displaying geographical data for parks and trails.'\n s.homepage = 'https://githu... | ruby | chosen |
[
{
"from": "human",
"value": "Add an example useage of the eventual api\n"
},
{
"from": "gpt",
"value": "$:.push File.expand_path('../../lib', __FILE__)\nrequire 'zulip'\n\n### Sends a private message to a new thread is posted to a specified stream\n\nclass ZulipEcho\n client = Zulip::Client.new... | ruby | chosen |
[
{
"from": "system",
"value": "Add check if user is admin\n"
},
{
"from": "human",
"value": "module AdminHelper\n #add before_filter :authorize to any controller if you want to make sure a authorized user can view that page\n def current_user\n @current_user ||= User.find(session[:user_id]) if... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deleted comments for specific blog 500 server error.\n"
},
{
"from": "human",
"value": "module BlogsHelper\n def weight_status_index(blog)\n \"<span class='ding_blogs'>[顶]</span>\" if blog.weight > 0\n end\n\n def show_comment(comment, index)\n if comme... | ruby | chosen |
[
{
"from": "system",
"value": "Include category_id as an allowed param for items\n"
},
{
"from": "human",
"value": "module ItemsHelper\n private\n def find_item\n @item = Item.find_by_id(params[:id])\n end\n\n def item_params\n params.require(:item).permit(:name, :description,... | ruby | chosen |
[
{
"from": "system",
"value": "Make root_url always have trailing slash"
},
{
"from": "human",
"value": "module PagesHelper\n def path_to_page(page)\n unless page.parent.nil?\n path_to_page(page.parent) + '/' + page.slug\n else\n root_url + '/' + page.slug\n end\n end\nend\n"... | ruby | chosen |
[
{
"from": "system",
"value": "Write pending test for vote validations\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Api::QuestionsController, :type => :controller do\n context \"Voting on Questions\" do\n describe \"Voting on a particular question\" do\n\n it \"sh... | ruby | chosen |
[
{
"from": "system",
"value": "Include hash composite examples in HashBranch.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'compo'\n\ndescribe Compo::HashBranch do\n describe '#initialize' do\n it 'initialises with a Parentless as parent' do\n expect(subject.parent).... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for post mode\n"
},
{
"from": "gpt",
"value": "require \"rails_helper\"\n\nRSpec.describe Post, :type => :model do\n before(:all) do\n user = User.create(name: 'Bob', email: 'bob@dbc.com', password: 'password')\n dog = Animal.create(breed_id: 1, name... | ruby | chosen |
[
{
"from": "system",
"value": "Send Connection: close in test\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'net/http'\n\ndescribe Reel::Server do\n let(:endpoint) { URI(\"http://#{example_addr}:#{example_port}#{example_url}\") }\n let(:response_body) { \"ohai thar\" }\n \n... | ruby | chosen |
[
{
"from": "system",
"value": "Add failing test about pos method\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe TicTacToe do\n it 'has a version number' do\n expect(TicTacToe::VERSION).not_to be nil\n end\n\n it 'has a board' do\n game = TicTacToe::Board.new\n ex... | ruby | chosen |
[
{
"from": "system",
"value": "Revert the mysql jar install target\n\nPrior to #960, the mysql-connector.jar is being installed in\n/usr/share/java/mysql-connector.jar instead of\n/usr/share/java/mysql-connector.jar/mysql-connector.jar. This new\nlocation causes Oozie and Hive to no find the jar.\n\nFixes #9... | ruby | chosen |
[
{
"from": "system",
"value": "Fix constants lookup in MetaClasses.\n"
},
{
"from": "human",
"value": "class MetaClass\n ivar_as_index :__ivars__ => 0, :methods => 1, :method_cache => 2, :name => 3, :constants => 4, :parent => 5, :superclass => 6, :instance_fields => 7, :instance_flags => 8, :at... | ruby | chosen |
[
{
"from": "system",
"value": "Update to '0.4.0' for reals\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"ClusterPrePermissions\"\n s.version = \"0.3.0\"\n s.summary = \"Cluster's pre-permissions utility to ask users using their own dialog fo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for default item model\n\ngit-svn-id: 40f48ef6be603b97d118b87e4ef5b23ea6e9fa7c@201 ac1452a4-9358-4c15-a3b0-de1119e254d8\n"
},
{
"from": "human",
"value": "class PlaylistItem < ActiveRecord::Base\n acts_as_category :scope => :playlist, :hidden => :active\n acts... | ruby | chosen |
[
{
"from": "system",
"value": "Test for the display of a user's groups\n\nNote that this test also checks that groups with long descriptions\nonly show the first 140 characters.\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass UsersProfileTest < ActionDispatch::IntegrationTest\n ... | ruby | chosen |
[
{
"from": "system",
"value": "REFACTOR: Remove puts statements in rake task\n"
},
{
"from": "human",
"value": "# lib/tasks/register_subscribers.rake\n# See: http://nithinbekal.com/posts/safe-rake-tasks/\n\nrequire_relative '../assets/ontrack_receive_action.rb'\n\ndesc 'Register a subscriber boun... | ruby | chosen |
[
{
"from": "system",
"value": "Fix uncommented email index for devise user model\n"
},
{
"from": "human",
"value": "class DeviseCreateUsers < ActiveRecord::Migration\n def change\n create_table(:users) do |t|\n ## Database authenticatable\n t.string :email, null: false,... | ruby | chosen |
[
{
"from": "system",
"value": "Update Rails 2 generate to be in sync w/Rails 3 generator\n"
},
{
"from": "human",
"value": "if defined? GovKit\n GovKit.configure do |config|\n # Get an API key for Sunlight's Open States project here:\n # http://services.sunlightlabs.com/accounts/register/\... | ruby | chosen |
[
{
"from": "system",
"value": "Allow versions of rails greater than 3.2.2\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"initforthe/routes/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specifica... | ruby | chosen |
[
{
"from": "system",
"value": "Remove some empty lines in example spec.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe ReplaceGemname::ReplaceCls do\n\n subject(:replace_cls) { ReplaceGemname::ReplaceCls.new }\n\n describe \".new\" do\n\n it \"makes a new instance\" do\... | ruby | chosen |
[
{
"from": "system",
"value": "Update spec to pass on rom from master\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'Inferring schema from database' do\n let(:setup) { ROM.setup(postgres: \"postgres://localhost/rom\") }\n\n context \"when database schema exists\" do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary git-blame option `-e`\n\nUnfortunately, this is not only unncecessary but also broken in git version\nless than 1.7.4. Git learned -e option at version 1.7.4\n"
},
{
"from": "human",
"value": "module CodeHunter\n class GitBlamer\n def initiali... | ruby | chosen |
[
{
"from": "system",
"value": "Replace `attr_accessor` with instance variable\n\nThe `features` hash does not have to be accessed from outside the\nrepository class.\n"
},
{
"from": "human",
"value": "module Flop\n module Repository\n class Memory\n attr_accessor :features\n\n def i... | ruby | chosen |
[
{
"from": "system",
"value": "Fix password parameter to GPG\n"
},
{
"from": "human",
"value": "require 'gpgme'\n\nmodule GooderData\n\n class SessionId\n\n def initialize(user_email, options = {})\n @crypto = GPGME::Crypto.new\n @user_email = user_email\n @options = GooderData... | ruby | chosen |
[
{
"from": "system",
"value": "Create task classes, instead of collecting klasses.\n"
},
{
"from": "human",
"value": "require_relative \"tasks/base\"\nrequire_relative \"tasks/stash_git_changes\"\nrequire_relative \"tasks/compile_assets\"\nrequire_relative \"tasks/steal_manifest\"\nrequire_relati... | ruby | chosen |
[
{
"from": "system",
"value": "Create alias as :ts of :t_scoped method\n"
},
{
"from": "human",
"value": "module I18nLazyScope\n module Helper\n def t_scoped(key, **args)\n t(key, scope: lazy_scope, **args)\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "module I18nLazy... | ruby | chosen |
[
{
"from": "system",
"value": "Fix constant lookup exception in FeedParser\n"
},
{
"from": "human",
"value": "module OpenMensa\n\n # FeedParser provide methods to parse XML input into an Nokogiri\n # XML document. There will be no validation or semantic check done.\n #\n # === Example\n #\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task for mass publishing\n\nAs we continue to iterate on what is sent as part of the ContentItem, we\nneed a way to mass publish all the Policies with the new information.\nThis commit adds a rake task which triggers a save for all PolicyAreas\nand Programmes, which the... | ruby | chosen |
[
{
"from": "system",
"value": "Move to Playeai for consistency\n"
},
{
"from": "human",
"value": "require 'pry'\nrequire 'sinatra/base'\nrequire_relative 'lib/tictactoe_rules'\nrequire_relative 'lib/tictactoe_board'\nrequire_relative 'lib/comp_player'\nrequire_relative 'lib/web_game_engine'\n\ncl... | ruby | chosen |
[
{
"from": "system",
"value": "Fix warnings with recent thor versions\n\nOtherwise running things like `bin/rails g --help` with `draper`\ninstalled leads to warnings like this:\n\n```\nExpected string default value for '--decorator'; got true (boolean)\n```\n\nSee https://github.com/erikhuda/thor/issues/538... | ruby | chosen |
[
{
"from": "system",
"value": "Fix has_all_acks? indentation and logic\n"
},
{
"from": "human",
"value": "class BugEntry\n attr_accessor :bz_id, :depends_on_ids, :pm_acks, :devel_acks, :qa_acks, :doc_acks, :ver_acks, :flag_version, :summary\n\n def initialize(bz) \n @bz_id = bz.bz_i... | ruby | chosen |
[
{
"from": "system",
"value": "Sort 'all tags' by name\n"
},
{
"from": "human",
"value": "module Blog\n module BlogsHelper\n\n def canonical_link_tag(url, options = {})\n options.reverse_merge! \\\n :rel => :canonical,\n :href => url\n\n tag :link, options\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix validations in rails 5.\n"
},
{
"from": "human",
"value": "class Ecm::Cms::Navigation < ActiveRecord::Base\n # associations\n has_many :ecm_cms_navigation_items,\n class_name: 'Ecm::Cms::NavigationItem',\n dependent: :destroy,\n f... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug wrong receiver condition\n"
},
{
"from": "human",
"value": "class ReceiverService\n # Create receiver and its logic from parameter\n # @param Receiver object\n # @param boolean true false\n def self.save(receiver)\n if !TeamPolicy.can_manage?(receiver... | ruby | chosen |
[
{
"from": "system",
"value": "Include casual reader transition when profile is saved with existing email\n"
},
{
"from": "human",
"value": "class Users::RegistrationsController < Devise::RegistrationsController\n\n def create\n super do\n if resource.persisted?\n else\n flas... | ruby | chosen |
[
{
"from": "system",
"value": "Add suffix to average age\n"
},
{
"from": "human",
"value": "SCHEDULER.every '1h', :first_at => Time.now do\n send_event('members', { current: CommercialDashboard.members })\n send_event('age', { current: CommercialDashboard.age })\n send_event('old-opportunities... | ruby | chosen |
[
{
"from": "system",
"value": "Check every corelib file with jshint"
},
{
"from": "human",
"value": "desc \"Build *corelib* and *stdlib* and lint the result\"\ntask :jshint do\n dir = 'tmp/lint'\n\n unless ENV['SKIP_BUILD']\n rm_rf dir if File.exist? dir\n sh \"rake dist DIR=#{dir}\"\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"convert from rvm to chruby\"\n\nThis reverts commit 6b78333bcb01e88967e904e11743685a3121c35c.\n"
},
{
"from": "human",
"value": "namespace :testing do\n\n desc 'Run all necessary tests'\n task :execute_all_tests do\n Rake::Task['testing:execute_rake_te... | ruby | chosen |
[
{
"from": "system",
"value": "Remove firstname login code for the BobCat layout since it's now bundled in with nyulibraries-assets\n"
},
{
"from": "human",
"value": "# app/views/layouts/bobcat.rb\nmodule Views\n module Layouts\n class Bobcat < ActionView::Mustache\n def application_java... | ruby | chosen |
[
{
"from": "system",
"value": "Add session helper methods log_in & current_user\n"
},
{
"from": "human",
"value": "module SessionsHelper\nend\n"
},
{
"from": "gpt",
"value": "module SessionsHelper\n # Login the given user\n def log_in(user)\n session[:user_id] = user.id\n end\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Add error log to create\n"
},
{
"from": "human",
"value": "class UserController < ApplicationController\n before_action :logged_in?, except: [:new,:create,:user_params]\n def new\n\t\t@user = User.new\n @user.build_department_assistant\n @user.build_coordina... | ruby | chosen |
[
{
"from": "system",
"value": "Make UserBanEventHandler correctly inherit from EventHandler\n"
},
{
"from": "human",
"value": "module Discordrb::Events\n # Raised when a user is banned\n class UserBanEvent\n # @return [User] the user that was banned\n attr_reader :user\n\n # @return [S... | ruby | chosen |
[
{
"from": "system",
"value": "Add read preference getter rdoc\n"
},
{
"from": "human",
"value": "require \"moped/read_preference/nearest\"\nrequire \"moped/read_preference/primary\"\nrequire \"moped/read_preference/primary_preferred\"\nrequire \"moped/read_preference/secondary\"\nrequire \"moped... | ruby | chosen |
[
{
"from": "system",
"value": "Remove obsolete pre-installed gems dir from gem env.\n"
},
{
"from": "human",
"value": "# Add a Rubinius platform to the platforms list.\ncpu = Gem::Platform.local.cpu\nversion = Rubinius::VERSION.split('.')[0, 2].join '.'\nGem.platforms << Gem::Platform.new([cpu, '... | ruby | chosen |
[
{
"from": "system",
"value": "Fix leak in the Open3.popen3 spec and add an example\n"
},
{
"from": "human",
"value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire 'open3'\n\ndescribe \"Open3.popen3\" do\n after :each do\n [@in, @out, @err].each do |io|\n io.close ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix FK backend access using CA\n"
},
{
"from": "human",
"value": "class Backend::BackendController < ApplicationController\n respond_to :html\n layout \"backend\"\n\n before_filter :verify_club\n def verify_club\n # Development backdoor\n return @club = Cl... | ruby | chosen |
[
{
"from": "system",
"value": "Use correct set of timeline events for the atom feed\n"
},
{
"from": "human",
"value": "class TimelineEventsController < ApplicationController\n\n resource_controller\n\n actions :index, :show\n\n before_filter :set_atom\n\n show.failure.wants.html { rescue_404 ... | ruby | chosen |
[
{
"from": "system",
"value": "Rename method for consistency and clarity\n"
},
{
"from": "human",
"value": "class PublishingApiScheduleWorker\n include Sidekiq::Worker\n\n attr_accessor :model, :locale\n\n def perform(model_name, id, locale=I18n.default_locale.to_s)\n @model = class_for(mod... | ruby | chosen |
[
{
"from": "system",
"value": "Drop column only if it exists.\n"
},
{
"from": "human",
"value": "class MoveToHasAndBelongsToManyForOntologiesTasksEnd < ActiveRecord::Migration\n def up\n remove_column(:ontologies, :task_id)\n remove_column(:tasks, :ontology_id)\n end\n\n def down\n ad... | ruby | chosen |
[
{
"from": "system",
"value": "Define missing variable in selection script sample\n"
},
{
"from": "human",
"value": "require 'java'\n\nSelectionUtils = Java::org.ow2.proactive.scripting.helper.selection.SelectionUtils\n\n#check if free memory is at least 1Go\nif SelectionUtils.checkFreeMemory(exp... | ruby | chosen |
[
{
"from": "system",
"value": "Document display user based on group\n"
},
{
"from": "human",
"value": "class DocumentsController < ApplicationController\n\n def index\n # @documents = Document.all\n @groups = Group.all\n end\n\n def show\n @document = Document.find(params[:id])\n end... | ruby | chosen |
[
{
"from": "system",
"value": "Update parslet ~> 1.8 and thor ~> 0.20\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'vim-flavor/version'\n\nGem::Specification.new do |spec|\n spec.n... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to checking Arel versions\n"
},
{
"from": "human",
"value": "require 'arel'\n\nmodule Arsi\n module ArelTreeManager\n # This is from Arel::SelectManager which inherits from Arel::TreeManager.\n # We need where_sql on both Arel::UpdateManager and Arel::... | ruby | chosen |
[
{
"from": "system",
"value": "Fix regexp to more strong\n\nAccording to the following error on Rails 4:\n\n ArgumentError: The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \\A and \\z, or forgot to add the :multiline => true optio... | ruby | chosen |
[
{
"from": "system",
"value": "Use string for Protocol::Command collection name\n"
},
{
"from": "human",
"value": "module Moped\n module Protocol\n\n # This is a convenience class on top of +Query+ for quickly creating a\n # command.\n #\n # @example\n # command = Moped::Protoco... | ruby | chosen |
[
{
"from": "system",
"value": "Use prepend to change LogSubscriber; add db_name to the payload\n"
},
{
"from": "human",
"value": "module Multidb\n module LogSubscriber\n extend ActiveSupport::Concern\n\n included do\n def debug_with_multidb(msg)\n if name = Multidb.balancer.cur... | ruby | chosen |
[
{
"from": "system",
"value": "Change the methods to set handlers\n"
},
{
"from": "human",
"value": "require 'singleton'\nrequire 'specinfra/command_result'\n\nmodule Specinfra\n module Backend\n class Base\n def self.instance\n @instance ||= self.new\n end\n\n def initi... | ruby | chosen |
[
{
"from": "system",
"value": "Make rspec a development dependency\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"approvals\"\n s.version = \"0.0.2\"\n s.authors = [\"Katr... | ruby | chosen |
[
{
"from": "system",
"value": "Compress the template when we attempt to validate it\n"
},
{
"from": "human",
"value": "module StackMaster\n class Validator\n def self.valid?(stack_definition, config)\n new(stack_definition, config).perform\n end\n\n def initialize(stack_definition,... | ruby | chosen |
[
{
"from": "system",
"value": "Add identity methods to Piece\n"
},
{
"from": "human",
"value": "require \"./chess_consts\"\n\nclass Piece\n attr_reader :type\n attr_accessor :row, :col\n\n def initialize(type = Chess::W_KING, row = 1, col = \"e\")\n @type = type\n @row = ro... | ruby | chosen |
[
{
"from": "system",
"value": "Remove note as it doesn't seem to be supported\n"
},
{
"from": "human",
"value": "module SynapsePayments\n class Users\n\n def initialize(client)\n @client = client\n end\n\n def all\n @client.get(path: '/users')\n end\n\n def authenticate_... | ruby | chosen |
[
{
"from": "system",
"value": "Add task support for rails 3; CR: DF"
},
{
"from": "human",
"value": "namespace :feeds do\n\n desc 'update feeds from GitHub'\n task update_feeds: :environment do\n require 'feedshub/feeds/git_feeds_handler'\n GitFeedsHandler.update_github_feeds\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change `map` to `map!` to save extra array creation on new array\n"
},
{
"from": "human",
"value": "module Twilio\n module REST\n module Utils\n\n def twilify(something)\n if something.is_a? Hash\n Hash[*something.to_a.map {|a| [twilify(a[0]... | ruby | chosen |
[
{
"from": "system",
"value": "Embed configuration in asset tag library\n"
},
{
"from": "human",
"value": "module Yarrow\n module HTML\n module AssetTags\n \n # TODO: make sprockets manifest optional/pluggable\n def manifest\n Yarrow::Assets::Manifest.new(config || {})\n... | ruby | chosen |
[
{
"from": "system",
"value": "Allow it to work without activerecord loaded\n"
},
{
"from": "human",
"value": "class Fabrication::Fabricator\n\n def initialize(class_name, &block)\n klass = class_for(class_name)\n if klass.ancestors.include?(ActiveRecord::Base)\n @fabricator = Fabrica... | ruby | chosen |
[
{
"from": "system",
"value": "Handle Errno::EAGAIN errors when writing\n"
},
{
"from": "human",
"value": "class IOActors::WriterActor < Concurrent::Actor::RestartingContext\n\n def initialize io\n @io = io\n @writes = []\n end\n\n def on_message message\n case message\n when IOAct... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary files from gem\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ltsv_logger_formatter/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor getting target into separate method\n"
},
{
"from": "human",
"value": "module Lita\n module Handlers\n class Hal9000 < Handler\n on(:unhandled_message) do |payload|\n handle_unhandled(payload: payload)\n end\n\n def handle_unhandle... | ruby | chosen |
[
{
"from": "system",
"value": "Add description for Message class\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n# frozen_string_literal: true\nmodule MessageBroker\n class Message\n attr_reader :sequence, :type, :from, :to, :raw\n\n module Type\n FOLLOW = 1\n UNFOLLOW = 2\... | ruby | chosen |
[
{
"from": "system",
"value": "Add conditional to increment longest streak if current streak becomes larger than longest streak\n"
},
{
"from": "human",
"value": "class Skill < ActiveRecord::Base\n belongs_to :user\n validates :title, presence: true\n before_save :set_expiration_time\n\n def ... | ruby | chosen |
[
{
"from": "system",
"value": "Increase aruba timeout because installing gems might take a lot of time\n"
},
{
"from": "human",
"value": "require 'aruba/cucumber'\n\nroot = Pathname.new(__FILE__).parent.parent.parent\n\nENV['PATH'] = \"#{root}/features/support/bin#{File::PATH_SEPARATOR}#{ENV['PAT... | ruby | chosen |
[
{
"from": "system",
"value": "Create default trait mapped to Rolistic::Everything\n"
},
{
"from": "human",
"value": "module Rolistic\n module ClassMethods\n def load(raw)\n case raw\n when self then raw\n when String, Symbol\n new(raw) unless raw.blank?\n else\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Define rake tasks for repopulating case studies\n\ninto either the draft or live environment.\n"
},
{
"from": "human",
"value": "namespace :publishing_api do\n desc \"export all whitehall content to draft environment of publishing api\"\n task :populate_draft_envi... | ruby | chosen |
[
{
"from": "system",
"value": "Fix superclass mismatch by using struct\n"
},
{
"from": "human",
"value": "module Torkify::Log\n class TestError < Struct.new(:filename, :lnum, :text, :type)\n def clean_text\n text.strip\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "mod... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing methods to Virtus::Typecast::Object\n"
},
{
"from": "human",
"value": "module Virtus\n module Typecast\n\n # Object\n #\n class Object\n\n # Typecast given value to String\n #\n # @example\n # Virtus::Typecast::Float.to_st... | ruby | chosen |
[
{
"from": "system",
"value": "Use new rspec expectations sintax\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'tasks/gem/bump_task'\n\ndescribe Gem::BumpTask do\n describe '#task' do\n subject { Gem::BumpTask.new :major }\n\n it 'bumps the version and writes it' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs for user observer\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe UserObserver do\n\nend\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe UserObserver do\n\n describe '#before_validation' do\n let(:use... | ruby | chosen |
[
{
"from": "system",
"value": "Add failing test for index_path_to_section_index util method\n"
},
{
"from": "human",
"value": "describe \"PM::Table utils\" do\n\n before do\n @subject = TestTableScreen.new\n @subject.on_load\n @subject.update_table_data\n end\n\n it \"should convert a... | ruby | chosen |
[
{
"from": "system",
"value": "Make support app hack slightly less fragile\n"
},
{
"from": "human",
"value": "class RootController < ApplicationController\n include UserPermissionsControllerMethods\n \n before_filter :authenticate_user!\n\n def index\n @applications_and_permissions = appli... | ruby | chosen |
[
{
"from": "system",
"value": "Use lt/gt or equal to in post stream window\n"
},
{
"from": "human",
"value": "class PostStreamWindow\n def self.for(topic:, from: (topic.highest_post_number+1), order: :desc, limit: SiteSetting.babble_page_size)\n lt_or_gt = (order.to_sym == :desc) ? '<' : '>'\... | ruby | chosen |
[
{
"from": "system",
"value": "Add gemspec description to fix gem build warnings\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'polymorphic_preloader/version'\n\nGem::Specification.n... | ruby | chosen |
[
{
"from": "system",
"value": "Increase variable verboseness for clarity\n\n(ih/2π).(∂ψ/∂t) = (–h2/8π2m)∇2ψ + Vψ\n"
},
{
"from": "human",
"value": "class State\n\tattr_reader :board\n\n\tdef initialize(matrix)\n\t\t@board = matrix\n\t\t@move_order = []\n\tend\n\n\tdef [](r, c)\n\t\t@board[r, c]\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add ArrayList version of Stacks\n"
},
{
"from": "human",
"value": "require_relative 'linked_list'\n\n# Linked List Version\nclass Stack\n attr_reader :stack\n\n def initialize\n @stack = LinkedList.new\n end\n\n def top\n node = stack.get(0)\n reveal_no... | ruby | chosen |
[
{
"from": "system",
"value": "Update the gemspec with dependencies and descriptions"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'artwork/version'\n\nGem::Specification.new do |spec|... | ruby | chosen |
[
{
"from": "system",
"value": "Remove reindex reference for the moment.\n"
},
{
"from": "human",
"value": "require 'thinking_sphinx/deltas/sidekiq_delta'\n\nnamespace :thinking_sphinx do\n desc 'Lock all delta indices (Resque will not run indexer or place new jobs on the :ts_delta queue).'\n ta... | ruby | chosen |
[
{
"from": "system",
"value": "Update TigerVNC Viewer to v.1.5.0\n"
},
{
"from": "human",
"value": "cask :v1 => 'tigervnc-viewer' do\n version '1.4.3'\n sha256 'e6c2f17092456f04ccce6d923af3103f7e69123c4a0f80e37b56ee3861149cca'\n\n # bintray.com is the official download host per the vendor home... | ruby | chosen |
[
{
"from": "system",
"value": "Use File.foreach instead of interating ourselves.\n"
},
{
"from": "human",
"value": "require 'json'\nrequire 'ruby-progressbar'\nrequire 'active_support/core_ext/hash/keys'\n\nmodule MemoryAnalyzer\n class HeapAnalyzer\n module Parser\n def self.parse(file,... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.