Hello community,

here is the log from the commit of package rubygem-flog for openSUSE:Factory 
checked in at 2017-04-11 09:32:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-flog (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-flog.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-flog"

Tue Apr 11 09:32:12 2017 rev:24 rq:457318 version:4.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-flog/rubygem-flog.changes        
2017-01-25 23:28:33.319558845 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-flog.new/rubygem-flog.changes   
2017-04-11 09:32:14.210641755 +0200
@@ -1,0 +2,33 @@
+Tue Feb 14 05:33:48 UTC 2017 - [email protected]
+
+- updated to version 4.6.1
+ see installed History.rdoc
+
+  === 4.6.1 / 2017-02-08
+  
+  * 1 bug fix:
+  
+    * Fixed max line number in range report. AKA I'm an idiot.
+  
+  === 4.6.0 / 2017-02-01
+  
+  * 2 minor enhancements:
+  
+    * Bumped dependency on sexp_processor to 4.8 and up.
+    * Include new Sexp#line_max info for in_method so DSLs can record line 
span.
+
+-------------------------------------------------------------------
+Fri Jan 20 05:30:51 UTC 2017 - [email protected]
+
+- updated to version 4.5.0
+ see installed History.rdoc
+
+  === 4.5.0 / 2017-01-19
+  
+  * 3 minor enhancements:
+  
+    * Added -t=N and --threshold N processing to FlogCLI.
+    * Added tweakable threshold to Flog (still defaults to 60%).
+    * Renamed Flog::THRESHOLD to Flog::DEFAULT_THRESHOLD (but kept an alias 
around).
+
+-------------------------------------------------------------------

Old:
----
  flog-4.4.1.gem

New:
----
  flog-4.6.1.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-flog.spec ++++++
--- /var/tmp/diff_new_pack.y6QHJz/_old  2017-04-11 09:32:15.098516360 +0200
+++ /var/tmp/diff_new_pack.y6QHJz/_new  2017-04-11 09:32:15.102515795 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-flog
-Version:        4.4.1
+Version:        4.6.1
 Release:        0
 %define mod_name flog
 %define mod_full_name %{mod_name}-%{version}

++++++ flog-4.4.1.gem -> flog-4.6.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/History.rdoc new/History.rdoc
--- old/History.rdoc    2017-01-14 00:09:41.000000000 +0100
+++ new/History.rdoc    2017-02-09 06:35:07.000000000 +0100
@@ -1,3 +1,24 @@
+=== 4.6.1 / 2017-02-08
+
+* 1 bug fix:
+
+  * Fixed max line number in range report. AKA I'm an idiot.
+
+=== 4.6.0 / 2017-02-01
+
+* 2 minor enhancements:
+
+  * Bumped dependency on sexp_processor to 4.8 and up.
+  * Include new Sexp#line_max info for in_method so DSLs can record line span.
+
+=== 4.5.0 / 2017-01-19
+
+* 3 minor enhancements:
+
+  * Added -t=N and --threshold N processing to FlogCLI.
+  * Added tweakable threshold to Flog (still defaults to 60%).
+  * Renamed Flog::THRESHOLD to Flog::DEFAULT_THRESHOLD (but kept an alias 
around).
+
 === 4.4.1 / 2017-01-13
 
 * 1 bug fix:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile        2017-01-14 00:09:41.000000000 +0100
+++ new/Rakefile        2017-02-09 06:35:07.000000000 +0100
@@ -22,7 +22,7 @@
 
   license "MIT"
 
-  dependency "sexp_processor", "~> 4.4"
+  dependency "sexp_processor", "~> 4.8"
   dependency "ruby_parser",    ["~> 3.1", "> 3.1.0"]
   dependency "path_expander", "~> 1.0"
 end
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/flog.rb new/lib/flog.rb
--- old/lib/flog.rb     2017-01-14 00:09:41.000000000 +0100
+++ new/lib/flog.rb     2017-02-09 06:35:07.000000000 +0100
@@ -11,12 +11,14 @@
 end
 
 class Flog < MethodBasedSexpProcessor
-  VERSION = "4.4.1" # :nodoc:
+  VERSION = "4.6.1" # :nodoc:
 
   ##
   # Cut off point where the report should stop unless --all given.
 
-  THRESHOLD = 0.60
+  DEFAULT_THRESHOLD = 0.60
+
+  THRESHOLD = DEFAULT_THRESHOLD # :nodoc:
 
   ##
   # The scoring system hash. Maps node type to score.
@@ -98,6 +100,7 @@
   attr_reader :calls, :option, :mass
   attr_reader :method_scores, :scores
   attr_reader :total_score, :totals
+  attr_writer :threshold
 
   # :startdoc:
 
@@ -230,9 +233,9 @@
   def initialize option = {}
     super()
     @option              = option
-    @method_locations    = {}
     @mass                = {}
     @parser              = nil
+    @threshold           = option[:threshold] || DEFAULT_THRESHOLD
     self.auto_shift_type = true
     self.reset
   end
@@ -294,7 +297,7 @@
   # Final threshold that is used for report
 
   def threshold
-    option[:all] ? nil : total_score * THRESHOLD
+    option[:all] ? nil : total_score * @threshold
   end
 
   ##
@@ -464,7 +467,7 @@
       if t == :call and r == nil and submsg = dsl_name?(a) then
         m = "#{m}(#{submsg})" if m and [String, Symbol].include?(submsg.class)
         in_klass m do                             # :task/namespace
-          in_method submsg, exp.file, exp.line do # :name
+          in_method submsg, exp.file, exp.line, exp.line_max do # :name
             process_until_empty exp
           end
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/flog_cli.rb new/lib/flog_cli.rb
--- old/lib/flog_cli.rb 2017-01-14 00:09:41.000000000 +0100
+++ new/lib/flog_cli.rb 2017-02-09 06:35:07.000000000 +0100
@@ -120,6 +120,10 @@
         option[:score] = true
       end
 
+      opts.on("-tN", "--threshold=N", Integer, "Set the report cutoff 
threshold (def: 60%).") do |n|
+        option[:threshold] = n / 100.0
+      end
+
       opts.on("-v", "--verbose", "Display progress during processing.") do
         option[:verbose] = true
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-01-14 00:09:41.000000000 +0100
+++ new/metadata        2017-02-09 06:35:07.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: flog
 version: !ruby/object:Gem::Version
-  version: 4.4.1
+  version: 4.6.1
 platform: ruby
 authors:
 - Ryan Davis
@@ -30,7 +30,7 @@
   E4oJcnPkJAr0rw504JGtlZtONZQblwmRJOIdXzolaE3NRGUzGVOUSptZppAKiavY
   fO6tdKQc/5RfA8oQEkg8hrxA5PQSz4TOFJGLpFvIapEk6tMruQ0bHgkhr9auXg==
   -----END CERTIFICATE-----
-date: 2017-01-13 00:00:00.000000000 Z
+date: 2017-02-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: sexp_processor
@@ -38,14 +38,14 @@
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: '4.4'
+        version: '4.8'
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - "~>"
       - !ruby/object:Gem::Version
-        version: '4.4'
+        version: '4.8'
 - !ruby/object:Gem::Dependency
   name: ruby_parser
   requirement: !ruby/object:Gem::Requirement
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/test_flog.rb new/test/test_flog.rb
--- old/test/test_flog.rb       2017-01-14 00:09:41.000000000 +0100
+++ new/test/test_flog.rb       2017-02-09 06:35:07.000000000 +0100
@@ -527,7 +527,7 @@
 
   def test_threshold
     test_flog
-    assert_in_epsilon Flog::THRESHOLD * 1.6, @flog.threshold
+    assert_in_epsilon 0.6 * 1.6, @flog.threshold
   end
 
   def test_no_threshold
@@ -535,6 +535,13 @@
     assert_nil @flog.threshold
   end
 
+  def test_threshold_custom
+    @flog.threshold = 0.33
+
+    test_flog
+    assert_in_epsilon 0.33 * 1.6, @flog.threshold
+  end
+
   def test_calculate
     setup_my_klass
 
@@ -559,7 +566,7 @@
     @flog.calculate_total_scores
     @flog.calculate
 
-    assert_equal({ 'User#blah' => 'user.rb:3' }, @flog.method_locations)
+    assert_equal({ 'User#blah' => 'user.rb:3-4' }, @flog.method_locations)
     assert_equal({ "User#blah" => 2.2 }, @flog.totals)
     assert_in_epsilon(2.2, @flog.total_score)
     assert_in_epsilon(1.0, @flog.multiplier)
@@ -581,7 +588,7 @@
     @flog.calculate_total_scores
     @flog.calculate
 
-    assert_equal({ 'Coder#happy?' => 'coder.rb:3' }, @flog.method_locations)
+    assert_equal({ 'Coder#happy?' => 'coder.rb:3-4' }, @flog.method_locations)
     assert_equal({ "Coder#happy?" => 1.0 }, @flog.totals)
     assert_in_epsilon(1.0, @flog.total_score)
     assert_in_epsilon(1.0, @flog.multiplier)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/test_flog_cli.rb new/test/test_flog_cli.rb
--- old/test/test_flog_cli.rb   2017-01-14 00:09:41.000000000 +0100
+++ new/test/test_flog_cli.rb   2017-02-09 06:35:07.000000000 +0100
@@ -37,10 +37,23 @@
       "--extended"     => :extended,
       "-s"             => :score,
       "--score"        => :score,
+      "-t"             => [:threshold, "75", 0.75],
+      "--threshold"    => [:threshold, "75", 0.75],
       "-v"             => :verbose,
       "--verbose"      => :verbose,
-    }.each do |key, val|
-      assert_equal true, FlogCLI.parse_options(key)[val]
+      # TODO: (maybe)
+      # "-h", "--help", "Show this message."
+      # "-I dir1,dir2,dir3", Array, "Add to LOAD_PATH."
+      # "--18", "Use a ruby 1.8 parser."
+      # "--19", "Use a ruby 1.9 parser."
+    }.each do |args, key|
+      exp = true
+      if key.is_a? Array then
+        key, arg, exp = key
+        args = [args, arg]
+      end
+
+      assert_equal exp, FlogCLI.parse_options(args)[key]
     end
   end
 


Reply via email to