conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use delete_node in latest graph\n" }, { "from": "human", "value": "#!/usr/bin/ruby -w\nrequire 'rubygems'\nrequire 'graph'\nrequire 'nokogiri'\nrequire 'open-uri'\n\nuri = \"http://www.cs.hmc.edu/program/course-descriptions/\"\ndoc = Nokogiri::HTML(open(uri)...
ruby
chosen
[ { "from": "system", "value": "Fix return expression of inject block\n" }, { "from": "human", "value": "require 'pp'\n\nrequire 'cpp_samples/version'\n\nmodule CppSamples\n\tSection = Struct.new(:path, :title)\n\n\tSAMPLES_DIR = './samples'\n\n\tdef self.generate\n\t\tpp build_samples_tree(SAMPLE...
ruby
chosen
[ { "from": "human", "value": "Add Parser which extracts all doctests from a file\n" }, { "from": "gpt", "value": "module Dest\n\n class Parser\n\n EXPRESSION = /\\s*#\\s*>>\\s*(?<expression>.*)/ # Matches the beginning of an expression\n RESULT = /\\s*#\\s*=>\\s*(?<result>.*)/ # Matche...
ruby
chosen
[ { "from": "system", "value": "Remove the LocalGitRepo from the DAnger Ssytems report on CI sources\n" }, { "from": "human", "value": "module Danger\n class Systems < Runner\n self.abstract_command = true\n self.description = \"For commands related to passing information from Danger to Dan...
ruby
chosen
[ { "from": "system", "value": "Fix relative_filename for eslint linter\n" }, { "from": "human", "value": "require 'gnurr/linter'\n\nmodule Gnurr\n module Linters\n # ES/JS Linter\n class EsLinter < Linter\n def type\n :es\n end\n\n def color\n :red\n end\n...
ruby
chosen
[ { "from": "system", "value": "Upgrade syntax for using Sequel\n" }, { "from": "human", "value": "class Import < Sequel::Model\n set_dataset :resets\n one_to_many :alerts_offences\n\n plugin :timestamps\n\n def duration\n if self.updated_at\n self.updated_at - self.created_at\n els...
ruby
chosen
[ { "from": "system", "value": "Fix Gateway as a class\n" }, { "from": "human", "value": "module Net\n module SSH\n module Gateway\n VERSION = \"2.0.0\"\n end\n end\nend\n" }, { "from": "gpt", "value": "module Net\n module SSH\n class Gateway\n VERSION = \"2.0.0\"...
ruby
chosen
[ { "from": "system", "value": "Remove unused 1:1 association :remote option\n\nThis option is unused, left over from pre-1.0 Rails to internally distinguish the location of the foreign key." }, { "from": "human", "value": "# This class is inherited by the has_one and belongs_to association classe...
ruby
chosen
[ { "from": "system", "value": "Upgrade IntelliJ ultimate eap to v139.144.2\n" }, { "from": "human", "value": "class IntellijIdeaUltimateEap < Cask\n version '14-PublicPreview'\n sha256 '4995c98608506c02348b4dfc0507a6a791c9db0ee555916edfe2fef9aa2dc85a'\n\n url \"http://download.jetbrains.com/id...
ruby
chosen
[ { "from": "system", "value": "Remove argument inspection from ArgumentError." }, { "from": "human", "value": "# in Fancy we use the BlockEnvironment as Block\nBlock = Rubinius::BlockEnvironment\n\nclass Block\n define_method(\"while_true:\") do |block|\n while tmp = self.call\n block.ca...
ruby
chosen
[ { "from": "system", "value": "Use my personal email in the 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 \"pipio/version\"\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Remove unused require for non-existent MGraph::Node\n" }, { "from": "human", "value": "require 'mgraph/edge'\nrequire 'mgraph/node'\nrequire 'mgraph/vertex_edge_table'\n\nrequire 'set'\n\nmodule MGraph\n class Graph\n def initialize graph_store = VertexEdgeTable...
ruby
chosen
[ { "from": "system", "value": "Use ::Rails.root instead of Dir.pwd" }, { "from": "human", "value": "require 'pieces/rails/railtie'\nrequire 'pieces/server'\n\nmodule Pieces\n class Rails\n attr_reader :path, :force_polling\n\n def initialize(options = {})\n @path = path || Dir.pwd\n ...
ruby
chosen
[ { "from": "system", "value": "Remove config from included files in gemspec" }, { "from": "human", "value": "root = File.dirname(File.absolute_path(__FILE__))\nrequire \"#{root}/lib/freeb/version\"\n\nGem::Specification.new do |s|\n s.name = \"freeb\"\n s.version = Freeb::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Change json to format in responder types\n" }, { "from": "human", "value": "module AlterMvc::Constants\n\n VIEWABLE_ACTIONS = %w{new show edit}\n\n RESPONDER_TYPES = %w{html js json}\n\nend" }, { "from": "gpt", "value": "module AlterMvc::Constants\n\n ...
ruby
chosen
[ { "from": "system", "value": "Set deployment targets for iOS and OS X.\n\nSigned-off-by: Justin DeWind <d58224c8587ca4c648fb37249b0d2e6771601768@atomicobject.com>\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Objection'\n s.version = '0.16.0'\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Change name to make more sense\n" }, { "from": "human", "value": "module Bitflyer\n module Executions\n def self.all(options = {})\n result = Bitflyer::Net.get(\"/v1/executions\", options)\n JSON.parse(result).map do |execution|\n Bitflyer::Exec...
ruby
chosen
[ { "from": "system", "value": "Allow shipping calculators to return nil values if no service is matched.\n\nWith shipping calculators returning 0, we run the risk of choosing and charging\na cost of $0 in cases where for example spree_active_shipping has a failed rate\nquery with the carrier API. This could ...
ruby
chosen
[ { "from": "system", "value": "Remove 'kind' instance method because it is shadowed.\n\nDetails:\n* Our ActiveSupport class_attribute declaration for:kind\n creates accessors for both the class and instances.\n Instances will default to the class value, but may have its own\n set instance values... this i...
ruby
chosen
[ { "from": "human", "value": "Add completed solution for 4.2.1 Defining Variables\n" }, { "from": "gpt", "value": "#Solution Below\nfirst_name = \"Catie\"\nlast_name = \"Stallings\"\nage = 25\n\n\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not...
ruby
chosen
[ { "from": "system", "value": "Update podspec from 0.1.0 to 0.1.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Swizzlean'\n s.version = '0.1.0'\n s.summary = 'A quick and lean way to swizzle methods for your Objective-C development needs.'\n s.homepage...
ruby
chosen
[ { "from": "system", "value": "Move static method outside 'protected' section\n" }, { "from": "human", "value": "require 'symgate/error'\n\nmodule Symgate\n # base class for API types, that provides magic initialisation from hash plus\n # assignment and comparison operators\n class Type\n d...
ruby
chosen
[ { "from": "system", "value": "Fix deployment error due to missing rubocop\n\nrubocop-govuk is only a dev dependency, so this task causes an error when run in production mode:\r\n\r\n 15:32:26 *** [err :: backend-2.backend.staging.publishing.service.gov.uk] rake aborted!\r\n 15:32:26 *** [err :: backen...
ruby
chosen
[ { "from": "system", "value": "Fix for RSpec 3 Support" }, { "from": "human", "value": "module RSpec\n module Sidekiq\n module Matchers\n def have_enqueued_job *expected_arguments\n HaveEnqueuedJob.new expected_arguments\n end\n\n class HaveEnqueuedJob\n def initi...
ruby
chosen
[ { "from": "system", "value": "Disable all compressors by default, ignore missing binaries\n\nimage_optim defaults to enabling every supported binary, and therefor\nrequiring its presence. We skip_missing_workers, so that when image_optim\nstarts supporting a new one which we do not yet disable, uploads do n...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.0.0 to 0.2.0.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP ...
ruby
chosen
[ { "from": "system", "value": "Make OS X 10.10 the minimum deployment target\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Subtitler'\n s.version = '0.1.0'\n s.license = 'MIT'\n s.summary = 'Downloading subtitles in Swift'\n s.homepage = 'https://github.com/mv...
ruby
chosen
[ { "from": "system", "value": "Remove automatic `React` version detection due to inability to access external file\n" }, { "from": "human", "value": "require 'json'\n\n# Returns the version number for a package.json file\npkg_version = lambda do |dir_from_root = '', version = 'version'|\n path =...
ruby
chosen
[ { "from": "system", "value": "Add edit of my peer 5.2 pad\n" }, { "from": "human", "value": "# Pad an Array\n\n# I worked on this challenge [by myself, with: ]\n\n# I spent [] hours on this challenge.\n\n\n# Complete each step below according to the challenge directions and\n# include it in this...
ruby
chosen
[ { "from": "human", "value": "Add rake tasks for fetch cafetera data\n" }, { "from": "gpt", "value": "namespace :om do\n desc \"Fetch data for all cafeterias\"\n task :fetch => :environment do\n Cafeteria.all.each do |cafeteria|\n cafeteria.fetch\n end\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Remove integrations tests for module snd_bcm2835\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n" }, { "from": "human", "value": "Specinfra::Runner.run_command('modprobe snd_bcm2835')\n\ndescribe kernel_module('snd_bcm2835') do\n ...
ruby
chosen
[ { "from": "system", "value": "Destroy tasks when group is deleted\n" }, { "from": "human", "value": "class GroupsController < ApplicationController\n def index\n @groups = Group.all\n end\n\n def new\n @group = Group.new\n end\n\n def edit\n @group = Group.find(params[:id])\n end\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Permit parameters in latest controller\"\n" }, { "from": "human", "value": "class LatestController < PublicFacingController\n include CacheControlHelper\n\n before_action :redirect_unless_subject\n\n def index; end\n\nprivate\n\n helper_method :subject,...
ruby
chosen
[ { "from": "system", "value": "Add a 'show' param for controlling results filters\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n def search\n @q = params[:q]\n @scrapers = Scraper.search @q, fields: [{full_name: :word_middle}, :description, {scraped_dom...
ruby
chosen
[ { "from": "system", "value": "Use dynamic loading for banks\n" }, { "from": "human", "value": "require 'bank_scrap/version'\nrequire 'bank_scrap/cli'\nrequire 'bank_scrap/bank'\n\n# TODO: load banks dynamically\nrequire 'bank_scrap/banks/bankinter'\nrequire 'bank_scrap/banks/bbva'\n\nmodule Bank...
ruby
chosen
[ { "from": "system", "value": "Change ServiceMixin.call to return the yield result for better chaining.\n" }, { "from": "human", "value": "module ServiceMixin\n extend ActiveSupport::Concern\n\n included do\n # Hide new in favor of using .call with block to force synchronization\n private...
ruby
chosen
[ { "from": "system", "value": "Update dependencies for Rails 4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |gem|\n gem.name = \"nokogiri_tru...
ruby
chosen
[ { "from": "human", "value": "PERF: Add score indexes for top topics.\n" }, { "from": "gpt", "value": "class AddScoresIndexesToTopTopics < ActiveRecord::Migration\n def change\n add_index :top_topics, :daily_score\n add_index :top_topics, :weekly_score\n add_index :top_topics, :monthly_...
ruby
chosen
[ { "from": "human", "value": "Add cask for MacGDBp app\n\nA little client for Xdebug\n" }, { "from": "gpt", "value": "class Macgdbp < Cask\n url 'https://www.bluestatic.org/downloads/macgdbp/macgdbp-1.5.zip'\n homepage 'https://www.bluestatic.org/software/macgdbp/'\n version '1.5'\n sha256 '9...
ruby
chosen
[ { "from": "system", "value": "Upgrade Vivaldi.app to v1.0.162.9 (Technical Preview 3)\n" }, { "from": "human", "value": "cask :v1 => 'vivaldi' do\n version '1.0.162.4'\n sha256 :no_check # required as upstream package is updated in-place\n\n url \"https://vivaldi.com/download/Vivaldi_TP3.#{ve...
ruby
chosen
[ { "from": "system", "value": "Add default value for unicorn web concurrency\n" }, { "from": "human", "value": "root_dir = \"/home/deploy/apps/copycopter-server/current\"\nworking_directory root_dir\n\npid \"#{root_dir}/tmp/pids/unicorn.pid\"\n\nstderr_path \"#{root_dir}/log/unicorn.log\"\nstdout...
ruby
chosen
[ { "from": "system", "value": "Use `require_relative` instead of `require`.\n\nPrevent conflicts, and more importantly, not be dependent on search path.\n" }, { "from": "human", "value": "# ===-- lib/ninja.rb -------------------------------------*- mode: Ruby -*-=== #\n#\n# ...
ruby
chosen
[ { "from": "system", "value": "Remove blank line from Token initializer\n" }, { "from": "human", "value": "class Token\n def initialize(char)\n raise 'Only one character is allowed' unless char.size == 1\n\n @char = char\n end\n\n def operator?\n !/[+\\-*\\/^%=(),]/.match(@char).nil?\...
ruby
chosen
[ { "from": "system", "value": "Switch source-code-pro to GitHub-hosted package\n" }, { "from": "human", "value": "cask :v1 => 'font-source-code-pro' do\n version '1.017'\n sha256 '8136b4686309c428ef073356ab178c2f7e8f7b6fadd5a6c61b6a20646377b21f'\n\n url \"http://downloads.sourceforge.net/sourc...
ruby
chosen
[ { "from": "system", "value": "Make sure ARC is required\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"UIColor-HNExtensions\"\n s.version = \"0.1\"\n s.summary = \"A grab-bag of useful UIColor helpers\"\n\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Add unit tests for User and Activity\n" }, { "from": "human", "value": "require './lib/tunefish_client/client'\nrequire_relative 'test_helper'\n\nclass TunefishClientTest < Minitest::Test\n def setup\n @client = TunefishClient::Client.new(host: 'http://localhost...
ruby
chosen
[ { "from": "system", "value": "Revert \"Change version in podspecs\"\n\nThis reverts commit d8f019517b89c05364b383cfc516044bbc7e785e.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CSStickyHeaderFlowLayout\"\n s.version = \"0.2.11\"\n s.summary = \"Paral...
ruby
chosen
[ { "from": "system", "value": "Check if releases returns alphabetically\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.describe \"Get releases\" do\n it \"returns releases alphabetically\" do\n query_string = <<-GRAPHQL\n query {\n releases {\n id\n ...
ruby
chosen
[ { "from": "system", "value": "Clean up PolicyChecker Spec for complete code coverage.\n\nDetails:\n* Used a mock instead of a proc that raises an error.\n* Remove unneeded parens for 'double'\n" }, { "from": "human", "value": "require 'spec_helper'\n\nrequire 'serf/errors/policy_failure'\nrequir...
ruby
chosen
[ { "from": "system", "value": "Stop to display empty image\n" }, { "from": "human", "value": "ActiveAdmin.register Post do\n permit_params(:site_id, :category_id, :title, :body, :published_at,\n images_attributes: [:id, :image, :_destroy])\n\n form do |f|\n f.semantic_errors\n...
ruby
chosen
[ { "from": "system", "value": "Set content length header to 0 on stats post responses.\n\nThis is a workaround for what seems like a Varnish bug. Without\nthe content length header, rails generates an empty response with\ntransfer-encoding chunked. This is valid but Varnish removes the\ntransfer encoding hea...
ruby
chosen
[ { "from": "system", "value": "Set tighter dependency on storext\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"storext/override/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Use sass compiler only if the environment is not production.\n" }, { "from": "human", "value": "module Nilgiri\n class App < Padrino::Application\n register SassInitializer\n use ActiveRecord::ConnectionAdapters::ConnectionManagement\n register Padrino::Re...
ruby
chosen
[ { "from": "system", "value": "Add lost BLOCK_SEPARATOR constant, used by LayoutAnalyzerTask\n" }, { "from": "human", "value": "require \"csv\"\n\nclass Document\n def lang\n self.app == :mapa76 ? :es : :en\n end\n\n def to_csv\n heading = %w(name, fuerza, etiqueta)\n CSV.generate do ...
ruby
chosen
[ { "from": "system", "value": "Include the docs directory when building gem\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + '/lib/'\nrequire 'sparkle_formation/version'\nGem::Specification.new do |s|\n s.name = 'sparkle_formation'\n s.version = S...
ruby
chosen
[ { "from": "system", "value": "Set default output style to be expanded.\n" }, { "from": "human", "value": "require 'compass/import-once/activate'\n# Require any additional compass plugins here.\nrequire 'compass-normalize'\n\n# Set this to the root of your project when deployed:\nhttp_path = \"/\...
ruby
chosen
[ { "from": "system", "value": "Enable Rack::Deflater for gzip support.\n" }, { "from": "human", "value": "require './app'\nrun Rack::Cascade.new [\n Transitmix::Routes::Status,\n Transitmix::Routes::Lines,\n Transitmix::Routes::Maps,\n Transitmix::Routes::Home\n]\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Use new namespace and rack-like paths" }, { "from": "human", "value": "# Just here to test easily\n\n# Ensure your sources (and smoke) are required before smoke-rack\nrequire 'examples/smoke-source'\nrequire 'lib/smoke-rack'\nuse Smoke::Rack\n\nrun Sinatra::Applicat...
ruby
chosen
[ { "from": "system", "value": "Allow BoardSerializer to sort by id" }, { "from": "human", "value": "class BoardSerializer\n include TalkSerializer\n include EmbeddedAttributes\n\n all_attributes\n attribute :latest_discussion\n can_filter_by :subject_default\n can_sort_by :position, :last_c...
ruby
chosen
[ { "from": "human", "value": "Add test for autocompletion within example namespace\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"the 'person' namespace example\" do\n class Person\n attr_reader :first_name\n def initialize\n @first_name = \"Colin\"\n end\n e...
ruby
chosen
[ { "from": "system", "value": "Fix generation of links to remove individual filters\n\nThe links to remove individual filters from the mappings index pages\nwere being wrongly generated by the site_mappings_path helper using\nthe site_id from the params hash as the format, for example:\n\n /sites/aaib/map...
ruby
chosen
[ { "from": "system", "value": "Update podspec version to 0.2 for Swift 2.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Swinject\"\n s.version = \"0.1\"\n s.summary = \"Dependency injection framework for Swift\"\n s.description = <<-DE...
ruby
chosen
[ { "from": "system", "value": "Update Rake version spec to ~> 13.0.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'asciimath/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "human", "value": "Add force publish anything to the user used by the force publisher\n" }, { "from": "gpt", "value": "force_publish_robot_user = ForcePublisher::Worker.new.user\nif force_publish_robot_user.nil?\n puts \"User for Force Publisher is not present! - can't escalate permis...
ruby
chosen
[ { "from": "system", "value": "Update rspec-rails 3.0.0.beta1 -> 3.0.0.beta2\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'simple_bootstrap_form/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.27.0.0 to 0.27.0.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.27.0.0'\n s.summary = 'Common primitives for platform-specific messaging...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.7.0.0 to 0.7.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.7.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": "Fix reschedule and better logging\n" }, { "from": "human", "value": "require 'transilien_realtime'\nclass FetchTravels\n include Sidekiq::Worker\n include RtTrWatcherWorker\n\n MANDATORY_ENV = %w(RTT_API_USER RTT_API_PWD)\n\n def setup_worker\n @user, @pwd = ...
ruby
chosen
[ { "from": "system", "value": "Expand testing of Revision model.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Revision do\n\n describe \"revision methods\" do\n it \"should create Revision objects\" do\n revision = build(:revision)\n revision.update\n e...
ruby
chosen
[ { "from": "system", "value": "Change migration, allow users nulls (inherit from org)\n" }, { "from": "human", "value": "Sequel.migration do\n up do\n alter_table :organizations do\n add_column :builder_enabled, :boolean, null: false, default: false\n end\n\n Rails::Sequel.connecti...
ruby
chosen
[ { "from": "system", "value": "Store links and images to speed up secondary calls to the corresponding functions.\n" }, { "from": "human", "value": "require File.expand_path(File.join(File.dirname(__FILE__), 'meta'))\n\nmodule WebInspector\n class Inspector\n\n def initialize(page)\n @pa...
ruby
chosen
[ { "from": "system", "value": "Use compile_time property to make gems install at compile_time\n" }, { "from": "human", "value": "#\n# Cookbook Name:: et_fog\n# Recipe:: default\n#\n# Copyright (C) 2013 EverTrue, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m...
ruby
chosen
[ { "from": "system", "value": "Reset version number to 00.00.00. This is new code!\n" }, { "from": "human", "value": "# coding: utf-8\r\n\r\n# The fOOrth Language System implemented via a Ruby gem.\r\n\r\nrequire_relative 'fOOrth/exceptions'\r\nrequire_relative 'fOOrth/display_abort'\r\nrequire_r...
ruby
chosen
[ { "from": "system", "value": "Allow tasks to exit with an error code without dumping a backtrace.\n" }, { "from": "human", "value": "namespace :fezzik do\n task :run do\n if ARGV.size == 0\n puts \" Usage: fez to_destination task\"\n exit 1\n end\n destination = ARGV[0]\n ...
ruby
chosen
[ { "from": "system", "value": "Test de la página redirigida.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')\n\nfeature \"Login\", %q{\n In order to manage the content\n As an administrator\n I want to be able to l...
ruby
chosen
[ { "from": "system", "value": "Add comments to \"RemoveInflectionalParticle\" class\n" }, { "from": "human", "value": "module Sastrawi\n module Stemmer\n module Context\n module Visitor\n class RemoveInflectionalParticle\n def visit(context)\n result = remove(c...
ruby
chosen
[ { "from": "system", "value": "Use SSH URLs for cloning from GitHub\n\nThis will allow us to push stuff from work and result dirs back to\nGitHub repos during the final compilation.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire_relative \"command\"\n\nmodule Commands\n class Cl...
ruby
chosen
[ { "from": "system", "value": "Allow additional raw zone content for Bind generator\n" }, { "from": "human", "value": "\nmodule Dyndnsd\n module Generator\n class Bind\n def initialize(domain, config)\n @domain = domain\n @ttl = config['ttl']\n @dns = config['dns']\n...
ruby
chosen
[ { "from": "system", "value": "Fix 'param categories must be an array'\n" }, { "from": "human", "value": "module FacebookPlaces\n class Client\n ## Accessors\n attr_accessor :access_token\n\n ## Methods\n def initialize(access_token)\n @access_token = access_token\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow public access to the step instance.\n\nThis is useful for tests.\n" }, { "from": "human", "value": "module Metacrunch\n class Transformer\n require_relative \"./transformer/step\"\n require_relative \"./transformer/helper\"\n\n attr_accessor :source,...
ruby
chosen
[ { "from": "human", "value": "Make paginate table skin work\n" }, { "from": "gpt", "value": "# \n# = The Paginate Table Link Renderer\n#\nclass PaginateLinkRenderer < WillPaginate::LinkRenderer\n def page_link(page, text, attributes = {})\n @template.link_to_function text, \"Paginate.Page...
ruby
chosen
[ { "from": "system", "value": "Refactor sitemap helper methods in a cleaner way\n" }, { "from": "human", "value": "#\n# == SitemapHelper\n#\nmodule SitemapHelper\n def classic_links\n add root_path\n add abouts_path, priority: 0.7, changefreq: 'monthly' if Category.find_by(name: 'About').m...
ruby
chosen
[ { "from": "system", "value": "Send single tags to content store in rake task\n\nThe rake task currently publishes all tags, *and* their dependent tags,\ndoing a lot of duplicate work. This commit restricts the rake task to\nonly publish a single tag.\n" }, { "from": "human", "value": "namespace ...
ruby
chosen
[ { "from": "system", "value": "Set Sansa and XOR to debug false\n\nPassing in hackerrank, so move on.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nDEBUG=true\n\ngets.to_i.times do\n n = gets.to_i\n array = gets.split.map {|i| i.to_i }\n result = 0\n offset = 0\n bump = n\n\n $s...
ruby
chosen
[ { "from": "human", "value": "Add base `LanguageInstall` resource/provider classes\n\nThese classes define the shared attributes and core action along with\nsome abstract methods each provider must implement.\n" }, { "from": "gpt", "value": "#\n# Copyright 2015, Chef Software, Inc.\n#\n# Licensed...
ruby
chosen
[ { "from": "system", "value": "Update berkshelf source for latest format\n" }, { "from": "human", "value": "# Tries to bootstrap with apache2 cookbook and\n# verifies the \"It Works!\" page is present.\n\nrequire $base_dir.join('integration', 'cases', 'apache2_cook')\n\nmodule Apache2Bootstrap\n ...
ruby
chosen
[ { "from": "system", "value": "Remove references to old spec files\n\nThese files no longer exist in govuk-puppet.\n" }, { "from": "human", "value": "require_relative '../../../../spec_helper'\n\njob_directory = File.join(File.dirname(__FILE__), '../../manifests/jobs')\nFILES = Dir.entries(job_di...
ruby
chosen
[ { "from": "system", "value": "Add locale switching in Profile page\n" }, { "from": "human", "value": "class ProfilePage\n include Capybara::DSL\n\nend\n\n" }, { "from": "gpt", "value": "# @author Dumitru Ursu\n# Page Object for the user profile page\nclass ProfilePage\n include Cap...
ruby
chosen
[ { "from": "system", "value": "Add spec for overriding the default url\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"teamsnap\"\n\nRSpec.describe \"teamsnap_rb\", :vcr => true do\n describe \".init\" do\n it \"requires token or client id and client secret\" do\n e...
ruby
chosen
[ { "from": "system", "value": "Make sure that react helper always closes the div tag\n\nFixes https://bugzilla.redhat.com/show_bug.cgi?id=1593152\n" }, { "from": "human", "value": "module ReactjsHelper\n def mount_react_component(name, selector, data = [])\n javascript_tag(:defer => 'defer') ...
ruby
chosen
[ { "from": "system", "value": "Load static images in theme" }, { "from": "human", "value": "# Use the app.rb file to load Ruby code, modify or extend the models, or\n# do whatever else you fancy when the theme is loaded.\n\n# This code tells Nesta to look for assets in the theme's public folder.\...
ruby
chosen
[ { "from": "system", "value": "Update the URL for the allele registry to the production server\n" }, { "from": "human", "value": "class AlleleRegistry\n attr_reader :variant\n\n def initialize(variant_id)\n @variant = Variant.find(variant_id)\n end\n\n def response\n Rails.cache.fetch(c...
ruby
chosen
[ { "from": "system", "value": "Move sort in Publication.change_notes_for to mongo\n\nIt will probably be marginally faster to do it there so why not.\n" }, { "from": "human", "value": "class PublicationLog\n include Mongoid::Document\n include Mongoid::Timestamps\n\n field :slug, type: String\...
ruby
chosen
[ { "from": "system", "value": "Adjust number of items returned for test\n" }, { "from": "human", "value": "Shindo.tests('AWS::RDS | db instance option requests', ['aws', 'rds']) do\n tests('success') do\n\n tests(\"#describe_orderable_db_instance_options('mysql)\").formats(AWS::RDS::Formats::...
ruby
chosen
[ { "from": "system", "value": "Disable drafts by default in RAILS_ENV=production\n\nTo reduce the chance of a misconfiguration revealing draft content in\nproduction, this changes the default config to not show drafts unless\nexplicitly overridden.\n\nThis removes the `show_transitions: false` option because...
ruby
chosen
[ { "from": "system", "value": "Remove unused directories on Windows\n" }, { "from": "human", "value": "name \"td-agent-cleanup\"\n#version '' # git ref\n\ndependency \"td-agent\"\n\nbuild do\n block do\n project_name = project.name\n rb_major, rb_minor, rb_teeny = project.overrides[:ruby][...
ruby
chosen
[ { "from": "system", "value": "Support all Rails 5 releases\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'administrate-field-paperclip'\n gem.version = '0.0.4'\n gem.authors = ['Fernando Briano']\n gem....
ruby
chosen
[ { "from": "system", "value": "Comment out the Capybara default timeout and just use the Poltergeist one\n" }, { "from": "human", "value": "# Configure Capybara\nrequire 'capybara/poltergeist'\nCapybara.configure do |config|\n Capybara.register_driver :poltergeist do |app|\n Capybara::Polterg...
ruby
chosen
[ { "from": "system", "value": "Fix course copy migration regression\n\nThe regression prevented users from importing courses using our version\nof the plugin. It was introduced in f8400335 when the migrations\ncontroller started checking for valid contexts. This fix is based on\n2ba4531f (default_plugins.rb:...
ruby
chosen
[ { "from": "system", "value": "Add an encoder for psych parsing." }, { "from": "human", "value": "# encoding: utf-8\nDataMapper::Resource.class_eval do\n yaml_as \"tag:ruby.yaml.org,2002:DataMapper\"\n\n def self.yaml_new(klass, tag, val)\n klass.get!(val['id'])\n end\n\n def to_yaml_prope...
ruby
chosen