conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Modify example to use an Observer\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\ndir = File.dirname(__FILE__) + '/../lib'\n$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)\n\nrequire 'rubygems'\nrequire 'currentcost/meter'\n\nrequire 'optparse'\n\n# Comm... | ruby | chosen |
[
{
"from": "system",
"value": "Return nil if fact not found\n"
},
{
"from": "human",
"value": "# TODO the tests should be refactored so they test this class directly\n# It is now inderectly integration tested via the other specs\n\nrequire_relative '../../classes/elastic_search'\n\nmodule Queries... | ruby | chosen |
[
{
"from": "system",
"value": "Use Time.now instead of Date.today\n\nI believe this will fix builds for ruby 1.8.7 and jrubies. Pushing so\nthat travis ci runs it.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.dirname(__FILE__) + '/lib/unit/version'\n\nGem::Specificat... | ruby | chosen |
[
{
"from": "system",
"value": "Use Ruby's new JSON-like syntax\n"
},
{
"from": "human",
"value": "module Api\n class CropsController < Api::Controller\n skip_before_action :authenticate_from_token!, only: [:index, :show]\n def index\n if params[:query].present? && (params[:query].leng... | ruby | chosen |
[
{
"from": "system",
"value": "Add file deletion to document resource\n"
},
{
"from": "human",
"value": "class DocumentsController < ApplicationController\n\n @@storage_location = '/tmp/rails'\n\n # POST /documents\n def create\n file = params[:file]\n file_name = sanitize_filename(file.... | ruby | chosen |
[
{
"from": "system",
"value": "Allow editing the new universe fields\n"
},
{
"from": "human",
"value": "# Controller for the Universe model\nclass UniversesController < ContentController\n private\n\n def content_params\n params.require(:universe).permit(content_param_list)\n end\n\n def c... | ruby | chosen |
[
{
"from": "system",
"value": "Use onestop_id setter to create valid onestop IDs\n"
},
{
"from": "human",
"value": "module HasAOnestopId\n extend ActiveSupport::Concern\n\n included do\n validates :onestop_id, presence: true\n validate :onestop_id, :validate_onestop_id\n\n def self.fin... | ruby | chosen |
[
{
"from": "system",
"value": "Copy timestamps from Notifications to Conversations"
},
{
"from": "human",
"value": "class NotificationsToMailboxer < ActiveRecord::Migration[5.2]\n def up\n Mailboxer.setup do |config|\n # turn off emails\n config.uses_emails = false\n end\n Not... | ruby | chosen |
[
{
"from": "human",
"value": "Add a simple example config\n"
},
{
"from": "gpt",
"value": "media_player 'KoKodi' do\n platform :kodi\n host 'http://192.168.0.13'\n port 8080\nend\n\n#\n#automation 'Activate movie playing scene' do\n# trigger.when('KoKodi').state(to: 'playing')\n#end\n"
}
] | ruby | chosen |
[
{
"from": "system",
"value": "Remove duplicated user extension requires\n\nWe only want to load the user extension we need for the selected user\nclass.\n"
},
{
"from": "human",
"value": "require 'alchemy/solidus/alchemy_user_extension'\nrequire 'alchemy/solidus/spree_user_extension'\nrequire 'a... | ruby | chosen |
[
{
"from": "system",
"value": "Use java_import instead of import so that rake doesn't get confused."
},
{
"from": "human",
"value": "include Java\n\nmodule Babosa\n module UTF8\n # A UTF-8 proxy module using Java's built-in Unicode support. Requires JRuby 1.5+.\n module JavaProxy\n ex... | ruby | chosen |
[
{
"from": "system",
"value": "Fix ownership relations (sorry for multiple commits...)\n"
},
{
"from": "human",
"value": "class CreateOwnerships < ActiveRecord::Migration\n def change\n create_table :ownerships do |t|\n t.belongs_to :user_id, index: true, foreign_key: true\n t.belon... | ruby | chosen |
[
{
"from": "system",
"value": "Check for local modification before doing build from lockfile\n"
},
{
"from": "human",
"value": "module GitCompound\n module Command\n module Procedure\n # BuildLock procedure class\n #\n class BuildLock < Procedure\n include Element::Manif... | ruby | chosen |
[
{
"from": "system",
"value": "Fix sql in teams controller\n"
},
{
"from": "human",
"value": "class TeamsController < ApplicationController\n def show\n @branch = Branch.find_by!(name: params[:branch])\n @branches = Branch.order('order_id')\n @team = MaintainerTeam.find_by!(login: \"@#{... | ruby | chosen |
[
{
"from": "system",
"value": "Add token back into user params\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n before_filter :authenticate, only: [:show, :update, :destroy]\n\n def sign_in\n user = User.find_by(email: params[:email])\n if user && user.au... | ruby | chosen |
[
{
"from": "system",
"value": "Define the new action for the User controller\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n def show\n @user = User.find(params[:id])\n end\n\n def new\n end\nend\n"
},
{
"from": "gpt",
"value": "class UsersCon... | ruby | chosen |
[
{
"from": "system",
"value": "Create a post instance for the user dashboard page\n\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n before_action :set_user, :only => [:show]\n before_action :authenticate_user!\n before_action :user_owner, :only => [:s... | ruby | chosen |
[
{
"from": "system",
"value": "Order payments by created_at and pick the latest\n"
},
{
"from": "human",
"value": "Spree::Order.class_eval do\n\n\tdef last_payment_method\n\t\treturn nil if last_payment.blank?\n\t\treturn last_payment.payment_method\n\tend\n\n\tdef last_payment\n\t\treturn nil if... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to modifying the protected attributes\n\nYay, rails 4\n\nChange-Id: Iab0dd87fa84128a18668176811544c65ff0a17e5\n"
},
{
"from": "human",
"value": "Spree::Taxon.class_eval do\n attr_accessible :header\n\n has_attached_file :header,\n styles: { normal: '1000... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce access to class attributes\n"
},
{
"from": "human",
"value": "module HumanistErrors\n class Search\n attr_accessor :found_error\n attr_accessor :error_object, :ruby_error_message\n\n def self.run(error_object, ruby_error_message)\n searcher = n... | ruby | chosen |
[
{
"from": "system",
"value": "Use single quoted string instead of %q{}\n"
},
{
"from": "human",
"value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ltsv_logger_formatter/version'\n\nGem::Specification.new do |spec|\n spec.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow a single space for display name for employee engagement landing page.\n"
},
{
"from": "human",
"value": "class CompanyProfile\n\n def self.normalize(data)\n {}.tap do |result|\n result[:email_s] = 'anonymous@code.org'\n result[:name_s] = required... | ruby | chosen |
[
{
"from": "system",
"value": "Add solution and reflection for challenge 5.7'\n"
},
{
"from": "human",
"value": "# Die Class 1: Numeric\n\n# I worked on this challenge [by myself, with: ]\n\n# I spent [] hours on this challenge.\n\n# 0. Pseudocode\n\n# Input:\n# Output:\n# Steps:\n\n\n# 1. Initia... | ruby | chosen |
[
{
"from": "system",
"value": "Set a max step for execution\n\ngit-svn-id: bbecf9db08a75a77aa31d13d235dbc25c5353c8b@18 82013aef-fb27-0410-99a1-c1893322ecab\n"
},
{
"from": "human",
"value": "module ActionFlow\n class Workflow\n def initialize(*steps)\n @steps = []\n steps.each { |s|... | ruby | chosen |
[
{
"from": "system",
"value": "Use built-in HTTP_AUTHORIZATION build helper\n"
},
{
"from": "human",
"value": "ENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\n\nclass ActiveSupport::TestCase\n # Setup all fixtures in test/... | ruby | chosen |
[
{
"from": "system",
"value": "Fix retrieval of hostname fact based on network.\n\nWhen Facter.value(:domain) is nil the facts fqdn_<network> are failing\nwith :\n\nCould not retrieve fact='fqdn_external', resolution='<anonymous>': undefined method `empty?' for nil:NilClass\n\nChange-Id: I3e7fa983d4cf91c6ab2... | ruby | chosen |
[
{
"from": "system",
"value": "Split validation functionality into HTML and CSS\n"
},
{
"from": "human",
"value": "require 'headhunter'\nrequire 'headhunter/rack/capturing_middleware'\n\nclass Headhunter\n module Rails\n class Railtie < ::Rails::Railtie\n initializer \"headhunter.hijack\... | ruby | chosen |
[
{
"from": "system",
"value": "Rename being_operation to start and make it public.\n"
},
{
"from": "human",
"value": "module Noam\n class Lemma\n attr_reader :listener, :player, :name, :hears, :plays\n\n # Initialize a new Lemma instance.\n #\n def initialize(name, dev_type, response... | ruby | chosen |
[
{
"from": "system",
"value": "Replace accent character using sub instead of tr\n\nWhen replace accent character in PinYin with normal English character,\ndo not use \"tr\", but use \"sub\" instead. Because for ruby 1.8, a accent\ncharacter is treat as two or more characters and when replace using\n\"tr\", i... | ruby | chosen |
[
{
"from": "system",
"value": "Remove comments after port definition\n"
},
{
"from": "human",
"value": "module VhdlDoctest\n class DUT\n def self.parse(path)\n entity, ports, cases = DoctestParser.new(path).parse\n new(entity, ports, cases)\n end\n\n attr_accessor :entity, :po... | ruby | chosen |
[
{
"from": "system",
"value": "Change gem \"homepage\" property to the GitHub project.\n\nThanks to @mislav for this."
},
{
"from": "human",
"value": "# encoding: utf-8\nKernel.load File.expand_path('../lib/guard/test/version.rb', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'gua... | ruby | chosen |
[
{
"from": "human",
"value": "Add Renoir::ClusterInfo which stores slots and nodes information\n"
},
{
"from": "gpt",
"value": "module Renoir\n class ClusterInfo\n class << self\n def node_name(host, port)\n \"#{host}:#{port}\"\n end\n end\n\n def initialize\n @slo... | ruby | chosen |
[
{
"from": "system",
"value": "Use a python shim for running for auth_ed25519 helper\n\nWhen mysql ed25519 authentication is enabled, puppet-tripleo\nuses a python helper to generate password hashes. Python\nhelpers have their +x permission stripped on install time,\nso run the helper via the right python in... | ruby | chosen |
[
{
"from": "system",
"value": "Add sidebar to product page.\n"
},
{
"from": "human",
"value": "module Spree\n ProductController.class_eval do\n\n def show\n @variants = @product.variants_including.active(current_currency).includes([:option_values, :images])\n @product_properties = @... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Make sure that api requires authentication by default\"\n\nThis reverts commit 3e89c8e52ced3935f74048f288aa9cdc524c88dc.\n\nThis is causing issues with the frontend & backend builds that need to be fixed before this commit can be applied.\n"
},
{
"from": "human... | ruby | chosen |
[
{
"from": "system",
"value": "Define accessor for Organizer Attrs.\n"
},
{
"from": "human",
"value": "require 'eventbrite/identity'\n\nmodule Eventbrite\n class Organizer < Eventbrite::Identity\n attr_reader :name, :url\n object_attr_reader :HtmlString, :description\n end\nend"
},
{
... | ruby | chosen |
[
{
"from": "system",
"value": "Update reddit job to skip the sticky\n"
},
{
"from": "human",
"value": "recurring_job('1m') do\n listing = JSON.parse(Net::HTTP.get(URI('https://www.reddit.com/r/todayilearned.json?limit=1')))\n title = listing['data']['children'][0]['data']['title']\n {reddit_he... | ruby | chosen |
[
{
"from": "system",
"value": "[Aula] Fix error when something goes wrong\n"
},
{
"from": "human",
"value": "module Iesde\n module Api\n class ObterAula < ::Iesde::API\n def initialize(format, opts)\n super(:aulas, format, opts)\n end\n end\n end\nend\n"
},
{
"fro... | ruby | chosen |
[
{
"from": "system",
"value": "Add exception message to log message field\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass JsonLimitBacktrace < SemanticLogger::Formatters::Json\n def exception\n return unless log.exception\n super\n # limits the stack trace leng... | ruby | chosen |
[
{
"from": "system",
"value": "Add guard to execution policy.\n"
},
{
"from": "human",
"value": "# -*- coding: utf-8 -*-\n#\n# Cookbook Name:: windows_setup\n# Recipe:: default\n#\n# Author:: Sean Fisk <sean@seanfisk.com>\n# Copyright:: Copyright (c) 2014, Sean Fisk\n# License:: Apache License, V... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor User auth helper methods\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n helper_method :current_user\n helper_method :signed_in?\n\n def sign_in!(user)\n session[:sessi... | ruby | chosen |
[
{
"from": "system",
"value": "Add email to devise sign up params\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n include Exceptions\n \n before_action :set_locale\n after_filter :set_csrf_cookie\n rescue_from Exceptions::Forbidden, with: :rescue_fro... | ruby | chosen |
[
{
"from": "system",
"value": "Remove comments form app controller\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with: :ex... | ruby | chosen |
[
{
"from": "system",
"value": "Fix displaying correct message when not a company user.\n"
},
{
"from": "human",
"value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n\n # Overwriting the sign_out redirect path method\n def after_sign_out_path_for(resource_or_sc... | ruby | chosen |
[
{
"from": "system",
"value": "Fix post update script execution\n"
},
{
"from": "human",
"value": "require 'shellwords'\n\nmodule V1\n class WebhooksController < BaseController\n # No authorization necessary for webhook\n skip_before_action :doorkeeper_authorize!\n\n # POST /v1/webhooks... | ruby | chosen |
[
{
"from": "system",
"value": "Fix generated spec for index template\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\nRSpec.describe \"issues/index\", type: :view do\n let(:project){ FactoryGirl.create(:project, owner: user) }\n let(:user){ FactoryGirl.create(:user) }\n before(:eac... | ruby | chosen |
[
{
"from": "system",
"value": "Improve validation rule for postcode\n"
},
{
"from": "human",
"value": "# == Schema Information\n#\n# Table name: maps\n#\n# id :integer not null, primary key\n# address :string(255)\n# city :string(255)\n# postcode ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix class scoping and rewrite position calc loop.\n"
},
{
"from": "human",
"value": "module Pentago\n class DummyPlayer < Pentago::Player\n def compute_next_move(board)\n # search for empty space w/ a highly precise algorithm :)\n x, y = rand(Pentago::... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Task spec failing when run at certain times.\n\nIn particular, when Date.today gives the same day as 1.day.from_now\ndue to timezone difference.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Task do\n\n describe \"mass assignment\" do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix description in pass spec\n"
},
{
"from": "human",
"value": "require File.expand_path(\"spec_helper\", File.dirname(File.dirname(__FILE__)))\n\ndescribe \"pass plugin\" do \n it \"executes on no arguments\" do\n app(:pass) do |r|\n r.on :id do |id|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix title to test level log\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'RubyRabbitmqJanus::Log', type: :config, name: :log do\n it 'Log instance is correctly loading' do\n expect(RubyRabbitmqJanus::Tools... | ruby | chosen |
[
{
"from": "human",
"value": "Add tests / stubs for setup command generator.\n"
},
{
"from": "gpt",
"value": "require \"./lib/newline_hw/shell/setup\"\n\ndescribe NewlineHw::Shell::Setup do\n it \"can generate a setup command based upon an id\" do\n # expect(NewlineHw::Shell::Setup.new(1, {})... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless private access modifier\n"
},
{
"from": "human",
"value": "require 'dentaku'\n\nmodule Riews\n class ColumnPattern\n\n def initialize(pattern)\n @pattern = pattern\n end\n\n def format(row)\n replacement_patterns = row.map{|k, v| [... | ruby | chosen |
[
{
"from": "system",
"value": "Define steps to show a given meeting's talks with the meeting itself\n"
},
{
"from": "human",
"value": "Given /^there (?:is|are) (\\d+) meetings?$/ do |count|\n @meeting = FactoryGirl.create(:meeting, {description: 'The quick brown fox jumped over the lazy dog'});\... | ruby | chosen |
[
{
"from": "system",
"value": "Add simple test for new battle command method\n"
},
{
"from": "human",
"value": "require_relative '../../../lib/Battle/BattleCommand/battle_command.rb'\n\nRSpec.describe BattleCommand do\n\n context \"constructor\" do\n it \"has the correct default parameters\" ... | ruby | chosen |
[
{
"from": "system",
"value": "Change the human friendly date formats.\n"
},
{
"from": "human",
"value": "include Nanoc::Helpers::Blogging\ninclude Nanoc::Helpers::Rendering\ninclude Nanoc::Helpers::LinkTo\n\n##\n# Returns a `<time>` tag for the given date string.\n#\n# @param [String] date\n# @r... | ruby | chosen |
[
{
"from": "system",
"value": "[sshd] Make upstart dependent on the platform version\n"
},
{
"from": "human",
"value": "log 'Configuring sshd...'\n\ntemplate '/etc/ssh/sshd_config' do\n owner 'root'\n group 'root'\n mode '600'\n source 'sshd_config.erb'\n variables({\n port: node[:sshd][:... | ruby | chosen |
[
{
"from": "system",
"value": "Remove usage of ||= in Configuration\n"
},
{
"from": "human",
"value": "module Virtus\n\n class Configuration\n\n attr_accessor :coerce\n\n def initialize\n @coerce = true # default\n end\n\n def call(&block)\n yield self if block_given?\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor has_option Variant scope test\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"Variant scopes\" do\n let!(:product) { Factory(:product) }\n let!(:variant_1) { Factory(:variant, :product => product) }\n let!(:variant_2) { Factory(:va... | ruby | chosen |
[
{
"from": "system",
"value": "Use the dynamic gemspec from `bundle gem`\n\nExcept the VERSION file because I'm not really using an application namespace.\nIf I add more complexity / files, then I will probably use this.\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove rescue to expose errors\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass Url\n\n def initialize(note)\n\n url = note.inferred_url\n\n return if url.blank?\n\n url = resolve_url(url)\n\n doc = Pismo::Document.new(url)\n\n note.url ... | ruby | chosen |
[
{
"from": "human",
"value": "Add a benchmark comparing gsub and tr performance difference for single character translations\n"
},
{
"from": "gpt",
"value": "require 'benchmark/ips'\n\nBenchmark.ips do |x|\n y = '1_2_3_4_5_6_7_8_9_10'\n\n x.report('gsub') do |_times|\n y.gsub('_', ' ')\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade Blink1Control.app to v1.7\nEnable checksum in Blink1Control.app\n"
},
{
"from": "human",
"value": "class Blink1control < Cask\n url 'http://thingm.com/blink1/downloads/Blink1Control-mac.zip'\n homepage 'http://blink1.thingm.com/'\n version 'latest'\n sha... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade Little Snitch to v3.5.2\n"
},
{
"from": "human",
"value": "cask :v1 => 'little-snitch' do\n version '3.5.1'\n sha256 'c743187a5bb8abd36d9d41cc95944b37f6d965f761319f2ffae6d55e8ce45050'\n\n url \"http://www.obdev.at/downloads/littlesnitch/LittleSnitch-#{ver... | ruby | chosen |
[
{
"from": "system",
"value": "Rename README to README.rdoc in gemspec\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'haproxy_log_parser'\n s.version = IO.read('VERSION').chomp\n s.authors = ['Toby Hsieh']\n s.homepage = 'https://github.com/tobyhs/haproxy_log_par... | ruby | chosen |
[
{
"from": "system",
"value": "Make teaspoon configuration more reliable\n\nPreviously `rake teaspoon` worked, but bundle exec teaspon didn't. It\nseemed to have some weirdness related to whether migrations had\npreviously been run or not.\n\nThis commit makes running teaspoon always work, regardless of the\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove nil on hashify helper"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule Charging\n module Helpers\n module_function\n\n def load_variables(object, attributes, hash)\n attributes.each do |attribute|\n value = hash.fetch(attribute,... | ruby | chosen |
[
{
"from": "human",
"value": "Load events to queue for reprocessing\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n#\n# Copyright 2012 Georgios Gousios <gousiosg@gmail.com>\n#\n# Redistribution and use in source and binary forms, with or\n# without modification, are permitted provided that... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor Leagues per pelusa output\n"
},
{
"from": "human",
"value": "require 'fanfeedr/utils'\n\nmodule Fanfeedr\n class Leagues\n\n include Fanfeedr::Utils\n\n attr_reader :api_key, :list\n\n def initialize(api_key)\n @api_key = api_key\n @list... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for power up\n"
},
{
"from": "human",
"value": "require './hero'\n\ndescribe Hero do \n it \"has a capitalized name\" do \n hero = Hero.new 'mike'\n\n expect(hero.name).to eq 'Mike' #hero.name == 'Mike'\n end\nend"
},
{
"from": "gpt",
"v... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Tag to Entry association\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass Tag < ActiveRecord::Base\n has_many :taggings,\n dependent: :destroy\n has_many :entries,\n through: :taggings,\n source: :tag,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add method `full_message` to Offense\n"
},
{
"from": "human",
"value": "module Apilint\n Offense = Struct.new(:obj, :attr, :msg) do\n end\nend\n"
},
{
"from": "gpt",
"value": "module Apilint\n Offense = Struct.new(:obj, :attr, :msg) do\n def full_m... | ruby | chosen |
[
{
"from": "system",
"value": "Set CREATED value in ical\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass AssignmentsIcs\n def initialize(assignments)\n @assignments = assignments\n end\n\n def output\n calendar.to_ical\n end\n\n private\n\n def calendar\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Create an input which generates a datalist tag\n\nCreate an input which supports http://www.w3schools.com/tags/tag_datalist.asp\r\nUsed as follows\r\nf.input :fieldname, as: datalist, collection: [\"list\", \"of\", \"items\"]\r\ncollection option accepts all formats supported by... | ruby | chosen |
[
{
"from": "system",
"value": "Make passenger-status and other admin tools respect the PASSENGER_TMPDIR variable. This has a higher priority than TMPDIR.\n"
},
{
"from": "human",
"value": "module Passenger\n\nmodule AdminTools\n\tdef self.tmpdir\n\t\tif ENV[\"TMPDIR\"] && !ENV[\"TMPDIR\"].empty?\... | ruby | chosen |
[
{
"from": "system",
"value": "Send circonus payload as json"
},
{
"from": "human",
"value": "module Reporter\n class BodyBuilder < Struct.new(:shards)\n def lift\n {\n 'key' => {\n '_type' => 'n',\n '_value' => shards.flatten\n }\n }\n end\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Add opted_out field to DataMapper model\n\nThis shouldn't be necessary because I'm working to replace\nDataMapper with sequal, but for the sake of consistency.\n"
},
{
"from": "human",
"value": "require 'thread'\n\nmodule Tech404logs\n class User\n include DataM... | ruby | chosen |
[
{
"from": "system",
"value": "Make first test use of greek string gem\n"
},
{
"from": "human",
"value": "module Gregex\n class Map\n\n MAP = { '\\w' => Gregex::Constants::ALL,\n '[α-ω]' => Gregex::Constants::PLAIN_VOWELS,\n '[^α-ω]' => Gregex::Constants::CONSONANTS,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Support for >1 patch files & writing to disk.\n\nThe `purdypatch` CLI tool now accepts multiple patch email files, and will\nwrite a purdified copy of the patch email alongside the original file with\nthe file extension changed to '.purdypatch'.\n\nThis allows for the following... | ruby | chosen |
[
{
"from": "system",
"value": "Index after running migrations automatically so it will happen on Heroku\n"
},
{
"from": "human",
"value": "namespace :db do\n desc \"Rebuild the multisearch index\"\n task :index do\n puts \"-- rebuild postgresql multisearch index\"\n %w(artist episode perf... | ruby | chosen |
[
{
"from": "system",
"value": "Fix email in variables of template resource; add in password.\n"
},
{
"from": "human",
"value": "# Cookbook Name:: right_api_client\n# Recipe:: configure_users\n#\n# Copyright 2013, Chris Fordham\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")... | ruby | chosen |
[
{
"from": "system",
"value": "Increment CocoaPods version to 1.1.2\n"
},
{
"from": "human",
"value": "\nPod::Spec.new do |s|\n s.name = \"Rally\"\n s.version = \"1.1.1\"\n s.summary = \"Summary goes here.\"\n\n s.description = <<-DESC\n \n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration to create Aichi 11 targets table\n"
},
{
"from": "gpt",
"value": "class CreateAichi11Targets < ActiveRecord::Migration\n def change\n create_table :aichi11_targets do |t|\n t.integer :country_id\n\n t.float :coverage_terrestrial\n t.f... | ruby | chosen |
[
{
"from": "system",
"value": "Use hybrid cookie serializer to not break existing cookies.\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.action_dispatch.cookies_serializer = :json\n"
},
{
"from": "gpt",
"valu... | ruby | chosen |
[
{
"from": "system",
"value": "Add meta data about our gem\n\nFeel free to fix your guises email to something else if you would like\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'Ka... | ruby | chosen |
[
{
"from": "system",
"value": "Add name, email, password_digest to user migration\n"
},
{
"from": "human",
"value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "class CreateUsers < Acti... | ruby | chosen |
[
{
"from": "human",
"value": "Copy Podspec file to this repository for reference\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = 'OBShapedButton'\n s.version = '1.0.2'\n s.license = 'MIT'\n s.summary = 'A UIButton subclass that works with non-rectangular button shapes.... | ruby | chosen |
[
{
"from": "human",
"value": "Test that passing external host redirects to root\n"
},
{
"from": "gpt",
"value": "# Copyright 2011-2018, The Trustees of Indiana University and Northwestern\n# University. Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec prior to repository renaming\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"RTSMediaPlayer\"\n s.version = \"0.1.0\"\n s.summary = \"Shared media player for RTS mobile apps.\"\n s.... | ruby | chosen |
[
{
"from": "system",
"value": "Convert messy set of ifs to case.\n"
},
{
"from": "human",
"value": "require 'gir_ffi/builder_helper'\n\nmodule GirFFI\n module InfoExt\n module ITypeInfo\n include BuilderHelper\n\n def layout_specification_type\n ffitype = GirFFI::Builder.ityp... | ruby | chosen |
[
{
"from": "human",
"value": "Add monkeypatch for Gitlab api.\n"
},
{
"from": "gpt",
"value": "require 'gitlab'\n\n# http://doc.gitlab.com/ce/api/commits.html#post-comment-to-commit\n\nclass Gitlab::Client\n module MergeRequests\n # Adds a comment to a merge request.\n #\n # @example\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 1.4.0.0 to 2.5.0.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '1.4.0.0'\n s.summary = 'Common primitives for platform-specific messaging im... | ruby | chosen |
[
{
"from": "system",
"value": "Switch sparkle to use ANSI escape codes.\n"
},
{
"from": "human",
"value": "class Message\n attr_accessor :source, :target, :args, :cmd, :cmd_args\n def initialize(source, target, args)\n @source = parse_source(source)\n @target = parse_target(target)\n @... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Temporarily change gem version back to 2.0\"\n\nThis reverts commit dd24ea232d5cbb02b7ad43946409fec3c1b78b47.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nGem::Specification.new do |s|\n s.name = 'bosh_aws_cpi'\n s.version = '2.0.0' \n... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec to Swift 4.2 as well.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"FontAwesome.swift\"\n s.version = \"1.4.4\"\n s.summary = \"Use Font Awesome in your Swift projects\"\n s.homepage = \... | ruby | chosen |
[
{
"from": "system",
"value": "Remove useless token and botan_token setting\n"
},
{
"from": "human",
"value": "require 'telegram/bot'\r\nrequire 'telegram/bot/botan'\r\nrequire_relative '../config/config'\r\nrequire_relative 'action'\r\n\r\nmodule Bot\r\n class Client\r\n def initialize(token... | ruby | chosen |
[
{
"from": "system",
"value": "Update to use sort parameter"
},
{
"from": "human",
"value": "require_relative 'base'\nrequire_relative 'exceptions'\n\nclass GdsApi::ContentApi < GdsApi::Base\n include GdsApi::ExceptionHandling\n\n def sections\n get_json!(\"#{base_url}/tags.json?type=section... | ruby | chosen |
[
{
"from": "human",
"value": "Add cask for Apache Directory Studio.\n"
},
{
"from": "gpt",
"value": "class ApacheDirectoryStudio < Cask\n url 'http://mirrors.sonic.net/apache//directory/studio/dist/2.0.0.v20130628/ApacheDirectoryStudio-macosx-x86_64-2.0.0.v20130628.dmg'\n homepage 'http://direc... | ruby | chosen |
[
{
"from": "human",
"value": "Implement sample class and tests\n"
},
{
"from": "gpt",
"value": "require \"bundler/setup\"\nrequire \"minitest/autorun\"\nrequire \"minitest/reporters\"\n\nclass Calc\n def add(x, y)\n x + y\n end\nend\n\nclass TestCalc < Minitest::Test\n def setup\n... | ruby | chosen |
[
{
"from": "system",
"value": "Read URL as an argument from the command line\n\nadd begin rescue blog to print error messages\n"
},
{
"from": "human",
"value": "require 'net/http'\n\nurl = \"http://tommyjohn.com\"\nurl2 = \"http://porkchop.club/\"\n\ndef check_www(url)\n uri = URI.parse(url)\n ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.