rubycritic 2.9.3 → 2.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +1 -0
  4. data/Rakefile +1 -0
  5. data/bin/rubycritic +1 -0
  6. data/features/step_definitions/rake_task_steps.rb +1 -0
  7. data/features/step_definitions/rubycritic_steps.rb +1 -0
  8. data/features/step_definitions/sample_file_steps.rb +1 -0
  9. data/features/support/env.rb +1 -0
  10. data/lib/rubycritic.rb +1 -0
  11. data/lib/rubycritic/analysers/attributes.rb +1 -0
  12. data/lib/rubycritic/analysers/churn.rb +1 -0
  13. data/lib/rubycritic/analysers/complexity.rb +1 -0
  14. data/lib/rubycritic/analysers/helpers/ast_node.rb +1 -0
  15. data/lib/rubycritic/analysers/helpers/flay.rb +1 -0
  16. data/lib/rubycritic/analysers/helpers/flog.rb +1 -0
  17. data/lib/rubycritic/analysers/helpers/methods_counter.rb +1 -0
  18. data/lib/rubycritic/analysers/helpers/modules_locator.rb +1 -0
  19. data/lib/rubycritic/analysers/helpers/parser.rb +1 -0
  20. data/lib/rubycritic/analysers/helpers/reek.rb +1 -0
  21. data/lib/rubycritic/analysers/smells/flay.rb +1 -0
  22. data/lib/rubycritic/analysers/smells/flog.rb +1 -0
  23. data/lib/rubycritic/analysers/smells/reek.rb +1 -0
  24. data/lib/rubycritic/analysers_runner.rb +1 -0
  25. data/lib/rubycritic/browser.rb +1 -0
  26. data/lib/rubycritic/cli/application.rb +1 -0
  27. data/lib/rubycritic/cli/options.rb +21 -18
  28. data/lib/rubycritic/colorize.rb +1 -0
  29. data/lib/rubycritic/command_factory.rb +1 -0
  30. data/lib/rubycritic/commands/base.rb +1 -0
  31. data/lib/rubycritic/commands/ci.rb +6 -1
  32. data/lib/rubycritic/commands/default.rb +9 -4
  33. data/lib/rubycritic/commands/help.rb +7 -2
  34. data/lib/rubycritic/commands/status_reporter.rb +7 -6
  35. data/lib/rubycritic/commands/version.rb +3 -1
  36. data/lib/rubycritic/configuration.rb +1 -0
  37. data/lib/rubycritic/core/analysed_module.rb +1 -0
  38. data/lib/rubycritic/core/analysed_modules_collection.rb +1 -0
  39. data/lib/rubycritic/core/location.rb +1 -0
  40. data/lib/rubycritic/core/rating.rb +1 -0
  41. data/lib/rubycritic/core/smell.rb +2 -1
  42. data/lib/rubycritic/generators/console_report.rb +1 -0
  43. data/lib/rubycritic/generators/html/base.rb +1 -0
  44. data/lib/rubycritic/generators/html/code_file.rb +3 -2
  45. data/lib/rubycritic/generators/html/code_index.rb +1 -0
  46. data/lib/rubycritic/generators/html/line.rb +1 -0
  47. data/lib/rubycritic/generators/html/overview.rb +1 -0
  48. data/lib/rubycritic/generators/html/smells_index.rb +1 -0
  49. data/lib/rubycritic/generators/html/turbulence.rb +1 -0
  50. data/lib/rubycritic/generators/html/view_helpers.rb +1 -0
  51. data/lib/rubycritic/generators/html_report.rb +1 -0
  52. data/lib/rubycritic/generators/json/simple.rb +1 -0
  53. data/lib/rubycritic/generators/json_report.rb +1 -0
  54. data/lib/rubycritic/generators/text/list.rb +1 -0
  55. data/lib/rubycritic/rake_task.rb +1 -0
  56. data/lib/rubycritic/reporter.rb +1 -0
  57. data/lib/rubycritic/serializer.rb +1 -0
  58. data/lib/rubycritic/smells_status_setter.rb +1 -0
  59. data/lib/rubycritic/source_control_systems/base.rb +1 -0
  60. data/lib/rubycritic/source_control_systems/double.rb +1 -0
  61. data/lib/rubycritic/source_control_systems/git.rb +1 -0
  62. data/lib/rubycritic/source_control_systems/mercurial.rb +1 -0
  63. data/lib/rubycritic/version.rb +1 -1
  64. data/rubycritic.gemspec +5 -4
  65. data/test/analysers_test_helper.rb +1 -0
  66. data/test/lib/rubycritic/analysers/churn_test.rb +1 -0
  67. data/test/lib/rubycritic/analysers/complexity_test.rb +1 -0
  68. data/test/lib/rubycritic/analysers/helpers/methods_counter_test.rb +1 -0
  69. data/test/lib/rubycritic/analysers/helpers/modules_locator_test.rb +1 -0
  70. data/test/lib/rubycritic/analysers/smells/flay_test.rb +1 -0
  71. data/test/lib/rubycritic/analysers/smells/flog_test.rb +1 -0
  72. data/test/lib/rubycritic/analysers/smells/reek_test.rb +1 -0
  73. data/test/lib/rubycritic/browser_test.rb +1 -0
  74. data/test/lib/rubycritic/commands/status_reporter_test.rb +1 -0
  75. data/test/lib/rubycritic/configuration_test.rb +1 -0
  76. data/test/lib/rubycritic/core/analysed_module_test.rb +1 -0
  77. data/test/lib/rubycritic/core/analysed_modules_collection_test.rb +1 -0
  78. data/test/lib/rubycritic/core/location_test.rb +1 -0
  79. data/test/lib/rubycritic/core/smell_test.rb +1 -0
  80. data/test/lib/rubycritic/core/smells_array_test.rb +1 -0
  81. data/test/lib/rubycritic/generators/console_report_test.rb +1 -0
  82. data/test/lib/rubycritic/generators/json_report_test.rb +1 -0
  83. data/test/lib/rubycritic/generators/turbulence_test.rb +1 -0
  84. data/test/lib/rubycritic/generators/view_helpers_test.rb +1 -0
  85. data/test/lib/rubycritic/revision_comparator_test.rb +1 -0
  86. data/test/lib/rubycritic/smells_status_setter_test.rb +1 -0
  87. data/test/lib/rubycritic/source_control_systems/base_test.rb +1 -0
  88. data/test/lib/rubycritic/source_control_systems/double_test.rb +1 -0
  89. data/test/lib/rubycritic/source_control_systems/git_test.rb +1 -0
  90. data/test/lib/rubycritic/source_control_systems/interfaces/basic.rb +1 -0
  91. data/test/lib/rubycritic/source_control_systems/interfaces/time_travel.rb +1 -0
  92. data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +1 -0
  93. data/test/lib/rubycritic/source_locator_test.rb +1 -0
  94. data/test/lib/rubycritic/version_test.rb +1 -0
  95. data/test/test_helper.rb +1 -0
  96. metadata +16 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d45634d69cea138832dc86f6c5e57a56e1c7a1a
