diff -Nru roodi-4.0.0/bin/roodi roodi-5.0.0/bin/roodi --- roodi-4.0.0/bin/roodi 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/bin/roodi 2015-06-19 18:51:02.000000000 +0000 @@ -4,12 +4,26 @@ require 'roodi' -runner = Roodi::Core::Runner.new -config_param = ARGV.detect {|arg| arg =~ /-config=.*/} -runner.config = config_param.split("=")[1] if config_param -ARGV.delete config_param +if ARGV.detect { |arg| arg == "-h" || arg == "--help" } + puts "Usage: roodi [options] [path1 path2 ...]" + puts + puts "By default Roodi looks for all **/*.rb files in the current directory." + puts + puts "Options are ..." + puts "-c, --config=FILE use FILE as the config file." + puts "-h, --help display this help." + puts "-v, --version display the program version." +elsif ARGV.detect { |arg| arg == "-v" || arg == "--version" } + puts Roodi::VERSION +else + runner = Roodi::Core::Runner.new -runner.start(ARGV) + config_param = ARGV.detect { |arg| arg=~ /-c=.*/ || arg =~ /--config=.*/ } + runner.config = config_param.split("=")[1] if config_param + ARGV.delete config_param -exit runner.errors.size + runner.start(ARGV) + + exit runner.errors.size +end Binary files /tmp/PuQZuGG1eC/roodi-4.0.0/checksums.yaml.gz and /tmp/Cc77K4kh3t/roodi-5.0.0/checksums.yaml.gz differ diff -Nru roodi-4.0.0/debian/changelog roodi-5.0.0/debian/changelog --- roodi-4.0.0/debian/changelog 2014-05-06 09:22:09.000000000 +0000 +++ roodi-5.0.0/debian/changelog 2015-06-19 18:59:30.000000000 +0000 @@ -1,3 +1,12 @@ +roodi (5.0.0-1) unstable; urgency=low + + * New upstream version. + * Update history file path. + * Update standards version; no changed needed. + * Update years in copyright file. + + -- David Suárez Fri, 19 Jun 2015 20:51:15 +0200 + roodi (4.0.0-1) unstable; urgency=low * New upstream version diff -Nru roodi-4.0.0/debian/control roodi-5.0.0/debian/control --- roodi-4.0.0/debian/control 2014-03-02 21:54:17.000000000 +0000 +++ roodi-5.0.0/debian/control 2015-06-19 18:59:30.000000000 +0000 @@ -8,7 +8,7 @@ rake, ruby-parser (>= 2.3.0), ruby-rspec (>= 2.13.0) -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/roodi.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/roodi.git;a=summary Homepage: http://roodi.rubyforge.org diff -Nru roodi-4.0.0/debian/copyright roodi-5.0.0/debian/copyright --- roodi-4.0.0/debian/copyright 2014-05-06 09:33:05.000000000 +0000 +++ roodi-5.0.0/debian/copyright 2015-06-19 18:59:30.000000000 +0000 @@ -3,11 +3,11 @@ Source: http://roodi.rubyforge.org Files: * -Copyright: 2008-2014 Marty Andrews +Copyright: 2008-2015 Marty Andrews License: Expat Files: debian/* -Copyright: 2013 David Suárez +Copyright: 2013-2015 David Suárez License: Expat Comment: the Debian packaging is licensed under the same terms as the original package. diff -Nru roodi-4.0.0/debian/patches/debian-changes roodi-5.0.0/debian/patches/debian-changes --- roodi-4.0.0/debian/patches/debian-changes 2014-05-06 09:44:34.000000000 +0000 +++ roodi-5.0.0/debian/patches/debian-changes 2015-06-20 18:44:49.000000000 +0000 @@ -9,8 +9,8 @@ For full commit history and separated commits, see the packaging Git repository. ---- roodi-4.0.0.orig/bin/roodi -+++ roodi-4.0.0/bin/roodi +--- roodi-5.0.0.orig/bin/roodi ++++ roodi-5.0.0/bin/roodi @@ -1,7 +1,5 @@ #!/usr/bin/env ruby @@ -18,9 +18,9 @@ - require 'roodi' - runner = Roodi::Core::Runner.new ---- roodi-4.0.0.orig/bin/roodi-describe -+++ roodi-4.0.0/bin/roodi-describe + +--- roodi-5.0.0.orig/bin/roodi-describe ++++ roodi-5.0.0/bin/roodi-describe @@ -1,6 +1,5 @@ #!/usr/bin/env ruby @@ -28,9 +28,9 @@ require 'roodi' roodi = Roodi::Core::Runner.new ---- roodi-4.0.0.orig/lib/roodi/core/runner.rb -+++ roodi-4.0.0/lib/roodi/core/runner.rb -@@ -8,6 +8,7 @@ require 'roodi/core/visitable_sexp' +--- roodi-5.0.0.orig/lib/roodi/core/runner.rb ++++ roodi-5.0.0/lib/roodi/core/runner.rb +@@ -8,6 +8,7 @@ require 'roodi/core/sexp' module Roodi module Core class Runner @@ -47,8 +47,8 @@ end def project_config ---- roodi-4.0.0.orig/spec/spec_helper.rb -+++ roodi-4.0.0/spec/spec_helper.rb +--- roodi-5.0.0.orig/spec/spec_helper.rb ++++ roodi-5.0.0/spec/spec_helper.rb @@ -1,6 +1,6 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) require 'roodi' diff -Nru roodi-4.0.0/debian/rules roodi-5.0.0/debian/rules --- roodi-4.0.0/debian/rules 2013-07-12 14:29:37.000000000 +0000 +++ roodi-5.0.0/debian/rules 2015-06-19 18:59:30.000000000 +0000 @@ -15,4 +15,4 @@ dh $@ --buildsystem=ruby --with ruby override_dh_installchangelogs: - dh_installchangelogs History.txt \ No newline at end of file + dh_installchangelogs History.md \ No newline at end of file diff -Nru roodi-4.0.0/.gitignore roodi-5.0.0/.gitignore --- roodi-4.0.0/.gitignore 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/.gitignore 2015-06-19 18:51:02.000000000 +0000 @@ -2,6 +2,4 @@ pkg Gemfile.lock coverage - -# Editor files -.idea \ No newline at end of file +.ruby-version \ No newline at end of file diff -Nru roodi-4.0.0/History.md roodi-5.0.0/History.md --- roodi-4.0.0/History.md 1970-01-01 00:00:00.000000000 +0000 +++ roodi-5.0.0/History.md 2015-06-19 18:51:02.000000000 +0000 @@ -0,0 +1,138 @@ +# 4.0.0 +* Send args to roodi_task will make it easier to add custom configuration (breaking backwards compatibility) + +# 3.3.1 +* Not checking .erb files by default + +# 3.3.0 +* Using the roodi.yml in the current folder by default if it exists +* Added coloured output + +# 3.2.0 +* Checks all files under current directory by default +* Made it easier to run for the whole project as a rake task +* Added instructions for how to add Roodi to your Rakefile +* Removed support for Ruby Enterprise Edition +* Removed support for Ruby 1.8 +* Improved installation instructions and corrected spelling error + +# 3.1.1 +* Merge pull request #23 from metricfu/remove_rubygems_require + * Fix ruby warnings + * Remove unnecessary require of rubygems + +# 3.1.0 +* Loosen ruby_parser version dependency (PR from Benjamin Fleischer) +* Files that can't be parsed are no longer silently skipped +* Empty rescue body check not failing when block contains empty arrays etc + +# 3.0.1 + +* Added brief class level documentation on all checks +* No longer printing out "Line: 1" every time you run roodi-describe +* Added code coverage badge from Coverall.io +* Added code coverage through Coveralls.io +* Pulled duplicated find_name method up to super class +* Added Code Climate badge +* Added info about how to contribute +* Updated copyright info to be current +* Re-added tasks for releasing new versions of the gem + +# 3.0.0 + +* Removed MissingForeignKeyIndexCheck, since it is specific to Rails/ActiveRecord and thus doesn't belong in Roodi +* A build is now running on Travis for the following Ruby versions: 1.8, 1.9, 2.0, JRuby 1.8 mode, JRuby 1.9 mode, Rubinius 1.8 mode, Rubinius 1.9 mode, Ruby Enterprise Edition +* Using ruby_parser 3.2.2 +* Better check if OS is windows (#2 Martin Gotink) +* Accept 'next' in a rescue block (#1 Virgil Mihailovici) +* Rescue line count when there are no lines +* Pull down updates from https://github.com/zdennis/roodi that includes updates from https://github.com/hooroo/roodi and https://github.com/aselder/roodi re: pull request https://github.com/martinjandrews/roodi/pull/12 https://github.com/martinjandrews/roodi/pull/11 + +# 2.0.1 + +* Fixed a bug where roodi.yml was not being loaded. Patch supplied by Rob Mitchell. + +# 2.0.0 + +* Changed internal structure to use a more pure visitor like pattern. +* Got *much* faster as a result of the change. +* Design change fixed 'feature' where nested blocks would all get listed if the inner one exceeded complexity. +* Outline for NPath complexity check is now possible. Not working yet though. +* Removed dependency on facets library. + +# 1.4.0 + +* Upgraded from ParseTree to ruby_parser. + +# 1.3.7 + +* Fixed a bug in the rake task where it always failed even if no errors existed. + +# 1.3.6 + +* Added nil as a valid response for an empty rescue block + +# 1.3.5 + +* Fixed bug in rake task + +# 1.3.4 + +* Minor cleanup + +# 1.3.3 + +* Added a rake task + +# 1.3.1 + +* wrapped errors in an object to become more usable as an API. + +# 1.3.0 + +* added case missing else check. +* updated checks to take a hash of options with built-in defaults. +* added support for complete configuration via external file. +* added support for passing in a custom config file via 'roodi -config= [pattern]' +* added assignment in conditional check. +* refactored checks to remove duplicate code. + +# 1.2.0 + +* added module name check. +* added parameter number check. +* added module line count check. +* added class line count check. + +# 1.1.1 + +* I'd initially published to Rubyforge under a 1.0.0 gem, and I've since tried to retrospectively fix up the version number system. It turns out that Rubyforge caches old gems permanently, so I have to re-start at a larger number again. +* class name check no longer gets confused about scoped class names like Module::Classname. + +# 0.5 + +* expanded regex matching for method name check. +* suppressed noisy output from ParseTree using facets API. +* updated dependencies and version as a result of facets change. +* made Roodi tolerant of being asked to parse files which aren't really Ruby files. +* updated the documentation with usage examples. + +# 0.4 + +* Added support back in for line numbers in error messages. +* Re-enabled MethodLineCountCheck as part of the default check set. + +# 0.3 + +* First version of Roodi to be published to Rubyforge. + +# 0.2 + +* Now use ParseTree instead of JRuby, which makes the tool much more accessible. +* Removed MagicNumberCheck +* Line numbers no longer supported as a result of the move. + +# 0.1 + +* A first version of a design checking tool for Ruby, with a few checks built in to get started. + diff -Nru roodi-4.0.0/History.txt roodi-5.0.0/History.txt --- roodi-4.0.0/History.txt 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/History.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -= 4.0.0 -* Send args to roodi_task will make it easier to add custom configuration (breaking backwards compatibility) - -= 3.3.1 -* Not checking .erb files by default - -= 3.3.0 -* Using the roodi.yml in the current folder by default if it exists -* Added coloured output - -= 3.2.0 -* Checks all files under current directory by default -* Made it easier to run for the whole project as a rake task -* Added instructions for how to add Roodi to your Rakefile -* Removed support for Ruby Enterprise Edition -* Removed support for Ruby 1.8 -* Improved installation instructions and corrected spelling error - -= 3.1.1 -* Merge pull request #23 from metricfu/remove_rubygems_require - * Fix ruby warnings - * Remove unnecessary require of rubygems - -= 3.1.0 -* Loosen ruby_parser version dependency (PR from Benjamin Fleischer) -* Files that can't be parsed are no longer silently skipped -* Empty rescue body check not failing when block contains empty arrays etc - -= 3.0.1 - -* Added brief class level documentation on all checks -* No longer printing out "Line: 1" every time you run roodi-describe -* Added code coverage badge from Coverall.io -* Added code coverage through Coveralls.io -* Pulled duplicated find_name method up to super class -* Added Code Climate badge -* Added info about how to contribute -* Updated copyright info to be current -* Re-added tasks for releasing new versions of the gem - -= 3.0.0 - -* Removed MissingForeignKeyIndexCheck, since it is specific to Rails/ActiveRecord and thus doesn't belong in Roodi -* A build is now running on Travis for the following Ruby versions: 1.8, 1.9, 2.0, JRuby 1.8 mode, JRuby 1.9 mode, Rubinius 1.8 mode, Rubinius 1.9 mode, Ruby Enterprise Edition -* Using ruby_parser 3.2.2 -* Better check if OS is windows (#2 Martin Gotink) -* Accept 'next' in a rescue block (#1 Virgil Mihailovici) -* Rescue line count when there are no lines -* Pull down updates from https://github.com/zdennis/roodi that includes updates from https://github.com/hooroo/roodi and https://github.com/aselder/roodi re: pull request https://github.com/martinjandrews/roodi/pull/12 https://github.com/martinjandrews/roodi/pull/11 - -= 2.0.1 - -* Fixed a bug where roodi.yml was not being loaded. Patch supplied by Rob Mitchell. - -= 2.0.0 - -* Changed internal structure to use a more pure visitor like pattern. -* Got *much* faster as a result of the change. -* Design change fixed 'feature' where nested blocks would all get listed if the inner one exceeded complexity. -* Outline for NPath complexity check is now possible. Not working yet though. -* Removed dependency on facets library. - -= 1.4.0 - -* Upgraded from ParseTree to ruby_parser. - -= 1.3.7 - -* Fixed a bug in the rake task where it always failed even if no errors existed. - -= 1.3.6 - -* Added nil as a valid response for an empty rescue block - -= 1.3.5 - -* Fixed bug in rake task - -= 1.3.4 - -* Minor cleanup - -= 1.3.3 - -* Added a rake task - -= 1.3.1 - -* wrapped errors in an object to become more usable as an API. - -= 1.3.0 - -* added case missing else check. -* updated checks to take a hash of options with built-in defaults. -* added support for complete configuration via external file. -* added support for passing in a custom config file via 'roodi -config= [pattern]' -* added assignment in conditional check. -* refactored checks to remove duplicate code. - -= 1.2.0 - -* added module name check. -* added parameter number check. -* added module line count check. -* added class line count check. - -= 1.1.1 - -* I'd initially published to Rubyforge under a 1.0.0 gem, and I've since tried to retrospectively fix up the version number system. It turns out that Rubyforge caches old gems permanently, so I have to re-start at a larger number again. -* class name check no longer gets confused about scoped class names like Module::Classname. - -= 0.5 - -* expanded regex matching for method name check. -* suppressed noisy output from ParseTree using facets API. -* updated dependencies and version as a result of facets change. -* made Roodi tolerant of being asked to parse files which aren't really Ruby files. -* updated the documentation with usage examples. - -= 0.4 - -* Added support back in for line numbers in error messages. -* Re-enabled MethodLineCountCheck as part of the default check set. - -= 0.3 - -* First version of Roodi to be published to Rubyforge. - -= 0.2 - -* Now use ParseTree instead of JRuby, which makes the tool much more accessible. -* Removed MagicNumberCheck -* Line numbers no longer supported as a result of the move. - -= 0.1 - -* A first version of a design checking tool for Ruby, with a few checks built in to get started. - diff -Nru roodi-4.0.0/lib/roodi/core/runner.rb roodi-5.0.0/lib/roodi/core/runner.rb --- roodi-4.0.0/lib/roodi/core/runner.rb 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/lib/roodi/core/runner.rb 2015-06-19 18:51:02.000000000 +0000 @@ -3,7 +3,7 @@ require 'roodi/core/checking_visitor' require 'roodi/core/parser' -require 'roodi/core/visitable_sexp' +require 'roodi/core/sexp' module Roodi module Core diff -Nru roodi-4.0.0/lib/roodi/core/sexp.rb roodi-5.0.0/lib/roodi/core/sexp.rb --- roodi-4.0.0/lib/roodi/core/sexp.rb 1970-01-01 00:00:00.000000000 +0000 +++ roodi-5.0.0/lib/roodi/core/sexp.rb 2015-06-19 18:51:02.000000000 +0000 @@ -0,0 +1,24 @@ +require 'sexp' + +class Sexp + def accept(visitor) + visitor.visit(self) + end + + def node_type + first + end + + def children + find_all { | sexp | Sexp === sexp } + end + + def is_language_node? + first.class == Symbol + end + + def visitable_children + parent = is_language_node? ? sexp_body : self + parent.children + end +end diff -Nru roodi-4.0.0/lib/roodi/core/visitable_sexp.rb roodi-5.0.0/lib/roodi/core/visitable_sexp.rb --- roodi-4.0.0/lib/roodi/core/visitable_sexp.rb 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/lib/roodi/core/visitable_sexp.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -require 'sexp' - -class Sexp - def accept(visitor) - visitor.visit(self) - end - - def node_type - first - end - - def children - find_all { | sexp | Sexp === sexp } - end - - def is_language_node? - first.class == Symbol - end - - def visitable_children - parent = is_language_node? ? sexp_body : self - parent.children - end -end diff -Nru roodi-4.0.0/lib/roodi/version.rb roodi-5.0.0/lib/roodi/version.rb --- roodi-4.0.0/lib/roodi/version.rb 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/lib/roodi/version.rb 2015-06-19 18:51:02.000000000 +0000 @@ -1,3 +1,3 @@ module Roodi - VERSION = '4.0.0' + VERSION = '5.0.0' end diff -Nru roodi-4.0.0/lib/roodi_task.rb roodi-5.0.0/lib/roodi_task.rb --- roodi-4.0.0/lib/roodi_task.rb 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/lib/roodi_task.rb 2015-06-19 18:51:02.000000000 +0000 @@ -19,6 +19,8 @@ end def define + prevent_multiple_runs! + desc "Run Roodi against all source files" task name do runner = Roodi::Core::Runner.new @@ -29,4 +31,15 @@ end self end + + private + + def prevent_multiple_runs! + if Rake::Task.task_defined?(name) + Rake::Task[name].clear + end + end end + +# Ensure that a default :roodi task is always available +RoodiTask.new diff -Nru roodi-4.0.0/metadata.yml roodi-5.0.0/metadata.yml --- roodi-4.0.0/metadata.yml 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/metadata.yml 2015-06-19 18:51:02.000000000 +0000 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: roodi version: !ruby/object:Gem::Version - version: 4.0.0 + version: 5.0.0 platform: ruby authors: - Marty Andrews @@ -9,26 +9,26 @@ autorequire: bindir: bin cert_chain: [] -date: 2014-04-10 00:00:00.000000000 Z +date: 2015-05-31 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: ruby_parser requirement: !ruby/object:Gem::Requirement requirements: - - - '>=' + - - ">=" - !ruby/object:Gem::Version version: 3.2.2 - - - ~> + - - "~>" - !ruby/object:Gem::Version version: '3.2' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - '>=' + - - ">=" - !ruby/object:Gem::Version version: 3.2.2 - - - ~> + - - "~>" - !ruby/object:Gem::Version version: '3.2' description: Roodi parses your Ruby code and warns you about design issues you have @@ -40,10 +40,10 @@ extensions: [] extra_rdoc_files: [] files: -- .gitignore -- .travis.yml +- ".gitignore" +- ".travis.yml" - Gemfile -- History.txt +- History.md - Manifest.txt - README.md - Rakefile @@ -79,7 +79,7 @@ - lib/roodi/core/error.rb - lib/roodi/core/parser.rb - lib/roodi/core/runner.rb -- lib/roodi/core/visitable_sexp.rb +- lib/roodi/core/sexp.rb - lib/roodi/version.rb - lib/roodi_task.rb - roodi.gemspec @@ -116,17 +116,17 @@ - lib 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: -rubygems_version: 2.0.14 +rubygems_version: 2.4.5 signing_key: specification_version: 4 summary: Roodi stands for Ruby Object Oriented Design Inferometer diff -Nru roodi-4.0.0/README.md roodi-5.0.0/README.md --- roodi-4.0.0/README.md 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/README.md 2015-06-19 18:51:02.000000000 +0000 @@ -54,7 +54,6 @@ Add the following to your Rakefile: require 'roodi_task' - RoodiTask.new task :default => [:roodi] or if you want to supply your own config file... @@ -63,6 +62,9 @@ RoodiTask.new :config => 'config/roodi.yml' task :default => [:roodi] +## Editor integration +You can run Roodi in Atom using the [linter-roodi](https://atom.io/packages/linter-roodi) package. + ## Custom Configuration To change the set of checks included, or to change the default values of the checks, you can provide your own config file. The config file is a YAML file that lists the checks to be included. Each check can optionally include a hash of options that are passed to the check to configure it. For example, the default config file looks like this: @@ -124,11 +126,16 @@ - Write meaningful commit messages explaining why this change is needed - Create a pull request. +### How to publish a new version (maintainers only) +1. Bump the version in version.rb +1. `$ gem build roodi.gemspec` +1. `$ gem push roodi-X.X.X.gem` + ## License (The MIT License) -Copyright (c) 2014 Peter Evjan +Copyright (c) 2015 Marty Andrews, Peter Evjan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru roodi-4.0.0/.travis.yml roodi-5.0.0/.travis.yml --- roodi-4.0.0/.travis.yml 2014-04-21 18:11:35.000000000 +0000 +++ roodi-5.0.0/.travis.yml 2015-06-19 18:51:02.000000000 +0000 @@ -3,4 +3,5 @@ - 1.9.2 - 1.9.3 - 2.0.0 + - 2.1.2 - jruby-19mode # JRuby in 1.9 mode