Hello community, here is the log from the commit of package rubygem-flog for openSUSE:Factory checked in at 2014-10-15 16:20:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-flog (Old) and /work/SRC/openSUSE:Factory/.rubygem-flog.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-flog" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-flog/rubygem-flog.changes 2014-10-14 07:12:16.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-flog.new/rubygem-flog.changes 2014-10-15 16:21:45.000000000 +0200 @@ -1,0 +2,12 @@ +Wed Oct 15 09:16:20 UTC 2014 - coolo@suse.com + +- updated to version 4.3.0 + * 1 minor enhancement: + * Added methods_only param to FlogTask. (jocranford) + + * 2 bug fixes: + + * Fixed grouping by class name. (guilhermesimoes) + * Removed dead rubyforge setting in Rakefile + +------------------------------------------------------------------- Old: ---- flog-4.2.0.gem New: ---- flog-4.3.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-flog.spec ++++++ --- /var/tmp/diff_new_pack.nHZkP7/_old 2014-10-15 16:21:47.000000000 +0200 +++ /var/tmp/diff_new_pack.nHZkP7/_new 2014-10-15 16:21:47.000000000 +0200 @@ -16,18 +16,24 @@ # +# +# This file was generated with a gem2rpm.yml and not just plain gem2rpm. +# All sections marked as MANUAL, license headers, summaries and descriptions +# can be maintained in that file. Please consult this file before editing any +# of those fields +# + Name: rubygem-flog -Version: 4.2.0 +Version: 4.3.0 Release: 0 %define mod_name flog %define mod_full_name %{mod_name}-%{version} -%define mod_branch -%{version} -%define mod_weight 40200 - BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: %{rubygem gem2rpm} +BuildRequires: %{rubygem rdoc > 3.10} +BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 BuildRequires: update-alternatives -BuildRequires: rubygem(rdoc) > 3.10 Url: http://ruby.sadi.st/ Source: http://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml @@ -40,7 +46,6 @@ Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in. - %prep %build ++++++ flog-4.2.0.gem -> flog-4.3.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.txt new/History.txt --- old/History.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/History.txt 2014-07-19 01:17:07.000000000 +0200 @@ -1,3 +1,16 @@ +=== 4.3.0 / 2014-07-18 + +* 1 minor enhancement: + + * Added methods_only param to FlogTask. (jocranford) + +=== 4.2.1 / 2014-05-29 + +* 2 bug fixes: + + * Fixed grouping by class name. (guilhermesimoes) + * Removed dead rubyforge setting in Rakefile + === 4.2.0 / 2013-10-18 * 3 minor enhancements: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.txt new/README.txt --- old/README.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/README.txt 2014-07-19 01:17:07.000000000 +0200 @@ -3,6 +3,7 @@ home :: http://ruby.sadi.st/ code :: https://github.com/seattlerb/flog rdoc :: http://seattlerb.rubyforge.org/flog +vim :: http://github.com/sentientmonkey/vim-flog == DESCRIPTION: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 1970-01-01 01:00:00.000000000 +0100 +++ new/Rakefile 2014-07-19 01:17:07.000000000 +0200 @@ -15,8 +15,6 @@ Hoe.spec 'flog' do developer 'Ryan Davis', 'ryand-ruby@zenspider.com' - self.rubyforge_name = 'seattlerb' - self.flog_method = :max_method self.flog_threshold = timebomb 150, 50, '2013-11-01', '2012-11-01' Files old/checksums.yaml.gz and new/checksums.yaml.gz differ Files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ 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 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/flog.rb 2014-07-19 01:17:07.000000000 +0200 @@ -11,7 +11,7 @@ end class Flog < MethodBasedSexpProcessor - VERSION = "4.2.0" # :nodoc: + VERSION = "4.3.0" # :nodoc: ## # Cut off point where the report should stop unless --all given. @@ -124,7 +124,7 @@ def calculate each_by_score threshold do |class_method, score, call_list| - klass = class_method.split(/#|::/).first + klass = class_method.scan(/.+(?=#|::)/).first method_scores[klass] << [class_method, score] scores[klass] += score diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/flog_task.rb new/lib/flog_task.rb --- old/lib/flog_task.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/flog_task.rb 2014-07-19 01:17:07.000000000 +0200 @@ -30,12 +30,13 @@ # Creates a new FlogTask instance with given +name+, +threshold+, # +dirs+, and +method+. - def initialize name = :flog, threshold = 200, dirs = nil, method = nil - @name = name - @dirs = dirs || %w(app bin lib spec test) - @threshold = threshold - @method = method || :total_score - @verbose = Rake.application.options.trace + def initialize name = :flog, threshold = 200, dirs = nil, method = nil, methods_only = false + @name = name + @dirs = dirs || %w(app bin lib spec test) + @threshold = threshold + @method = method || :total_score + @verbose = Rake.application.options.trace + @methods_only = methods_only yield self if block_given? @@ -51,7 +52,7 @@ desc "Analyze for code complexity in: #{dirs.join(', ')}" task name do require "flog_cli" - flog = FlogCLI.new :continue => true, :quiet => true + flog = FlogCLI.new :continue => true, :quiet => true, :methods => @methods_only flog.flog(*dirs) desc, score = flog.send method diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 1970-01-01 01:00:00.000000000 +0100 +++ new/metadata 2014-07-19 01:17:07.000000000 +0200 @@ -1,19 +1,13 @@ ---- !ruby/object:Gem::Specification +--- !ruby/object:Gem::Specification name: flog -version: !ruby/object:Gem::Version - hash: 55 - prerelease: - segments: - - 4 - - 2 - - 0 - version: 4.2.0 +version: !ruby/object:Gem::Version + version: 4.3.0 platform: ruby -authors: +authors: - Ryan Davis autorequire: bindir: bin -cert_chain: +cert_chain: - | -----BEGIN CERTIFICATE----- MIIDPjCCAiagAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu @@ -35,107 +29,99 @@ Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw xx3n58i0lQkBE1EpKE0lFu/y -----END CERTIFICATE----- - -date: 2013-10-18 00:00:00 Z -dependencies: -- !ruby/object:Gem::Dependency +date: 2014-07-18 00:00:00.000000000 Z +dependencies: +- !ruby/object:Gem::Dependency name: sexp_processor - prerelease: false - requirement: &id001 !ruby/object:Gem::Requirement - none: false - requirements: - - - ~> - - !ruby/object:Gem::Version - hash: 19 - segments: - - 4 - - 4 - version: "4.4" + requirement: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '4.4' type: :runtime - version_requirements: *id001 -- !ruby/object:Gem::Dependency - name: ruby_parser prerelease: false - requirement: &id002 !ruby/object:Gem::Requirement - none: false - requirements: - - - ~> - - !ruby/object:Gem::Version - hash: 5 - segments: - - 3 - - 1 - version: "3.1" - - - ">" - - !ruby/object:Gem::Version - hash: 3 - segments: - - 3 - - 1 - - 0 + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '4.4' +- !ruby/object:Gem::Dependency + name: ruby_parser + requirement: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '3.1' + - - '>' + - !ruby/object:Gem::Version version: 3.1.0 type: :runtime - version_requirements: *id002 -- !ruby/object:Gem::Dependency - name: minitest prerelease: false - requirement: &id003 !ruby/object:Gem::Requirement - none: false - requirements: - - - ~> - - !ruby/object:Gem::Version - hash: 31 - segments: - - 5 - - 0 - version: "5.0" + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '3.1' + - - '>' + - !ruby/object:Gem::Version + version: 3.1.0 +- !ruby/object:Gem::Dependency + name: minitest + requirement: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '5.4' type: :development - version_requirements: *id003 -- !ruby/object:Gem::Dependency - name: rdoc prerelease: false - requirement: &id004 !ruby/object:Gem::Requirement - none: false - requirements: - - - ~> - - !ruby/object:Gem::Version - hash: 27 - segments: - - 4 - - 0 - version: "4.0" + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '5.4' +- !ruby/object:Gem::Dependency + name: rdoc + requirement: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '4.0' type: :development - version_requirements: *id004 -- !ruby/object:Gem::Dependency - name: hoe prerelease: false - requirement: &id005 !ruby/object:Gem::Requirement - none: false - requirements: - - - ~> - - !ruby/object:Gem::Version - hash: 9 - segments: - - 3 - - 7 - version: "3.7" + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '4.0' +- !ruby/object:Gem::Dependency + name: hoe + requirement: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '3.12' type: :development - version_requirements: *id005 + prerelease: false + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ~> + - !ruby/object:Gem::Version + version: '3.12' description: |- Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in. -email: +email: - ryand-ruby@zenspider.com -executables: +executables: - flog extensions: [] - -extra_rdoc_files: +extra_rdoc_files: - History.txt - Manifest.txt - README.txt -files: +files: - .autotest +- .gemtest - History.txt - Manifest.txt - README.txt @@ -147,41 +133,32 @@ - lib/gauntlet_flog.rb - test/test_flog.rb - test/test_flog_cli.rb -- .gemtest homepage: http://ruby.sadi.st/ -licenses: +licenses: - MIT +metadata: {} post_install_message: -rdoc_options: +rdoc_options: - --main - README.txt -require_paths: +require_paths: - lib -required_ruby_version: !ruby/object:Gem::Requirement - none: false - requirements: - - - ">=" - - !ruby/object:Gem::Version - hash: 3 - segments: - - 0 - version: "0" -required_rubygems_version: !ruby/object:Gem::Requirement - none: false - requirements: - - - ">=" - - !ruby/object:Gem::Version - hash: 3 - segments: - - 0 - version: "0" +required_ruby_version: !ruby/object:Gem::Requirement + requirements: + - - '>=' + - !ruby/object:Gem::Version + version: '0' +required_rubygems_version: !ruby/object:Gem::Requirement + requirements: + - - '>=' + - !ruby/object:Gem::Version + version: '0' requirements: [] - -rubyforge_project: seattlerb -rubygems_version: 1.8.25 +rubyforge_project: +rubygems_version: 2.2.1 signing_key: -specification_version: 3 +specification_version: 4 summary: Flog reports the most tortured code in an easy to read pain report -test_files: +test_files: - test/test_flog.rb - test/test_flog_cli.rb 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 1970-01-01 01:00:00.000000000 +0100 +++ new/test/test_flog.rb 2014-07-19 01:17:07.000000000 +0200 @@ -540,8 +540,8 @@ @flog.calculate_total_scores @flog.calculate - assert_equal({ 'MyKlass' => 42.0 }, @flog.scores) - assert_equal({ 'MyKlass' => [["MyKlass::Base#mymethod", 42.0]] }, @flog.method_scores) + assert_equal({ 'MyKlass::Base' => 42.0 }, @flog.scores) + assert_equal({ 'MyKlass::Base' => [["MyKlass::Base#mymethod", 42.0]] }, @flog.method_scores) end def test_reset @@ -588,6 +588,35 @@ assert_equal({ "Coder" => 1.0 }, @flog.scores) end + def test_method_scores + user_class = %( + module User + class Account + def blah n + puts "blah" * n + end + end + + class Profile + def bleh n + puts "bleh" * n + end + end + end + ) + user_file = "user.rb" + + @flog.flog_ruby user_class, user_file + @flog.calculate_total_scores + @flog.calculate + + expected = { + "User::Account"=>[["User::Account#blah", 2.2]], + "User::Profile"=>[["User::Profile#bleh", 2.2]] + } + assert_equal(expected, @flog.method_scores) + end + def setup_my_klass @flog.class_stack << "Base" << "MyKlass" @flog.method_stack << "mymethod" -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org