4
- data.tar.gz: 3786e8e320a4d6dc1a3f50eec50be3e520861f59
3
+ metadata.gz: ec33a1c32385f0cbfdefeaa9129d913496b1ae5c
4
+ data.tar.gz: dee2aa84cf1b44b413d269c9f245376922a20519
5
5
  SHA512:
6
- metadata.gz: da6f74791c9c71255c3e1150d38a8afd9fe6cc46715c5de86ff9609311818b5dc6d2aeaa38baa21fe32ee1b5615e3353ec376810844dec8a790153e7aa5804da
7
- data.tar.gz: c532a3b2a06a996ac31fe11253168cf050f752bba5975339403867894387afba3749a1a61c429bb0b501b85940764a36e09605ef10a1c0a3cafa208cf773e854
6
+ metadata.gz: 1a5d63349c3a3cf426b70edfb3ffc5bf28a6c6d469fd4e725aed83633e7b6e0d3ccc7ab708c9fabaabb73afb4e7984b08b00885456f6c2bf1499248b84f3bbe5
7
+ data.tar.gz: afe13be04b5e8cf03258f08fb1cb82403a99e41afa092bdc26e57a4e254d850ee5e047a2739e0e48a1032b54c680c8061c260fcead134439308d067c034aa864
@@ -1,3 +1,8 @@
1
+
2
+ # 2.9.4 / 2016-09-16
3
+
4
+ * [CHANGE] Update Reek, flog, flay (by bglusman)
5
+
1
6
  # 2.9.3 / 2016-08-17
