flog 4.9.1 → 4.9.3

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: '07738fae525db950a36908c105a3ea7f4ef2735ad8ec39621332bb12dff927b8'
4
- data.tar.gz: 0506b7754237f626888a17e8e17f9b54a74683a093ae24440fe6275cdc4fa6c0
3
+ metadata.gz: 8031dfa607d41e264121a14a84f9798425b87dffdce2a5bd8cabf15a6836e0f8
4
+ data.tar.gz: 95a6b848cbe35d02bae912cf8bd4871998b94bb9faeedc9f92a099c8b565f06a
5
5
  SHA512:
6
- metadata.gz: c6f3379c0fa7795f344bcc2d45bbbef81de04a6cc54ea77219651cb7215b4e402e3814265be85208c2ab174b220a150be1d63489ececed98c97683b15da5dfa5
7
- data.tar.gz: '0493e8b1fcaa2868e2cd9f39cbe75dc51a2d196e78cf4cac8c94faadbff0c7494e18805dc0058a6a2488d6ceda7dad16015253d0b4d6e5f2bc1b8bdc915e57e8'
6
+ metadata.gz: 0dc58926910d69b830974eeb0e9cac686fdcd8a49ee6f678e23f557daeb124d09568c7fe293d4b37cb5e6282de37f5ab6489b6d4ae0099b323445196511917d8
7
+ data.tar.gz: c7b1ea584cad2c550c1020057fe22ebfb6ed449705de797d0313cb87a7b90e479003f59055dd4889102159a42ba1efd0dc532c972688d1a421436e17d8dc3fed
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,16 @@
1
+ === 4.9.3 / 2026-01-05
2
+
3
+ * 1 bug fix:
4
+
5
+ * Fixed bug caused by last release duplicating (frozen) options hash. (nateberkopec)
6
+
7
+ === 4.9.2 / 2026-01-04
8
+
9
+ * 2 bug fixes:
10
+
11
+ * Duplicate passed in options in case frozen.
12
+ * Oops! Fixed --legacy option definition.
13
+
1
14
  === 4.9.1 / 2025-12-20
2
15
 
3
16
  * 4 bug fixes:
data/lib/flog.rb CHANGED
@@ -16,7 +16,7 @@ NotRubyParser = Class.new Prism::Translation::RubyParser
16
16
  # thoroughly test.
17
17
 
18
18
  class Flog < MethodBasedSexpProcessor
19
- VERSION = "4.9.1" # :nodoc:
19
+ VERSION = "4.9.3" # :nodoc:
20
20
 
21
21
  ##
22
22
  # Cut off point where the report should stop unless --all given.
@@ -230,7 +230,7 @@ class Flog < MethodBasedSexpProcessor
230
230
 
231
231
  def initialize option = {}
232
232
  super()
233
- @option = option
233
+ @option = option = option.dup
234
234
  @mass = {}
235
235
  @parser = nil
236
236
  @threshold = option[:threshold] || DEFAULT_THRESHOLD
data/lib/flog_cli.rb CHANGED
@@ -130,7 +130,7 @@ class FlogCLI
130
130
  option[:score] = true
131
131
  end
132
132
 
133
- opts.on "--legacy" "Use RubyParser for parsing." do
133
+ opts.on "--legacy", "Use RubyParser for parsing." do
134
134
  require "ruby_parser"
135
135
  option[:parser] = RubyParser
136
136
  end
data/test/test_flog.rb CHANGED
@@ -697,3 +697,15 @@ class TestFlog < FlogTest
697
697
  @flog.add_to_score "blah", 42
698
698
  end
699
699
  end
700
+
701
+ class TestFlogDefaultOptions < Minitest::Test
702
+ def test_flog_with_default_options
703
+ # Regression test for issue #84
704
+ # Flog should work with default options (no explicit parser)
705
+ flog = Flog.new
706
+ flog.flog_ruby "2 + 3", "test.rb"
707
+ flog.calculate_total_scores
708
+
709
+ assert_in_epsilon 1.6, flog.total_score
710
+ end
711
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flog
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.1
4
+ version: 4.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -78,34 +78,34 @@ dependencies:
78
78
  requirements:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: '4.0'
81
+ version: '6.0'
82
82
  - - "<"
83
83
  - !ruby/object:Gem::Version
84
- version: '7'
84
+ version: '8'
85
85
  type: :development
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
- version: '4.0'
91
+ version: '6.0'
92
92
  - - "<"
93
93
  - !ruby/object:Gem::Version
94
- version: '7'
94
+ version: '8'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: hoe
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '4.3'
101
+ version: '4.5'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '4.3'
108
+ version: '4.5'
109
109
  description: |-
110
110
  Flog reports the most tortured code in an easy to read pain
111
111
  report. The higher the score, the more pain the code is in.
metadata.gz.sig CHANGED
Binary file