gem_hadar 2.0.4 → 2.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02a07af5340e02cca960b8c50bb32129d4c7203c9dc337bbe57354fe754490c2
4
- data.tar.gz: 7adb26caabcdb62ecb45a0179384fe9ade1c0bf50718252f4b2e0c1ec962ce02
3
+ metadata.gz: f01f8950f6b88b9bedbc5625f05ea64a94e8e21420ca3aca50f6920f79536a39
4
+ data.tar.gz: 29e83f4d30a06fc64e2288872d80315047ae1fc42903445cf5d8fc0babfc682d
5
5
  SHA512:
6
- metadata.gz: 28357b3be7f6b52bc5dc268d0483685b31ccf37801f011867014ee1e4a6c96932b84a8e6706d828d7c89ee0e6034f057785e1eea3a1bd86e066d3ac0d87c0e91
7
- data.tar.gz: 4728c3ab51a1ade4e60887e421e37395899365a5caa2adc0d031127fbd39419befe7fa63175ab34e978ce5c20c439e5cd2a9d674034b63eee203cadbea8c4ecd
6
+ metadata.gz: 5ea2fc314ad1b9c55e2892b190e6d506ca096207ee84ee4f879f429e004825fa95a172b694e72552357124942bdd460a3607527f41d26d31e123fe3bcfc3a211
7
+ data.tar.gz: 00c44133466267127819c79617812cd67705a7af7bbd57fd9cdc53114ffb655956e9b553fc0022551bb656d914c9f1e50e0eaba804456ec40ea79de023ad8953
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.4
1
+ 2.1.0
data/gem_hadar.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: gem_hadar 2.0.4 ruby lib
2
+ # stub: gem_hadar 2.1.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gem_hadar".freeze
6
- s.version = "2.0.4".freeze
6
+ s.version = "2.1.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.description = "This library contains some useful functionality to support the development of Ruby Gems".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["gem_hadar".freeze]
15
- s.extra_rdoc_files = ["README.md".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze]
16
- s.files = [".gitignore".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/gem_hadar".freeze, "gem_hadar.gemspec".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze]
15
+ s.extra_rdoc_files = ["README.md".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze, "lib/gem_hadar/warn.rb".freeze]
16
+ s.files = [".gitignore".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/gem_hadar".freeze, "gem_hadar.gemspec".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze, "lib/gem_hadar/warn.rb".freeze]
17
17
  s.homepage = "https://github.com/flori/gem_hadar".freeze
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "GemHadar - Library for the development of Ruby Gems".freeze, "--main".freeze, "README.md".freeze]
@@ -5,6 +5,7 @@ require 'pathname'
5
5
 
6
6
  class GemHadar
7
7
  end
8
+ require 'gem_hadar/warn'
8
9
 
9
10
  # A module that provides SimpleCov-related functionality for code coverage
10
11
  # analysis.
@@ -17,36 +18,6 @@ end
17
18
  #
18
19
  # @example Initializing SimpleCov with GemHadar GemHadar::SimpleCov.start
19
20
  module GemHadar::SimpleCov
20
- # A module that provides warning functionality with colored output.
21
- #
22
- # This module enhances the standard warn method to display warning messages
23
- # in orange color, making them more visible in terminal outputs. It is
24
- # designed to be included in classes that need consistent warning message
25
- # formatting throughout the application.
26
- #
27
- # @example Using the warn method from this module
28
- # class MyClass
29
- # include GemHadar::SimpleCov::WarnModule
30
- #
31
- # def my_method
32
- # warn "This is a warning message"
33
- # end
34
- # end
35
- module WarnModule
36
- # The warn method displays warning messages using orange colored output.
37
- #
38
- # This method takes an array of message strings, applies orange color
39
- # formatting to each message, and then passes them to the superclass's warn
40
- # method for display. The uplevel: 1 option ensures that the warning
41
- # originates from the caller's context rather than from within this method
42
- # itself.
43
- #
44
- # @param msgs [ Array<String> ] the array of message strings to display as warnings
45
- def warn(*msgs)
46
- msgs.map! { |m| color(208) { m } }
47
- super(*msgs, uplevel: 1)
48
- end
49
- end
50
21
 
51
22
  # A formatter class that generates detailed JSON coverage reports from
52
23
  # SimpleCov results.
@@ -107,7 +78,7 @@ module GemHadar::SimpleCov
107
78
  covered_branches: result.covered_branches,
108
79
  missed_branches: result.missed_branches,
109
80
  coverage_strength: result.covered_strength.round(2),
110
- least_covered_file: result.least_covered_file,
81
+ least_covered_file: (result.least_covered_file rescue nil),
111
82
  covered_files:,
112
83
  uncovered_files:,
113
84
  files_count:,
@@ -126,7 +97,7 @@ module GemHadar::SimpleCov
126
97
 
127
98
  private
128
99
 
129
- include WarnModule
100
+ include GemHadar::Warn
130
101
 
131
102
  # The project_name method retrieves the name of the current working
132
103
  # directory.
@@ -215,6 +186,6 @@ module GemHadar::SimpleCov
215
186
 
216
187
  private
217
188
 
218
- include WarnModule
189
+ include GemHadar::Warn
219
190
  end
220
191
  end
@@ -1,6 +1,6 @@
1
1
  class GemHadar
2
2
  # GemHadar version
3
- VERSION = '2.0.4'
3
+ VERSION = '2.1.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -0,0 +1,55 @@
1
+ require 'term/ansicolor'
2
+
3
+ class GemHadar
4
+ # A module that provides warning functionality with colored output.
5
+ #
6
+ # This module enhances the standard warn method to display warning messages
7
+ # in orange color, making them more visible in terminal outputs. It is
8
+ # designed to be included in classes that need consistent warning message
9
+ # formatting throughout the application.
10
+ #
11
+ # @example Using the warn method from this module
12
+ # class MyClass
13
+ # include GemHadar::SimpleCov::Warn
14
+ #
15
+ # def my_method
16
+ # warn "This is a warning message"
17
+ # end
18
+ # end
19
+ module Warn
20
+ include Term::ANSIColor
21
+ # The warn method displays warning messages using orange colored output.
22
+ #
23
+ # This method takes an array of message strings, applies orange color
24
+ # formatting to each message, and then passes them to the superclass's warn
25
+ # method for display. The uplevel: 1 option ensures that the warning
26
+ # originates from the caller's context rather than from within this method
27
+ # itself.
28
+ #
29
+ # @param msgs [ Array<String> ] the array of message strings to display as warnings
30
+ def warn(*msgs)
31
+ msgs.map! do |a|
32
+ a.respond_to?(:to_str) ? color(208) { a.to_str } : a
33
+ end
34
+ super(*msgs, uplevel: 1)
35
+ end
36
+
37
+ # The fail method formats and displays failure messages using red colored output.
38
+ #
39
+ # This method takes an array of message objects, applies red color formatting
40
+ # to string representations of the messages, and then passes them to the
41
+ # superclass's fail method for display. The uplevel: 1 option ensures that
42
+ # the failure message originates from the caller's context rather than from
43
+ # within this method itself.
44
+ #
45
+ # @param msgs [ Array<Object> ] the array of message objects to display as failures
46
+ #
47
+ # @return [ void ]
48
+ def fail(*msgs)
49
+ msgs.map! do |a|
50
+ a.respond_to?(:to_str) ? color(196) { a.to_str } : a
51
+ end
52
+ super(*msgs)
53
+ end
54
+ end
55
+ end
data/lib/gem_hadar.rb CHANGED
@@ -60,15 +60,18 @@ class GemHadar
60
60
  end
61
61
  require 'gem_hadar/version'
62
62
  require 'gem_hadar/utils'
63
+ require 'gem_hadar/warn'
63
64
  require 'gem_hadar/setup'
64
65
  require 'gem_hadar/template_compiler'
65
66
  require 'gem_hadar/github'
66
67
  require 'gem_hadar/prompt_template'
68
+ require 'gem_hadar/changes'
67
69
 
68
70
  class GemHadar
69
71
  include Term::ANSIColor
70
72
  include GemHadar::Utils
71
73
  include GemHadar::PromptTemplate
74
+ include GemHadar::Warn
72
75
 
73
76
  if defined?(::RbConfig)
74
77
  include ::RbConfig
@@ -1866,25 +1869,6 @@ class GemHadar
1866
1869
  end
1867
1870
  end
1868
1871
 
1869
- # The warn method displays warning messages using orange colored output.
1870
- #
1871
- # @param msgs [Array<String>] the array of message strings to display
1872
- def warn(*msgs)
1873
- msgs.map! { |m| color(208) { m } }
1874
- super(*msgs, uplevel: 1)
1875
- end
1876
-
1877
- # The fail method formats and displays failure messages using red colored
1878
- # output.
1879
- #
1880
- # @param args [Array] the array of arguments to be formatted and passed to super
1881
- def fail(*args)
1882
- args.map! do |a|
1883
- a.respond_to?(:to_str) ? color(196) { a.to_str } : a
1884
- end
1885
- super(*args)
1886
- end
1887
-
1888
1872
  # The git_remotes method retrieves the list of remote repositories configured
1889
1873
  # for the current Git project.
1890
1874
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_hadar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -123,6 +123,7 @@ extra_rdoc_files:
123
123
  - lib/gem_hadar/template_compiler.rb
124
124
  - lib/gem_hadar/utils.rb
125
125
  - lib/gem_hadar/version.rb
126
+ - lib/gem_hadar/warn.rb
126
127
  files:
127
128
  - ".gitignore"
128
129
  - Gemfile
@@ -140,6 +141,7 @@ files:
140
141
  - lib/gem_hadar/template_compiler.rb
141
142
  - lib/gem_hadar/utils.rb
142
143
  - lib/gem_hadar/version.rb
144
+ - lib/gem_hadar/warn.rb
143
145
  homepage: https://github.com/flori/gem_hadar
144
146
  licenses:
145
147
  - MIT