2
7
 
3
8
  * [FEATURE] Save json report to file (by NickTroy)
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in rubycritic.gemspec
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'bundler/gem_tasks'
2
3
  require 'rake/testtask'
3
4
  require 'rubocop/rake_task'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # Always look in the lib directory of this gem
4
5
  # first when searching the load path
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  When(/^I run rake (\w*) with:$/) do |name, task_def|
2
3
  rake(name, task_def)
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  When(/^I run rubycritic (.*)$/) do |args|
2
3
  rubycritic(args)
3
4
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  Given(/^the smelly file 'smelly.rb'/) do
2
3
  contents = <<-EOS.strip_heredoc
3
4
  class AllTheMethods
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative '../../lib/rubycritic'
2
3
  require_relative '../../lib/rubycritic/cli/application'
3
4
  require_relative '../../lib/rubycritic/commands/status_reporter'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/command_factory'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/methods_counter'
2
3
  require 'rubycritic/analysers/helpers/modules_locator'
3
4
  require 'rubycritic/colorize'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/colorize'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/flog'
2
3
  require 'rubycritic/colorize'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Parser
2
3
  module AST
3
4
  class Node
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'flay'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'flog'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/parser'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/parser'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'parser/current'
2
3
  require 'rubycritic/analysers/helpers/ast_node'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'reek'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/flay'
2
3
  require 'rubycritic/core/smell'
3
4
  require 'rubycritic/colorize'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/flog'
2
3
  require 'rubycritic/core/smell'
3
4
  require 'rubycritic/colorize'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/analysers/helpers/reek'
2
3
  require 'rubycritic/core/smell'
3
4
  require 'rubycritic/colorize'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/core/analysed_modules_collection'
2
3
  require 'rubycritic/analysers/smells/flay'
3
4
  require 'rubycritic/analysers/smells/flog'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'launchy'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic'
2
3
  require 'rubycritic/cli/options'
3
4
  require 'rubycritic/command_factory'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'optparse'
2
3
  require 'rubycritic/browser'
3
4
 
@@ -6,12 +7,12 @@ module RubyCritic
6
7
  class Options
7
8
  def initialize(argv)
8
9
  @argv = argv
9
- @parser = OptionParser.new
10
+ self.parser = OptionParser.new
10
11
  end
11
12
 
12
13
  # rubocop:disable Metrics/MethodLength
13
14
  def parse
14
- @parser.new do |opts|
15
+ parser.new do |opts|
15
16
  opts.banner = 'Usage: rubycritic [options] [paths]'
16
17
 
17
18
  opts.on('-p', '--path [PATH]', 'Set path where report will be saved (tmp/rubycritic by default)') do |path|
@@ -26,35 +27,35 @@ module RubyCritic
26
27
  ' json',
27
28
  ' console'
28
29
  ) do |format|
29
- @format = format
30
+ self.format = format
30
31
  end
31
32
 
32
33
  opts.on('-s', '--minimum-score [MIN_SCORE]', 'Set a minimum score') do |min_score|
33
- @minimum_score = Integer(min_score)
34
+ self.minimum_score = Integer(min_score)
34
35
  end
35
36
 
36
37
  opts.on('-m', '--mode-ci', 'Use CI mode (faster, but only analyses last commit)') do
37
- @mode = :ci
38
+ self.mode = :ci
38
39
  end
39
40
 
40
41
  opts.on('--deduplicate-symlinks', 'De-duplicate symlinks based on their final target') do
41
- @deduplicate_symlinks = true
42
+ self.deduplicate_symlinks = true
42
43
  end
43
44
 
44
45
  opts.on('--suppress-ratings', 'Suppress letter ratings') do
45
- @suppress_ratings = true
46
+ self.suppress_ratings = true
46
47
  end
