conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Change to handle versionnumbers abbove 10\n"
},
{
"from": "human",
"value": "Facter.add(:iis_version) do\n confine :kernel => :windows\n setcode do\n\tversion = nil\n\trequire 'win32/registry'\n\tbegin\n\tWin32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\\Microso... | ruby | chosen |
[
{
"from": "system",
"value": "Add explicit requires to fact\n"
},
{
"from": "human",
"value": "# Netbios names are limited to 15 chars and must be unique. We can't use\n# $hostname or $fqdn because these may be non-unique when truncated. Instead\n# we use the first 9 alphanumeric chars of the ho... | ruby | chosen |
[
{
"from": "system",
"value": "Use underscore instead of downcase\n"
},
{
"from": "human",
"value": "module ActiveTsv\n module Reflection\n def has_many(name)\n class_eval <<-CODE, __FILE__, __LINE__ + 1\n def #{name}\n #{name.to_s.singularize.classify}.where(\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Switch from Null Session to Exception for CSRF Protection\n\nThere are apparently some vulnerabilities to session \nnulling, depending on how one uses before_action. Not using before_action in vulnerable ways right now, but \nsince I will undoubtedly forget this in the future I... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor: Use hash rocket abbr and Rubyish String comparison\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n before_action :store_location , :unless=> :login_page_access?\n\n # Prevent CSRF attacks by raising an exception.... | ruby | chosen |
[
{
"from": "system",
"value": "Copy BaseAttachmentsController methods into CsvPreviewController\n\nI think these are the only two methods in BaseAttachmentsController\nwhich need access to the filesystem. I'm hoping to implement them in a\ndifferent way to avoid needing this access.\n"
},
{
"from": "... | ruby | chosen |
[
{
"from": "human",
"value": "Add useful methods to Hash & Array\n\nHash.map returns an Array, so add Hash.hamp to return a Hash\nAdd Array.interpolate & Hash.interpolate to centralise comprehensive methods\nto interpolate data into those structures E.g. job context.\n"
},
{
"from": "gpt",
"value... | ruby | chosen |
[
{
"from": "system",
"value": "Rename and organise methods for clarity\n"
},
{
"from": "human",
"value": "module PansophyAuthenticator\n module Configuration\n class Configurator\n attr_accessor :local, :bucket_name, :file_path, :configuration_path, :application\n attr_writer :cache... | ruby | chosen |
[
{
"from": "system",
"value": "Remove the list creating outside of the benchmark code.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\nroot_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))\nlib_dir = File.join(root_dir,'lib')\n$LOAD_PATH << lib_dir unless $LOAD_PATH.includ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix unicode symbol on windows.\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule TTY\n class Prompt\n # Cross platform common Unicode symbols.\n #\n # @api public\n module Symbols\n KEYS = {\n tick: '✓',\n cross: '✘',\n ... | ruby | chosen |
[
{
"from": "human",
"value": "ADD - get column widths\n"
},
{
"from": "gpt",
"value": "def extract_values line\n\tspaces = []\n\tresult = []\n\n\twhile result != nil do\n\t\t\n\t\tif spaces.length==0\n\t\t\tline=line[0,line.length]\n\t\telse\t\n\t\t\tline=line[spaces.last+1,line.length]\n\t\tend\... | ruby | chosen |
[
{
"from": "system",
"value": "guests/debian: Set hostname to short value\n\nRefs GH-7488"
},
{
"from": "human",
"value": "module VagrantPlugins\n module GuestDebian\n module Cap\n class ChangeHostName\n # For more information, please see:\n #\n # https://wiki.debi... | ruby | chosen |
[
{
"from": "system",
"value": "Use yield instead of block.call with &block arguments\n\nThis yields us a little performance improvement (see https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode)"
},
{
"from": "human",
"value": "module Dry\n class Matcher\n class... | ruby | chosen |
[
{
"from": "system",
"value": "[refinery] Make refinery user's forem_admin? key off of refinery roles.\n"
},
{
"from": "human",
"value": "module Forem\n module UserExtensions\n def self.included(base)\n Forem::Topic.belongs_to :user, :class_name => base.to_s \n Forem::Post.belongs_t... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary require in the main module\n"
},
{
"from": "human",
"value": "# Lightspeed Restaurant Ruby Bindings\n# API spec at http://staging-exact-integration.posios.com/PosServer/swagger-ui.html\n\nrequire 'rest-client'\nrequire 'json'\n\n#\n# Version... | ruby | chosen |
[
{
"from": "system",
"value": "Update HTTP_ACCEPT for jquery.iframe-transport update\n\nChange params['X-Http-Accept'] with params['X-HTTP-Accept']"
},
{
"from": "human",
"value": "module Remotipart\n\n # A middleware to look for our form parameters and\n # encourage Rails to respond with the r... | ruby | chosen |
[
{
"from": "system",
"value": "Destroy existing cached assets if they exist.\n"
},
{
"from": "human",
"value": "namespace :cached_assets do \n desc \"Regenerate aggregate/cached files\"\n task :regenerate => :environment do\n include ActionView::Helpers::TagHelper\n include ActionView::H... | ruby | chosen |
[
{
"from": "system",
"value": "Use unix sockets, not IPv4, for the dummy DB configuration.\n\nBy default, we trust local unix socket connections[1], but not\n127.0.0.1 or ::1. Therefore, we should use unix sockets for the rake task\nthat ensures we don't try to connect using a badly configured\ndatabase UR... | ruby | chosen |
[
{
"from": "system",
"value": "Change cookie serialiser to hybrid to prepare for switch to json\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Specify a serializer for the signed and encrypted cookie jars.\n# Valid options are :json, :marshal, ... | ruby | chosen |
[
{
"from": "system",
"value": "[aphrodite] Send id for documents in search\n"
},
{
"from": "human",
"value": "collection @results\nattributes :title, :original_filename, :document_id, :num, :text, :created_at, :counters, :highlight"
},
{
"from": "gpt",
"value": "collection @results\na... | ruby | chosen |
[
{
"from": "system",
"value": "Fix events retrieval for GobiertoPeople welcome controller\n"
},
{
"from": "human",
"value": "module GobiertoPeople\n class WelcomeController < GobiertoPeople::ApplicationController\n include PoliticalGroupsHelper\n\n def index\n @people = current_site.p... | ruby | chosen |
[
{
"from": "system",
"value": "Update strong parameters for UserModuleAssessment\n\nRails 5.1 has a new feature for supporting arbitrary hashes that we'll\nbe using to permit the selected_answer_choices for an assessment.\n\nhttps://github.com/rails/rails/commit/e86524c0c5a26ceec92895c830d1355ae47a7034\n"
... | ruby | chosen |
[
{
"from": "system",
"value": "Change the login method to handle variable numbers of args\n"
},
{
"from": "human",
"value": "Xlogin.configure :vyos do |os|\n os.prompt(/[$#] (?:\\e\\[K)?\\z/n)\n\n os.bind(:login) do |username, password|\n waitfor(/login:\\s/) && puts(username)\n waitfo... | ruby | chosen |
[
{
"from": "system",
"value": "Add .pre for next release\n"
},
{
"from": "human",
"value": "module EY\n VERSION = '3.1.1'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.6.1'\nend\n"
},
{
"from": "gpt",
"value": "module EY\n VERSION = '3.1.2.pre'\n ENG... | ruby | chosen |
[
{
"from": "system",
"value": "Fix calling to setter method\n"
},
{
"from": "human",
"value": "module Fabrication\n module Config\n extend self\n\n def configure; yield self end\n\n def reset_defaults\n @fabricator_path =\n @path_prefix =\n @sequence_start =\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Convert the response to string before passing it to the superclass\n"
},
{
"from": "human",
"value": "module Frankie\n class Request < Rack::Request\n end\n\n class Response < Rack::Response\n attr_reader :raw_body\n\n def initialize body=[], status=200, he... | ruby | chosen |
[
{
"from": "system",
"value": "Add twitter API KEY and sceret\n"
},
{
"from": "human",
"value": "Rails.application.config.middleware.use OmniAuth::Builder do\n if ENV['CONSUMER_KEY'].blank? || ENV['CONSUMER_SECRET'].blank?\n warn '*' * 80\n warn 'WARNING: Missing consumer key or secret. Fi... | ruby | chosen |
[
{
"from": "system",
"value": "Fix country code for sweden\n"
},
{
"from": "human",
"value": "require \"kupong_integration/version\"\n\nmodule KupongIntegration\n # Your code goes here...\nend\n"
},
{
"from": "gpt",
"value": "require 'kupong_integration/version'\nrequire 'kupong_inte... | ruby | chosen |
[
{
"from": "system",
"value": "Remove one more bad ref, tests pass in-memory.\n"
},
{
"from": "human",
"value": "require 'seam'\nrequire \"seam/active_record/version\"\nrequire 'moped'\nrequire 'subtle'\n\nmodule Seam\n module ActiveRecord\n end\nend\n\n"
},
{
"from": "gpt",
"value"... | ruby | chosen |
[
{
"from": "system",
"value": "Remove require for unexistant mocksource\n"
},
{
"from": "human",
"value": "require 'redis'\nrequire 'liquid'\nrequire 'maruku'\nrequire 'mime/types'\nrequire 'pathname'\nrequire 'active_support/core_ext'\n\nrequire_relative \"blimp/source\"\nrequire_relative \"blim... | ruby | chosen |
[
{
"from": "human",
"value": "Create a task for the monthly aggregation\n"
},
{
"from": "gpt",
"value": "require_relative '../statistics.rb'\n\nnamespace :statistics do\n desc '月次のイベント履歴を集計します'\n task :aggregation, [:yyyymm] => :environment do |tasks, args|\n date = Time.current.prev_month.b... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we're setting up the machine when we provision\n"
},
{
"from": "human",
"value": "begin\n require 'vagrant'\nrescue LoadError\n abort 'vagrant-soa must be loaded in a Vagrant environment.'\nend\n\n\nmodule VagrantPlugins\n module Soa\n class Plugin <... | ruby | chosen |
[
{
"from": "system",
"value": "Use Lexicon instead of Word\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'forwardable'\n\nrequire 'myaso/version'\nrequire 'myaso/pi_table'\nrequire 'myaso/ngrams'\nrequire 'myaso/tagger'\nrequire 'myaso/tagger/model'\n\n# The UnknownWord exceptio... | ruby | chosen |
[
{
"from": "system",
"value": "Allow empty puts in OutputFile\n"
},
{
"from": "human",
"value": "require 'fileutils'\nmodule Xdrgen\n class OutputFile\n SPACES_PER_INDENT = 2\n\n def initialize(output, path)\n @output = output\n @path = path\n @current_inde... | ruby | chosen |
[
{
"from": "system",
"value": "Update calling pattern for greater ease of communication"
},
{
"from": "human",
"value": "require_relative 'listener'\nrequire_relative 'message'\n\nmodule Slacker\n class Robot\n attr_reader :name\n\n def initialize(name)\n @name, @listeners, @adapter =... | ruby | chosen |
[
{
"from": "system",
"value": "Send specialist sectors to Rummager for Manuals\n\nIn order to list Manuals on Topic pages for Specialist Sectors we need\nto send these to Rummager. We do this by pulling out the Specialist\nSector tags when formatting the Manual for indexing and merging it into\nthe `indexabl... | ruby | chosen |
[
{
"from": "human",
"value": "Add Unity Android Build Support 5.3.1f1\n"
},
{
"from": "gpt",
"value": "cask 'unity-android-support-for-editor' do\n version '5.3.1f1'\n sha256 'c805d5ea4bf3ab089909427bc1ba6af82e05fd04cac832b3f154f27821b6d54a'\n\n url \"http://netstorage.unity3d.com/unity/cc9cbb... | ruby | chosen |
[
{
"from": "system",
"value": "Add minitest to development dependencies\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"whenever/version\"\n\nGem::Specification.new do |s|\n s.name = \"whenever\"\n s.version = Wh... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up quantal64 rootfs after building box\n"
},
{
"from": "human",
"value": "namespace :boxes do\n namespace :quantal64 do\n desc 'Build Ubuntu Quantal 64 bits Vagrant LXC box'\n task :build do\n if File.exists?('./boxes/output/lxc-quantal64.box')\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add wrapped class name for sidekiq web interface"
},
{
"from": "human",
"value": "require 'sidekiq'\n\nmodule ActiveJob\n module QueueAdapters\n class SidekiqAdapter\n class << self\n def enqueue(job)\n #Sidekiq::Client does not support symb... | ruby | chosen |
[
{
"from": "system",
"value": "Fix up constant value extraction\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nmodule GObjectIntrospection\n # Wraps a GIConstantInfo struct; represents a constant.\n class IConstantInfo < IBaseInfo\n TYPE_TAG_TO_UNION_MEMBER = {\n gboo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix generator source_root, so migrations get copied over correctly."
},
{
"from": "human",
"value": "class RefinerycmsPodcasts < Refinery::Generators::EngineInstaller\n\n source_root File.expand_path('../../', __FILE__)\n engine_name \"podcasts\"\n\nend\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Fix wrong attribute name in CleanDirtyQueryNode\n"
},
{
"from": "human",
"value": "require 'whatsapp/protocol/node'\nrequire 'whatsapp/protocol/nodes/category_node'\n\nmodule WhatsApp\n module Protocol\n\n class CleanDirtyQueryNode < Node\n\n def initialize... | ruby | chosen |
[
{
"from": "system",
"value": "Fix pod spec to include the resources\n\nI missed the xib files and bundle in the original pod spec. This commit fixes that issue\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'NeoveraColorPicker'\n s.version = '1.0'\n s.summary = 'Neovera Co... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration to generate proper SQL\n\n(ActionItem1733)\n"
},
{
"from": "human",
"value": "class RemovePublishedArticles < ActiveRecord::Migration\n def self.up\n select_all(\"SELECT * from articles WHERE type = 'PublishedArticle'\").each do |published|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless PDF mime-type registration\n\nSigned-off-by: Tommaso Visconti <be60654a2ce5335d5724f2c9dcbf232b965b889e@gmail.com>\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Add new mime types for use in respon... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec file(Version number to 0.0.9).\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"CMRefresh\"\n s.version = \"0.0.8\"\n s.summary = \"Some util refresh categories for UIScrollView and it's subclasses.\"\n s.desc... | ruby | chosen |
[
{
"from": "human",
"value": "Add podspec for version 1.0.0\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = \"CMSignals\"\n s.version = \"1.0.0\"\n s.summary = \"Qt Signals and Slots clone to Objective-C.\"\n s.homepage = \"https://github.com/edgurgel/CM... | ruby | chosen |
[
{
"from": "system",
"value": "Fix a link of the cursor position is not display\n"
},
{
"from": "human",
"value": "require \"curses\"\n\nmodule Feedcellar\n module CursesView\n module_function\n def run(feeds)\n Curses.init_screen\n Curses.noecho\n Curses.nonl\n\n # TOD... | ruby | chosen |
[
{
"from": "system",
"value": "Make the consumer in Tutorial 1 wait for messages until interrupted\n\nJust like the Java version does.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nrequire \"bunny\"\n\nconn = Bunny.new\nconn.start\n\nch = conn.create_channel\nq ... | ruby | chosen |
[
{
"from": "system",
"value": "Change add_check and remove_check signatures\n"
},
{
"from": "human",
"value": "module Postgresql\n module Check\n module Table\n def check(column, condition = nil)\n @base.add_check(@table_name, column, condition)\n end\n\n def remove_chec... | ruby | chosen |
[
{
"from": "system",
"value": "Remove redundant attr_accessor for :requests_manifest\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\nmodule ResponseMate\n class Recorder\n include ResponseMate::ManifestParser\n\n attr_accessor :base_url, :conn, :requests_manifest, :manifest, :oauth, ... | ruby | chosen |
[
{
"from": "system",
"value": "Set pods deployment target back to 8\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"SwiftCharts\"\n s.version = \"0.5.1\"\n s.summary = \"Easy to use and highly customizable charts library for iOS\"\n s.homepage = \"https://github.com/i-sch... | ruby | chosen |
[
{
"from": "system",
"value": "Rename current subscription to active subscription\n"
},
{
"from": "human",
"value": "module SubscriptionFu\n module Models\n def self.included(base)\n base.send(:extend, ClassMethods)\n end\n\n module ClassMethods\n def needs_subscription\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Put a license into 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 'morpher_inflecter/version'\n\nGem::Specification.new do |gem|\n ge... | ruby | chosen |
[
{
"from": "system",
"value": "Add limit change for 'data' column in 'events' when using MySQL\n"
},
{
"from": "human",
"value": "class LimitsToMysql < ActiveRecord::Migration\n def up\n return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/\n\n change_column :me... | ruby | chosen |
[
{
"from": "system",
"value": "Add foreign key to fitness professional profile table\n"
},
{
"from": "human",
"value": "class CreateFitnessProfessionalProfiles < ActiveRecord::Migration\n def change\n create_table :fitness_professional_profiles do |t|\n t.string :ethnicity\n t.strin... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for products having many categories\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe Product, type: :model do\n product = Product.create(name: 'Widget')\n\n it 'creates successfully' do\n expect(product).to be_truthy\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade Android Studio.app to v1.2.0.12\n"
},
{
"from": "human",
"value": "cask :v1 => 'android-studio' do\n version '1.1.0'\n sha256 '7d31edf46f57c2be12e228fbdb2344c0fb3a4e3fc07b692ec05156c575ef7a61'\n\n # google.com is the official download host per the vendor ... | ruby | chosen |
[
{
"from": "system",
"value": "Add context for merging potentially conflicting tests\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'rundeck' do\n context 'supported operating systems' do\n ['Debian','RedHat'].each do |osfamily|\n describe \"rundeck class without an... | ruby | chosen |
[
{
"from": "system",
"value": "Update OmniFocus Beta to version 2.3.x-r247728\n\nThis commit updates the version and sha256 stanzas.\n"
},
{
"from": "human",
"value": "cask :v1 => 'omnifocus-beta' do\n version '2.3.x-r245365'\n sha256 'd601cc7585c2a8c9127e3ca8ac1ac00afb64e63d643ca40491acc0d7967... | ruby | chosen |
[
{
"from": "human",
"value": "Add The Unarchiver - a free replacement for Archive Utiliy.app\n"
},
{
"from": "gpt",
"value": "class TheUnarchiver < Cask\n url 'http://theunarchiver.googlecode.com/files/TheUnarchiver3.3.zip'\n homepage 'http://unarchiver.c3.cx/'\n version '3.3'\nend"
}
] | ruby | chosen |
[
{
"from": "system",
"value": "Fix erroneous search/replace in migration\n"
},
{
"from": "human",
"value": "class RenameresourceToResource < ActiveRecord::Migration\n def change\n rename_table :resources, :resources\n end\nend\n"
},
{
"from": "gpt",
"value": "class RenameBookable... | ruby | chosen |
[
{
"from": "system",
"value": "Use SQL for all the things"
},
{
"from": "human",
"value": "class DefaultValueForTaskBody < ActiveRecord::Migration\n def up\n execute \"ALTER TABLE tasks ALTER COLUMN body SET DEFAULT '[]'::JSON\"\n Task.where(body: nil).update_all(body: '[]')\n change_co... | ruby | chosen |
[
{
"from": "system",
"value": "Fix appfog spec about the directory's basename\n\nThis fixes #154\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'dpl/provider/appfog'\n\ndescribe DPL::Provider::Appfog do\n subject :provider do\n described_class.new(DummyContext.new, :email =... | ruby | chosen |
[
{
"from": "system",
"value": "Fix accidental Ruby 1.9 Hash syntax\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Rpub::Epub::Cover do\n let(:book) { double('book', config: double('config', :cover_image => 'cover.jpg', :title => 'title')) }\n let(:subject) { described_c... | ruby | chosen |
[
{
"from": "system",
"value": "Remove comment refering to old spree upgrade\n"
},
{
"from": "human",
"value": "module OpenFoodNetwork\n module EmailHelper\n # Some specs trigger actions that send emails, for example creating an order.\n # But sending emails doesn't work out-of-the-box. Thi... | ruby | chosen |
[
{
"from": "system",
"value": "Remove standard helpers from integration tests\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nrequire File.expand_path('../../test_helper', __FILE__)\nrequire File.expand_path('../../test_integration_helper', __FILE__)\n\nclass InstallationTest < MiniTest::... | ruby | chosen |
[
{
"from": "system",
"value": "Correct spec metadata for explicit coverage\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe AUOM,'.try_convert' do\n subject { object.try_convert(value) }\n\n let(:object) { AUOM::Unit }\n\n context 'with unit' do\n let(:value) { AUOM::Uni... | ruby | chosen |
[
{
"from": "system",
"value": "Make Authentication.login input recognition more robust"
},
{
"from": "human",
"value": "module TwentyfourSevenOffice\n module Services\n class Authentication < Service\n wsdl \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\"\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix admin users list when user has no org\n"
},
{
"from": "human",
"value": "class Admin::UsersController < Admin::BaseController\n before_filter :load_user, only: [:show, :edit, :update]\n\n def index\n @users = User.with_translations_for(:organisation).sort_b... | ruby | chosen |
[
{
"from": "system",
"value": "Replace ENV['REQUEST_PATH'] with path to make it work in production too.\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n\n before_filter :prepare_nav\n before_filter :update_sanitized_params, if: :devise_controller?\n\n r... | ruby | chosen |
[
{
"from": "system",
"value": "Add redirect method after sign in\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n before_action :configure_permitted_parameters, if: :devise_controller?\n\n private\n\n # def after... | ruby | chosen |
[
{
"from": "system",
"value": "Enable the rack mini profiler in production\n\n* Use the ?rmp=1 query parameter to enable it.\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to us... | ruby | chosen |
[
{
"from": "system",
"value": "Fix two way friendships ;)\n"
},
{
"from": "human",
"value": "class FriendshipsController < ApplicationController\n def create\n current_user = User.find(params[:current_user])\n @user = User.find(params[:id])\n current_user.friends << @user\n redirect_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for Combustion's generated rackup file.\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler'\n\nBundler.require :default, :development\n\nCombustion.initialize!\nrun Combustion::Application\n"
},
{
"from": "gpt",
"value": "require... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor: Clean up DetermineOutdatedness stage a bit more\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule Nanoc::Int::Compiler::Stages\n class DetermineOutdatedness\n include Nanoc::Int::ContractsSupport\n\n def initialize(reps:, ou... | ruby | chosen |
[
{
"from": "system",
"value": "Make RSS feeds use the right URL\n"
},
{
"from": "human",
"value": "xml.instruct! :xml, version: '1.0'\nxml.feed xmlns: 'http://www.w3.org/2005/Atom' do\n xml.id category_feed_url(@category)\n xml.title \"New Questions - #{@category.name} - #{SiteSetting['SiteName... | ruby | chosen |
[
{
"from": "system",
"value": "Remove refernce to cloc table\n"
},
{
"from": "human",
"value": "require 'flounder'\nrequire 'data_objects'\n\n# Handle DB options.\n#\noptions = {}\nuri = DataObjects::URI::parse(ENV['DATABASE_URL'])\n[:host, :port, :user, :password].each do |key|\n val = uri.send... | ruby | chosen |
[
{
"from": "system",
"value": "Change root to map/query page\n"
},
{
"from": "human",
"value": "Rails.application.routes.draw do\n\n resources :rentals\n get 'rentals/my_rentals', to: 'rentals#my_rentals'\n post 'preview', to: 'rentals#preview'\n\n get 'hello_world', to: 'hello_world#index'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add route to edit any page by visiting /page/edit\n"
},
{
"from": "human",
"value": "Forest::Engine.routes.draw do\n # Concerns\n concern :paginatable do\n get '(page/:page)', action: :index, on: :collection\n end\n\n # Root\n root to: 'public#index'\n\n # ... | ruby | chosen |
[
{
"from": "human",
"value": "Enable request forgery protection for features\n\nBulk edit without js has been broken for a few months due to a missing\nauthenticity_token, and we didn't notice. This change will mean that\nfeatures should fail if we do this again.\n"
},
{
"from": "gpt",
"value": "... | ruby | chosen |
[
{
"from": "system",
"value": "Document a script for creating student username CSVs by cohort\n"
},
{
"from": "human",
"value": "# This can be run in the rails console to generate a csv of all course\n# participants' usernames.\n\nrequire 'csv'\n\nusernames = User.joins(:courses_users).uniq.pluck... | ruby | chosen |
[
{
"from": "system",
"value": "Update homepage to repository URL.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'repo_man/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix getting mac address from the driver.\n"
},
{
"from": "human",
"value": "require 'vagrant/util/template_renderer'\n\nmodule VagrantPlugins\n module HyperV\n module Action\n class PackageVagrantfile\n # For TemplateRenderer\n include Vagrant... | ruby | chosen |
[
{
"from": "system",
"value": "Modify FixedSize to use NodePattern\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n module Performance\n # Do not compute the size of statically sized objects.\n class FixedSize < Cop... | ruby | chosen |
[
{
"from": "system",
"value": "Update dependency on neo4apis and bump minor version because it's easier\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib/', __FILE__)\n$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |s|\n s.name = 'neo4apis... | ruby | chosen |
[
{
"from": "system",
"value": "Fix module name so it loads correctly"
},
{
"from": "human",
"value": "module CloudKicker\n module MapBookmarking\n def add_bookmarking_functions\n add_location_to_anchor\n end\n \n private\n \n def add_location_to_anchor\n <<-JS\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add multi-arity block support to my PipeFunctions."
},
{
"from": "human",
"value": "module Pacer\n module Wrappers\n class WrappingPipeFunction\n include com.tinkerpop.pipes.PipeFunction\n\n attr_reader :block, :graph, :wrapper, :extensions, :back\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use modifier form of if statement\n"
},
{
"from": "human",
"value": "module PaperTrailScrapbook\n # Module VersionHelpers provides methods for extracting common information\n # from a version or PaperTrailScrapbook config\n module VersionHelpers\n delegate :ev... | ruby | chosen |
[
{
"from": "human",
"value": "Add script to generate autocomplete search-top-trumps.js file.\n"
},
{
"from": "gpt",
"value": "namespace :autocomplete do\n desc 'Find all the titles and formats for the slugs in autocomplete-top-trumps.csv, writes out search-top-trumps.json'\n task :build_top_tru... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests for ActiveAdmin Comment resource\n"
},
{
"from": "gpt",
"value": "require 'test_helper'\n\n#\n# == Admin namespace\n#\nmodule Admin\n #\n # == HomesController test\n #\n class PostCommentsControllerTest < ActionController::TestCase\n include Devise::... | ruby | chosen |
[
{
"from": "system",
"value": "Update Handler for Request id =nill\n"
},
{
"from": "human",
"value": "require 'json'\n\nmodule Cenit\n class Handler\n\n attr_accessor :payload, :parameters, :request_id, :model\n\n def initialize(message, model=nil)\n self.payload = ::JSON.parse(... | ruby | chosen |
[
{
"from": "system",
"value": "Add helper methods to stub all folder requests\n"
},
{
"from": "human",
"value": "require \"ruby-box\"\nrequire \"webmock\"\nrequire \"ruby-box/mock/version\"\nrequire \"ruby-box/mock/folder\"\n"
},
{
"from": "gpt",
"value": "require \"ruby-box\"\nrequir... | ruby | chosen |
[
{
"from": "human",
"value": "Add JSON support file, extracted from global-web\n"
},
{
"from": "gpt",
"value": "module JsonHelpers\n def expect_json_response(path = nil)\n expect(json_response(path))\n end\n\n def expect_json(body, path = nil)\n expect(parse_json(body, path))\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update ignored file extension list\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nmodule Watnow::Config\n\n # Default constants\n FOLDER_IGNORE = %w(tmp node_modules db public log)\n FILE_EXTENSION_IGNORE = %w(tmproj)\n PATTERNS = %w(TODO FIXME)\n\n def s... | ruby | chosen |
[
{
"from": "system",
"value": "Use different constant for testing IConstantInfo.\n\nFixes issue #25.\n"
},
{
"from": "human",
"value": "require File.expand_path('../test_helper.rb', File.dirname(__FILE__))\n\ndescribe GObjectIntrospection::IConstantInfo do\n describe \"for GLib::ALLOCATOR_LIST, ... | ruby | chosen |
[
{
"from": "system",
"value": "Sort TagList tag names so tests pass\n"
},
{
"from": "human",
"value": "require 'helper'\n\nclass TestNominetCustomTagListResponse < Test::Unit::TestCase\n context 'NominetEPP::Custom::TagList' do\n setup do\n @tag_list_response = NominetEPP::Custom::TagLis... | ruby | chosen |
[
{
"from": "system",
"value": "Change something to fix Travis.\n"
},
{
"from": "human",
"value": "require File.expand_path(\"../lib/pry-vterm_aliases/version\", __FILE__)\n\nGem::Specification.new do |s|\n s.version = Pry::VTermAliases::VERSION\n s.email = [\"envygeeks@gmail.com\"]\n s.authors... | ruby | chosen |
[
{
"from": "system",
"value": "Add description and summary to gempspec\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/active_record_deprecated_finders/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jon Leighton\"]\n... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.