[DRE-commits] [roodi] 01/06: Imported Upstream version 5.0.0

David Suárez deiv-guest at moszumanska.debian.org
Fri Jun 19 19:00:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

deiv-guest pushed a commit to branch master
in repository roodi.

commit 79fd01be17b0285dd5dfb01502d6713c6da4ef33
Author: David Suárez <david.sephirot at gmail.com>
Date:   Fri Jun 19 20:50:06 2015 +0200

    Imported Upstream version 5.0.0
---
 .gitignore                                    |   4 +--
 .travis.yml                                   |   1 +
 History.txt => History.md                     |  50 +++++++++++++-------------
 README.md                                     |  11 ++++--
 bin/roodi                                     |  26 ++++++++++----
 checksums.yaml.gz                             | Bin 268 -> 0 bytes
 lib/roodi/core/runner.rb                      |   2 +-
 lib/roodi/core/{visitable_sexp.rb => sexp.rb} |   0
 lib/roodi/version.rb                          |   2 +-
 lib/roodi_task.rb                             |  13 +++++++
 metadata.yml                                  |  26 +++++++-------
 11 files changed, 84 insertions(+), 51 deletions(-)

diff --git a/.gitignore b/.gitignore
index ac1e08a..4fa1020 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,4 @@ doc
 pkg
 Gemfile.lock
 coverage
-
-# Editor files
-.idea
\ No newline at end of file
+.ruby-version
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 57d7da3..a5a71b8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,4 +3,5 @@ rvm:
   - 1.9.2
   - 1.9.3
   - 2.0.0
+  - 2.1.2
   - jruby-19mode # JRuby in 1.9 mode
diff --git a/History.txt b/History.md
similarity index 95%
rename from History.txt
rename to History.md
index e543b52..aa13f75 100644
--- a/History.txt
+++ b/History.md
@@ -1,14 +1,14 @@
-= 4.0.0
+# 4.0.0
 * Send args to roodi_task will make it easier to add custom configuration (breaking backwards compatibility)
 
-= 3.3.1
+# 3.3.1
 * Not checking .erb files by default
 
-= 3.3.0
+# 3.3.0
 * Using the roodi.yml in the current folder by default if it exists
 * Added coloured output
 
-= 3.2.0
+# 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
@@ -16,17 +16,17 @@
 * Removed support for Ruby 1.8
 * Improved installation instructions and corrected spelling error
 
-= 3.1.1
+# 3.1.1
 * Merge pull request #23 from metricfu/remove_rubygems_require
   * Fix ruby warnings
   * Remove unnecessary require of rubygems
 
-= 3.1.0
+# 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
+# 3.0.1
 
 * Added brief class level documentation on all checks
 * No longer printing out "Line: 1" every time you run roodi-describe
@@ -38,7 +38,7 @@
 * Updated copyright info to be current
 * Re-added tasks for releasing new versions of the gem
 
-= 3.0.0
+# 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
@@ -48,11 +48,11 @@
 * 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
+# 2.0.1
 
 * Fixed a bug where roodi.yml was not being loaded.  Patch supplied by Rob Mitchell.
 
-= 2.0.0
+# 2.0.0
 
 * Changed internal structure to use a more pure visitor like pattern.
 * Got *much* faster as a result of the change.
@@ -60,35 +60,35 @@
 * Outline for NPath complexity check is now possible.  Not working yet though.
 * Removed dependency on facets library.
 
-= 1.4.0
+# 1.4.0
 
 * Upgraded from ParseTree to ruby_parser.
 
-= 1.3.7
+# 1.3.7
 
 * Fixed a bug in the rake task where it always failed even if no errors existed.
 
-= 1.3.6
+# 1.3.6
 
 * Added nil as a valid response for an empty rescue block
 
-= 1.3.5
+# 1.3.5
 
 * Fixed bug in rake task
 
-= 1.3.4
+# 1.3.4
 
 * Minor cleanup
 
-= 1.3.3
+# 1.3.3
 
 * Added a rake task
 
-= 1.3.1
+# 1.3.1
 
 * wrapped errors in an object to become more usable as an API.
 
-= 1.3.0
+# 1.3.0
 
 * added case missing else check.
 * updated checks to take a hash of options with built-in defaults.
@@ -97,19 +97,19 @@
 * added assignment in conditional check.
 * refactored checks to remove duplicate code.
 
-= 1.2.0
+# 1.2.0
 
 * added module name check.
 * added parameter number check.
 * added module line count check.
 * added class line count check.
 
-= 1.1.1
+# 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
+# 0.5
 
 * expanded regex matching for method name check.
 * suppressed noisy output from ParseTree using facets API.
@@ -117,22 +117,22 @@
 * made Roodi tolerant of being asked to parse files which aren't really Ruby files.
 * updated the documentation with usage examples.
 
-= 0.4
+# 0.4
 
 * Added support back in for line numbers in error messages.
 * Re-enabled MethodLineCountCheck as part of the default check set.
 
-= 0.3
+# 0.3
 
 * First version of Roodi to be published to Rubyforge.
 
-= 0.2
+# 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
+# 0.1
 
 * A first version of a design checking tool for Ruby, with a few checks built in to get started.
 
diff --git a/README.md b/README.md
index 9e53511..742d080 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,6 @@ If you're writing a check, it is useful to see the structure of a file the way t
 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 @@ or if you want to supply your own config file...
     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 @@ Fantastic! Please follow this procedure:
 - 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 --git a/bin/roodi b/bin/roodi
index 23d713f..beb9bc4 100755
--- a/bin/roodi
+++ b/bin/roodi
@@ -4,12 +4,26 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
 
 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
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
deleted file mode 100644
index adb8bd6..0000000
Binary files a/checksums.yaml.gz and /dev/null differ
diff --git a/lib/roodi/core/runner.rb b/lib/roodi/core/runner.rb
index 56232ee..c11b80f 100644
--- a/lib/roodi/core/runner.rb
+++ b/lib/roodi/core/runner.rb
@@ -3,7 +3,7 @@ require 'yaml'
 
 require 'roodi/core/checking_visitor'
 require 'roodi/core/parser'
-require 'roodi/core/visitable_sexp'
+require 'roodi/core/sexp'
 
 module Roodi
   module Core
diff --git a/lib/roodi/core/visitable_sexp.rb b/lib/roodi/core/sexp.rb
similarity index 100%
rename from lib/roodi/core/visitable_sexp.rb
rename to lib/roodi/core/sexp.rb
diff --git a/lib/roodi/version.rb b/lib/roodi/version.rb
index 26329b4..d3e163a 100644
--- a/lib/roodi/version.rb
+++ b/lib/roodi/version.rb
@@ -1,3 +1,3 @@
 module Roodi
-  VERSION = '4.0.0'
+  VERSION = '5.0.0'
 end
diff --git a/lib/roodi_task.rb b/lib/roodi_task.rb
index b621b1f..0b014ec 100644
--- a/lib/roodi_task.rb
+++ b/lib/roodi_task.rb
@@ -19,6 +19,8 @@ class RoodiTask < Rake::TaskLib
   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 @@ class RoodiTask < Rake::TaskLib
     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 --git a/metadata.yml b/metadata.yml
index 3cb2b8e..8d80550 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -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 @@ authors:
 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 @@ executables:
 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 @@ files:
 - 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 @@ require_paths:
 - 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/roodi.git



More information about the Pkg-ruby-extras-commits mailing list