47
48
 
48
49
  opts.on('--no-browser', 'Do not open html report with browser') do
49
- @no_browser = true
50
+ self.no_browser = true
50
51
  end
51
52
 
52
53
  opts.on_tail('-v', '--version', "Show gem's version") do
53
- @mode = :version
54
+ self.mode = :version
54
55
  end
55
56
 
56
57
  opts.on_tail('-h', '--help', 'Show this message') do
57
- @mode = :help
58
+ self.mode = :help
58
59
  end
59
60
  end.parse!(@argv)
60
61
  self
@@ -62,20 +63,22 @@ module RubyCritic
62
63
 
63
64
  def to_h
64
65
  {
65
- mode: @mode,
66
- root: @root,
67
- format: @format,
68
- deduplicate_symlinks: @deduplicate_symlinks,
66
+ mode: mode,
67
+ root: root,
68
+ format: format,
69
+ deduplicate_symlinks: deduplicate_symlinks,
69
70
  paths: paths,
70
- suppress_ratings: @suppress_ratings,
71
- help_text: @parser.help,
72
- minimum_score: @minimum_score || 0,
73
- no_browser: @no_browser
71
+ suppress_ratings: suppress_ratings,
72
+ help_text: parser.help,
73
+ minimum_score: minimum_score || 0,
74
+ no_browser: no_browser
74
75
  }
75
76
  end
76
77
 
77
78
  private
78
79
 
80
+ attr_accessor :mode, :root, :format, :deduplicate_symlinks,
81
+ :suppress_ratings, :minimum_score, :no_browser, :parser
79
82
  def paths
80
83
  if @argv.empty?
81
84
  ['.']
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module Colorize
3
4
  def colorize(text, color_code)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/configuration'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/commands/status_reporter'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/source_control_systems/base'
2
3
  require 'rubycritic/analysers_runner'
3
4
  require 'rubycritic/reporter'
@@ -7,8 +8,12 @@ module RubyCritic
7
8
  module Command
8
9
  class Ci < Default
9
10
  def critique
10
- AnalysersRunner.new(@paths).run
11
+ AnalysersRunner.new(paths).run
11
12
  end
13
+
14
+ private
15
+
16
+ attr_reader :paths
12
17
  end
13
18
  end
14
19
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/source_control_systems/base'
2
3
  require 'rubycritic/analysers_runner'
3
4
  require 'rubycritic/revision_comparator'
@@ -15,18 +16,22 @@ module RubyCritic
15
16
 
16
17
  def execute
17
18
  report(critique)
18
- @status_reporter
19
+ status_reporter
19
20
  end
20
21
 
21
22
  def critique
22
- analysed_modules = AnalysersRunner.new(@paths).run
23
- RevisionComparator.new(@paths).set_statuses(analysed_modules)
23
+ analysed_modules = AnalysersRunner.new(paths).run
24
+ RevisionComparator.new(paths).set_statuses(analysed_modules)
24
25
  end
25
26
 
26
27
  def report(analysed_modules)
27
28
  Reporter.generate_report(analysed_modules)
28
- @status_reporter.score = analysed_modules.score
29
+ status_reporter.score = analysed_modules.score
29
30
  end
31
+
32
+ private
33
+
34
+ attr_reader :paths, :status_reporter
30
35
  end
31
36
  end
32
37
  end
@@ -1,12 +1,17 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/commands/base'
2
3
 
3
4
  module RubyCritic
4
5
  module Command
5
6
  class Help < Base
6
7
  def execute
7
- puts @options[:help_text]
8
- @status_reporter
8
+ puts options[:help_text]
9
+ status_reporter
9
10
  end
11
+
12
+ private
13
+
14
+ attr_reader :options, :status_reporter
10
15
  end
11
16
  end
12
17
  end
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module Command
3
4
  class StatusReporter
4
- attr_reader :status, :status_message
5
+ attr_reader :status, :status_message, :score
5
6
  SUCCESS = 0
6
7
  SCORE_BELOW_MINIMUM = 1
7
8
 
@@ -10,8 +11,8 @@ module RubyCritic
10
11
  @status = SUCCESS
11
12
  end
12
13
 
