conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Drop the fileicon in ConfiguredSystemDecorator\n" }, { "from": "human", "value": "class ConfiguredSystemDecorator < MiqDecorator\n def self.fonticon\n 'ff ff-configured-system'\n end\n\n def fileicon\n \"100/#{image_name.downcase}.png\"\n end\nend\n" }, ...
ruby
chosen
[ { "from": "human", "value": "Write rubocop rspec and test rakefile\n" }, { "from": "gpt", "value": "require 'rubocop/rake_task'\nrequire 'rspec/core/rake_task'\n\nnamespace :test do\n desc 'Run RuboCop'\n RuboCop::RakeTask.new(:rubocop) do |task|\n # Make it easier to disable cops.\n tas...
ruby
chosen
[ { "from": "system", "value": "Make sure we're using a safe version of httparty." }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'imaginary/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Include refactored solution in guessing game\n" }, { "from": "human", "value": "# Build a simple guessing game\n\n\n# I worked on this challenge by myself.\n# I spent 1 hours on this challenge.\n\n# Pseudocode\n\n# Input:\n# Output:\n# Steps:\n\n\n# Initial Solution...
ruby
chosen
[ { "from": "system", "value": "Add field 'id' to physical info\n" }, { "from": "human", "value": "class PhysicalElement\n\n attr_accessor :order, :orderlabel #, :type, :id, :level\n\nend" }, { "from": "gpt", "value": "class PhysicalElement\n\n attr_accessor :order, :orderlabel, :id ...
ruby
chosen
[ { "from": "system", "value": "Fix Rubocop lints in Engine class\n\nChange-Id: Ib6135d18727a078277810f78ecfc516085e1362d\nReviewed-on: http://gerrit.causes.com/36708\nTested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>\nReviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33...
ruby
chosen
[ { "from": "system", "value": "Add a move entry prompt\n" }, { "from": "human", "value": "module TicTacToe\n class Game\n attr_reader :to_play\n\n NEXT_PLAYER = {\"X\" => \"O\",\n \"O\" => \"X\"}\n\n def initialize(console, board)\n @console, @board = console, boa...
ruby
chosen
[ { "from": "human", "value": "Add script to process CitA csv\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'csv'\nrequire 'geocoder'\nrequire 'json'\n\nlocations = []\n\n# \"REGION\",\"DELIVERY BUREAU\",\"PRIMARY CONTACT\",\"POSTAL ADDRESS\",\"Phone number\"\nCSV.foreach('cita.c...
ruby
chosen
[ { "from": "system", "value": "Fix authorization check on the /admin/events page\n" }, { "from": "human", "value": "class Admin::EventsController < Admin::BaseController\n before_filter :authenticate_user!\n skip_authorization_check # XXX because I'm using the BaseController for auth\n\n def i...
ruby
chosen
[ { "from": "system", "value": "Fix failing confirmation on invite to poll\n" }, { "from": "human", "value": "class InvitationSerializer < ActiveModel::Serializer\n include Routing\n\n embed :ids, include: true\n attributes :id, :group_id, :token, :name, :email, :recipient_email, :accepted_at, ...
ruby
chosen
[ { "from": "system", "value": "Remove whole report info from NotificationData and add report_id.\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'uri'\nrequire 'json'\n\nclass FirebaseCloudMessaging\n\n # @param [Report] report\n # @param [Array<User>] to\n def self.send_new_rep...
ruby
chosen
[ { "from": "human", "value": "Add example for creating requests\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'active_support/time'\n\ndescribe 'Hotel Booking Example' do\n\n module Request\n def self.create(params, params_module)\n value = self.create_value(params || ...
ruby
chosen
[ { "from": "system", "value": "Update suse version to match Fauxhai\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'chef-client::init_service' do\n\n os = { platform: 'suse', version: '11.03', conf_dir: 'sysconfig' }\n\n context os[:platform] do\n\n let(:chef_run) do\n ...
ruby
chosen
[ { "from": "system", "value": "Rework message creation since created_by isn't mass assignable.\n" }, { "from": "human", "value": "class MessagesController < ApplicationController\n def create\n @thread = MessageThread.find(params[:thread_id])\n @message = @thread.messages.build(params[:mes...
ruby
chosen
[ { "from": "system", "value": "Update rspec version from 2.13.0 to 2.14.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'pronto/version'\n\nGem::Specification.new do |s|\n s.name = 'pronto'\n s.version = Pronto::...
ruby
chosen
[ { "from": "system", "value": "Print error message for NullWorker\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'sinatra/json'\n\nrequire 'sidekiq'\nrequire 'sidekiq/web'\n\nrequire './lib/downloader'\nrequire './lib/reply'\nrequire './lib/feed_builder'\nrequire './lib/settin...
ruby
chosen
[ { "from": "system", "value": "Add a :service_container_groups field to conserve the number of pods running the registry service functionality\n" }, { "from": "human", "value": "class ContainerImageRegistry < ApplicationRecord\n belongs_to :ext_management_system, :foreign_key => \"ems_id\"\n ha...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning for `.uniq` usage\n" }, { "from": "human", "value": "class I18nContentTranslation < ActiveRecord::Base\n def self.existing_languages\n self.select(:locale).uniq.map{ |l| l.locale.to_sym }.to_a\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Add validation for event age range on sign-up\n" }, { "from": "human", "value": "class RegistrantEventSignUp < ActiveRecord::Base\n validates :event, :registrant, :presence => true\n #validates :event_category, :presence => true, :if => \"signed_up\"\n validates...
ruby
chosen
[ { "from": "system", "value": "Add support for config Redis conection\n" }, { "from": "human", "value": "require 'redis'\n\nmodule Cenit\n module Redis\n class << self\n\n def client?\n !client.nil?\n end\n\n def client\n unless instance_variable_defined?(:@redis_...
ruby
chosen
[ { "from": "system", "value": "Add quoting to filename part of Content-Disposition header.\n" }, { "from": "human", "value": "require 'spreadsheet'\n\nmodule Spreadsheet\n module Rails\n module SpreadsheetHelper\n\n def excel_document(opts={})\n download = opts.delete(:force_downl...
ruby
chosen
[ { "from": "human", "value": "Add spec for 'rake db:dev_seed' task\n" }, { "from": "gpt", "value": "require 'rails_helper'\nrequire 'rake'\n\ndescribe 'rake db:dev_seed' do\n before do\n Rake.application.rake_require('tasks/db')\n Rake::Task.define_task(:environment)\n end\n\n let :run_r...
ruby
chosen
[ { "from": "system", "value": "Make Wireless network location join optional\n" }, { "from": "human", "value": "class WirelessNetworksController < MyplaceonlineController\n def use_bubble?\n true\n end\n \n def bubble_text(obj)\n obj.location.nil? ? nil : obj.location.display_simple\n e...
ruby
chosen
[ { "from": "system", "value": "Add stub_template_settings for testing access to template config\n" }, { "from": "human", "value": "def stub_settings(hash)\n settings = Config::Options.new.merge!(hash)\n stub_const(\"Settings\", settings)\n allow(Vmdb::Settings).to receive(:for_resource) { sett...
ruby
chosen
[ { "from": "system", "value": "Add in delay to allow nickserv to prompt.\n" }, { "from": "human", "value": "module Vapebot\nmodule IRC\n def register\n send_nick\n send_user\n send_pass\n end\n\n def send_pass\n if Config[:identify]\n send \"NICKSERV IDENTIFY #{Config[:passwor...
ruby
chosen
[ { "from": "system", "value": "Add multiple attr_accessor_with_history test to part5\n" }, { "from": "human", "value": "require 'hw1_part5'\nrequire 'test/unit'\n\nclass Foo\n attr_accessor_with_history :bar\nend\n\nclass TestAdvancedOOP < Test::Unit::TestCase\n\n def test_attr_accessor_wit...
ruby
chosen
[ { "from": "system", "value": "Send response to parse_message. Not response.body.\n" }, { "from": "human", "value": "module Dirigible\n module Request\n def get(path, options = {}, headers = {})\n request(:get, path, options, headers)\n end\n\n def post(path, options = {}, headers ...
ruby
chosen
[ { "from": "system", "value": "Use spec version as the source tag.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'FCModel'\n s.version = '0.1.0'\n s.summary = 'An alternative to Core Data for people who like having direct SQL access.'\n s.homepage = 'https://github.com/ma...
ruby
chosen
[ { "from": "system", "value": "Remove socket lifecycle puts for monitor\n" }, { "from": "human", "value": "require 'flatware/poller'\n\nmodule Flatware\n class Fireable\n PORT = 'ipc://die'\n\n def self.bind\n @kill = Flatware.socket ZMQ::PUB\n monitor = @kill.monitor\n @kil...
ruby
chosen
[ { "from": "system", "value": "Fix require gems not working (maybe?)\n" }, { "from": "human", "value": "begin\n require 'cinch'\nrescue LoadError\n puts \"You're missing the gem `cinch`. Would you like to install this now? (y/n)\"\n input = gets.chomp\n if input == 'y'\n `gem install cinch...
ruby
chosen
[ { "from": "system", "value": "Allow coloring to be disabled with false or nil\n" }, { "from": "human", "value": "require 'ripl'\n\nmodule Ripl\n module ColorResult\n VERSION = '0.1.0'\n\n # def inspect_result(result)\n # result.inspect\n # end\n\n def format_prompt(result)\n ...
ruby
chosen
[ { "from": "system", "value": "Make loading of indexes.rb dependent on its existance\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nmodule Spontaneous\n class Facet\n def initialize(root)\n @root = root\n paths.add :lib, [\"lib\", \"**/*.rb\"]\n paths.add :schema, [\"s...
ruby
chosen
[ { "from": "system", "value": "Create actual post content for file\n" }, { "from": "human", "value": "class PostWriter\n\n def initialize( logger )\n @logger = logger\n end\n\n def write_files(posts, directory)\n validate_directory directory\n verify_directory\n posts.each do |post...
ruby
chosen
[ { "from": "system", "value": "Stop packaging test files with the gem\n\nIt drastically reduces the size of the gem, from 1.9M to 32K. The\ndefault for new gems (created by bundler) is not to include test files.\nSee bundler/bundler#3207\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*...
ruby
chosen
[ { "from": "system", "value": "Add descriptions and runtime dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rulers/version'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to_number to work with numbers.\n" }, { "from": "human", "value": "def to_number(ns)\n if ns.include? '.'\n return ns.to_f\n else\n return ns.to_i\n end\nend\n" }, { "from": "gpt", "value": "def to_number(ns)\n if ns.class =...
ruby
chosen
[ { "from": "system", "value": "Add comment about possible deprecation of Nrefs\n" }, { "from": "human", "value": "module LLT\n module Diff::Alignment::Difference\n class Nrefs\n include Diff::Helpers::HashContainable\n include Diff::Helpers::DiffReporter\n\n xml_tag :nrefs\n\n ...
ruby
chosen
[ { "from": "human", "value": ":elephant: Migrate cities for Factual imports\n" }, { "from": "gpt", "value": "namespace :temporary do\n desc 'Fill in city from old Factual imports'\n task factual_re_migration: :environment do\n factual_imports = [27, 28, 29]\n \n factual_imports.each do...
ruby
chosen
[ { "from": "system", "value": "Update ELB sample to work with collapsed Result\n" }, { "from": "human", "value": "$: << File.expand_path(\"../../lib\", __FILE__)\n\nrequire 'aws/elb'\n\n##\n# Expects your Amazon keys to be in the environment, something like\n#\n# export AWS_KEY=\"KEY\"\n# export ...
ruby
chosen
[ { "from": "system", "value": "Use mutually prime port offsets to prevent overlap.\n" }, { "from": "human", "value": "require 'bundler'\nBundler.setup\n\nrequire 'rspec'\n\n$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire 'aker'\n\nrequire File.expand_path('../deprecation_h...
ruby
chosen
[ { "from": "system", "value": "Set login even on deleted users" }, { "from": "human", "value": "class MigrateUserLogin < ActiveRecord::Migration\n def up\n total = User.count\n validator = LoginUniquenessValidator.new\n\n User.find_each.with_index do |user, index|\n puts \"#{ index...
ruby
chosen
[ { "from": "system", "value": "Update github-linguist requirement to >= 5.1, < 5.3\n\nUpdates the requirements on [github-linguist](https://github.com/github/linguist) to permit the latest version.\n- [Release notes](https://github.com/github/linguist/releases)" }, { "from": "human", "value": "Ge...
ruby
chosen
[ { "from": "system", "value": "Add UIKit dependency to podspec\n\nSigned-off-by: Sean Doughety <58cdf895b71f84481e06f521739b30fbd55e8539@gmail.com>\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'SDColor'\n spec.version = '0.1.0'\n spec.summary = 'De...
ruby
chosen
[ { "from": "system", "value": "Add support to Rails 4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/sandbox_assets/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Rodrigo Rosenfeld Rosas\"]\n gem.email = [\...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.1.2.0 to 0.2.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.1.2.0'\n s.description = ' '\...
ruby
chosen
[ { "from": "system", "value": "Remove old additional plugin load paths\n" }, { "from": "human", "value": "require 'config/boot'\n\nRails::Initializer.run do |config|\n config.plugin_paths << '..'\n config.plugins = %w(tags smart_field_constraints)\n config.cache_classes = false\n config.whiny...
ruby
chosen
[ { "from": "system", "value": "Change old views var to institution_views with nyulibraries_templates change\n" }, { "from": "human", "value": "# app/views/layouts/bobcat.rb\nmodule LayoutsHelper\n def application_javascript\n javascript_include_tag \"search\"\n end\n\n def gauges?\n Rail...
ruby
chosen
[ { "from": "system", "value": "ENHANCE: Add convenience methods to helpdesk ticket model\n" }, { "from": "human", "value": "#\n# Tracking for tickets logged at the helpdesk.\n#\nclass HelpdeskTicket < ActiveRecord::Base\n # Model associations\n belongs_to :project\n belongs_to :task\n\n # Mod...
ruby
chosen
[ { "from": "human", "value": "Add basic test for sitemap generation\n\nCheck to make sure both fully qualified urls and path only urls are\ncorrectly handled when generating the sitemap.\n" }, { "from": "gpt", "value": "require \"test_helper\"\nrequire \"elasticsearch/sitemap\"\n\nclass SitemapGe...
ruby
chosen
[ { "from": "system", "value": "Fix bug (use DIFFICULTY as Array)\n" }, { "from": "human", "value": "class Scoreset < Sequel::Model\n many_to_one :player\n one_to_many :score\n\n def Scoreset.new_scores(player, song, registered_at)\n scoreset = Scoreset.new(\n player: player,\n reg...
ruby
chosen
[ { "from": "human", "value": "Add migration to store the started timestamp. Not used yet\n" }, { "from": "gpt", "value": "class AddStartedToBackupJob < ActiveRecord::Migration\n def self.up\n add_column :backup_jobs, :started, :datetime\n end\n\n def self.down\n remove_column :backup_job...
ruby
chosen
[ { "from": "human", "value": "Add first iteration on all permutation\n" }, { "from": "gpt", "value": "#http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/\n\n# Preorder \n$string_arr = %w( a b c )\n$used_chars = Array.new($string_arr.size,false)\n$depth = 0...
ruby
chosen
[ { "from": "human", "value": "Add scratch code for analyzing wikidata contribs for courses\n" }, { "from": "gpt", "value": "load \"#{Rails.root}/lib/wikidata_summary_parser.rb\"\n\ncampaign = Campaign.find_by_slug 'wikidata_stats'\n\ni = 0\n\ncampaign.courses.each do |course|\n course.revisions....
ruby
chosen
[ { "from": "system", "value": "Use absolute path for controller in gend thumbs url helper\n\nIt needs this to point to the root namespace when the helper is used\nfrom the API namespace.\n" }, { "from": "human", "value": "# encoding: UTF-8\n# frozen_string_literal: true\n\n# Build urls for genera...
ruby
chosen
[ { "from": "system", "value": "Include deps class in unit test for sync\n\nChange-Id: Ia8fd8c95fe1572b9132899ed76d1ca6386220900\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe '{{cookiecutter.project_name}}::db::sync' do\n shared_examples '{{cookiecutter.project_name}}-dbsyn...
ruby
chosen
[ { "from": "system", "value": "Add require_all dependency, fix description\n" }, { "from": "human", "value": "# In the top directory\n# gem build rdl.gemspec\n# gem install rdl-1.0.0.beta.1.gem\n\nGem::Specification.new do |s|\n s.name = 'rdl'\n s.version = '1.0.0.rc1'\n s.date ...
ruby
chosen
[ { "from": "system", "value": "Fix code style to make rubocop happy for git monkey patch" }, { "from": "human", "value": "module Git\n # Lib class from https://github.com/voxpupuli/modulesync/pull/144/files\n #\n # Copyright [2018] [Dave Wongillies https://github.com/davewongillies]\n\n # Lic...
ruby
chosen
[ { "from": "system", "value": "Use a better path for template root." }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), \"mixins\", \"web_controller\")\nmodule Merb\n \n # A Merb::PartController is a light weight way to share logic and templates\n # amongst controllers. ...
ruby
chosen
[ { "from": "system", "value": "Add user to task execution\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Cat3FilterTaskTest < ActiveSupport::TestCase\n include ::Validators\n include ActiveJob::TestHelper\n\n def setup\n @product_test = FactoryBot.create(:static_filter_te...
ruby
chosen
[ { "from": "system", "value": "Improve options validation for TwitterLoader\n" }, { "from": "human", "value": "# TwitterLoader requires \"twitter\" block in the application credentials file\n# to contain Twitter API access credentials. See REQUIRED_OPTIONS definition\n# and 'twitter' gem document...
ruby
chosen
[ { "from": "system", "value": "Change article rendering app to www\n" }, { "from": "human", "value": "require \"edition\"\n\nclass ArticleEdition < Edition\n\n # type: (News Item / Blog Post / Media Release) uses tags\n # headline uses artefact name\n field :content, type: St...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Fix last commit (at least for OS X/Ubuntu)\n\ngit-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@11359 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "require 'zip/zip'\nrequire 'tempfile'\nrequire 'find'\n\nmodule Selenium\n m...
ruby
chosen
[ { "from": "system", "value": "Remove 'homepage' override in 'LocaleChecker'\n\nPreviously, we ignored all locale properties beginning with the\n'homepage' prefix, for several reasons:\n\n1) The locale files lost the traditional key/value structure in\n 51a5b885a21fa1e6da9c7d8092da9a814227058e, meaning Rai...
ruby
chosen
[ { "from": "system", "value": "Isolate nasty search for leg unload location.\n" }, { "from": "human", "value": "require 'ice_nine'\nrequire 'hamster'\nrequire 'pp'\n\nclass Itinerary\n attr_reader :legs\n\n # TODO Handle empty values for attributes by returning UNKNOWN location\n # TODO Add is...
ruby
chosen
[ { "from": "system", "value": "Add rspec to development dependencies" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'hippo_xml_parser/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Change method name in PaginateProcessor to page_size to match adapter semantics\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative './base_processor'\nrequire_relative './paginate/enumerable_adapter'\nrequire_relative './paginate/ac...
ruby
chosen
[ { "from": "system", "value": "Add a simple description for rubygems and change platform to RUBY.\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = 'swftly'\n spec.version = '0.1.1'\n spec.summary = \"swftly abstracts and automates intera...
ruby
chosen
[ { "from": "system", "value": "Update to the latest versions of bundler and rake\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"interactor-rails\"\n spec.version = \"2.0.1\"\n\n spec.author = \"Collective Idea\"\n spec.email ...
ruby
chosen
[ { "from": "system", "value": "Rename variable and update comments\n" }, { "from": "human", "value": "require 'app/services/connection_builder'\nrequire 'app/services/publisher_update'\n\nmodule Citygram::Workers\n class PublisherPoll\n include Sidekiq::Worker\n sidekiq_options retry: 5\n\...
ruby
chosen
[ { "from": "human", "value": "Add script for updating user origin\n\nSigned-off-by: Toby Lorne <527052641d65eef236eeef9545b2acac74c35d57@digital.cabinet-office.gov.uk>\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'json'\n\ndef usage\n <<~USAGE\n Usage: #{$0} user-guid desired...
ruby
chosen
[ { "from": "system", "value": "Remove a few useless methods from search class\n" }, { "from": "human", "value": "require_relative './filter'\nrequire_relative './organization_field'\n\nclass OrganizationSearch\n attr_accessor :start, :limit, :sort, :order,\n :calc_found_rows, :fie...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to allow for ActiveSupport versions below 7.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jsonapi/matchers/version'\n\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Declare support for Rails 4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"knockoutjs-rails/version\"\n\nGem::Specification.new do |s|\n s.name = \"knockoutjs-rails\"\n s.version =...
ruby
chosen
[ { "from": "system", "value": "Create directory if not exist\n" }, { "from": "human", "value": "require \"pathname\"\n\nmodule Autodoc\n class Documents\n def initialize\n @table = Hash.new {|table, key| table[key] = [] }\n end\n\n def append(context)\n document = Autodoc::Doc...
ruby
chosen
[ { "from": "system", "value": "Remove the rake tasks require\n" }, { "from": "human", "value": "# make sure we're running inside Merb\nif defined?(Merb::Plugins)\n Merb.logger.info \"loading simple forms helpers\"\n require Pathname(__FILE__).dirname.expand_path / 'merb-simple-forms' / 'simple-...
ruby
chosen
[ { "from": "system", "value": "Add generate administrator rake task. :smiley:\n" }, { "from": "human", "value": "namespace :admin do\n desc 'Grunt a user as administation'\n task add: :environment do\n email = ENV['email']\n logger = Logger.new(File.join(Rails.root, 'log', 'admin.log'))\n...
ruby
chosen
[ { "from": "system", "value": "rubocop: Use find_by instead of where.first.\n\n" }, { "from": "human", "value": "class HomepageHeader < ApplicationRecord\n default_scope { order(active: :desc, updated_at: :desc) }\n\n validates :heading, presence: true\n\n mount_uploader :background_image, Bac...
ruby
chosen
[ { "from": "system", "value": "Add better error message when validation fails.\n" }, { "from": "human", "value": "class StudyValidator\n def initialize\n @conditions = [\n {\n nct_id: 'NCT00734539',\n columns_or_associated_objects: {\n outcomes: { count: 24 },\n ...
ruby
chosen
[ { "from": "system", "value": "Remove blocks from Runtime::Browser.visit calls within Mattermost tests\n\nUse .perform instead of .act in Mattermost test\n\nSigned-off-by: ddavison <2d8af30be2746a8359c9d49236dee9d2380c4fc1@gitlab.com>\n" }, { "from": "human", "value": "# frozen_string_literal: tr...
ruby
chosen
[ { "from": "system", "value": "Use Concurrent::Obligation to manage SagaStatus state.\n" }, { "from": "human", "value": "module Aggro\n # Public: Tracks the state of a saga as it processes.\n class SagaStatus\n include Projection\n\n attr_reader :reason\n attr_reader :value\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Check if log dir is writable\n" }, { "from": "human", "value": "module Appsignal\n class Railtie < Rails::Railtie\n rake_tasks do\n load \"tasks/auth_check.rake\"\n end\n\n initializer \"appsignal.configure_rails_initialization\" do |app|\n # Som...
ruby
chosen
[ { "from": "system", "value": "Change name of constructor's argument in User\n" }, { "from": "human", "value": "module CodewarsApi\n class User\n def initialize(username)\n fail 'Username is not set' unless username\n @response = RequestHelper.get(\"#{CodewarsApi::API_URL}/users/#{u...
ruby
chosen
[ { "from": "system", "value": "Add missing single_quad definition for ConfiguredSystemDecorator\n" }, { "from": "human", "value": "class ConfiguredSystemDecorator < MiqDecorator\n def self.fonticon\n 'ff ff-configured-system'\n end\nend\n" }, { "from": "gpt", "value": "class Conf...
ruby
chosen
[ { "from": "system", "value": "Add a weird pending test.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rack/client/adapter/faraday'\n\ndescribe Faraday::Adapter::RackClient do\n\n let(:url) { URI.join(@base_url, '/faraday') }\n\n let(:conn) do\n Faraday.new(:url => url) ...
ruby
chosen
[ { "from": "system", "value": "Test that navigating to admin/pages/new works\n\nThis test reproduces #43\n\nConflicts:\n\tspec/features/config_spec.rb\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'Configuration of a site' do\n describe 'valid configuration' do\n befor...
ruby
chosen
[ { "from": "system", "value": "Make sure ruby facet depends on application facet\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at...
ruby
chosen
[ { "from": "system", "value": "Add count between challenge.\n:q\nwq\nx\nq\nsubl .\n" }, { "from": "human", "value": "# Count Between\n\n# I worked on this challenge [by myself, with: ].\n\n# count_between is a method with three arguments:\n# 1. An array of integers\n# 2. An integer lower boun...
ruby
chosen
[ { "from": "system", "value": "Add a message that version 2 is being used to the standard output (don't want to break people's stuff without them knowing)\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'discordrb/version'\nrequire 'discordrb/bot'\nrequire 'discordrb/c...
ruby
chosen
[ { "from": "system", "value": "Add support for .cocoapods.yml files as well as cocoadocs.yml settings\n" }, { "from": "human", "value": "class CocoaDocsSettings\n\n def self.settings_at_location download_location\n cocoadocs_settings = download_location + \"/.cocoadocs.yml\"\n settings = Y...
ruby
chosen
[ { "from": "system", "value": "Fix another, almost identical, search bug\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n def index\n if params[:q]\n redirect_to search_path(URI.escape(params[:q].strip))\n elsif params[:term].present?\n @term = ...
ruby
chosen
[ { "from": "system", "value": "Remove default value for app_root\n\nIf PWD is going to be used as the default app root, it should be defined in\nthe reporters. This implementation only worked when using the middleware and\nits default logger.\n" }, { "from": "human", "value": "require 'pilfer/log...
ruby
chosen
[ { "from": "system", "value": "Check for $VISUAL before $EDITOR\n" }, { "from": "human", "value": "require 'projectionist'\nrequire 'thor'\n\nmodule Projectionist\n class CLI < Thor\n attr_accessor :projections\n\n def initialize(*)\n @projections = Projectionist::Projections.new\n ...
ruby
chosen
[ { "from": "human", "value": "Make module for enum constants\n" }, { "from": "gpt", "value": "module TastingEnums\n extend ActiveSupport::Concern\n\n\tRED_FRUIT_ENUMS = { red: 1, \n blue: 2, \n black: 3}\n WHITE_FRUIT_ENUMS = { cit...
ruby
chosen
[ { "from": "system", "value": "Add fetch method to return a radbeacon with a given mac\n" }, { "from": "human", "value": "module Radbeacon\n class Scanner < LeScanner\n\n C_DEVICE_NAME = \"0x0003\"\n RADBEACON_USB = \"52 61 64 42 65 61 63 6f 6e 20 55 53 42\"\n\n def scan\n radbeaco...
ruby
chosen
[ { "from": "system", "value": "Add methods for public and private adding\n" }, { "from": "human", "value": "class FileStorageService\n\n def self.get_object(storage_key)\n get_bucket.object(storage_key)\n end\n\n def self.get_string_io(storage_key)\n get_object(storage_key).get.body\n e...
ruby
chosen
[ { "from": "system", "value": "Sort packages in spreadsheet by name" }, { "from": "human", "value": "namespace :downloads do\n\n desc \"make downloadable for packages\"\n task packages: :environment do\n book = Spreadsheet::Workbook.new\n\n sheet = book.create_worksheet name: 'Julia Packa...
ruby
chosen
[ { "from": "system", "value": "[google] Add support for instance tags\n" }, { "from": "human", "value": "def test\n connection = Fog::Compute.new({ :provider => \"Google\" })\n\n server = connection.servers.create(defaults = {\n :name => \"fog-smoke-test-#{Time.now.to_i}\",\n :image_name ...
ruby
chosen
[ { "from": "system", "value": "Test with not-null constraint and index\n" }, { "from": "human", "value": "ActiveRecord::Schema.define(:version => 1) do\n\n create_table \"articles\", :force => true do |t|\n t.column \"headline\", \"string\"\n t.column \"section\", \"string\"\n t.column ...
ruby
chosen
[ { "from": "system", "value": "Support multiple values for one header\n" }, { "from": "human", "value": "module HTTP\n class Response\n attr_reader :headers, :cookies\n\n def initialize(native_response, cookies)\n @native_response = native_response\n @headers = Headers.new(native...
ruby
chosen
[ { "from": "system", "value": "Make ActiveStorage update migration compatible with install migration\n\nIf you install active_storage in rails 6.1, then use rails app:update,\nthe service name migration handles that case but not the variant records\none, which fails trying to re-create the table.\n\nCo-autho...
ruby
chosen