repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/c/c_parser.rb | lib/yard/parser/c/c_parser.rb | # frozen_string_literal: true
module YARD
module Parser
module C
class CParser < Base
def initialize(source, file = '(stdin)')
@file = file
@namespaces = {}
@content = source
@index = 0
@line = 1
@state = nil
@newline = true
... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/c/comment_parser.rb | lib/yard/parser/c/comment_parser.rb | # frozen_string_literal: true
module YARD
module Parser
module C
module CommentParser
protected
def parse_comments(comments)
@overrides = []
spaces = nil
comments = remove_private_comments(comments)
comments = comments.split(/\r?\n/).map do |line|
... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/ast_node.rb | lib/yard/parser/ruby/ast_node.rb | # frozen_string_literal: true
module YARD
module Parser
module Ruby
# Builds and s-expression by creating {AstNode} objects with
# the type provided by the first argument.
#
# @example An implicit list of keywords
# ast = s(s(:kw, "if"), s(:kw, "else"))
# ast.type # => :lis... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/token_resolver.rb | lib/yard/parser/ruby/token_resolver.rb | # frozen_string_literal: true
module YARD
module Parser
module Ruby
# Supports {#each} enumeration over a source's tokens, yielding
# the token and a possible {CodeObjects::Base} associated with the
# constant or identifier token.
class TokenResolver
include Enumerable
incl... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/ruby_parser.rb | lib/yard/parser/ruby/ruby_parser.rb | # frozen_string_literal: true
begin require 'ripper'; rescue LoadError; nil end
module YARD
module Parser
module Ruby
# Ruby 1.9 parser
# @!attribute [r] encoding_line
# @!attribute [r] frozen_string_line
# @!attribute [r] shebang_line
# @!attribute [r] enumerator
class RubyPa... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/statement_list.rb | lib/yard/parser/ruby/legacy/statement_list.rb | # frozen_string_literal: true
module YARD
module Parser::Ruby::Legacy
class StatementList < Array
include RubyToken
attr_accessor :shebang_line, :encoding_line
# The following list of tokens will require a block to be opened
# if used at the beginning of a statement.
OPEN_BLOCK_TOK... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/statement.rb | lib/yard/parser/ruby/legacy/statement.rb | # frozen_string_literal: true
module YARD
module Parser::Ruby::Legacy
class Statement
attr_reader :tokens, :comments, :block
attr_accessor :comments_range
# @deprecated Groups are now defined by directives
# @see Tags::GroupDirective
attr_accessor :group
attr_accessor :commen... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/token_list.rb | lib/yard/parser/ruby/legacy/token_list.rb | # frozen_string_literal: true
module YARD
module Parser::Ruby::Legacy
class TokenList < Array
include RubyToken
def initialize(content = nil)
self << content if content
end
def to_s(full_statement = false, show_block = true)
inject([]) do |acc, token|
break acc ... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/ruby_lex.rb | lib/yard/parser/ruby/legacy/ruby_lex.rb | require_relative 'irb/slex'
module YARD
module Parser::Ruby::Legacy
# Legacy lexical tokenizer module.
module RubyToken
EXPR_BEG = :EXPR_BEG
EXPR_MID = :EXPR_MID
EXPR_END = :EXPR_END
EXPR_ARG = :EXPR_ARG
EXPR_FNAME = :EXPR_FNAME
EXPR_DOT = :EXPR_DOT
EXPR_CL... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | true |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/ruby_parser.rb | lib/yard/parser/ruby/legacy/ruby_parser.rb | # frozen_string_literal: true
module YARD
module Parser
module Ruby
module Legacy
# Legacy Ruby parser
# @since 0.5.6
class RubyParser < Parser::Base
def initialize(source, _filename)
@source = source
end
def parse
@parse ||= Sta... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
lsegal/yard | https://github.com/lsegal/yard/blob/34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75/lib/yard/parser/ruby/legacy/irb/slex.rb | lib/yard/parser/ruby/legacy/irb/slex.rb | # frozen_string_literal: false
#
# irb/slex.rb - simple lex analyzer
# $Release Version: 0.9.6$
# $Revision$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#
require "irb/notifier"
# @private
module IRB
class SLex
DOUT = Notifier::def_notifier("SLex::")
D_WARN = DOUT::def_notifier(1, "Warn:... | ruby | MIT | 34796c5bfc0ce69a5fea1b38d96435fc4f5b7a75 | 2026-01-04T15:58:51.996173Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/.mdl_style.rb | .mdl_style.rb | all
# our changelog does this, by design
exclude_rule 'MD024'
# default in next version, remove then
rule 'MD007', :indent => 3
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/tools/view_markdown.rb | tools/view_markdown.rb | #!/usr/bin/env ruby
# Quick script for viewing getting at kramdown's and markdownlint's view of a
# markdown file
require 'mdl/doc'
require 'pry'
doc = MarkdownLint::Doc.new_from_file(ARGV[0])
children = doc.parsed.root.children
# rubocop:disable Lint/Debugger
binding.pry
# rubocop:enable Lint/Debugger
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/tools/test_location.rb | tools/test_location.rb | #!/usr/bin/env ruby
# Script for identifying when markdownlint is receiving an incorrect line
# number for an element. It checks all headers, then grabs the lines
# associated with the headers according to markdown and compares the content,
# printing out any that don't match.
require 'mdl/doc'
require 'pry'
text = Fi... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/test_cli.rb | test/test_cli.rb | require_relative 'setup_tests'
require 'open3'
require 'erb'
require 'fileutils'
require 'json'
class TestCli < Minitest::Test
def test_help_text
result = run_cli('--help')
assert_match(/Usage: \S+ \[options\]/, result[:stdout])
assert_equal(0, result[:status])
end
def test_json_output
result = ... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/test_ruledocs.rb | test/test_ruledocs.rb | require_relative 'setup_tests'
# Ensures there is documentation for every rule, and that the
# descriptions/tags/etc in the rule match those in the documentation
# rubocop:disable Style/ClassVars
class TestRuledocs < Minitest::Test
@@ruleset = MarkdownLint::RuleSet.new
@@ruleset.load_default
@@rules = @@ruleset.... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/test_rules.rb | test/test_rules.rb | require_relative 'setup_tests'
class TestRules < Minitest::Test
def get_expected_errors(lines)
# Looks for lines tagged with {MD123} to signify that a rule is expected to
# fire for this line. It also looks for lines tagged with {MD123:1} to
# signify that a rule is expected to fire on another line (the ... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/setup_tests.rb | test/setup_tests.rb | require 'bundler/setup'
Bundler.setup
require_relative '../lib/mdl'
require 'minitest/autorun'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/fixtures/docs_ruleset_2.rb | test/fixtures/docs_ruleset_2.rb | require 'digest/md5'
docs do |id, description|
"https://example.com/#{id}##{Digest::MD5.hexdigest(description)}"
end
rule 'MY004', 'Documents must start with C' do
tags :opinionated
check do |doc|
[1] if doc.lines[0] != 'C'
end
end
rule 'MY005', 'Documents must start with D' do
tags :opinionated
docs... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/fixtures/docs_ruleset_1.rb | test/fixtures/docs_ruleset_1.rb | docs 'https://example.com/static-docs'
rule 'MY002', 'Documents must start with A' do
tags :opinionated
check do |doc|
[1] if doc.lines[0] != 'A'
end
end
rule 'MY003', 'Documents must start with B' do
tags :opinionated
docs 'https://example.com/override-docs'
check do |doc|
[1] if doc.lines[0] != ... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/fixtures/my_ruleset.rb | test/fixtures/my_ruleset.rb | rule 'MY001', 'Documents must start with Hello World' do
tags :opinionated
check do |doc|
[1] if doc.lines[0] != 'Hello World'
end
end
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/fixtures/fake_tty.rb | test/fixtures/fake_tty.rb | # A hacky 'ruleset' file which forces an externally run
# mdl instance to believe it's in a TTY, used for testing.
def $stdout.tty?
true
end
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/inline_html_style.rb | test/rule_tests/inline_html_style.rb | all
exclude_rule 'MD046'
rule 'MD033', :allowed_elements => 'br'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_header_setext_style.rb | test/rule_tests/incorrect_header_setext_style.rb | all
rule 'MD003', :style => :setext
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/spaces_after_list_marker_style.rb | test/rule_tests/spaces_after_list_marker_style.rb | all
rule 'MD007', :indent => 4
rule 'MD030', :ul_multi => 3, :ol_multi => 2
exclude_rule 'MD041'
exclude_rule 'MD046'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/trailing_spaces_br_style.rb | test/rule_tests/trailing_spaces_br_style.rb | all
rule 'MD009', :br_spaces => 2
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/header_trailing_punctuation_customized_style.rb | test/rule_tests/header_trailing_punctuation_customized_style.rb | all
rule 'MD026', :punctuation => '.,;:!'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_header_atx_style.rb | test/rule_tests/incorrect_header_atx_style.rb | all
rule 'MD003', :style => :atx
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/long_lines_code_style.rb | test/rule_tests/long_lines_code_style.rb | all
rule 'MD013', :code_blocks => false, :tables => false
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/header_duplicate_content_different_nesting_style.rb | test/rule_tests/header_duplicate_content_different_nesting_style.rb | rule 'MD024', :allow_different_nesting => true
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/hard_tabs_code_blocks_style.rb | test/rule_tests/hard_tabs_code_blocks_style.rb | all
rule 'MD010', :ignore_code_blocks => true
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/hr_style_long_style.rb | test/rule_tests/hr_style_long_style.rb | all
rule 'MD035', :style => '_____'
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_bullet_style_dash_style.rb | test/rule_tests/incorrect_bullet_style_dash_style.rb | all
rule 'MD004', :style => :dash
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/code_block_consistency_style.rb | test/rule_tests/code_block_consistency_style.rb | rule 'MD046', :style => :consistent
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/hr_style_dashes_style.rb | test/rule_tests/hr_style_dashes_style.rb | all
rule 'MD035', :style => '---'
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/md013_ignore_long_lines_in_code_block_style.rb | test/rule_tests/md013_ignore_long_lines_in_code_block_style.rb | all
rule 'MD013', :ignore_code_blocks => true, :tables => false
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/no_first_line_top_level_header_style.rb | test/rule_tests/no_first_line_top_level_header_style.rb | all
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/first_line_top_level_header_setext_style.rb | test/rule_tests/first_line_top_level_header_setext_style.rb | # Only test MD041 here
rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/fenced_code_without_blank_lines_style.rb | test/rule_tests/fenced_code_without_blank_lines_style.rb | all
exclude_rule 'MD040'
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/hr_style_stars_style.rb | test/rule_tests/hr_style_stars_style.rb | all
rule 'MD035', :style => '***'
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_bullet_style_plus_style.rb | test/rule_tests/incorrect_bullet_style_plus_style.rb | all
rule 'MD004', :style => :plus
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/long_lines_100_style.rb | test/rule_tests/long_lines_100_style.rb | all
rule 'MD013', :line_length => 100
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/ordered_list_item_prefix_ordered_style.rb | test/rule_tests/ordered_list_item_prefix_ordered_style.rb | all
rule 'MD029', :style => :ordered
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/alternate_top_level_header_style.rb | test/rule_tests/alternate_top_level_header_style.rb | all
rule 'MD002', :level => 2
rule 'MD025', :level => 2
rule 'MD041', :level => 2
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/code_block_fenced_style.rb | test/rule_tests/code_block_fenced_style.rb | rule 'MD046', :style => :fenced
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/bulletd_list_sublist_style.rb | test/rule_tests/bulletd_list_sublist_style.rb | rule 'MD004', :style => :sublist
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_header_atx_closed_style.rb | test/rule_tests/incorrect_header_atx_closed_style.rb | all
rule 'MD003', :style => :atx_closed
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/code_block_indented_style.rb | test/rule_tests/code_block_indented_style.rb | rule 'MD046', :style => :indented
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/default_test_style.rb | test/rule_tests/default_test_style.rb | # Default style file for rule tests
all
exclude_rule 'MD041'
# exclude_rule "MD046"
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/headers_good_setext_with_atx_style.rb | test/rule_tests/headers_good_setext_with_atx_style.rb | all
rule 'MD003', :style => :setext_with_atx
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/no_first_line_header_style.rb | test/rule_tests/no_first_line_header_style.rb | all
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/first_line_top_level_header_atx_style.rb | test/rule_tests/first_line_top_level_header_atx_style.rb | # Only test MD041 here
rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/bulleted_list_2_space_indent_style.rb | test/rule_tests/bulleted_list_2_space_indent_style.rb | all
rule 'MD007', :indent => 4
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/test/rule_tests/incorrect_bullet_style_asterisk_style.rb | test/rule_tests/incorrect_bullet_style_asterisk_style.rb | all
rule 'MD004', :style => :asterisk
exclude_rule 'MD041'
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/example/new_style_example.rb | example/new_style_example.rb | all
rule 'MD013', :line_length => 500
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/example/exclude_example/.exclude_example.rb | example/exclude_example/.exclude_example.rb | # This is an example style file.
#
# This file defines the rules to include/exclude and/or parameters
# of those rules.
# This must be included from your .mdlrc using the `style` paramter.
# This is a sample style to exclude very long lines
# First, include all rules:
all
# Then, exclude MD013 (long lines), with:
exc... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl.rb | lib/mdl.rb | require_relative 'mdl/formatters/sarif'
require_relative 'mdl/cli'
require_relative 'mdl/config'
require_relative 'mdl/doc'
require_relative 'mdl/kramdown_parser'
require_relative 'mdl/ruleset'
require_relative 'mdl/style'
require_relative 'mdl/version'
require 'kramdown'
require 'mixlib/shellout'
# Primary MDL conta... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/ruleset.rb | lib/mdl/ruleset.rb | module MarkdownLint
# defines a single rule
class Rule
attr_accessor :id, :description
def initialize(id, description, fallback_docs: nil, &)
@id = id
@description = description
@generate_docs = fallback_docs
@docs_overridden = false
@aliases = []
@tags = []
@param... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/version.rb | lib/mdl/version.rb | module MarkdownLint
VERSION = '0.15.0'.freeze
end
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/doc.rb | lib/mdl/doc.rb | require 'kramdown'
require_relative 'kramdown_parser'
module MarkdownLint
##
# Representation of the markdown document passed to rule checks
class Doc
##
# A list of raw markdown source lines. Note that the list is 0-indexed,
# while line numbers in the parsed source are 1-indexed, so you need to
... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/rules.rb | lib/mdl/rules.rb | docs do |id, description|
url_hash = [id.downcase,
description.downcase.gsub(/[^a-z]+/, '-')].join('---')
"https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md##{url_hash}"
end
rule 'MD001', 'Header levels should only increment by one level at a time' do
tags :headers
aliases 'hea... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/kramdown_parser.rb | lib/mdl/kramdown_parser.rb | # Modified version of the kramdown parser to add in features/changes
# appropriate for markdownlint, but which don't make sense to try to put
# upstream.
require 'kramdown/parser/gfm'
module Kramdown
module Parser
# modified parser class - see comment above
class MarkdownLint < Kramdown::Parser::Kramdown
... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/cli.rb | lib/mdl/cli.rb | require 'mixlib/cli'
require 'pathname'
module MarkdownLint
# Our Mixlib::CLI class
class CLI
include Mixlib::CLI
CONFIG_FILE = '.mdlrc'.freeze
banner "Usage: #{File.basename($PROGRAM_NAME)} [options] [FILE.md|DIR ...]"
option :show_aliases,
:short => '-a',
:long => '--[no-... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/config.rb | lib/mdl/config.rb | require 'mixlib/config'
module MarkdownLint
# our Mixlib::Config class
module Config
extend Mixlib::Config
default :style, 'default'
end
end
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/style.rb | lib/mdl/style.rb | module MarkdownLint
# defines a style
class Style
attr_reader :rules
def initialize(all_rules)
@tagged_rules = {}
@aliases = {}
all_rules.each do |id, r|
r.tags.each do |t|
@tagged_rules[t] ||= Set.new
@tagged_rules[t] << id
end
r.aliases.each d... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/styles/default.rb | lib/mdl/styles/default.rb | all
exclude_rule 'fenced-code-language' # Fenced code blocks should have a language
exclude_rule 'first-line-h1' # First line in file should be a top level header
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/styles/cirosantilli.rb | lib/mdl/styles/cirosantilli.rb | # Enforce the style guide at https://cirosantilli.com/markdown-style-guide
all
rule 'MD003', :style => :atx
rule 'MD004', :style => :dash
rule 'MD007', :indent => 4
rule 'MD030', :ul_multi => 3, :ol_multi => 2
rule 'MD035', :style => '---'
# Inline HTML - this isn't forbidden by the style guide, and raw HTML use is
# ... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/styles/relaxed.rb | lib/mdl/styles/relaxed.rb | all
exclude_tag :whitespace
exclude_tag :line_length
exclude_rule 'MD006' # Lists at beginning of line
exclude_rule 'MD007' # List indentation
exclude_rule 'MD033' # Inline HTML
exclude_rule 'MD034' # Bare URL used
exclude_rule 'MD040' # Fenced code blocks should have a language specified
exclude_rule 'MD041' # First ... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/styles/all.rb | lib/mdl/styles/all.rb | all
| ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
markdownlint/markdownlint | https://github.com/markdownlint/markdownlint/blob/94bee4780918f3ca69ff672fb23f9b18a23ef889/lib/mdl/formatters/sarif.rb | lib/mdl/formatters/sarif.rb | require 'json'
module MarkdownLint
# SARIF formatter
#
# @see https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html
class SarifFormatter
class << self
def generate(rules, results)
matched_rules_id = results.map { |result| result['rule'] }.uniq
matched_rules = rules.slice(*m... | ruby | MIT | 94bee4780918f3ca69ff672fb23f9b18a23ef889 | 2026-01-04T15:59:05.933702Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/spec_helper.rb | spec/spec_helper.rb | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/data.rb | spec/rqrcode/data.rb | AS_ANSI = <<~ANSI.chomp
\e[47m \e[m\n\e[47m \e[m\n\e[47m \e[m\n\e[47m \e[m\n\e[47m ... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | true |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/export_html_spec.rb | spec/rqrcode/export_html_spec.rb | require "spec_helper"
describe "Export::HTML" do
it "must respond_to html" do
expect(RQRCode::QRCode.new("html")).to respond_to(:as_html)
end
it "must export to html" do
expect(RQRCode::QRCode.new("html").as_html).to eq(AS_HTML)
end
end
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/export_svg_spec.rb | spec/rqrcode/export_svg_spec.rb | require "spec_helper"
require "rqrcode/data"
describe "Export::SVG" do
it "must respond_to svg" do
expect(RQRCode::QRCode.new("qrcode")).to respond_to(:as_svg)
end
context "with use_rect (default) option" do
it "must export to svg" do
expect(RQRCode::QRCode.new("https://kyan.com").as_svg).to eq(AS... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/qrqcode_spec.rb | spec/rqrcode/qrqcode_spec.rb | require "spec_helper"
require "rqrcode/data"
describe "RQRCode" do
it "must provide a custom to_s" do
qr = RQRCode::QRCode.new("http://kyan.com", size: 3)
expect(qr.to_s[0..50]).to eq("xxxxxxx x x xxx xxxxxxx\nx x xxxxx x x ")
expect(qr.to_s(dark: "q", light: "n")[0..36]).to eq("qqqqqqqnnnqn... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/export_png_spec.rb | spec/rqrcode/export_png_spec.rb | require "spec_helper"
describe "Export::PNG" do
let(:mockImage) { double(:mock_image) }
before :each do
allow(mockImage).to receive(:[]=)
end
it "must respond_to png" do
expect(RQRCode::QRCode.new("x")).to respond_to(:as_png)
end
it "must export to png file" do
expect(RQRCode::QRCode.new("pn... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/spec/rqrcode/export_ansi_spec.rb | spec/rqrcode/export_ansi_spec.rb | require "spec_helper"
require "rqrcode/data"
describe "Export::ANSI" do
it "must respond_to ansi" do
expect(RQRCode::QRCode.new("x")).to respond_to(:as_ansi)
end
it "must export to ansi" do
expect(RQRCode::QRCode.new("ansi").as_ansi).to eq(AS_ANSI)
end
end
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode.rb | lib/rqrcode.rb | # frozen_string_literal: true
module RQRCode
require "rqrcode_core"
require "rqrcode/qrcode"
require "rqrcode/export"
require "rqrcode/version"
end
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/export.rb | lib/rqrcode/export.rb | # frozen_string_literal: true
require "rqrcode/export/ansi"
require "rqrcode/export/html"
require "rqrcode/export/png"
require "rqrcode/export/svg"
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/version.rb | lib/rqrcode/version.rb | # frozen_string_literal: true
module RQRCode
VERSION = "3.1.1"
end
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/qrcode.rb | lib/rqrcode/qrcode.rb | # frozen_string_literal: true
require "rqrcode/qrcode/qrcode"
| ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/export/svg.rb | lib/rqrcode/export/svg.rb | # frozen_string_literal: true
# This class creates a SVG files.
# Initial code from: https://github.com/samvincent/rqrcode-rails3
module RQRCode
module Export
module SVG
class BaseOutputSVG
attr_reader :result
def initialize(qrcode)
@qrcode = qrcode
@result = []
... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/export/ansi.rb | lib/rqrcode/export/ansi.rb | # frozen_string_literal: true
module RQRCode
module Export
module ANSI
#
# Returns a string of the QR code as
# characters writen with ANSI background set.
#
# Options:
# light: Foreground ("\033[47m")
# dark: Background ANSI code. ("\033[40m")
# fill_character: Th... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/export/png.rb | lib/rqrcode/export/png.rb | # frozen_string_literal: true
require "chunky_png"
# This class creates PNG files.
module RQRCode
module Export
module PNG
# Render the PNG from the QR Code.
#
# Options:
# fill - Background ChunkyPNG::Color, defaults to 'white'.
# color - Foreground ChunkyPNG::Color, defaults to ... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/export/html.rb | lib/rqrcode/export/html.rb | # frozen_string_literal: true
module RQRCode
module Export
module HTML
#
# Use this module to HTML-ify the QR code if you just want the default HTML
def as_html
["<table>", rows.as_html, "</table>"].join
end
private
def rows
Rows.new(@qrcode)
end
... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
whomwah/rqrcode | https://github.com/whomwah/rqrcode/blob/e789be339b6f833a01bc4c84e3d444e4699c3765/lib/rqrcode/qrcode/qrcode.rb | lib/rqrcode/qrcode/qrcode.rb | # frozen_string_literal: true
require "forwardable"
module RQRCode # :nodoc:
class QRCode
extend Forwardable
def_delegators :@qrcode, :to_s
def_delegators :@qrcode, :modules # deprecated
attr_reader :qrcode
def initialize(string, *args)
@qrcode = RQRCodeCore::QRCode.new(string, *args)
... | ruby | MIT | e789be339b6f833a01bc4c84e3d444e4699c3765 | 2026-01-04T15:59:18.653934Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/jobs/application_job.rb | app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
end
| ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/uploaders/pkg_uploader.rb | app/uploaders/pkg_uploader.rb | class PkgUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/uploaders/icon_uploader.rb | app/uploaders/icon_uploader.rb | class IconUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
#... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/helpers/sessions_helper.rb | app/helpers/sessions_helper.rb | module SessionsHelper
end
| ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/helpers/plats_helper.rb | app/helpers/plats_helper.rb | module PlatsHelper
def pkg_selectable_map
PkgAdapter.config.adapters.map{|k,v|{v[:des] => k}}.inject(:merge)
end
end
| ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
include UserSign
end | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/pkgs_controller.rb | app/controllers/pkgs_controller.rb | class PkgsController < ApplicationController
protect_from_forgery :except => [:api_create]
before_action :set_plat, only: [:new,:create]
def show
@pkg = Pkg.find params[:id]
history = Pkg.where("id < ?",@pkg.id).limit(20).where(plat_id:@pkg.plat_id).id_desc
history.each do |e|
@history ||= {}... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/udid_controller.rb | app/controllers/udid_controller.rb | class UdidController < ApplicationController
skip_before_action :verify_authenticity_token, :only => [:create]
def create
profile_service_attributes = PkgAdapter::ConfigParser.mobileconfig(request.raw_post)
udid = profile_service_attributes.value['UDID'].value
redirect_to "#{request.base_url}udid?udi... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/apps_controller.rb | app/controllers/apps_controller.rb | class AppsController < ApplicationController
before_action :set_app, only: [:show, :edit, :update, :destroy, :comments]
def index
unless User.admin.exists?
redirect_to new_user_path and return
end
@apps = App.active.all
@has_archived = App.archived.count > 0
end
def show
redirect_to ... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < ApplicationController
def index
@users = User.id_desc.page(params[:page]).per(params[:per])
end
def new
unless User.admin.exists?
@init_admin = true
end
@user = User.admin.new
end
def create
user = User.new user_params
if !User.admin.exists? || authoriz... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/sessions_controller.rb | app/controllers/sessions_controller.rb | class SessionsController < ApplicationController
def new
end
def create
user = User.find_by(email: params[:session][:email].downcase)
if user&.authenticate(params[:session][:password])
sign_in user
redirect_to root_path
else
flash[:error] = '用户名或密码错误'
redirect_to new_... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
# skip_before_action :verify_authenticity_token
include UserSign
around_action :set_thread_current_variable
private
def set_thread_current_variable
Current.request = request
yield
ensure
Current.req... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/controllers/plats_controller.rb | app/controllers/plats_controller.rb | class PlatsController < ApplicationController
before_action :set_app, only: [:index, :show, :new, :create, :destroy, :api_sort]
before_action :set_plat, only: [:show,:destroy,:update,:edit]
def index
@plats = Plat.where(app_id:params[:app_id])
if @plats.present?
redirect_to app_plat_path @plats.fir... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
pluosi/app-host | https://github.com/pluosi/app-host/blob/703ed3952fc4d2e51bf0e6dade57309c3fb32efb/app/models/ability.rb | app/models/ability.rb | class Ability
include CanCan::Ability
def initialize(user)
# Define abilities for the passed in user here. For example:
#
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
cannot :manage, User
can :update, User do |user,current_user|
... | ruby | MIT | 703ed3952fc4d2e51bf0e6dade57309c3fb32efb | 2026-01-04T15:58:19.863477Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.