13
- def score=(score)
14
- @score = score.round(2)
14
+ def score=(input_score)
15
+ @score = input_score.round(2)
15
16
  update_status
16
17
  end
17
18
 
@@ -27,15 +28,15 @@ module RubyCritic
27
28
  end
28
29
 
29
30
  def satisfy_minimum_score_rule
30
- @score >= @options[:minimum_score]
31
+ score >= @options[:minimum_score]
31
32
  end
32
33
 
33
34
  def update_status_message
34
35
  case @status
35
36
  when SUCCESS
36
- @status_message = "Score: #{@score}"
37
+ @status_message = "Score: #{score}"
37
38
  when SCORE_BELOW_MINIMUM
38
- @status_message = "Score (#{@score}) is below the minimum #{@options[:minimum_score]}"
39
+ @status_message = "Score (#{score}) is below the minimum #{@options[:minimum_score]}"
39
40
  end
40
41
  end
41
42
  end
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/version'
2
3
  require 'rubycritic/commands/base'
3
4
 
4
5
  module RubyCritic
5
6
  module Command
6
7
  class Version < Base
8
+ attr_reader :status_reporter
7
9
  def execute
8
10
  puts "RubyCritic #{VERSION}"
9
- @status_reporter
11
+ status_reporter
10
12
  end
11
13
  end
12
14
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  class Configuration
3
4
  attr_reader :root
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'virtus'
2
3
  require 'rubycritic/core/rating'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/source_locator'
2
3
  require 'rubycritic/core/analysed_module'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'pathname'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  class Rating
3
4
  def self.from_cost(cost)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'virtus'
2
3
  require 'rubycritic/core/location'
3
4
 
@@ -70,7 +71,7 @@ module RubyCritic
70
71
  protected
71
72
 
72
73
  def state
73
- [@context, @message, @score, @type]
74
+ [context, message, score, type]
74
75
  end
75
76
 
76
77
  private
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/text/list'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'erb'
2
3
  require 'pathname'
3
4
  require 'rubycritic/generators/html/view_helpers'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/html/base'
2
3
  require 'rubycritic/generators/html/line'
3
4
 
@@ -22,14 +23,14 @@ module RubyCritic
22
23
  end
23
24
 
24
25
  def render
25
- file_code = ''
26
+ file_code = []
26
27
  File.readlines(@pathname).each.with_index(LINE_NUMBER_OFFSET) do |line_text, line_number|
27
28
  location = Location.new(@pathname, line_number)
28
29
  line_smells = @analysed_module.smells_at_location(location)
29
30
  file_code << Line.new(file_directory, line_text, line_smells).render
30
31
  end
31
32
 
32
- file_body = TEMPLATE.result(get_binding { file_code })
33
+ file_body = TEMPLATE.result(get_binding { file_code.join })
33
34
  LAYOUT_TEMPLATE.result(get_binding { file_body })
34
35
  end
35
36
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/html/base'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'cgi'
2
3
  require 'rubycritic/generators/html/base'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/html/base'
2
3
  require 'rubycritic/generators/html/turbulence'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/html/base'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'json'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module ViewHelpers
3
4
  def timeago_tag(time)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'fileutils'
2
3
  require 'rubycritic/configuration'
3
4
  require 'rubycritic/generators/html/overview'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'json'
2
3
  require 'rubycritic/version'
3
4
  require 'pathname'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rubycritic/generators/json/simple'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'colorize'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'rake'
2
3
  require 'rake/tasklib'
3
4
  require 'English'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module Reporter
3
4
  def self.generate_report(analysed_modules)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'fileutils'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module SmellsStatusSetter
3
4
  def self.set(smells_before, smells_now)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'shellwords'
2
3
 
3
4
  module RubyCritic
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module SourceControlSystem
3
4
  class Double < Base
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module SourceControlSystem
3
4
  class Git < Base
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module RubyCritic
2
3
  module SourceControlSystem
3
4
  class Mercurial < Base
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCritic
4
- VERSION = '2.9.3'.freeze
4
+ VERSION = '2.9.4'.freeze
5
5
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'rubycritic/version'
@@ -21,9 +22,9 @@ Gem::Specification.new do |spec|
21
22
  spec.require_path = 'lib'
