_id
stringlengths
2
6
title
stringlengths
9
130
partition
stringclasses
3 values
text
stringlengths
30
4.3k
language
stringclasses
1 value
meta_information
dict
q10200
Bixby.CommandSpec.manifest
train
def manifest if File.exists?(manifest_file) && File.readable?(manifest_file)
ruby
{ "resource": "" }
q10201
Bixby.CommandSpec.to_s
train
def to_s # :nocov: s = [] s << "CommandSpec:#{self.object_id}" s << " digest: #{self.digest}" s << " repo: #{self.repo}" s << " bundle: #{self.bundle}" s << " command: #{self.command}" s << " args: #{self.args}" s << " user: #{self.user}"
ruby
{ "resource": "" }
q10202
LatoBlog.Category.check_category_father_circular_dependency
train
def check_category_father_circular_dependency return unless self.lato_blog_category_id all_children = self.get_all_category_children same_children = all_children.select { |child| child.id === self.lato_blog_category_id } if same_children.length >
ruby
{ "resource": "" }
q10203
LatoBlog.Category.check_lato_blog_category_parent
train
def check_lato_blog_category_parent category_parent = LatoBlog::CategoryParent.find_by(id: lato_blog_category_parent_id) if !category_parent errors.add('Category parent', 'not exist for the category') throw :abort return end same_language_category = category_parent.categ...
ruby
{ "resource": "" }
q10204
NSIVideoGranulate.FakeServerManager.start_server
train
def start_server(port=9886) @thread = Thread.new do Server.prepare
ruby
{ "resource": "" }
q10205
SycLink.Importer.links
train
def links rows.map do |row| attributes = Link::ATTRS.dup - [:url]
ruby
{ "resource": "" }
q10206
Machined.Server.to_app
train
def to_app # :nodoc: Rack::Builder.new.tap do |app| app.use Middleware::Static, machined.output_path
ruby
{ "resource": "" }
q10207
Checkdin.TwitterHashtagStreams.twitter_hashtag_streams
train
def twitter_hashtag_streams(campaign_id, options={}) response = connection.get do |req| req.url
ruby
{ "resource": "" }
q10208
Checkdin.TwitterHashtagStreams.twitter_hashtag_stream
train
def twitter_hashtag_stream(campaign_id, id, options={}) response = connection.get do |req| req.url
ruby
{ "resource": "" }
q10209
RailsLegacyMapper.Mapper.root
train
def root(options = {}) if options.is_a?(Symbol) if source_route = @set.named_routes.routes[options]
ruby
{ "resource": "" }
q10210
LatoBlog.Back::CategoriesController.index
train
def index core__set_header_active_page_title(LANGUAGES[:lato_blog][:pages][:categories]) # find categories to show @categories = LatoBlog::Category.where(meta_language: cookies[:lato_blog__current_language]).order('title ASC')
ruby
{ "resource": "" }
q10211
LatoBlog.Back::CategoriesController.new
train
def new core__set_header_active_page_title(LANGUAGES[:lato_blog][:pages][:categories_new]) @category = LatoBlog::Category.new if params[:language]
ruby
{ "resource": "" }
q10212
LatoBlog.Back::CategoriesController.create
train
def create @category = LatoBlog::Category.new(new_category_params) if !@category.save flash[:danger] = @category.errors.full_messages.to_sentence
ruby
{ "resource": "" }
q10213
LatoBlog.Back::CategoriesController.edit
train
def edit core__set_header_active_page_title(LANGUAGES[:lato_blog][:pages][:categories_edit]) @category = LatoBlog::Category.find_by(id: params[:id]) return unless check_category_presence if @category.meta_language
ruby
{ "resource": "" }
q10214
LatoBlog.Back::CategoriesController.update
train
def update @category = LatoBlog::Category.find_by(id: params[:id]) return unless check_category_presence if !@category.update(edit_category_params) flash[:danger] = @category.errors.full_messages.to_sentence redirect_to lato_blog.edit_category_path(@category.id) return e...
ruby
{ "resource": "" }
q10215
LatoBlog.Back::CategoriesController.destroy
train
def destroy @category = LatoBlog::Category.find_by(id: params[:id]) return unless check_category_presence if !@category.destroy flash[:danger] = @category.category_parent.errors.full_messages.to_sentence redirect_to lato_blog.edit_category_path(@category.id) return end ...
ruby
{ "resource": "" }
q10216
Pump.Encoder.encode
train
def encode(object, options={}) object = object.to_a if defined?(ActiveRecord::Relation) && object.is_a?(ActiveRecord::Relation) fields_to_hash(options) if object.is_a?(Array) if options[:fields] encode_partial_array(object, options) else
ruby
{ "resource": "" }
q10217
NetworkExecutive.ChannelSchedule.extend_off_air
train
def extend_off_air( programs, program, stop ) prev = programs.pop + program program = prev.program occurrence = prev.occurrence remainder =
ruby
{ "resource": "" }
q10218
Reaction.Client::Signer.outgoing
train
def outgoing(message, callback) # Allow non-data messages to pass through. return callback.call(message) if %r{^/meta/} =~ message['channel'] message['ext'] ||= {}
ruby
{ "resource": "" }
q10219
PutText.Extractor.extract
train
def extract(path) files = files_in_path(path)
ruby
{ "resource": "" }
q10220
Whowas.Validatable.validate
train
def validate(input) (check_exists(required_inputs, input) && check_format(input_formats, input)) ||
ruby
{ "resource": "" }
q10221
Whowas.Validatable.check_exists
train
def check_exists(required, input) required.inject(true) do |result, key|
ruby
{ "resource": "" }
q10222
MachineConfigure.Exporter.get_files
train
def get_files return @dir.values.map do |dir| next get_files_recursively_from dir
ruby
{ "resource": "" }
q10223
Kanade.Engine.deserialize_object
train
def deserialize_object(definition, hash) return nil if hash.nil? result = definition.new result.__fields.each do |field| name = field.key_json || name_to_json(field.sym) if field.options[:as] == :list value = deserialize_list(hash[name], field) elsif field.options[:a...
ruby
{ "resource": "" }
q10224
CohortScope.BigCohort.reduce!
train
def reduce! @reduced_characteristics = if @reduced_characteristics.keys.length < 2 {} else most_restrictive_characteristic = @reduced_characteristics.keys.max_by do |key| conditions = CohortScope.conditions_for @reduced_characteristics.except(key)
ruby
{ "resource": "" }
q10225
Aptly.Snapshot.pull
train
def pull name, source, dest, kwargs={} packages = kwargs.arg :packages, [] deps = kwargs.arg :deps, true remove = kwargs.arg :remove, true if packages.length == 0 raise AptlyError.new "1 or more package names are required" end cmd = 'aptly snapshot pull' cmd += ' -no-...
ruby
{ "resource": "" }
q10226
Aptly.Snapshot.pull_from
train
def pull_from source, dest, kwargs={} packages = kwargs.arg :packages, [] deps = kwargs.arg :deps, true remove = kwargs.arg :remove, true
ruby
{ "resource": "" }
q10227
Derelict.Parser::Status.exists?
train
def exists?(vm_name = nil) return (vm_names.count > 0) if vm_name.nil?
ruby
{ "resource": "" }
q10228
Derelict.Parser::Status.state
train
def state(vm_name) unless states.include? vm_name.to_sym raise Derelict::VirtualMachine::NotFound.new
ruby
{ "resource": "" }
q10229
Derelict.Parser::Status.vm_lines
train
def vm_lines output.match(PARSE_LIST_FROM_OUTPUT).tap {|list| logger.debug "Parsing VM
ruby
{ "resource": "" }
q10230
Mongolicious.DB.get_opts
train
def get_opts(db_uri) uri = URI.parse(db_uri) { :host => uri.host, :port => uri.port, :user => uri.user,
ruby
{ "resource": "" }
q10231
Mongolicious.DB.dump
train
def dump(db, path) Mongolicious.logger.info("Dumping database #{db[:db]}") cmd = "mongodump -d #{db[:db]} -h #{db[:host]}:#{db[:port]} -o #{path}" cmd << " -u '#{db[:user]}' -p '#{db[:password]}'" unless (db[:user].nil? || db[:user].empty?)
ruby
{ "resource": "" }
q10232
WSOC.Runner.run
train
def run(*args) optparse(*args) options = { :env => :production, :host => @host, :port => @port
ruby
{ "resource": "" }
q10233
Biju.Modem.messages
train
def messages(which = "ALL") # read message from all storage in the mobile phone (sim+mem) cmd('AT+CPMS="MT"') # get message list sms = cmd('AT+CMGL="%s"' % which ) # collect messages msgs =
ruby
{ "resource": "" }
q10234
GmailMailer.Mailer.send_smtp
train
def send_smtp(mail) smtp = Net::SMTP.new(SMTP_SERVER, SMTP_PORT) smtp.enable_starttls_auto secret = { :consumer_key => SMTP_CONSUMER_KEY, :consumer_secret => SMTP_CONSUMER_SECRET, :token => @email_credentials[:smtp_oauth_token], :token_secret => @email_credentials[:smt...
ruby
{ "resource": "" }
q10235
Mango.Application.render_404_public_file!
train
def render_404_public_file!(file_name) four_oh_four_path = File.expand_path("#{file_name}.html", settings.public_dir) return unless
ruby
{ "resource": "" }
q10236
Mango.Application.render_404_template!
train
def render_404_template!(template_name) VIEW_TEMPLATE_ENGINES.each do |engine, extension| @preferred_extension = extension.to_s find_template(settings.views, template_name, engine) do |file|
ruby
{ "resource": "" }
q10237
Mango.Application.render_javascript_template!
train
def render_javascript_template!(uri_path) javascript_match = File.join(settings.javascripts, "*") javascript_path = File.expand_path(uri_path, settings.javascripts) return unless File.fnmatch(javascript_match, javascript_path)
ruby
{ "resource": "" }
q10238
Mango.Application.render_stylesheet_template!
train
def render_stylesheet_template!(uri_path) stylesheet_match = File.join(settings.stylesheets, "*") stylesheet_path = File.expand_path(uri_path, settings.stylesheets) return unless File.fnmatch(stylesheet_match, stylesheet_path)
ruby
{ "resource": "" }
q10239
Mango.Application.render_index_file!
train
def render_index_file!(uri_path) return unless URI.directory?(uri_path) index_match = File.join(settings.public_dir, "*") index_file_path = File.expand_path(uri_path + "index.html", settings.public_dir)
ruby
{ "resource": "" }
q10240
Mango.Application.render_content_page!
train
def render_content_page!(uri_path) uri_path += "index" if URI.directory?(uri_path) content_match = File.join(settings.content, "*") content_page_path = File.expand_path(uri_path, settings.content) return unless File.fnmatch(content_match, content_page_path) begin content_page...
ruby
{ "resource": "" }
q10241
Mango.Application.find_content_page
train
def find_content_page(uri_path) ContentPage::TEMPLATE_ENGINES.each do |engine, extension| @preferred_extension = extension.to_s find_template(settings.content, uri_path, engine) do |file| next unless File.file?(file)
ruby
{ "resource": "" }
q10242
EstoreConventions.ClassMethods.factory_build_for_store
train
def factory_build_for_store(atts_hash, identifier_conditions = {}, full_data_object={}, &blk) if identifier_conditions.empty? record = self.new else record = self.where(identifier_conditions).first_or_initialize end
ruby
{ "resource": "" }
q10243
Rexport.TreeNode.add_child
train
def add_child(*names) names.flatten! return unless name = names.shift node = children.find { |c| c.name == name } node ?
ruby
{ "resource": "" }
q10244
Bookmarks.Document.parse_a_bookmark
train
def parse_a_bookmark line line = line.strip if line =~ /^<DT><H3/ @h3_tags << h3_tags(line) elsif line =~ /^<\/DL>/ @h3_tags.pop elsif line =~ /<DT><A HREF="http/
ruby
{ "resource": "" }
q10245
Atlas.BoxVersion.save
train
def save # rubocop:disable Metrics/AbcSize body = { version: to_hash } # providers are saved seperately body[:version].delete(:providers) begin response = Atlas.client.put(url_builder.box_version_url, body: body) rescue Atlas::Errors::NotFoundError response = Atlas.client...
ruby
{ "resource": "" }
q10246
EnchantedQuill.Label.textRectForBounds
train
def textRectForBounds(bounds, limitedToNumberOfLines: num_of_lines) required_rect = rect_fitting_text_for_container_size(bounds.size,
ruby
{ "resource": "" }
q10247
EnchantedQuill.Label.add_link_attribute
train
def add_link_attribute(mut_attr_string) range_pointer = Pointer.new(NSRange.type) attributes = mut_attr_string.attributesAtIndex(0, effectiveRange: range_pointer).dup attributes[NSFontAttributeName] = self.font attributes[NSForegroundColorAttributeName] = self.textColor mut_attr_string.ad...
ruby
{ "resource": "" }
q10248
ShellTastic.Utils.empty_nil_blank?
train
def empty_nil_blank?(str, raize=false) result = (str !~ /[^[:space:]]/ || str.nil? || str.empty?) raise
ruby
{ "resource": "" }
q10249
Nadb.Tool.load_config
train
def load_config path = ENV['HOME'] + '/.nadb.config' if !File.exists?(path) return end
ruby
{ "resource": "" }
q10250
Nadb.Tool.run_adb_command
train
def run_adb_command(command, device = nil) full_command = construct_adb_command command, device puts full_command
ruby
{ "resource": "" }
q10251
Nadb.Tool.get_connected_devices
train
def get_connected_devices get_adb_command_output('devices')
ruby
{ "resource": "" }
q10252
Jekyll.FridgeFilters.fridge_asset
train
def fridge_asset(input) return input unless input if input.respond_to?('first') input = input.first['name'] end site = @context.registers[:site] asset_dir = site.config['fridge'].config['asset_dir'] dest_path = File.join(site.dest, asset_dir, input) path = File.join(ass...
ruby
{ "resource": "" }
q10253
Git.Trifle.cover
train
def cover(path, options={}) reset = options.delete :reset cook_layer do @dressing << Proc.new {
ruby
{ "resource": "" }
q10254
ActiveCopy.Finders.matches?
train
def matches? query query.reduce(true) do |matches, (key, value)| matches = if key == 'tag' return false unless tags.present?
ruby
{ "resource": "" }
q10255
RailsKvsDriver.ValidationDriverConfig.validate_driver_config!
train
def validate_driver_config!(driver_config) raise_argument_error!(:host) unless driver_config.has_key? :host raise_argument_error!(:port) unless driver_config.has_key? :port raise_argument_error!(:namespace) unless driver_config.has_key? :namespace raise_argument_error!(:timeout_s...
ruby
{ "resource": "" }
q10256
Hometown.CreationTracer.update_on_instance_created
train
def update_on_instance_created(clazz, on_instance_created) return unless on_instance_created clazz.instance_eval do def instance_hooks hooks = (self.ancestors + [self]).map do |target| target.instance_variable_get(:@instance_hooks) end
ruby
{ "resource": "" }
q10257
Serket.FieldEncrypter.encrypt
train
def encrypt(field) return if field !~ /\S/ aes = OpenSSL::Cipher.new(symmetric_algorithm) aes_key = aes.random_key iv = aes.random_iv
ruby
{ "resource": "" }
q10258
Serket.FieldEncrypter.parse
train
def parse(iv, encrypted_key, encrypted_text) case @format when :delimited [iv, field_delimiter, encrypted_key, field_delimiter, encrypted_text].join('') when :json hash = {} hash['iv'] =
ruby
{ "resource": "" }
q10259
Cfror.Data.save_cfror_fields
train
def save_cfror_fields(fields) fields.each do |field, value| field = Cfror::Field.find(field)
ruby
{ "resource": "" }
q10260
Cfror.Data.value_fields_for
train
def value_fields_for(source, order=nil) fields = self.send(source).fields
ruby
{ "resource": "" }
q10261
Kawaii.FormatHandler.method_missing
train
def method_missing(meth, *_args, &block) format = FormatRegistry.formats[meth]
ruby
{ "resource": "" }
q10262
Kawaii.JsonFormat.parse_params
train
def parse_params(request) json = request.body.read
ruby
{ "resource": "" }
q10263
Kawaii.JsonFormat.encode
train
def encode(response) json = response.to_json [200, { Rack::CONTENT_TYPE => 'application/json',
ruby
{ "resource": "" }
q10264
Closync.Sync.upload!
train
def upload!(local_file) @remote.directory.files.create( key: local_file.key,
ruby
{ "resource": "" }
q10265
ADAM6050.Password.obfuscate
train
def obfuscate(plain) codepoints = plain.codepoints raise FormatError if codepoints.length > 8 password = Array.new(8, 0x0E) codepoints.each_with_index do |c, i|
ruby
{ "resource": "" }
q10266
ActiveRecord.Base.to_yaml
train
def to_yaml(opts = {}) #:nodoc: if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck? super else coder = {}
ruby
{ "resource": "" }
q10267
CodeNode.SexpWalker.walk
train
def walk(s = nil) s ||= @root if [:module, :class].member?(s[0]) add_node s elsif find_relations? && s[0] == :call && s.length >= 4 &&
ruby
{ "resource": "" }
q10268
AQL.Buffer.delimited
train
def delimited(nodes, delimiter = ', ') max = nodes.length - 1 nodes.each_with_index do |element, index| element.visit(self)
ruby
{ "resource": "" }
q10269
OandaRubyClient.ExchangeRatesClient.rates
train
def rates(rates_request) rates_uri = "#{oanda_endpoint}#{RATES_BASE_PATH}#{rates_request.base_currency}.json?#{rates_request.query_string}"
ruby
{ "resource": "" }
q10270
OandaRubyClient.ExchangeRatesClient.remaining_quotes
train
def remaining_quotes remaining_quotes_response = HTTParty.get("#{oanda_endpoint}#{REMAINING_QUOTES_PATH}",
ruby
{ "resource": "" }
q10271
LegoNXT::LowLevel.Brick.reset_motor_position
train
def reset_motor_position port, set_relative transmit( DirectOps::NO_RESPONSE,
ruby
{ "resource": "" }
q10272
LegoNXT::LowLevel.Brick.run_motor
train
def run_motor port, power=100 raise ArgumentError.new("Power must be -100 through 100") if power < -100 || power > 100 transmit( DirectOps::NO_RESPONSE, DirectOps::SETOUTPUTSTATE, normalize_motor_port(port, true), sbyte(power), # power set point byte(1),
ruby
{ "resource": "" }
q10273
LegoNXT::LowLevel.Brick.transceive
train
def transceive *bits bitstring = bits.map(&:byte_string).join("") retval = connection.transceive bitstring # Check that it's a response bit. raise ::LegoNXT::BadResponseError unless retval[0] == "\x02" # Check that it's for this command. raise ::LegoNXT::BadResponseError unless retva...
ruby
{ "resource": "" }
q10274
ActionView.Renderer.render_body
train
def render_body(context, options) if options.key?(:partial) [render_partial(context, options)]
ruby
{ "resource": "" }
q10275
ActiveModel.AttributeMethods.attribute_missing
train
def attribute_missing(match, *args, &block)
ruby
{ "resource": "" }
q10276
ActiveModel.AttributeMethods.matched_attribute_method
train
def matched_attribute_method(method_name) matches = self.class.send(:attribute_method_matchers_matching, method_name)
ruby
{ "resource": "" }
q10277
ActiveSupport.Inflector.demodulize
train
def demodulize(path) path = path.to_s if i = path.rindex("::")
ruby
{ "resource": "" }
q10278
ActiveSupport.Inflector.const_regexp
train
def const_regexp(camel_cased_word) parts = camel_cased_word.split("::") return Regexp.escape(camel_cased_word) if parts.blank? last = parts.pop
ruby
{ "resource": "" }
q10279
ActiveSupport.Inflector.apply_inflections
train
def apply_inflections(word, rules, locale = :en) result = word.to_s.dup if word.empty? || inflections(locale).uncountables.uncountable?(result)
ruby
{ "resource": "" }
q10280
ActiveSupport.Dependencies.autoload_module!
train
def autoload_module!(into, const_name, qualified_name, path_suffix) return nil unless base_path = autoloadable_module?(path_suffix) mod = Module.new into.const_set const_name, mod log("constant #{qualified_name} autoloaded (module autovivified from #{File.join(base_path, path_suffix)})")
ruby
{ "resource": "" }
q10281
ActiveSupport.XmlMini_REXML.parse
train
def parse(data) if !data.respond_to?(:read) data = StringIO.new(data || "") end if data.eof? {} else silence_warnings { require "rexml/document" } unless defined?(REXML::Document) doc = REXML::Document.new(data) if doc.root merge_element!({}, d...
ruby
{ "resource": "" }
q10282
ActiveRecord.ConnectionHandling.connects_to
train
def connects_to(database: {}) connections = [] database.each do |role, database_key| config_hash = resolve_config_for_connection(database_key)
ruby
{ "resource": "" }
q10283
ActiveRecord.ConnectionHandling.clear_query_caches_for_current_thread
train
def clear_query_caches_for_current_thread ActiveRecord::Base.connection_handlers.each_value do |handler| handler.connection_pool_list.each do |pool|
ruby
{ "resource": "" }
q10284
ActiveRecord.SchemaDumper.formatted_version
train
def formatted_version stringified = @version.to_s return stringified unless stringified.length == 14
ruby
{ "resource": "" }
q10285
ActiveRecord.SchemaDumper.indexes
train
def indexes(table, stream) if (indexes = @connection.indexes(table)).any? add_index_statements = indexes.map do |index| table_name = remove_prefix_and_suffix(index.table).inspect " add_index #{([table_name]
ruby
{ "resource": "" }
q10286
ActiveSupport.TimeWithZone.formatted_offset
train
def formatted_offset(colon = true, alternate_utc_string = nil) utc? && alternate_utc_string ||
ruby
{ "resource": "" }
q10287
ActiveSupport.TimeWithZone.advance
train
def advance(options) # If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time, # otherwise advance from #utc, for accuracy when moving across DST boundaries if options.values_at(:years, :weeks, :months,
ruby
{ "resource": "" }
q10288
AbstractController.Base.process
train
def process(action, *args) @_action_name = action.to_s unless action_name = _find_action_name(@_action_name)
ruby
{ "resource": "" }
q10289
ActiveSupport.ArrayInquirer.any?
train
def any?(*candidates) if candidates.none? super else candidates.any? do |candidate|
ruby
{ "resource": "" }
q10290
ActiveRecord.Integration.cache_key
train
def cache_key if new_record? "#{model_name.cache_key}/new" else if cache_version "#{model_name.cache_key}/#{id}" else timestamp = max_updated_column_timestamp if timestamp timestamp = timestamp.utc.to_s(cache_timestamp_format)
ruby
{ "resource": "" }
q10291
ActionMailer.MailHelper.format_paragraph
train
def format_paragraph(text, len = 72, indent = 2) sentences = [[]] text.split.each do |word| if sentences.first.present? && (sentences.last + [word]).join(" ").length > len sentences << [word] else sentences.last
ruby
{ "resource": "" }
q10292
ActiveRecord.Batches.find_in_batches
train
def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil) relation = self unless block_given? return to_enum(:find_in_batches, start: start, finish: finish, batch_size: batch_size, error_on_ignore: error_on_ignore) do total = apply_limits(relation, start, finish)...
ruby
{ "resource": "" }
q10293
ActiveModel.Error.match?
train
def match?(attribute, type = nil, **options) if @attribute != attribute || (type && @type != type)
ruby
{ "resource": "" }
q10294
ActionView.CollectionCaching.fetch_or_cache_partial
train
def fetch_or_cache_partial(cached_partials, template, order_by:) order_by.each_with_object({}) do |cache_key, hash| hash[cache_key] = if content = cached_partials[cache_key] build_rendered_template(content, template) else
ruby
{ "resource": "" }
q10295
ActiveSupport.Callbacks.run_callbacks
train
def run_callbacks(kind) callbacks = __callbacks[kind.to_sym] if callbacks.empty? yield if block_given? else env = Filters::Environment.new(self, false, nil) next_sequence = callbacks.compile invoke_sequence = Proc.new do skipped = nil while true ...
ruby
{ "resource": "" }
q10296
Rails.SourceAnnotationExtractor.extract_annotations_from
train
def extract_annotations_from(file, pattern) lineno = 0 result = File.readlines(file, encoding: Encoding::BINARY).inject([]) do |list, line| lineno += 1 next list unless line =~ pattern
ruby
{ "resource": "" }
q10297
ActionController.ParamsWrapper._wrapper_enabled?
train
def _wrapper_enabled? return false unless request.has_content_type? ref = request.content_mime_type.ref
ruby
{ "resource": "" }
q10298
Rails.ConsoleMethods.new_session
train
def new_session app = Rails.application session = ActionDispatch::Integration::Session.new(app) yield session if block_given? # This makes app.url_for and app.foo_path available in the console
ruby
{ "resource": "" }
q10299
Rails.ConsoleMethods.reload!
train
def reload!(print = true) puts "Reloading..."
ruby
{ "resource": "" }