_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q7200 | Clin::CommandMixin::Options.ClassMethods.list_option | train | def list_option(name, description, **config)
add_option | ruby | {
"resource": ""
} |
q7201 | Clin::CommandMixin::Options.ClassMethods.list_flag_option | train | def list_flag_option(name, description, **config)
add_option | ruby | {
"resource": ""
} |
q7202 | Clin::CommandMixin::Options.ClassMethods.general_option | train | def general_option(option_cls, config = {})
option_cls = option_cls.constantize if option_cls.is_a? String
| ruby | {
"resource": ""
} |
q7203 | Clin::CommandMixin::Options.ClassMethods.remove_general_option | train | def remove_general_option(option_cls)
option_cls = option_cls.constantize if option_cls.is_a? String
| ruby | {
"resource": ""
} |
q7204 | Clin::CommandMixin::Options.ClassMethods.option_defaults | train | def option_defaults
out = {}
@specific_options.each do |option|
option.load_default(out)
end
@general_options.each do |_cls, option| | ruby | {
"resource": ""
} |
q7205 | PhilipsHue.Bridge.add_all_lights | train | def add_all_lights
all_lights = []
overview["lights"].each do |id, light|
| ruby | {
"resource": ""
} |
q7206 | TableFor.Helper.table_for | train | def table_for(model_class, records, html = {}, &block) | ruby | {
"resource": ""
} |
q7207 | Jinx.Unique.uniquify_attributes | train | def uniquify_attributes(attributes)
attributes.each do |ka|
oldval = send(ka)
next unless String === oldval
newval = UniquifierCache.instance.get(self, oldval)
set_property_value(ka, newval) | ruby | {
"resource": ""
} |
q7208 | PureCDB.Writer.store | train | def store key,value
# In an attempt to save memory, we pack the hash data we gather into
# strings of BER compressed integers...
h = hash(key)
hi = (h % num_hashes)
@hashes[hi] ||= ""
header | ruby | {
"resource": ""
} |
q7209 | ICO.Utils.png_to_sizes | train | def png_to_sizes(input_filename, sizes_array, output_dirname=nil, append_filenames=APPEND_FILE_FORMAT, force_overwrite=false, clear=true, force_clear=false)
basename = File.basename(input_filename, '.*')
output_dirname ||= File.join(File.expand_path(File.dirname(input_filename)), "#{basename}_sizes")
... | ruby | {
"resource": ""
} |
q7210 | Jinx.Hasher.qp | train | def qp
qph = {}
each { |k, v| qph[k.qp] = | ruby | {
"resource": ""
} |
q7211 | Cashboard.Base.update | train | def update
options = self.class.merge_options()
options.merge!({:body => self.to_xml})
response = self.class.put(self.href, options)
begin
| ruby | {
"resource": ""
} |
q7212 | Cashboard.Base.delete | train | def delete
options = self.class.merge_options()
response = self.class.delete(self.href, options) | ruby | {
"resource": ""
} |
q7213 | Cashboard.Base.to_xml | train | def to_xml(options={})
options[:indent] ||= 2
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
xml.instruct! unless options[:skip_instruct]
obj_name = self.class.resource_name.singularize
# Turn our OpenStruct attributes into a hash we can export to X... | ruby | {
"resource": ""
} |
q7214 | KeytechKit.ElementHandler.delete | train | def delete(element_key)
parameter = { basic_auth: @auth }
response = self.class.delete("/elements/#{element_key}", parameter)
unless response.success?
puts | ruby | {
"resource": ""
} |
q7215 | KeytechKit.ElementHandler.notes | train | def notes(element_key)
parameter = { basic_auth: @auth }
response = self.class.get("/elements/#{element_key}/notes", parameter)
if response.success?
search_response_header | ruby | {
"resource": ""
} |
q7216 | KeytechKit.ElementHandler.note_handler | train | def note_handler
@_note_handler = NoteHandler.new(keytechkit.base_url, keytechkit.username, keytechkit.password) | ruby | {
"resource": ""
} |
q7217 | KeytechKit.ElementHandler.file_handler | train | def file_handler
@_element_file_handler = ElementFileHandler.new(keytechkit.base_url, | ruby | {
"resource": ""
} |
q7218 | Quicky.ResultsHash.to_hash | train | def to_hash
ret = {}
self.each_pair do |k, v|
| ruby | {
"resource": ""
} |
q7219 | Quicky.ResultsHash.merge! | train | def merge!(rh)
rh.each_pair do |k, v|
# v is a TimeCollector
if self.has_key?(k)
self[k].merge!(v)
| ruby | {
"resource": ""
} |
q7220 | ActiveSupport.Inflector.titleize | train | def titleize(word)
# negative lookbehind doesn't work in Firefox / Safari
# humanize(underscore(word)).gsub(/\b(?<!['’`])[a-z]/) { |match| match.capitalize }
| ruby | {
"resource": ""
} |
q7221 | FilterFactory.Filter.attributes | train | def attributes
fields.each_with_object(HashWithIndifferentAccess.new) do |field, acc|
| ruby | {
"resource": ""
} |
q7222 | Roroacms.RoutingHelper.get_type_by_url | train | def get_type_by_url
return 'P' if params[:slug].blank?
# split the url up into segments
segments = params[:slug].split('/')
# general variables
url = params[:slug]
article_url = Setting.get('articles_slug')
category_url = Setting.get('category_slug')
tag_url = Setting.... | ruby | {
"resource": ""
} |
q7223 | Houston.Conversations.hear | train | def hear(message, params={})
raise ArgumentError, "`message` must respond to :channel" unless message.respond_to?(:channel)
raise ArgumentError, "`message` must respond to :sender" unless message.respond_to?(:sender)
listeners.hear(message).each do |match|
event = Houston::Conversations::Even... | ruby | {
"resource": ""
} |
q7224 | Mutagem.Mutex.execute | train | def execute(&block)
result = false
raise ArgumentError, "missing block" unless block_given?
begin
open(lockfile, 'w') do |f|
# exclusive non-blocking lock
result = lock(f, | ruby | {
"resource": ""
} |
q7225 | MovingsignApi.Command.to_bytes | train | def to_bytes
# set defaults
self.sender ||= :pc
self.receiver ||= 1
bytes = []
bytes.concat [0x00] * 5 # start of command
bytes.concat [0x01] # <SOH>
bytes.concat self.sender.to_bytes # Sender... | ruby | {
"resource": ""
} |
q7226 | FuturoCube.ResourceFile.records | train | def records
if !@records
@io.seek(44, IO::SEEK_SET)
records = []
header.record_count.times do
| ruby | {
"resource": ""
} |
q7227 | FuturoCube.ResourceFile.data | train | def data(rec)
@io.seek(rec.data_offset, | ruby | {
"resource": ""
} |
q7228 | FuturoCube.ResourceFile.compute_checksum | train | def compute_checksum(&block)
crc = CRC.new
# Have to read this first because it might change the seek position.
file_size = header.file_size
@io.seek(8, IO::SEEK_SET)
pos = 8
length = 4096-8
buf = nil
while true
| ruby | {
"resource": ""
} |
q7229 | Woro.Task.build_task_template | train | def build_task_template
b = binding
| ruby | {
"resource": ""
} |
q7230 | BarkestCore.ApplicationControllerBase.authorize! | train | def authorize!(*group_list)
begin
# an authenticated user must exist.
unless logged_in?
store_location
raise_not_logged_in "You need to login to access '#{request.fullpath}'.",
'nobody is logged in'
end
# clean up the group list.... | ruby | {
"resource": ""
} |
q7231 | Higml.Applier.selector_matches? | train | def selector_matches?(selector)
selector.any? do |group|
group.keys.all? do | ruby | {
"resource": ""
} |
q7232 | Encryptbot.Cert.ready_for_challenge | train | def ready_for_challenge(domain, dns_challenge)
record = "#{dns_challenge.record_name}.#{domain}"
challenge_value = dns_challenge.record_content
txt_value = Resolv::DNS.open do |dns|
| ruby | {
"resource": ""
} |
q7233 | Kajiki.Handler.check_existing_pid | train | def check_existing_pid
return false unless pid_file_exists?
pid = read_pid
| ruby | {
"resource": ""
} |
q7234 | Kajiki.Handler.trap_default_signals | train | def trap_default_signals
Signal.trap('INT') do
puts 'Interrupted. Terminating process...'
exit
end
Signal.trap('HUP') do
puts 'SIGHUP - Terminating process...'
exit
end
| ruby | {
"resource": ""
} |
q7235 | Snapshotify.Document.links | train | def links
# Find all anchor elements
doc.xpath('//a').map do |element|
# extract all the href attributes
element.attribute('href')
end.compact.map(&:value).map do |href|
| ruby | {
"resource": ""
} |
q7236 | Snapshotify.Document.write! | train | def write!
writer = Snapshotify::Writer.new(self) | ruby | {
"resource": ""
} |
q7237 | SysCmd.Definition.option | train | def option(option, *args)
options = args.pop if args.last.is_a?(Hash)
options ||= {}
raise "Invalid number of arguments (0 or 1 expected)" if args.size > 1
return unless @shell.applicable?(options)
value = args.shift || options[:value]
if options[:os_prefix]
option = @shell.o... | ruby | {
"resource": ""
} |
q7238 | SysCmd.Definition.os_option | train | def os_option(option, *args)
options = args.pop if args.last.is_a?(Hash)
| ruby | {
"resource": ""
} |
q7239 | SysCmd.Definition.argument | train | def argument(value, options = {})
return unless @shell.applicable?(options)
value = value.to_s
| ruby | {
"resource": ""
} |
q7240 | SysCmd.Command.run | train | def run(options = {})
@output = @status = @error_output = @error = nil
if options[:direct]
command = @shell.split(@command)
else
command = [@command]
end
stdin_data = options[:stdin_data] || @input
if stdin_data
command << { stdin_data: stdin_data }
end
... | ruby | {
"resource": ""
} |
q7241 | Iparser.Machine.interactive_parser | train | def interactive_parser ( )
puts 'Press <Enter> to exit...'
# Цикл обработки ввода.
loop do
str = interactive_input( )
break if str == ""
| ruby | {
"resource": ""
} |
q7242 | Attrtastic.SemanticAttributesBuilder.attributes | train | def attributes(*args, &block)
options = args.extract_options!
options[:html] ||= {}
if args.first and args.first.is_a? String
options[:name] = args.shift
end
if options[:for].blank?
attributes_for(record, args, options, &block)
else
for_value = if options[:f... | ruby | {
"resource": ""
} |
q7243 | Attrtastic.SemanticAttributesBuilder.attribute | train | def attribute(*args, &block)
options = args.extract_options!
options.reverse_merge!(Attrtastic.default_options)
options[:html] ||= {}
method = args.shift
html_label_class = [ "label", options[:html][:label_class] ].compact.join(" ")
html_value_class = [ "value", options[:html][:val... | ruby | {
"resource": ""
} |
q7244 | Mongosteen.BaseHelpers.collection | train | def collection
get_collection_ivar || begin
chain = end_of_association_chain
# scopes
chain = apply_scopes(chain)
# search
if params[:search]
chain = chain.search(params[:search].to_s.downcase, match: :all)
end
# pagination
if params[:pa... | ruby | {
"resource": ""
} |
q7245 | Mongosteen.BaseHelpers.get_resource_version | train | def get_resource_version
resource = get_resource_ivar
version = params[:version].try(:to_i)
if version && version > 0 && version < resource.version
resource.undo(nil, from: version | ruby | {
"resource": ""
} |
q7246 | KeyTree.Path.- | train | def -(other)
other = other.to_key_path
raise KeyError | ruby | {
"resource": ""
} |
q7247 | KeyTree.Path.prefix? | train | def prefix?(other)
other = other.to_key_path
return false if other.length > length
key_enum = each
| ruby | {
"resource": ""
} |
q7248 | StalkClimber.Climber.max_job_ids | train | def max_job_ids
connection_pairs = connection_pool.connections.map do |connection|
| ruby | {
"resource": ""
} |
q7249 | RoleAuth.Parser.task | train | def task(name, options = {})
options[:is] = options[:is].is_a?(Array) ? options[:is] : [options[:is]].compact | ruby | {
"resource": ""
} |
q7250 | RoleAuth.Parser.add_permission | train | def add_permission(target, *args)
raise '#can and #can_not have to be used inside a role block' unless @role
options = args.last.is_a?(Hash) ? args.pop : {}
tasks = []
models = []
models << args.pop if args.last == :any
args.each {|arg| arg.is_a?(Symbol) ? tasks << arg : models << a... | ruby | {
"resource": ""
} |
q7251 | RoleAuth.Parser.process_tasks | train | def process_tasks
@tasks.each_value do |task|
task.options[:ancestors] = []
set_ancestor_tasks(task)
| ruby | {
"resource": ""
} |
q7252 | RoleAuth.Parser.set_ancestor_tasks | train | def set_ancestor_tasks(task, ancestor = nil)
task.options[:ancestors] += (ancestor || task).options[:is]
(ancestor || task).options[:is].each | ruby | {
"resource": ""
} |
q7253 | RoleAuth.Parser.set_alternative_tasks | train | def set_alternative_tasks(task, ancestor = nil)
(ancestor || task).options[:is].each do |task_name|
if @permissions.key? task_name
(@tasks[task_name].options[:alternatives] ||= []) << task.name
| ruby | {
"resource": ""
} |
q7254 | RoleAuth.Parser.set_descendant_roles | train | def set_descendant_roles(descendant_role, ancestor_role = nil)
role = ancestor_role || descendant_role
return unless role[:is]
role[:is].each do |role_name|
| ruby | {
"resource": ""
} |
q7255 | BetterRailsDebugger.GroupInstance.big_classes | train | def big_classes(max_size=1.megabytes)
return @big_classes if @big_classes
@big_classes = {}
ObjectInformation.where(:group_instance_id => self.id, :memsize.gt => max_size).all.each do |object|
@big_classes[object.class_name] ||= {total_mem: 0, average: 0, count: 0}
@big_classes[object.... | ruby | {
"resource": ""
} |
q7256 | Roroacms.Admin::TermsController.categories | train | def categories
# add breadcrumb and set title
add_breadcrumb I18n.t("generic.categories"), :admin_article_categories_path, :title => I18n.t("controllers.admin.terms.categories.breadcrumb_title")
set_title(I18n.t("generic.categories"))
@type = 'category'
| ruby | {
"resource": ""
} |
q7257 | Roroacms.Admin::TermsController.create | train | def create
@category = Term.new(term_params)
redirect_url = Term.get_redirect_url(params)
respond_to do |format|
if @category.save
@term_anatomy = @category.create_term_anatomy(:taxonomy => params[:type_taxonomy])
format.html { redirect_to URI.parse(redirect_url).path, o... | ruby | {
"resource": ""
} |
q7258 | Roroacms.Admin::TermsController.update | train | def update
@category = Term.find(params[:id])
@category.deal_with_cover(params[:has_cover_image])
respond_to do |format|
# deal with abnormalaties - update the structure url
if @category.update_attributes(term_params)
| ruby | {
"resource": ""
} |
q7259 | Roroacms.Admin::TermsController.destroy | train | def destroy
@term = Term.find(params[:id])
# return url will be different for either tag or category
redirect_url = Term.get_redirect_url({ type_taxonomy: @term.term_anatomy.taxonomy })
@term.destroy
respond_to do | ruby | {
"resource": ""
} |
q7260 | Roroacms.Admin::TermsController.edit_title | train | def edit_title
if @category.term_anatomy.taxonomy == 'category'
add_breadcrumb I18n.t("generic.categories"), :admin_article_categories_path, :title => I18n.t("controllers.admin.terms.edit_title.category.breadcrumb_title")
add_breadcrumb I18n.t("controllers.admin.terms.edit_title.category.title")
... | ruby | {
"resource": ""
} |
q7261 | YoreCore.Yore.upload | train | def upload(aFile)
#ensure_bucket()
logger.debug "Uploading #{aFile} to S3 bucket #{config[:bucket]} ..."
logger.info "Uploading #{File.basename(aFile)} to S3 bucket | ruby | {
"resource": ""
} |
q7262 | YoreCore.Yore.decode_file_name | train | def decode_file_name(aFilename)
prefix,date,ext = aFilename.scan(/(.*?)\-(.*?)\.(.*)/).flatten
| ruby | {
"resource": ""
} |
q7263 | Fried::Schema::Attribute.DefineReader.call | train | def call(definition, klass)
variable = definition.instance_variable
klass.instance_eval do
| ruby | {
"resource": ""
} |
q7264 | BarkestCore.MiscHelper.fixed | train | def fixed(value, places = 2)
value = value.to_s.to_f | ruby | {
"resource": ""
} |
q7265 | BarkestCore.MiscHelper.split_name | train | def split_name(name)
name ||= ''
if name.include?(',')
last,first = name.split(',', 2)
first,middle = first.to_s.strip.split(' ', 2)
else
first,middle,last = name.split(' ', 3)
if middle && !last
| ruby | {
"resource": ""
} |
q7266 | Pipio.BasicParser.parse | train | def parse
if pre_parse
messages = @file_reader.other_lines.map do |line|
basic_message_match = @line_regex.match(line)
meta_message_match = @line_regex_status.match(line)
if basic_message_match
create_message(basic_message_match)
elsif | ruby | {
"resource": ""
} |
q7267 | Pipio.BasicParser.pre_parse | train | def pre_parse
@file_reader.read
metadata = Metadata.new(MetadataParser.new(@file_reader.first_line).parse)
if metadata.valid?
@metadata = metadata
@alias_registry = AliasRegistry.new(@metadata.their_screen_name)
| ruby | {
"resource": ""
} |
q7268 | EventMachine.StatHat.time | train | def time(name, opts = {})
opts[:ez] ||= true
start = Time.now
yield if block_given?
if opts[:ez] == true
| ruby | {
"resource": ""
} |
q7269 | Qipowl::Bowlers.Bowler.add_entity | train | def add_entity section, key, value, enclosure_value = null
if (tags = self.class.const_get("#{section.upcase}_TAGS"))
key = key.bowl.to_sym
tags[key] = value.to_sym
self.class.const_get("ENCLOSURES_TAGS")[key] = enclosure_value.to_sym if enclosure_value
self.class.const_get("ENTITI... | ruby | {
"resource": ""
} |
q7270 | Jinx.Property.restrict_flags | train | def restrict_flags(declarer, *flags)
copy | ruby | {
"resource": ""
} |
q7271 | Jinx.Property.inverse= | train | def inverse=(attribute)
return if inverse == attribute
# if no attribute, then the clear the existing inverse, if any
return clear_inverse if attribute.nil?
# the inverse attribute meta-data
begin
@inv_prop = type.property(attribute)
rescue NameError => e
raise Metada... | ruby | {
"resource": ""
} |
q7272 | Jinx.Property.owner_flag_set | train | def owner_flag_set
if dependent? then
raise MetadataError.new("#{declarer.qp}.#{self} cannot be set as a #{type.qp} owner since it is already defined as a #{type.qp} dependent")
end
inv_prop = inverse_property
if inv_prop then
inv_prop.qualify(:dependent) unless inv_prop.dependen... | ruby | {
"resource": ""
} |
q7273 | Truncus.Client.get_token | train | def get_token(url)
req = Net::HTTP::Post.new('/', initheader = {'Content-Type' => 'application/json'})
req.body = {url: url, format: 'json'}.to_json
| ruby | {
"resource": ""
} |
q7274 | Garcon.ThreadPoolExecutor.on_worker_exit | train | def on_worker_exit(worker)
mutex.synchronize do
@pool.delete(worker)
if @pool.empty? && !running?
| ruby | {
"resource": ""
} |
q7275 | Garcon.ThreadPoolExecutor.execute | train | def execute(*args, &task)
if ensure_capacity?
@scheduled_task_count += 1
@queue << [args, task]
else
if @max_queue | ruby | {
"resource": ""
} |
q7276 | Garcon.ThreadPoolExecutor.ensure_capacity? | train | def ensure_capacity?
additional = 0
capacity = true
if @pool.size < @min_length
additional = @min_length - @pool.size
elsif @queue.empty? && @queue.num_waiting >= 1
additional = 0
elsif @pool.size == 0 && @min_length == 0
additional = 1
| ruby | {
"resource": ""
} |
q7277 | Garcon.ThreadPoolExecutor.prune_pool | train | def prune_pool
if Garcon.monotonic_time - @gc_interval >= @last_gc_time
@pool.delete_if { |worker| worker.dead? }
# send :stop for each thread over | ruby | {
"resource": ""
} |
q7278 | Garcon.ThreadPoolExecutor.create_worker_thread | train | def create_worker_thread
wrkr = ThreadPoolWorker.new(@queue, self)
Thread.new(wrkr, self) do |worker, parent|
Thread.current.abort_on_exception = false
| ruby | {
"resource": ""
} |
q7279 | ComfyPress::Tag.InstanceMethods.render | train | def render
ignore = [ComfyPress::Tag::Partial, ComfyPress::Tag::Helper].member?(self.class)
| ruby | {
"resource": ""
} |
q7280 | Jinx.Mergeable.merge_attributes | train | def merge_attributes(other, attributes=nil, matches=nil, &filter)
return self if other.nil? or other.equal?(self)
attributes = [attributes] if Symbol === attributes
attributes ||= self.class.mergeable_attributes
# If the source object is not a hash, then convert it to an attribute => value hash.... | ruby | {
"resource": ""
} |
q7281 | Layabout.SlackRequest.perform_webhook | train | def perform_webhook
http_request.body = {'text' => params[:text]}.to_json.to_s
http_request.query = {'token' | ruby | {
"resource": ""
} |
q7282 | IRCSupport.Case.irc_upcase! | train | def irc_upcase!(irc_string, casemapping = :rfc1459)
case casemapping
when :ascii
irc_string.tr!(*@@ascii_map)
when :rfc1459
irc_string.tr!(*@@rfc1459_map)
when :'strict-rfc1459'
| ruby | {
"resource": ""
} |
q7283 | IRCSupport.Case.irc_upcase | train | def irc_upcase(irc_string, casemapping = :rfc1459)
result | ruby | {
"resource": ""
} |
q7284 | IRCSupport.Case.irc_downcase! | train | def irc_downcase!(irc_string, casemapping = :rfc1459)
case casemapping
when :ascii
irc_string.tr!(*@@ascii_map.reverse)
when :rfc1459
irc_string.tr!(*@@rfc1459_map.reverse)
when :'strict-rfc1459'
| ruby | {
"resource": ""
} |
q7285 | IRCSupport.Case.irc_downcase | train | def irc_downcase(irc_string, casemapping = :rfc1459)
result | ruby | {
"resource": ""
} |
q7286 | JsMessage.ControllerMethods.render_js_message | train | def render_js_message(type, hash = {})
unless [ :ok, :redirect, :error ].include?(type)
raise "Invalid js_message response type: #{type}"
end
js_message = {
:status => type,
:html => nil,
:message => nil,
| ruby | {
"resource": ""
} |
q7287 | Numerals.Format::BaseScaler.scaled_digit | train | def scaled_digit(group)
unless group.size == @base_scale
raise "Invalid digits group size for scaled_digit (is #{group.size}; should be #{@base_scale})"
end
| ruby | {
"resource": ""
} |
q7288 | Numerals.Format::BaseScaler.grouped_digits | train | def grouped_digits(digits)
unless (digits.size % @base_scale) == 0
raise "Invalid number of digits for | ruby | {
"resource": ""
} |
q7289 | NRSER.LazyAttr.call | train | def call target_method, receiver, *args, &block
unless target_method.parameters.empty?
raise NRSER::ArgumentError.new \
"{NRSER::LazyAttr} can only decorate methods with 0 params",
receiver: receiver,
target_method: target_method
end
unless args.empty?
raise NRSER::A... | ruby | {
"resource": ""
} |
q7290 | TableMe.Builder.column | train | def column name,options = {}, &block
@columns | ruby | {
"resource": ""
} |
q7291 | Milenage.Kernel.op= | train | def op=(op)
fail "OP must be 128 bits" unless op.each_byte.to_a.length == 16
| ruby | {
"resource": ""
} |
q7292 | Typhoeus.SpecCache.remove_unnecessary_cache_files! | train | def remove_unnecessary_cache_files!
current_keys = cache_files.map do |file|
get_cache_key_from_filename(file)
end
inmemory_keys = responses.keys
| ruby | {
"resource": ""
} |
q7293 | Typhoeus.SpecCache.read_cache_fixtures! | train | def read_cache_fixtures!
files = cache_files
files.each do |file|
cache_key = get_cache_key_from_filename(file)
| ruby | {
"resource": ""
} |
q7294 | Typhoeus.SpecCache.dump_cache_fixtures! | train | def dump_cache_fixtures!
responses.each do |cache_key, response|
path = filepath_for(cache_key)
| ruby | {
"resource": ""
} |
q7295 | Roroacms.AdminRoroaHelper.get_theme_options | train | def get_theme_options
hash = []
Dir.glob("#{Rails.root}/app/views/themes/*/") do |themes|
opt = themes.split('/').last
if File.exists?("#{themes}theme.yml")
info = YAML.load(File.read("#{themes}theme.yml"))
| ruby | {
"resource": ""
} |
q7296 | Roroacms.AdminRoroaHelper.get_templates | train | def get_templates
hash = []
current_theme = Setting.get('theme_folder')
Dir.glob("#{Rails.root}/app/views/themes/#{current_theme}/template-*.html.erb") do |my_text_file|
opt = my_text_file.split('/').last
opt['template-'] = ''
opt['.html.erb'] = ''
| ruby | {
"resource": ""
} |
q7297 | Roroacms.AdminRoroaHelper.theme_exists | train | def theme_exists
if !Dir.exists?("app/views/themes/#{Setting.get('theme_folder')}/")
html = "<div class='alert alert-danger'><strong>" + I18n.t("helpers.admin_roroa_helper.theme_exists.warning") + "!</strong> | ruby | {
"resource": ""
} |
q7298 | Roroacms.AdminRoroaHelper.get_notifications | train | def get_notifications
html = ''
if flash[:error]
html += "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'>x</button><strong>" + I18n.t("helpers.view_helper.generic.flash.error") + "!</strong> | ruby | {
"resource": ""
} |
q7299 | Roroacms.AdminRoroaHelper.append_application_menu | train | def append_application_menu
html = ''
Roroacms.append_menu.each do |f|
html += (render :partial => | ruby | {
"resource": ""
} |
Subsets and Splits
SQL Console for CoIR-Retrieval/CodeSearchNet-ccr-ruby-queries-corpus
Retrieves a large number of entries in the 'ruby' language, providing basic information but limited analytical value.