22
23
 
23
24
  spec.add_runtime_dependency 'virtus', '~> 1.0'
24
- spec.add_runtime_dependency 'flay', '2.8.0'
25
- spec.add_runtime_dependency 'flog', '4.4.0'
26
- spec.add_runtime_dependency 'reek', '4.1.0'
25
+ spec.add_runtime_dependency 'flay', '~> 2.8'
26
+ spec.add_runtime_dependency 'flog', '~> 4.4'
27
+ spec.add_runtime_dependency 'reek', '~> 4.4'
27
28
  spec.add_runtime_dependency 'parser', '2.3.1.2'
28
29
  spec.add_runtime_dependency 'ruby_parser', '~> 3.8'
29
30
  spec.add_runtime_dependency 'colorize'
@@ -36,6 +37,6 @@ Gem::Specification.new do |spec|
36
37
  spec.add_development_dependency 'rake'
37
38
  spec.add_development_dependency 'minitest', '~> 5.3'
38
39
  spec.add_development_dependency 'mocha', '~> 1.1'
39
- spec.add_development_dependency 'rubocop', '>= 0.41.1'
40
+ spec.add_development_dependency 'rubocop', '>= 0.42.0'
40
41
  spec.add_development_dependency 'pry-byebug'
41
42
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
 
3
4
  class AnalysedModuleDouble < OpenStruct; end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'analysers_test_helper'
2
3
  require 'rubycritic/analysers/churn'
3
4
  require 'rubycritic/source_control_systems/base'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'analysers_test_helper'
2
3
  require 'rubycritic/analysers/complexity'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'analysers_test_helper'
2
3
  require 'rubycritic/analysers/helpers/methods_counter'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/analysers/helpers/modules_locator'
3
4
  require 'rubycritic/core/analysed_module'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/analysers/smells/flay'
3
4
  require 'rubycritic/core/analysed_module'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'analysers_test_helper'
2
3
  require 'rubycritic/analysers/smells/flog'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'analysers_test_helper'
2
3
  require 'rubycritic/analysers/smells/reek'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/browser'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/commands/status_reporter'
3
4
  require 'rubycritic/cli/options'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/configuration'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/analysed_module'
3
4
  require 'rubycritic/core/smell'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/analysed_modules_collection'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/location'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/smell'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/smell'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/generators/console_report'
3
4
  require 'rubycritic/core/rating'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/analysed_modules_collection'
3
4
  require 'rubycritic/generators/json_report'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/generators/html/turbulence'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/generators/html/view_helpers'
3
4
  require 'pathname'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/revision_comparator'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/core/smell'
3
4
  require 'rubycritic/smells_status_setter'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/source_control_systems/base'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/source_control_systems/base'
3
4
  require_relative 'interfaces/basic'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/source_control_systems/base'
3
4
  require_relative 'interfaces/basic'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module BasicInterface
2
3
  def test_implements_basic_interface
3
4
  assert_respond_to @system, :revisions_count
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This interface is only used if `@system.revision?` returns `true`.
2
3
  module TimeTravelInterface
3
4
  def test_implements_time_travel_interface
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/source_control_systems/base'
3
4
  require_relative 'interfaces/basic'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/source_locator'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'test_helper'
2
3
  require 'rubycritic/version'
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'minitest/autorun'
2
3
  require 'minitest/pride'
3
4
  require 'mocha/mini_test'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.3
4
+ version: 2.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Simoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -28,44 +28,44 @@ dependencies:
28
28
  name: flay
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.0
33
+ version: '2.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.8.0
40
+ version: '2.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: flog
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 4.4.0
47
+ version: '4.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 4.4.0
54
+ version: '4.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: reek
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.0
61
+ version: '4.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.0
68
+ version: '4.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: parser
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - ">="
228
228
  - !ruby/object:Gem::Version
229
- version: 0.41.1
229
+ version: 0.42.0
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - ">="
235
235
  - !ruby/object:Gem::Version
236
- version: 0.41.1
236
+ version: 0.42.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: pry-byebug
239
239
  requirement: !ruby/object:Gem::Requirement