_id
stringlengths
2
6
title
stringlengths
9
130
partition
stringclasses
3 values
text
stringlengths
30
4.3k
language
stringclasses
1 value
meta_information
dict
q10800
Decidim.NewslettersHelper.custom_url_for_mail_root
train
def custom_url_for_mail_root(organization, newsletter_id = nil) if newsletter_id.present? decidim.root_url(host:
ruby
{ "resource": "" }
q10801
Decidim.LayoutHelper.icon
train
def icon(name, options = {}) html_properties = {} html_properties["width"] = options[:width] html_properties["height"] = options[:height] html_properties["aria-label"] = options[:aria_label] html_properties["role"] = options[:role] html_properties["aria-hidden"] = options[:aria_hidd...
ruby
{ "resource": "" }
q10802
Decidim.LayoutHelper.external_icon
train
def external_icon(path, options = {}) classes = _icon_classes(options) + ["external-icon"] if path.split(".").last == "svg" asset = Rails.application.assets_manifest.find_sources(path).first asset.gsub("<svg
ruby
{ "resource": "" }
q10803
Decidim.ContinuityBadgeTracker.track!
train
def track!(date) @subject.with_lock do last_session_at = status.try(:last_session_at) || date current_streak = status.try(:current_streak) || 1 streak = if last_session_at == date
ruby
{ "resource": "" }
q10804
Decidim.DecidimDeviseMailer.invitation_instructions
train
def invitation_instructions(user, token, opts = {}) with_user(user) do @token = token @organization = user.organization @opts = opts opts[:subject] = I18n.t("devise.mailer.#{opts[:invitation_instructions]}.subject", organization: user.organization.name)
ruby
{ "resource": "" }
q10805
Decidim.ActivitiesCell.show
train
def show return if activities.blank? activities.map do |activity| activity.organization_lazy
ruby
{ "resource": "" }
q10806
Decidim.ComponentPathHelper.main_component_path
train
def main_component_path(component) current_params = try(:params)
ruby
{ "resource": "" }
q10807
Decidim.ComponentPathHelper.main_component_url
train
def main_component_url(component) current_params = try(:params)
ruby
{ "resource": "" }
q10808
Decidim.ComponentPathHelper.manage_component_path
train
def manage_component_path(component) current_params = try(:params)
ruby
{ "resource": "" }
q10809
Decidim.SearchesHelper.searchable_resource_human_name
train
def searchable_resource_human_name(resource, count: 5) resource = if resource.is_a?(String) resource.constantize else
ruby
{ "resource": "" }
q10810
Decidim.SearchesHelper.search_path_by
train
def search_path_by(resource_type: nil, space_state: nil) new_params = { utf8: params[:utf8], filter: { decidim_scope_id: params.dig(:filter, :decidim_scope_id), term: params[:term] || params.dig(:filter, :term) } }
ruby
{ "resource": "" }
q10811
Decidim.SearchesHelper.search_path_by_state_link
train
def search_path_by_state_link(state) path = search_path_by(resource_type: params.dig(:filter, :resource_type), space_state: state) is_active = params.dig(:filter, :space_state).to_s
ruby
{ "resource": "" }
q10812
Decidim.DecidimFormHelper.decidim_form_for
train
def decidim_form_for(record, options = {}, &block) options[:data] ||= {} options[:data].update(abide: true, "live-validate" => true, "validate-on-blur" => true) options[:html] ||= {} options[:html].update(novalidate: true) output = ""
ruby
{ "resource": "" }
q10813
Decidim.DecidimFormHelper.editor_field_tag
train
def editor_field_tag(name, value, options = {}) options[:toolbar] ||= "basic" options[:lines] ||= 10 content_tag(:div, class: "editor") do template = "" template += label_tag(name, options[:label]) if options[:label] != false template += hidden_field_tag(name, value, options) ...
ruby
{ "resource": "" }
q10814
Decidim.DecidimFormHelper.scopes_picker_field_tag
train
def scopes_picker_field_tag(name, value, id: nil) picker_options = { id: id || sanitize_to_id(name), class: "picker-single", name: name } prompt_params = yield(nil) selected_scopes = value ? Decidim::Scope.where(id: value) : [] scopes = selected_scopes.map { |scope...
ruby
{ "resource": "" }
q10815
Decidim.DecidimFormHelper.translated_field_tag
train
def translated_field_tag(type, object_name, name, value = {}, options = {}) locales = available_locales field_label = label_tag(name, options[:label]) if locales.count == 1 field_name = "#{name}_#{locales.first.to_s.gsub("-", "__")}" field_input = send( type, "#{o...
ruby
{ "resource": "" }
q10816
Decidim.DecidimFormHelper.decidim_form_slug_url
train
def decidim_form_slug_url(prepend_path = "", value = "") prepend_slug_path = if prepend_path.present? "/#{prepend_path}/" else "/" end content_tag(:span, class: "slug-url") do [ requ...
ruby
{ "resource": "" }
q10817
Decidim.TraceabilityHelper.render_resource_last_editor
train
def render_resource_last_editor(resource) render partial: "decidim/shared/version_author",
ruby
{ "resource": "" }
q10818
Decidim.TraceabilityHelper.render_resource_editor
train
def render_resource_editor(version) render partial: "decidim/shared/version_author",
ruby
{ "resource": "" }
q10819
Decidim.TraceabilityHelper.diff_renderer
train
def diff_renderer @diff_renderer ||= if current_version.item_type.include? "Decidim::Proposals" Decidim::Proposals::DiffRenderer.new(current_version)
ruby
{ "resource": "" }
q10820
Decidim.TraceabilityHelper.render_diff_value
train
def render_diff_value(value, type, action, options = {}) return "".html_safe if value.blank? value_to_render = case type when :date l value, format: :long when :percentage number_to_percentage value, precisi...
ruby
{ "resource": "" }
q10821
Decidim.ActivityCell.title
train
def title resource_title = resource.try(:resource_title) || resource.try(:title) return if resource_title.blank? if resource_title.is_a?(String) resource_title
ruby
{ "resource": "" }
q10822
Decidim.ActivityCell.description
train
def description resource_description = resource.try(:resource_description) || resource.try(:description) return if resource_description.blank? resource_description = if resource_description.is_a?(String) resource_description elsif resource_d...
ruby
{ "resource": "" }
q10823
Decidim.CtaButtonHelper.cta_button
train
def cta_button button_text = translated_attribute(current_organization.cta_button_text).presence || t("decidim.pages.home.hero.participate")
ruby
{ "resource": "" }
q10824
Decidim.CtaButtonHelper.cta_button_path
train
def cta_button_path if current_organization.cta_button_path.present? current_organization.cta_button_path elsif Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?
ruby
{ "resource": "" }
q10825
Decidim.DataPortabilityFileReader.file_path
train
def file_path directory_name = Rails.root.join(Decidim::DataPortabilityUploader.new.store_dir)
ruby
{ "resource": "" }
q10826
Decidim.FiltersHelper.filter_form_for
train
def filter_form_for(filter, url = url_for) content_tag :div, class: "filters" do form_for filter, namespace: filter_form_namespace, builder: FilterFormBuilder, url: url, as: :filter, method: :get,
ruby
{ "resource": "" }
q10827
Decidim.AttachmentUploader.image?
train
def image?(new_file) content_type = model.content_type
ruby
{ "resource": "" }
q10828
Decidim.AttachmentUploader.set_content_type_and_size_in_model
train
def set_content_type_and_size_in_model model.content_type
ruby
{ "resource": "" }
q10829
Decidim.FilterFormBuilder.collection_radio_buttons
train
def collection_radio_buttons(method, collection, value_method, label_method, options = {}, html_options = {}) fieldset_wrapper options[:legend_title] do super(method, collection, value_method,
ruby
{ "resource": "" }
q10830
Decidim.FilterFormBuilder.collection_check_boxes
train
def collection_check_boxes(method, collection, value_method, label_method, options = {}, html_options = {}) fieldset_wrapper options[:legend_title] do super(method, collection, value_method,
ruby
{ "resource": "" }
q10831
Capistrano.DSL.execute
train
def execute(*) file, line, = caller.first.split(":") colors = SSHKit::Color.new($stderr) $stderr.puts colors.colorize("Warning: `execute' should be wrapped in an `on' scope in #{file}:#{line}.", :red) $stderr.puts $stderr.puts " task :example do" $stderr.puts colors.colorize(" on...
ruby
{ "resource": "" }
q10832
Jets.Preheat.warm_all
train
def warm_all threads = [] all_functions.each do |function_name| next if function_name.include?('jets-public_controller') # handled by warm_public_controller_more next if function_name.include?('jets-rack_controller') # handled by warm_rack_controller_more
ruby
{ "resource": "" }
q10833
Jets::Job::Dsl.IotEvent.iot_event
train
def iot_event(props={}) if props.is_a?(String) # SQL Statement props = {sql: props} topic_props = {topic_rule_payload: props} elsif props.key?(:topic_rule_payload) # full properties structure topic_props = props
ruby
{ "resource": "" }
q10834
Jets::Resource::Lambda.Function.lookup_class_properties
train
def lookup_class_properties(klass) all_classes = [] while klass != Object all_classes << klass klass = klass.superclass end class_properties = {} # Go back down class heirachry top to down
ruby
{ "resource": "" }
q10835
Jets::Resource::Lambda.Function.finalize_properties!
train
def finalize_properties!(props) handler = full_handler(props) runtime = get_runtime(props) managed = { handler: handler, runtime: runtime, description: description, }
ruby
{ "resource": "" }
q10836
Jets::Resource::Iam.PolicyDocument.standardize
train
def standardize(definition) case definition when String # Expands simple string from: logs => logs:* definition = "#{definition}:*" unless definition.include?(':') @policy[:statement] << { action: [definition], effect: "Allow", resource: "*", }
ruby
{ "resource": "" }
q10837
Jets::Controller::Rack.Adapter.process
train
def process status, headers, body = Jets.application.call(env)
ruby
{ "resource": "" }
q10838
Jets.Router.check_collision!
train
def check_collision! paths = self.routes.map(&:path) collision = Jets::Resource::ApiGateway::RestApi::Routes::Collision.new
ruby
{ "resource": "" }
q10839
Jets.Router.resources
train
def resources(name) get "#{name}", to: "#{name}#index" get "#{name}/new", to: "#{name}#new" unless api_mode? get "#{name}/:id", to: "#{name}#show" post "#{name}", to: "#{name}#create" get "#{name}/:id/edit", to: "#{name}#edit" unless api_mode?
ruby
{ "resource": "" }
q10840
Jets.Router.all_paths
train
def all_paths results = [] paths = routes.map(&:path) paths.each do |p| sub_paths = [] parts = p.split('/') until parts.empty? parts.pop sub_path = parts.join('/') sub_paths
ruby
{ "resource": "" }
q10841
Jets.Router.ordered_routes
train
def ordered_routes length = Proc.new { |r| r.path.length * -1 } capture_routes = routes.select { |r| r.path.include?(':') }.sort_by(&length) wildcard_routes = routes.select { |r| r.path.include?('*') }.sort_by(&length)
ruby
{ "resource": "" }
q10842
Jets::Controller::Middleware.Local.routes_table
train
def routes_table routes = Jets::Router.routes return "Your routes table is empty." if routes.empty? text = "Verb | Path | Controller#action\n"
ruby
{ "resource": "" }
q10843
Jets::Resource::ApiGateway.Cors.cors_headers
train
def cors_headers rack = Jets::Controller::Middleware::Cors.new(Jets.application)
ruby
{ "resource": "" }
q10844
Jets.RackServer.serve
train
def serve # Note, looks like stopping jets server with Ctrl-C sends the TERM signal # down to the sub bin/rackup command cleans up the child process fine. Bundler.with_clean_env do args = '' # only forward the host option, port is always 9292 for simplicity if @options[:host] ...
ruby
{ "resource": "" }
q10845
Jets.RackServer.wait_for_socket
train
def wait_for_socket return unless Jets.rack? retries = 0 max_retries = 30 # 15 seconds at a delay of 0.5s delay = 0.5 if ENV['C9_USER'] # overrides for local testing max_retries = 3 delay = 3 end begin server = TCPSocket.new('localhost', 9292)
ruby
{ "resource": "" }
q10846
Jets.Logger.add
train
def add(severity, message = nil, progname = nil) # Taken from Logger#add source # https://ruby-doc.org/stdlib-2.5.1/libdoc/logger/rdoc/Logger.html#method-i-add if message.nil? if block_given? message = yield
ruby
{ "resource": "" }
q10847
Jets::Commands::Markdown.Page.long_description
train
def long_description text = @command.long_description return "" if text.nil? # empty description lines = text.split("\n")
ruby
{ "resource": "" }
q10848
Jets.Rdoc.options
train
def options exclude = %w[ docs spec vendor core.rb .js templates commands internal support Dockerfile
ruby
{ "resource": "" }
q10849
Jets::Middleware.DefaultStack.use_webpacker
train
def use_webpacker(middleware) return unless Jets.webpacker? # checks for local development if webpacker installed # Different check for middleware because we need webpacker helpers for url helpers. # But we dont want to actually serve via
ruby
{ "resource": "" }
q10850
Jets.AwsInfo.account
train
def account return '123456789' if test? # ensure region set, required for sts.get_caller_identity.account to work ENV['AWS_REGION'] ||= region begin sts.get_caller_identity.account
ruby
{ "resource": "" }
q10851
Jets::Commands.Deploy.check_route_connected_functions
train
def check_route_connected_functions return if Jets::Router.all_routes_valid puts "Deploy fail: The jets application contain invalid routes.".color(:red) puts "Please double check the routes below map to valid controllers:"
ruby
{ "resource": "" }
q10852
Jets::Commands.Deploy.minimal_rollback_complete?
train
def minimal_rollback_complete? stack = find_stack(stack_name) return false unless stack return false unless stack.stack_status == 'ROLLBACK_COMPLETE' # Finally check if all the minimal resources in the parent template have been deleted
ruby
{ "resource": "" }
q10853
Jets::Resource::Iam.ClassRole.all_classes
train
def all_classes klass = @app_class.constantize all_classes = [] while klass != Object all_classes << klass
ruby
{ "resource": "" }
q10854
Jets::Lambda.FunctionConstructor.adjust_tasks
train
def adjust_tasks(klass) class_name = @code_path.to_s.sub(/.*\/functions\//,'').sub(/\.rb$/, '') class_name = class_name.classify klass.tasks.each do |task|
ruby
{ "resource": "" }
q10855
GitHubChangelogGenerator.Section.generate_content
train
def generate_content content = "" if @issues.any? content += "#{@prefix}\n\n" unless @options[:simple_list] || @prefix.blank? @issues.each
ruby
{ "resource": "" }
q10856
GitHubChangelogGenerator.Section.get_string_for_issue
train
def get_string_for_issue(issue) encapsulated_title = encapsulate_string issue["title"] title_with_number = "#{encapsulated_title} [\\##{issue['number']}](#{issue['html_url']})" title_with_number = "#{title_with_number}#{line_labels_for(issue)}"
ruby
{ "resource": "" }
q10857
GitHubChangelogGenerator.Section.encapsulate_string
train
def encapsulate_string(string) string = string.gsub('\\', '\\\\') ENCAPSULATED_CHARACTERS.each do |char|
ruby
{ "resource": "" }
q10858
GitHubChangelogGenerator.Generator.fetch_tags_dates
train
def fetch_tags_dates(tags) print "Fetching tag dates...\r" if options[:verbose] i = 0 tags.each do
ruby
{ "resource": "" }
q10859
GitHubChangelogGenerator.Generator.detect_actual_closed_dates
train
def detect_actual_closed_dates(issues) print "Fetching closed dates for issues...\r" if options[:verbose] i = 0
ruby
{ "resource": "" }
q10860
GitHubChangelogGenerator.Generator.add_first_occurring_tag_to_prs
train
def add_first_occurring_tag_to_prs(tags, prs) total = prs.count prs_left = associate_tagged_prs(tags, prs, total) prs_left = associate_release_branch_prs(prs_left, total) prs_left = associate_rebase_comment_prs(tags, prs_left, total) if prs_left.any? # PRs in prs_left will be untagged, no...
ruby
{ "resource": "" }
q10861
GitHubChangelogGenerator.Generator.associate_tagged_prs
train
def associate_tagged_prs(tags, prs, total) @fetcher.fetch_tag_shas_async(tags) i = 0 prs.reject do |pr| found = false # XXX Wish I could use merge_commit_sha, but gcg doesn't currently # fetch that. See # https://developer.github.com/v3/pulls/#get-a-single-pull-request...
ruby
{ "resource": "" }
q10862
GitHubChangelogGenerator.Generator.set_date_from_event
train
def set_date_from_event(event, issue) if event["commit_id"].nil? issue["actual_date"] = issue["closed_at"] else begin commit = @fetcher.fetch_commit(event["commit_id"]) issue["actual_date"] = commit["commit"]["author"]["date"] # issue['actual_date'] = commit['a...
ruby
{ "resource": "" }
q10863
GitHubChangelogGenerator.OctoFetcher.calculate_pages
train
def calculate_pages(client, method, request_options) # Makes the first API call so that we can call last_response check_github_response do client.send(method, user_project, DEFAULT_REQUEST_OPTIONS.merge(request_options)) end last_response =
ruby
{ "resource": "" }
q10864
GitHubChangelogGenerator.OctoFetcher.github_fetch_tags
train
def github_fetch_tags tags = [] page_i = 0 count_pages = calculate_pages(@client, "tags", {}) iterate_pages(@client, "tags") do |new_tags| page_i += PER_PAGE_NUMBER print_in_same_line("Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}") tags.concat(...
ruby
{ "resource": "" }
q10865
GitHubChangelogGenerator.OctoFetcher.fetch_events_async
train
def fetch_events_async(issues) i = 0 threads = [] issues.each_slice(MAX_THREAD_NUMBER) do |issues_slice| issues_slice.each do |issue| threads << Thread.new do issue["events"] = [] iterate_pages(@client, "issue_events", issue["number"]) do |new_event| ...
ruby
{ "resource": "" }
q10866
GitHubChangelogGenerator.OctoFetcher.fetch_comments_async
train
def fetch_comments_async(prs) threads = [] prs.each_slice(MAX_THREAD_NUMBER) do |prs_slice| prs_slice.each do |pr| threads << Thread.new do pr["comments"] = [] iterate_pages(@client, "issue_comments", pr["number"]) do |new_comment| pr["comments"].conc...
ruby
{ "resource": "" }
q10867
GitHubChangelogGenerator.OctoFetcher.fetch_date_of_tag
train
def fetch_date_of_tag(tag) commit_data = fetch_commit(tag["commit"]["sha"])
ruby
{ "resource": "" }
q10868
GitHubChangelogGenerator.OctoFetcher.fetch_compare
train
def fetch_compare(older, newer) unless @compares["#{older}...#{newer}"] compare_data = check_github_response { @client.compare(user_project, older, newer || "HEAD") } raise StandardError, "Sha #{older} and sha #{newer} are not related; please file a github-changelog-generator issues and describe h...
ruby
{ "resource": "" }
q10869
GitHubChangelogGenerator.OctoFetcher.fetch_commit
train
def fetch_commit(commit_id) found = commits.find do |commit| commit["sha"] == commit_id end if found stringify_keys_deep(found.to_hash) else # cache miss; don't add to @commits because unsure of order. check_github_response do
ruby
{ "resource": "" }
q10870
GitHubChangelogGenerator.OctoFetcher.fetch_tag_shas_async
train
def fetch_tag_shas_async(tags) i = 0 threads = [] print_in_same_line("Fetching SHAs for tags: #{i}/#{tags.count}\r") if @options[:verbose] tags.each_slice(MAX_THREAD_NUMBER) do |tags_slice| tags_slice.each do |tag| threads << Thread.new do # Use oldest commit becau...
ruby
{ "resource": "" }
q10871
GitHubChangelogGenerator.OctoFetcher.check_github_response
train
def check_github_response Retriable.retriable(retry_options) do yield end rescue MovedPermanentlyError => e fail_with_message(e, "The repository has moved, update your configuration") rescue Octokit::Forbidden => e
ruby
{ "resource": "" }
q10872
GitHubChangelogGenerator.Generator.fetch_and_filter_tags
train
def fetch_and_filter_tags since_tag due_tag all_tags = @fetcher.get_all_tags fetch_tags_dates(all_tags) # Creates a Hash @tag_times_hash all_sorted_tags = sort_tags_by_date(all_tags) @sorted_tags = filter_excluded_tags(all_sorted_tags) @filtered_tags = get_filtered_tags(@so...
ruby
{ "resource": "" }
q10873
GitHubChangelogGenerator.Generator.get_time_of_tag
train
def get_time_of_tag(tag_name) raise ChangelogGeneratorError, "tag_name is nil" if tag_name.nil? name_of_tag = tag_name.fetch("name") time_for_tag_name = @tag_times_hash[name_of_tag] return time_for_tag_name if time_for_tag_name
ruby
{ "resource": "" }
q10874
GitHubChangelogGenerator.Generator.detect_link_tag_time
train
def detect_link_tag_time(newer_tag) # if tag is nil - set current time newer_tag_time = newer_tag.nil? ? Time.new : get_time_of_tag(newer_tag) # if it's future release tag - set this value if newer_tag.nil? && options[:future_release] newer_tag_name = options[:future_release] ne...
ruby
{ "resource": "" }
q10875
GitHubChangelogGenerator.Reader.parse_heading
train
def parse_heading(heading) captures = { "version" => nil, "url" => nil, "date" => nil } @heading_structures.each do |regexp|
ruby
{ "resource": "" }
q10876
GitHubChangelogGenerator.Reader.parse
train
def parse(data) sections = data.split(/^## .+?$/) headings = data.scan(/^## .+?$/) headings.each_with_index.map do
ruby
{ "resource": "" }
q10877
GitHubChangelogGenerator.Generator.find_issues_to_add
train
def find_issues_to_add(all_issues, tag_name) all_issues.select do |issue| if issue["milestone"].nil? false else # check, that this milestone in tag list: milestone_is_tag = @filtered_tags.find do |tag| tag["name"] == issue["milestone"]["title"]
ruby
{ "resource": "" }
q10878
GitHubChangelogGenerator.Generator.filter_array_by_labels
train
def filter_array_by_labels(all_issues) filtered_issues = include_issues_by_labels(all_issues)
ruby
{ "resource": "" }
q10879
GitHubChangelogGenerator.Entry.generate_entry_for_tag
train
def generate_entry_for_tag(pull_requests, issues, newer_tag_name, newer_tag_link, newer_tag_time, older_tag_name) # rubocop:disable Metrics/ParameterLists github_site = @options[:github_site] || "https://github.com" project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" create_sectio...
ruby
{ "resource": "" }
q10880
GitHubChangelogGenerator.Entry.generate_header
train
def generate_header(newer_tag_name, newer_tag_link, newer_tag_time, older_tag_name, project_url) header = "" # Generate date string: time_string = newer_tag_time.strftime(@options[:date_format]) # Generate tag name and link release_url = if @options[:release_url] fo...
ruby
{ "resource": "" }
q10881
GitHubChangelogGenerator.Entry.sort_into_sections
train
def sort_into_sections(pull_requests, issues) if @options[:issues] unmapped_issues = sort_labeled_issues(issues) add_unmapped_section(unmapped_issues) end if @options[:pulls]
ruby
{ "resource": "" }
q10882
GitHubChangelogGenerator.Entry.sort_labeled_issues
train
def sort_labeled_issues(issues) sorted_issues = [] issues.each do |issue| label_names = issue["labels"].collect { |l| l["name"] } # Add PRs in the order of the @sections array. This will either be the # default sections followed by any --add-sections sections in # user-defin...
ruby
{ "resource": "" }
q10883
GitHubChangelogGenerator.ParserFile.extract_pair
train
def extract_pair(line) key, value = line.split("=",
ruby
{ "resource": "" }
q10884
GitHubChangelogGenerator.ChangelogGenerator.run
train
def run log = @generator.compound_changelog if @options.write_to_file? output_filename = @options[:output].to_s
ruby
{ "resource": "" }
q10885
GitHubChangelogGenerator.Generator.generate_entry_between_tags
train
def generate_entry_between_tags(older_tag, newer_tag) filtered_issues, filtered_pull_requests = filter_issues_for_tags(newer_tag, older_tag) if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty? # do not generate empty unreleased section return "" end new...
ruby
{ "resource": "" }
q10886
GitHubChangelogGenerator.Generator.filter_issues_for_tags
train
def filter_issues_for_tags(newer_tag, older_tag) filtered_pull_requests = filter_by_tag(@pull_requests, newer_tag) filtered_issues = delete_by_time(@issues, "actual_date", older_tag, newer_tag) newer_tag_name = newer_tag.nil? ? nil : newer_tag["name"] if options[:filter_issues_by_milest...
ruby
{ "resource": "" }
q10887
GitHubChangelogGenerator.Generator.generate_entries_for_all_tags
train
def generate_entries_for_all_tags puts "Generating entry..." if options[:verbose] entries = generate_unreleased_entry @tag_section_mapping.each_pair do |_tag_section, left_right_tags|
ruby
{ "resource": "" }
q10888
Hanami.Environment.to_options
train
def to_options @options.merge( environment: environment, env_config: env_config, apps_path: apps_path,
ruby
{ "resource": "" }
q10889
Hanami.ApplicationConfiguration.root
train
def root(value = nil) if value @root = value
ruby
{ "resource": "" }
q10890
Hanami.ApplicationConfiguration.routes
train
def routes(path = nil, &blk) if path or block_given?
ruby
{ "resource": "" }
q10891
Hanami.ApplicationConfiguration.port
train
def port(value = nil) if value @port = Integer(value) else return @port if defined?(@port) return @env.port unless @env.default_port?
ruby
{ "resource": "" }
q10892
Hanami.Env.load!
train
def load!(path) return unless defined?(Dotenv::Parser) contents = ::File.open(path, "rb:bom|utf-8", &:read) parsed = Dotenv::Parser.call(contents)
ruby
{ "resource": "" }
q10893
Hanami.Hanamirc.default_options
train
def default_options @default_options ||= Utils::Hash.symbolize({ PROJECT_NAME => project_name, TEST_KEY => DEFAULT_TEST_SUITE,
ruby
{ "resource": "" }
q10894
Hanami.Hanamirc.parse_file
train
def parse_file(path) {}.tap do |hash| File.readlines(path).each do |line| key, value = line.split(SEPARATOR)
ruby
{ "resource": "" }
q10895
Hanami.MiddlewareStack.load!
train
def load! load_default_stack stack.each { |m, args, block| builder.use(load_middleware(m), *args,
ruby
{ "resource": "" }
q10896
Hanami.MiddlewareStack.use
train
def use(middleware, *args, &blk) stack.push [middleware, args,
ruby
{ "resource": "" }
q10897
Hanami.MiddlewareStack.prepend
train
def prepend(middleware, *args, &blk) stack.unshift [middleware,
ruby
{ "resource": "" }
q10898
Hanami.Routes.path
train
def path(name, *args) Utils::Escape::SafeString.
ruby
{ "resource": "" }
q10899
Hanami.Routes.url
train
def url(name, *args) Utils::Escape::SafeString.n
ruby
{ "resource": "" }