shields-badge 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +122 -5
- data/LICENSE.md +11 -0
- data/README.md +302 -355
- data/lib/shields/badge/activity/github_commits_since_latest_release.rb +10 -4
- data/lib/shields/badge/analysis/.keep +0 -0
- data/lib/shields/badge/base.rb +2 -2
- data/lib/shields/badge/build/github_branch_check_runs.rb +10 -4
- data/lib/shields/badge/chat/.keep +0 -0
- data/lib/shields/badge/code_coverage/coveralls.rb +10 -4
- data/lib/shields/badge/core/.keep +0 -0
- data/lib/shields/badge/dependencies/.keep +0 -0
- data/lib/shields/badge/downloads/gem_download_rank.rb +9 -3
- data/lib/shields/badge/downloads/gem_total_downloads.rb +9 -3
- data/lib/shields/badge/funding/.keep +0 -0
- data/lib/shields/badge/issue_tracking/.keep +0 -0
- data/lib/shields/badge/license/.keep +0 -0
- data/lib/shields/badge/monitoring/.keep +0 -0
- data/lib/shields/badge/other/.keep +0 -0
- data/lib/shields/badge/platform_version_support/.keep +0 -0
- data/lib/shields/badge/rating/.keep +0 -0
- data/lib/shields/badge/size/.keep +0 -0
- data/lib/shields/badge/social/github_repo_stars.rb +9 -3
- data/lib/shields/badge/test_results/.keep +0 -0
- data/lib/shields/badge/version/.keep +0 -0
- data/lib/shields/badge/version.rb +5 -1
- data/lib/shields/badge.rb +1 -1
- data/lib/shields/categories.rb +1 -1
- data/lib/shields/formatters/image_src_url.rb +1 -1
- data/lib/shields/formatters/markdown.rb +1 -1
- data/lib/shields/plugins/query_plugin.rb +5 -5
- data/sig/shields/badge.rbs +9 -0
- data.tar.gz.sig +0 -0
- metadata +233 -95
- metadata.gz.sig +0 -0
- data/CODE_OF_CONDUCT.md +0 -133
- data/CONTRIBUTING.md +0 -139
- data/LICENSE.txt +0 -21
- data/SECURITY.md +0 -24
|
@@ -14,7 +14,7 @@ module Shields
|
|
|
14
14
|
class QueryDto < ::Castkit::DataObject
|
|
15
15
|
OPTIONS = {
|
|
16
16
|
sort: %w[date semver],
|
|
17
|
-
include_prereleases: %w[true false]
|
|
17
|
+
include_prereleases: %w[true false]
|
|
18
18
|
}
|
|
19
19
|
FILTER_MATCHER = /[*!]/
|
|
20
20
|
|
|
@@ -39,11 +39,17 @@ module Shields
|
|
|
39
39
|
class << self
|
|
40
40
|
# Formatted string specification template
|
|
41
41
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
42
|
-
def api_template
|
|
42
|
+
def api_template
|
|
43
|
+
"/github/commits-since/%{user}/%{repo}/latest"
|
|
44
|
+
end
|
|
43
45
|
|
|
44
|
-
def anchor_href_template
|
|
46
|
+
def anchor_href_template
|
|
47
|
+
"https://github.com/%{user}/%{repo}/releases"
|
|
48
|
+
end
|
|
45
49
|
|
|
46
|
-
def label_text_template
|
|
50
|
+
def label_text_template
|
|
51
|
+
"%{user}/%{repo} commits since latest release"
|
|
52
|
+
end
|
|
47
53
|
end
|
|
48
54
|
end
|
|
49
55
|
end
|
|
File without changes
|
data/lib/shields/badge/base.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Shields
|
|
|
6
6
|
HTTP_METHOD = :get
|
|
7
7
|
BASE_URL = {
|
|
8
8
|
"svg" => "https://img.shields.io",
|
|
9
|
-
"png" => "https://raster.shields.io"
|
|
9
|
+
"png" => "https://raster.shields.io"
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class << self
|
|
@@ -48,7 +48,7 @@ module Shields
|
|
|
48
48
|
def format(formatter)
|
|
49
49
|
args = formatter.signature.each_with_object({}) { |key, memo| memo[key] = send(key) }
|
|
50
50
|
formatter.call(
|
|
51
|
-
**args
|
|
51
|
+
**args
|
|
52
52
|
)
|
|
53
53
|
end
|
|
54
54
|
|
|
@@ -16,7 +16,7 @@ module Shields
|
|
|
16
16
|
enable_plugins :query_plugin
|
|
17
17
|
|
|
18
18
|
optional do
|
|
19
|
-
string :name_filter, ignore_nil: true, aliases: %w
|
|
19
|
+
string :name_filter, ignore_nil: true, aliases: %w[nameFilter]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Calls up to QueryPlugin#camel_case_keys
|
|
@@ -28,11 +28,17 @@ module Shields
|
|
|
28
28
|
class << self
|
|
29
29
|
# Formatted string specification template
|
|
30
30
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
31
|
-
def api_template
|
|
31
|
+
def api_template
|
|
32
|
+
"/github/check-runs/%{user}/%{repo}/%{branch}"
|
|
33
|
+
end
|
|
32
34
|
|
|
33
|
-
def anchor_href_template
|
|
35
|
+
def anchor_href_template
|
|
36
|
+
"https://github.com/%{user}/%{repo}/actions"
|
|
37
|
+
end
|
|
34
38
|
|
|
35
|
-
def label_text_template
|
|
39
|
+
def label_text_template
|
|
40
|
+
"%{user}/%{repo} check runs (branch: %{branch})"
|
|
41
|
+
end
|
|
36
42
|
end
|
|
37
43
|
end
|
|
38
44
|
end
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ module Shields
|
|
|
12
12
|
enable_plugins :github_repo_plugin
|
|
13
13
|
|
|
14
14
|
required do
|
|
15
|
-
string :vcs_type, ignore_nil: true, aliases: %w
|
|
15
|
+
string :vcs_type, ignore_nil: true, aliases: %w[vcsType], validator: ->(v, _options) {
|
|
16
16
|
raise Errors::ValidationError, "invalid option for vcs_type, must be one of #{VCS_TYPES}" if v && !VCS_TYPES.include?(v)
|
|
17
17
|
true
|
|
18
18
|
}
|
|
@@ -30,11 +30,17 @@ module Shields
|
|
|
30
30
|
class << self
|
|
31
31
|
# Formatted string specification template
|
|
32
32
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
33
|
-
def api_template
|
|
33
|
+
def api_template
|
|
34
|
+
"/coverallsCoverage/%{vcs_type}/%{user}/%{repo}"
|
|
35
|
+
end
|
|
34
36
|
|
|
35
|
-
def anchor_href_template
|
|
37
|
+
def anchor_href_template
|
|
38
|
+
"https://github.com/%{user}/%{repo}/actions"
|
|
39
|
+
end
|
|
36
40
|
|
|
37
|
-
def label_text_template
|
|
41
|
+
def label_text_template
|
|
42
|
+
"%{user}/%{repo} test coverage"
|
|
43
|
+
end
|
|
38
44
|
end
|
|
39
45
|
end
|
|
40
46
|
end
|
|
File without changes
|
|
File without changes
|
|
@@ -25,11 +25,17 @@ module Shields
|
|
|
25
25
|
class << self
|
|
26
26
|
# Formatted string specification template
|
|
27
27
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
28
|
-
def api_template
|
|
28
|
+
def api_template
|
|
29
|
+
"/gem/%{period}/%{gem}"
|
|
30
|
+
end
|
|
29
31
|
|
|
30
|
-
def anchor_href_template
|
|
32
|
+
def anchor_href_template
|
|
33
|
+
"https://rubygems.org/gems/%{gem}"
|
|
34
|
+
end
|
|
31
35
|
|
|
32
|
-
def label_text_template
|
|
36
|
+
def label_text_template
|
|
37
|
+
"RubyGems Download Rank"
|
|
38
|
+
end
|
|
33
39
|
end
|
|
34
40
|
end
|
|
35
41
|
end
|
|
@@ -20,11 +20,17 @@ module Shields
|
|
|
20
20
|
class << self
|
|
21
21
|
# Formatted string specification template
|
|
22
22
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
23
|
-
def api_template
|
|
23
|
+
def api_template
|
|
24
|
+
"/gem/dt/%{gem}"
|
|
25
|
+
end
|
|
24
26
|
|
|
25
|
-
def anchor_href_template
|
|
27
|
+
def anchor_href_template
|
|
28
|
+
"https://rubygems.org/gems/%{gem}"
|
|
29
|
+
end
|
|
26
30
|
|
|
27
|
-
def label_text_template
|
|
31
|
+
def label_text_template
|
|
32
|
+
"RubyGems Total Downloads"
|
|
33
|
+
end
|
|
28
34
|
end
|
|
29
35
|
end
|
|
30
36
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -18,11 +18,17 @@ module Shields
|
|
|
18
18
|
class << self
|
|
19
19
|
# Formatted string specification template
|
|
20
20
|
# See: https://ruby-doc.org/3.4.1/String.html#method-i-25
|
|
21
|
-
def api_template
|
|
21
|
+
def api_template
|
|
22
|
+
"/github/stars/%{user}/%{repo}"
|
|
23
|
+
end
|
|
22
24
|
|
|
23
|
-
def anchor_href_template
|
|
25
|
+
def anchor_href_template
|
|
26
|
+
"https:///github.com/%{user}/%{repo}/stargazers"
|
|
27
|
+
end
|
|
24
28
|
|
|
25
|
-
def label_text_template
|
|
29
|
+
def label_text_template
|
|
30
|
+
"GitHub Stars"
|
|
31
|
+
end
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
end
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module Shields
|
|
4
4
|
module Badge
|
|
5
|
+
# Version namespace for this gem.
|
|
5
6
|
module Version
|
|
6
|
-
|
|
7
|
+
# Current gem version.
|
|
8
|
+
VERSION = "1.0.1"
|
|
7
9
|
end
|
|
10
|
+
# Current gem version exposed at the traditional constant location.
|
|
11
|
+
VERSION = Version::VERSION # Traditional Constant Location
|
|
8
12
|
end
|
|
9
13
|
end
|
data/lib/shields/badge.rb
CHANGED
data/lib/shields/categories.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Shields
|
|
2
2
|
module Formatters
|
|
3
3
|
module Markdown
|
|
4
|
-
SIGNATURE = %i
|
|
4
|
+
SIGNATURE = %i[label_text img_src_url anchor_href_url]
|
|
5
5
|
|
|
6
6
|
def call(label_text:, img_src_url:, anchor_href_url:)
|
|
7
7
|
"[](%{anchor_href_url})" %
|
|
@@ -8,7 +8,7 @@ module Shields
|
|
|
8
8
|
cache_seconds
|
|
9
9
|
].freeze
|
|
10
10
|
UNIVERSAL_OPTIONS = {
|
|
11
|
-
style: %w[flat flat-square plastic for-the-badge social]
|
|
11
|
+
style: %w[flat flat-square plastic for-the-badge social]
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
class << self
|
|
@@ -20,12 +20,12 @@ module Shields
|
|
|
20
20
|
true
|
|
21
21
|
})
|
|
22
22
|
klass.string(:logo, ignore_nil: true)
|
|
23
|
-
klass.string(:logo_color, ignore_nil: true, aliases: %w
|
|
24
|
-
klass.string(:logo_size, ignore_nil: true, aliases: %w
|
|
23
|
+
klass.string(:logo_color, ignore_nil: true, aliases: %w[logoColor])
|
|
24
|
+
klass.string(:logo_size, ignore_nil: true, aliases: %w[logoSize])
|
|
25
25
|
klass.string(:label, ignore_nil: true)
|
|
26
|
-
klass.string(:label_color, ignore_nil: true, aliases: %w
|
|
26
|
+
klass.string(:label_color, ignore_nil: true, aliases: %w[labelColor])
|
|
27
27
|
klass.string(:color, ignore_nil: true)
|
|
28
|
-
klass.string(:cache_seconds, ignore_nil: true, aliases: %w
|
|
28
|
+
klass.string(:cache_seconds, ignore_nil: true, aliases: %w[cacheSeconds], validator: ->(v, _options) {
|
|
29
29
|
raise Errors::ValidationError, "invalid option for cache_seconds, must be an integer string but was #{v} (#{v.class})" if v && v.to_i.to_s != v
|
|
30
30
|
true
|
|
31
31
|
})
|
data.tar.gz.sig
CHANGED
|
Binary file
|