1
1
# frozen_string_literal: true
2
2
3
- # Get the GEMFILE_VERSION without *require* "my_gem/version", for code coverage accuracy
4
- # See: https://github.com/simplecov-ruby/simplecov/issues/557#issuecomment-825171399
5
- load "lib/omniauth/identity/version.rb"
6
- gem_version = OmniAuth ::Identity ::Version ::VERSION
7
- OmniAuth ::Identity ::Version . send ( :remove_const , :VERSION )
3
+ gem_version =
4
+ if RUBY_VERSION >= "3.1"
5
+ # Loading version into an anonymous module allows version.rb to get code coverage from SimpleCov!
6
+ # See: https://github.com/simplecov-ruby/simplecov/issues/557#issuecomment-2630782358
7
+ Module . new . tap { |mod | Kernel . load ( "lib/omniauth/identity/version.rb" , mod ) } ::OmniAuth ::Identity ::Version ::VERSION
8
+ else
9
+ # TODO: Remove this hack once support for Ruby 3.0 and below is removed
10
+ Kernel . load ( "lib/omniauth/identity/version.rb" )
11
+ g_ver = OmniAuth ::Identity ::Version ::VERSION
12
+ OmniAuth ::Identity ::Version . send ( :remove_const , :VERSION )
13
+ g_ver
14
+ end
8
15
9
16
Gem ::Specification . new do |spec |
10
17
spec . name = "omniauth-identity"
@@ -44,9 +51,13 @@ Gem::Specification.new do |spec|
44
51
spec . metadata [ "funding_uri" ] = "https://liberapay.com/pboling"
45
52
spec . metadata [ "rubygems_mfa_required" ] = "true"
46
53
54
+ # Specify which files should be added to the gem when it is released.
47
55
spec . files = Dir [
48
56
# Splats (alphabetical)
49
- "lib/**/*" ,
57
+ "lib/**/*.rb" ,
58
+ ]
59
+ # Automatically included with gem package, no need to list again in files.
60
+ spec . extra_rdoc_files = Dir [
50
61
# Files (alphabetical)
51
62
"CHANGELOG.md" ,
52
63
"CODE_OF_CONDUCT.md" ,
@@ -55,6 +66,15 @@ Gem::Specification.new do |spec|
55
66
"README.md" ,
56
67
"SECURITY.md" ,
57
68
]
69
+ spec . rdoc_options += [
70
+ "--title" ,
71
+ "#{ spec . name } - #{ spec . summary } " ,
72
+ "--main" ,
73
+ "README.md" ,
74
+ "--line-numbers" ,
75
+ "--inline-source" ,
76
+ "--quiet" ,
77
+ ]
58
78
spec . bindir = "exe"
59
79
spec . require_paths = [ "lib" ]
60
80
0 commit comments