conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add new and create actions for feedback\n"
},
{
"from": "human",
"value": "class FeedbacksController < ApplicationController\n def new\n end\n\n def create\n end\n\n def show\n end\nend\n"
},
{
"from": "gpt",
"value": "class FeedbacksController < A... | ruby | chosen |
[
{
"from": "system",
"value": "Access story image nested in story\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\ndescribe Api::StoryImagesController do\n let(:story_image) { create(:story_image) }\n let(:story) { story_image.story }\n let(:account) { story.account }\n let(:token)... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure we have an activity session.\n"
},
{
"from": "human",
"value": "class UpdateMilestonesWorker\n include Sidekiq::Worker\n\n def perform(activity_session_uid)\n return unless activity_session_uid\n activity_session = ActivitySession.find_by_uid(activ... | ruby | chosen |
[
{
"from": "system",
"value": "Add a scope for full text search\n"
},
{
"from": "human",
"value": "class Document < ActiveRecord::Base\nend\n"
},
{
"from": "gpt",
"value": "class Document < ActiveRecord::Base\n scope :full_text_search, -> (query) {\n where(\"MATCH(content) AGAINST... | ruby | chosen |
[
{
"from": "system",
"value": "Add check for length restrictions of file name and folders\n"
},
{
"from": "human",
"value": "class Cleaner\n def self.clean_folder path\n dirty_folders = []\n Dir.glob(path + \"/**\").sort.each do |file|\n if File.directory?(file)\n self.clean_fo... | ruby | chosen |
[
{
"from": "system",
"value": "Fix the gem build warnings\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = \"ohm-contrib\"\n s.version = \"2.0.1\"\n s.summary = %{A collection of decoupled drop-in modules for Ohm.}\n s.description = %{Includes a couple of core funct... | ruby | chosen |
[
{
"from": "system",
"value": "Update rubocop dependency version to 0.13.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'pronto/rubocop/version'\n\nGem::Specification.new do |s|\n s.name = 'pronto-rubocop'\n s.versi... | ruby | chosen |
[
{
"from": "system",
"value": "Update chef client to 11.16.0-1\n"
},
{
"from": "human",
"value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [ \"opscode\" ]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"11.1.3-1\"\n\n# Set ... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.0.0.1 to 0.0.1.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'data_aggregation-accumulator'\n s.version = '0.0.0.1'\n s.summary = 'Data aggregation accumulator library'... | ruby | chosen |
[
{
"from": "human",
"value": "Add solution to problem 35, circular primes.\n"
},
{
"from": "gpt",
"value": "require 'prime'\n\n# find all circular primes below a certain number \ndef p35(max)\n (collection = []).tap do\n Prime.each(max) do |p|\n digits_array = p.to_s.chars.map(&:to_i)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Tag read string correctly as UTF8"
},
{
"from": "human",
"value": "module DataRepository\n extend self\n\n def save(name, data)\n file = Tempfile.new(name)\n file.write(data)\n file.close\n FileUtils.mv(file.path, \"#{data_dir}/#{name}.json\")\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Rename to_array_of_hashes so it's clearer how it works.\n"
},
{
"from": "human",
"value": "require \"contracts\"\nrequire \"github_api\"\n\nclass HowBad::Fetcher\n include Contracts::Core\n\n Contract String, C::Any => {issues: C::Not[nil], pulls: C::Not[nil]}\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix list of redirect codes we handle\n"
},
{
"from": "human",
"value": "module HTTP\n class Redirector\n # Notifies that we reached max allowed redirect hops\n class TooManyRedirectsError < RuntimeError; end\n\n # Notifies that following redirects got into... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing negative mass assignment spec\n\n[#47720609]\n\nMdm::ModuleAction's spec was missing that it should NOT allow mass\nassignment of module_detail_id, which all the other Mdm::Module* specs\ndid have.\n"
},
{
"from": "human",
"value": "require 'spec_helper'... | ruby | chosen |
[
{
"from": "system",
"value": "Change user to current_user and role to current_role\n"
},
{
"from": "human",
"value": "class Policy\n attr_reader :user, :role\n\n def initialize(user, role, object)\n @user = user\n @role = role\n\n unless object.is_a?(Symbol)\n instance_variable_s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix last failing test, Package knows its dependencies\n"
},
{
"from": "human",
"value": "module Rip\n class Package < OpenStruct\n def to_s\n \"#{source} (#{version})\"\n end\n\n def name\n if source =~ /git/\n source.split('/').last.chomp... | ruby | chosen |
[
{
"from": "system",
"value": "Replace dots with spaces and squeeze and strip the string.\n"
},
{
"from": "human",
"value": "module Identificamex\n module Nombre\n module Mayusculas\n def mayusculas(str)\n return if str.nil?\n str\n .gsub(/[ÁÉÍÓÚÜáéíóúü]/, hash_vocal... | ruby | chosen |
[
{
"from": "system",
"value": "Set queue explicity since weird thing with AS\n"
},
{
"from": "human",
"value": "module Harness\n class Railtie < ::Rails::Railtie\n config.harness = Harness.config\n\n rake_tasks do\n load \"harness/tasks.rake\"\n end\n\n initializer \"harness.ada... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unnecessary and nonfunctional C::Optional.\n"
},
{
"from": "human",
"value": "require 'contracts'\nrequire 'github_api'\n\n##\n# Fetches data from GitHub.\nclass HowBad::Fetcher\n include Contracts::Core\n\n ##\n # Standardized representation for fetcher r... | ruby | chosen |
[
{
"from": "system",
"value": "Fix bug in Class.new when taking a block\n"
},
{
"from": "human",
"value": "class Class\n def self.new(sup = Object, &block)\n %x{\n var klass = boot_class(sup);\n klass.o$name = \"AnonClass\";\n\n make_metaclass(klass, sup.o$klass);\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Expand initialize ivars instead of using 1 line\n\nFlattening the ivars here causes them to be allocated as an array.\nThis commit expands them to avoid these extra allocations.\n\nTotal allocations before: 2913000\nTotal allocations after: 2892000\n"
},
{
"from": "hum... | ruby | chosen |
[
{
"from": "system",
"value": "Return the doc when it is a xhr request.\n"
},
{
"from": "human",
"value": "require 'rack-plastic'\nrequire 'etc'\n\nmodule Rack\n\n class Serverinfo < Plastic\n\n def change_nokogiri_doc(doc)\n return request.xhr?\n\n badge = doc.create_element 'div',... | ruby | chosen |
[
{
"from": "system",
"value": "Split compile into two methods\n"
},
{
"from": "human",
"value": "require 'forwardable'\n\nmodule Twain\n class Describer\n\n attr_reader :subject\n extend Forwardable\n\n def initialize(subject, view_template)\n @subject = subject\n @view_templa... | ruby | chosen |
[
{
"from": "system",
"value": "Create methods for game enginer for vs user and vs computer\n"
},
{
"from": "human",
"value": "$: << File.dirname(__FILE__)\n\nclass WebGameEngine\n\n attr_accessor :ttt_board\n attr_reader :player_1, :player_2, :rules\n\n def initialize(args)\n @ttt_board = a... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing quadicon definition for generic object definitions\n\nFixes https://bugzilla.redhat.com/show_bug.cgi?id=1650146\n"
},
{
"from": "human",
"value": "class GenericObjectDefinitionDecorator < MiqDecorator\n def self.fonticon\n 'fa fa-file-text-o'\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Change :style values in the example\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'tty-spinner'\n\nopts = {\n indent: 4,\n style: {\n top: \". \",\n middle: \"|--\",\n bottom: \"|__\",\n }\n}\nspinners = TTY::Spinner::Multi.new(\"[:spin... | ruby | chosen |
[
{
"from": "system",
"value": "Fix an error on quitting ruco. Windows full paths have a colon, and those were not being passed to the system correctly.\n"
},
{
"from": "human",
"value": "require \"digest/md5\"\n\nmodule Ruco\n class FileStore\n def initialize(folder, options)\n @folder =... | ruby | chosen |
[
{
"from": "human",
"value": "Add a few specs against LXC singleton methods\n"
},
{
"from": "gpt",
"value": "$:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))\n\nrequire 'test/unit'\nrequire 'lxc'\nrequire 'timeout'\n\nclass TestLXCClassMethods < Test::Unit::TestCase\n def se... | ruby | chosen |
[
{
"from": "system",
"value": "[REFACTORING] Remove obsolete frame parameter, calculate x only once\n"
},
{
"from": "human",
"value": "\nrequire 'color'\nrequire 'set/color_set'\n\nclass RainbowSet < ColorSet\n\n def initialize(length = DEFAULT_LENGTH, type = DEFAULT_TYPE)\n super(length, typ... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration for header_color and short_title\n"
},
{
"from": "gpt",
"value": "class AddHeaderColorAndShortTitleToAppContentSet < ActiveRecord::Migration\n def change\n add_column :app_content_sets, :header_color, :string\n add_column :app_content_sets, :shor... | ruby | chosen |
[
{
"from": "system",
"value": "Change rspec runner to not use BuildpackUploader\n\nRelies on shell script in shared ~/.aliases instead.\n"
},
{
"from": "human",
"value": "require 'bundler/setup'\nrequire 'machete'\n\n`mkdir -p log`\nMachete.logger = Machete::Logger.new(\"log/integration.log\")"
... | ruby | chosen |
[
{
"from": "system",
"value": "Convert id to BSON before loading\n"
},
{
"from": "human",
"value": "require 'sunspot'\nrequire 'mongoid'\nrequire 'sunspot/rails'\n\n# == Examples:\n#\n# class Post\n# include Mongoid::Document\n# field :title\n# \n# include Sunspot::Mongoid\n# searchable d... | ruby | chosen |
[
{
"from": "system",
"value": "Remove deprecation check for 'public/assets' as that's we're precompiled assets get created.\n"
},
{
"from": "human",
"value": "\n\n# check for incorect product assets path in public directory\nif File.exist?(Rails.root.join(\"public/assets/products\")) || File.exi... | ruby | chosen |
[
{
"from": "system",
"value": "Configure capybara screenshot to use correct directory and prune excess screenshots.\n"
},
{
"from": "human",
"value": "require 'capybara-screenshot/cucumber'\n"
},
{
"from": "gpt",
"value": "require 'capybara-screenshot/cucumber'\nCapybara.save_path = F... | ruby | chosen |
[
{
"from": "system",
"value": "Fix to avoid dependency upon broken super_stack (0.4)\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'stacked_config/version'\n\nGem::Specification.new ... | ruby | chosen |
[
{
"from": "system",
"value": "Add launchy as a dependency.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/railsthemes/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Railsthemes\"]\n gem.email = [\"anthony@... | ruby | chosen |
[
{
"from": "human",
"value": "Add helper to get sample schemas for use in tests\n\nThe schemas provided by these helpers are based on the \"real\" schema in\nconfig. This is more like the normal pattern of an app testing against\nthe database models it's actually using, rather than abstract potential\nmodel... | ruby | chosen |
[
{
"from": "system",
"value": "Test another type of invalid URL\n\nClose #7.\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass UrlTest < Test::Unit::TestCase\n context \".validate\" do\n should \"return true for a valid url\" do\n assert Twingly::URL.validate(\"http://blo... | ruby | chosen |
[
{
"from": "system",
"value": "Revert part of last commit\n"
},
{
"from": "human",
"value": "set :stage, :local\nset :rails_env, :production\nset :branch, :http_proxy\n\nrole :app, %w{deploy@localhost}\nrole :web, %w{deploy@localhost}\nrole :db, %w{deploy@localhost}\n\nset :ssh_options, {\n por... | ruby | chosen |
[
{
"from": "system",
"value": "Fix crash for out of bounds\n"
},
{
"from": "human",
"value": "module Fastlane\n module Actions\n class SlackTrainAction < Action\n def self.run(params)\n train_emoji = lane_context[SharedValues::SLACK_TRAIN_EMOJI]\n rail_emoji = lane_context[... | ruby | chosen |
[
{
"from": "system",
"value": "Create single item array filter code\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire_relative '../filter'\n\nrequire 'set'\n\nmodule OctocatalogDiff\n module CatalogDiff\n class Filter\n # Filter out changes in parameters when on... | ruby | chosen |
[
{
"from": "system",
"value": "Remove index only if exists\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n"
},
{
"from": "human",
"value": "class AddIdentityTable < ActiveRecord::Migration\n def up\n create_table :identities do |t|\n t.string ... | ruby | chosen |
[
{
"from": "human",
"value": "Create method that removes all dup values from array\n"
},
{
"from": "gpt",
"value": "# Pseudocode\n=begin\nINPUT: Obtain an array and duplicate_values\nCreate a empty array called dup_values\nIterate through the array object\nIterate through the duplicate_values obj... | ruby | chosen |
[
{
"from": "system",
"value": "Use a Rails controller for integration tests.\n"
},
{
"from": "human",
"value": "# This is an absolute minimal Rails application\n\nrequire 'rails'\nrequire 'action_controller/railtie'\n\nclass Dummy < Rails::Application\n config.session_store :cookie_store, :key =... | ruby | chosen |
[
{
"from": "system",
"value": "Switch app config test to move off of site_name\n\nRelated to #4415\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Spree::AppConfiguration do\n\n let (:prefs) { Rails.application.config.spree.preferences }\n\n it \"should be available from th... | ruby | chosen |
[
{
"from": "system",
"value": "Use name instead of to_s\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass TestToriDefine < Test::Unit::TestCase\n setup do\n @orig = Tori.config.filename_callback\n Tori.config.filename_callback = ->(model){\n model\n }\n Tori.conf... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.3.0.0 to 0.4.0.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'schema'\n s.summary = \"Primitives for schema and structure\"\n s.version = '0.3.0.0'\n s.description = '... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 2.2.8.0 to 2.3.0.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '2.2.8.0'\n s.descri... | ruby | chosen |
[
{
"from": "system",
"value": "Use fixed DB password so that multiple runs succeed\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nrequire 'thredded_create_app/tasks/base'\nrequire 'securerandom'\nmodule ThreddedCreateApp\n module Tasks\n class SetupDatabase < Base\n de... | ruby | chosen |
[
{
"from": "system",
"value": "Set group names on MWP subjects"
},
{
"from": "human",
"value": "require_relative 'manifest'\n\nclass MilkyWay\n include Manifest\n \n def prepare\n file_list = load_json file_named 'round_2_list.json'\n file_list.each do |file|\n _, group_name, size, ... | ruby | chosen |
[
{
"from": "system",
"value": "Update rake requirement to ~> 12.1\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.ex... | ruby | chosen |
[
{
"from": "human",
"value": "Add handler for AWS RateLimitExceeded errors\n"
},
{
"from": "gpt",
"value": "require 'aws-sdk'\nrequire 'contracts'\nrequire 'retries'\n\nmodule StackatoLKG\n module Amazon\n module Support\n module RateLimitHandler\n include ::Contracts::Core\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add homepage link to gemspec\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"setler/version\"\n\nGem::Specification.new do |s|\n s.name = \"setler\"\n s.version = Setler::VERSION\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Web: Create Jekyll plugin to generate in-page TOC data\n\nProgress on #344\n"
},
{
"from": "gpt",
"value": "# Copyright 2015 Google Inc. All rights reserved.\n#\n# Use of this source code is governed by The MIT License.\n# See the LICENSE file for details.\n\n# Jekyl... | ruby | chosen |
[
{
"from": "system",
"value": "Test if page has a link back to uploader\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"images/show\" do\n before(:each) do\n @image = assign(:image, stub_model(Image))\n end\n\n it \"renders attributes in <p>\" do\n render\n # Ru... | ruby | chosen |
[
{
"from": "system",
"value": "Add way to classify activities as high priority\n"
},
{
"from": "human",
"value": "class Activity < ApplicationRecord\n belongs_to :appointment\n belongs_to :user\n belongs_to :owner, class_name: User\n belongs_to :prior_owner, class_name: User\n belongs_to :re... | ruby | chosen |
[
{
"from": "system",
"value": "Add validators on Incident Model\n"
},
{
"from": "human",
"value": "class Incident < ActiveRecord::Base\n belongs_to :monitoring\n belongs_to :server\n\n # https://github.com/collectiveidea/audited\n # audited\n\n attr_accessible :body, :name\nend\n"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Disable strict mode of JSON::Validator\n\nStrict mode treats all properties as required, and ignores the\n`required` attribute specified in the schema. This behaviour makes it\nimpossible to have optional fields in the schema.\n\nUsing the `required` property in the schema allo... | ruby | chosen |
[
{
"from": "system",
"value": "Replace rails dependency with railties >= 3.2\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"warden/rails/version\"\n\nGem::Specification.new do |s|\n s.name = \"warden-rails\"\n s.version = Warden::Rails::V... | ruby | chosen |
[
{
"from": "human",
"value": "Add a logger helper module for jobs\n"
},
{
"from": "gpt",
"value": "require 'active_support/concern'\n\nmodule Cangaroo\n module LoggerHelper\n extend ActiveSupport::Concern\n\n def job_tags(tags = {})\n tags.merge!(job: self.class.to_s,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add methods to APplication Controller\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\nend\n"
},
{
"from": "gpt",
"value": "class ApplicationController < ActionController::B... | ruby | chosen |
[
{
"from": "system",
"value": "Add column_name options to sort in the collection table helper.\n"
},
{
"from": "human",
"value": "module Rails\n module AddOns\n module TableHelper\n def collection_table(options = {}, &block)\n Component::CollectionTable.new(self, options, &block).... | ruby | chosen |
[
{
"from": "system",
"value": "Update Synology Cloud Client to version 3423\n"
},
{
"from": "human",
"value": "cask :v1 => 'synology-cloud-station' do\n version '3317'\n sha256 'd3305b5f2b4d47cf84e18cdbdb86a58578bff396fbe4664c4c778745098a362d'\n\n url \"https://global.download.synology.com/dow... | ruby | chosen |
[
{
"from": "system",
"value": "Add GitHub homepage to gemspec"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"arbitrary_mock/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add spec for main github client.\n"
},
{
"from": "human",
"value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\ndescribe Github do\n pending\nend\n"
},
{
"from": "gpt",
"value": "require File.expand_path(File.dirname(__FILE__) +... | ruby | chosen |
[
{
"from": "system",
"value": "Fix simplecov to cover the gem code, not the spec code\n"
},
{
"from": "human",
"value": "require 'linkedin2'\n\nrequire 'rspec'\nrequire 'vcr'\nrequire 'pry'\nrequire 'byebug'\nrequire 'simplecov'\n\nSimpleCov.start do\n add_group 'API', 'lib/linkedin/api'\nend\n\... | ruby | chosen |
[
{
"from": "system",
"value": "Enable Rails perform_caching to fix upstream spec.\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler/setup'\n\nrequire 'combustion'\nrequire 'cashier'\nrequire 'redis'\nrequire 'dalli'\n\nCombustion.initialize! :all\n\nrequire 'rspec/rails'\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update simplecov with post 1.0 config\n"
},
{
"from": "human",
"value": "require 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'hashid/rails'\n\nActiveRecord::Base.establish_connec... | ruby | chosen |
[
{
"from": "system",
"value": "Add helper for status setting.\n"
},
{
"from": "human",
"value": "require 'rubygems'\n\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nrequire 'rspec'\nrequire 'rack/test'\nrequire 'rack/policy'\n\nm... | ruby | chosen |
[
{
"from": "system",
"value": "FIX remove :all options for specs silent CLI config\n"
},
{
"from": "human",
"value": "require 'pry'\nrequire 'ripper'\nrequire 'fakefs/spec_helpers'\n\n# silence CLI output\nRSpec.configure do |config|\n original_stderr = $stderr\n original_stdout = $stdout\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Write spec for expire_token method\n"
},
{
"from": "human",
"value": "describe Tiddle do\n\n describe \"create_and_return_token\" do\n\n before do\n @user = User.create!(email: \"test@example.com\", password: \"12345678\")\n end\n\n it \"returns strin... | ruby | chosen |
[
{
"from": "human",
"value": "Add FindVeterans class and GitHub API call methods\n"
},
{
"from": "gpt",
"value": "require 'httparty'\n\nclass FindVeterans\n include HTTParty\n base_uri 'https://api.github.com'\n\n # Find the first 10 users on GitHub whose location starts with \"New York\"\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Allow Ruby 2.2.2+ to use ActiveSupport 5+\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'foreplay/version'\n\nGem::Specification.new do |s|\n s.name = 'forepl... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 0.7.1.2 to 0.7.1.3\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '0.7.1.2'\n s.descri... | ruby | chosen |
[
{
"from": "system",
"value": "Fix | in title when no title\n"
},
{
"from": "human",
"value": "module Georgia\n module MetaTagsHelper\n\n def meta_title title\n site_title = \"\"\n site_title << \"#{title} | \" if title\n site_title << Georgia.title\n content_tag :title, s... | ruby | chosen |
[
{
"from": "system",
"value": "Modify dashboard index to show only curent users contacts\n"
},
{
"from": "human",
"value": "class DashboardController < ApplicationController\n def index\n if current_user\n @user = current_user\n @appointment = Appointment.new\n @appointments_by... | ruby | chosen |
[
{
"from": "system",
"value": "Remove user variable from edit actions fo resources.\n"
},
{
"from": "human",
"value": "class ResourcesController < ApplicationController\n before_action :set_resource, only: [:show, :edit, :update, :destroy]\n\n def index\n end\n\n def new\n @user = current_... | ruby | chosen |
[
{
"from": "system",
"value": "Allow description in waypoint parameters\n"
},
{
"from": "human",
"value": "class WaypointsController < ApiController\n before_action :authenticate_user!\n before_action :set_tour\n\n def create\n waypoint = @tour.waypoints.new(waypoint_params)\n waypoint.p... | ruby | chosen |
[
{
"from": "system",
"value": "Send MYC session header to the application\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nmodule MultiYearChartsHelper\n # Public: The full URL to the Multi-Year Charts application for an instance of\n # MultiYearCharts.\n #\n # Returns a stri... | ruby | chosen |
[
{
"from": "system",
"value": "Simplify methods by decomposing them, and use really explicit method names\n"
},
{
"from": "human",
"value": "require \"latent_object_detector/version\"\n\nmodule LatentObjectDetector\n class Detector\n attr_accessor :klass\n\n def self.for(klass)\n new(... | ruby | chosen |
[
{
"from": "system",
"value": "Fix place editions - displaying the results\n\nThe JS which filled in the results was getting an error page instead\nof JSON, so would error.\n"
},
{
"from": "human",
"value": "class PublicationPresenter\n include GdsApi::PartMethods\n\n attr_reader :artefact\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to use README.md not README.rdoc\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"flair/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.ne... | ruby | chosen |
[
{
"from": "system",
"value": "Disable reverse lookup, speed up linux; DUH!\n"
},
{
"from": "human",
"value": "module Specjour\n module SocketHelper\n def ip_from_hostname(hostname)\n Socket.getaddrinfo(hostname, nil, Socket::AF_INET, Socket::SOCK_STREAM).first.fetch(3)\n end\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Raise if no reservation is configured in data bag\n"
},
{
"from": "human",
"value": "module PortReservation\n extend Chef::DSL::DataQuery\n\n class << self\n def for(type)\n reservations[type]\n end\n\n def reservations\n @reservations ||= data_... | ruby | chosen |
[
{
"from": "system",
"value": "Update rake requirement from ~> 12.3.2 to ~> 13.0.0\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\... | ruby | chosen |
[
{
"from": "human",
"value": "Add Spec for Version11 Api\n\nAdd a spec to test the Version11 Api.\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\ndescribe ManageEngine::AppManager::Api::Version11 do\n subject { ManageEngine::AppManager::Api.new(\"11\") }\n\n it \"returns the connect_p... | ruby | chosen |
[
{
"from": "human",
"value": "Add a spec for multi-adapter repo :boom: :tada: :boom:\n"
},
{
"from": "gpt",
"value": "RSpec.describe 'Repository with multi-adapters setup' do\n include_context 'database'\n\n let(:rom) { ROM.env }\n\n let(:users) { rom.relation(:users) }\n let(:tasks) { rom.re... | ruby | chosen |
[
{
"from": "system",
"value": "Add FakeLogger to specs helper\n"
},
{
"from": "human",
"value": "ENV['RACK_ENV'] = 'test'\nrequire_relative \"../lib/raygun.rb\"\nrequire \"minitest/autorun\"\nrequire \"minitest/pride\"\nrequire \"fakeweb\"\nrequire \"timecop\"\nrequire \"mocha/mini_test\"\nrequir... | ruby | chosen |
[
{
"from": "system",
"value": "Use HasAccountsController for People dummy spec controller.\n"
},
{
"from": "human",
"value": "class PeopleController < AuthorizedController\n def index\n set_collection_ivar resource_class.search(\n params[:by_text],\n :star => true,\n :page => p... | ruby | chosen |
[
{
"from": "system",
"value": "Move app spec setup from before :all to :each\n"
},
{
"from": "human",
"value": "require 'hyperloop'\n\ndescribe Hyperloop::Application do\n before :all do\n @root = 'spec/fixtures/simple/'\n end\n\n it 'finds the index view' do\n app = Hyperloop::Applicati... | ruby | chosen |
[
{
"from": "system",
"value": "Use the updated monit conf directory"
},
{
"from": "human",
"value": "template \"/etc/monit.d/elasticsearch-monit.conf\" do\n source \"elasticsearch.monitrc.conf.erb\"\n mode 0440\n owner \"root\"\n group \"root\"\nend"
},
{
"from": "gpt",
"value": "... | ruby | chosen |
[
{
"from": "system",
"value": "Remove redundant field name from error\n"
},
{
"from": "human",
"value": "name :bsa\nrequire_helpers :get_field_as_float\n\nexecute do\n weight = get_field_as_float :weight_in_kg\n height = get_field_as_float :height_in_m\n\n raise FieldError.new('weight', 'weigh... | ruby | chosen |
[
{
"from": "system",
"value": "Add deprecation warning on country object.\n"
},
{
"from": "human",
"value": "require 'countries/version'\n\nrequire 'iso3166'\nrequire 'countries/mongoid' if defined?(Mongoid)\n\nclass Country < ISO3166::Country\n def to_s\n name\n end\nend\n"
},
{
"fr... | ruby | chosen |
[
{
"from": "system",
"value": "Add a tracker for legacy encryption scheme.\n"
},
{
"from": "human",
"value": "require 'zmarshal'\n\nclass Encryptor\n def initialize(key)\n @encryptors = [ActiveSupport::MessageEncryptor.new(key, serializer: ZMarshal), ActiveSupport::MessageEncryptor.new(key)]\... | ruby | chosen |
[
{
"from": "human",
"value": "Add cask for Daisydisk Beta\n\nCloses #946.\n"
},
{
"from": "gpt",
"value": "cask :v1 => 'daisydisk-beta' do\n version :latest\n sha256 :no_check\n\n url 'http://daisydiskapp.com/downloads/DaisyDiskBeta.zip'\n appcast 'http://www.daisydiskapp.com/downloads/appcas... | ruby | chosen |
[
{
"from": "system",
"value": "Update PCKeyboardHack to version 10.2.0\n"
},
{
"from": "human",
"value": "class Pckeyboardhack < Cask\n url 'https://pqrs.org/macosx/keyremap4macbook/files/PCKeyboardHack-10.0.0.dmg'\n homepage 'https://pqrs.org/macosx/keyremap4macbook/pckeyboardhack.html.en'\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use require relative not require\n"
},
{
"from": "human",
"value": "module ContentManager\n module ClassResolution\n\n def self.content_class(name)\n content_class_name(name).constantize\n end\n\n def self.content_class_name(class_name)\n klass =... | ruby | chosen |
[
{
"from": "system",
"value": "Use the generic llvm-config for library detection\n"
},
{
"from": "human",
"value": "require 'rbconfig'\nrequire 'mkmf'\n\n# This is pretty terrible, but we need to have the environment set up\n# before we require the ffi-clang module.\n\nmodule LibDetect\n\n DARWI... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task to calculate cached voted score\n\nRun this task it's only necessary if already existing legislation proposals in DB.\n"
},
{
"from": "gpt",
"value": "namespace :legislation_proposals do\n desc \"Calculate cached votes score for existing legislation pr... | ruby | chosen |
[
{
"from": "system",
"value": "Handle case where _at field is already a time\n"
},
{
"from": "human",
"value": "module Inkling\n module AttributeInitialization\n \n def initialize_attributes(attributes = {})\n attributes.each do |key, val|\n if respond_to?(\"#{key}=\")\n ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.