rubycritic 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +593 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/CONTRIBUTING.md +17 -15
- data/README.md +15 -4
- data/Rakefile +9 -6
- data/bin/rubycritic +2 -2
- data/lib/rubycritic.rb +21 -1
- data/lib/rubycritic/analysers/churn.rb +4 -2
- data/lib/rubycritic/analysers/helpers/ast_node.rb +4 -8
- data/lib/rubycritic/analysers/helpers/methods_counter.rb +2 -5
- data/lib/rubycritic/analysers/helpers/modules_locator.rb +2 -5
- data/lib/rubycritic/analysers/helpers/parser.rb +12 -0
- data/lib/rubycritic/analysers/helpers/reek.rb +6 -2
- data/lib/rubycritic/analysers/smells/reek.rb +1 -1
- data/lib/rubycritic/analysers_runner.rb +13 -7
- data/lib/rubycritic/cli/application.rb +24 -0
- data/lib/rubycritic/cli/options.rb +57 -0
- data/lib/rubycritic/commands/ci.rb +28 -0
- data/lib/rubycritic/commands/default.rb +30 -0
- data/lib/rubycritic/commands/help.rb +13 -0
- data/lib/rubycritic/commands/version.rb +11 -0
- data/lib/rubycritic/configuration.rb +19 -14
- data/lib/rubycritic/core/analysed_module.rb +1 -1
- data/lib/rubycritic/core/smell.rb +1 -1
- data/lib/rubycritic/report_generators/base.rb +1 -1
- data/lib/rubycritic/report_generators/line.rb +1 -1
- data/lib/rubycritic/report_generators/smells_index.rb +1 -0
- data/lib/rubycritic/report_generators/templates/code_file.html.erb +1 -1
- data/lib/rubycritic/report_generators/templates/smells_index.html.erb +6 -2
- data/lib/rubycritic/report_generators/templates/smelly_line.html.erb +1 -1
- data/lib/rubycritic/report_generators/view_helpers.rb +4 -4
- data/lib/rubycritic/reporters/base.rb +1 -1
- data/lib/rubycritic/revision_comparator.rb +14 -14
- data/lib/rubycritic/source_control_systems/base.rb +9 -32
- data/lib/rubycritic/source_control_systems/double.rb +6 -7
- data/lib/rubycritic/source_control_systems/git.rb +10 -16
- data/lib/rubycritic/source_control_systems/mercurial.rb +29 -0
- data/lib/rubycritic/source_locator.rb +4 -5
- data/lib/rubycritic/version.rb +1 -1
- data/rubycritic.gemspec +4 -3
- data/test/lib/rubycritic/analysers/churn_test.rb +5 -5
- data/test/lib/rubycritic/analysers/smells/flay_test.rb +1 -1
- data/test/lib/rubycritic/configuration_test.rb +8 -7
- data/test/lib/rubycritic/core/analysed_module_test.rb +2 -2
- data/test/lib/rubycritic/core/smell_test.rb +2 -2
- data/test/lib/rubycritic/source_control_systems/{source_control_system_test.rb → base_test.rb} +1 -1
- data/test/lib/rubycritic/source_control_systems/double_test.rb +11 -0
- data/test/lib/rubycritic/source_control_systems/git_test.rb +13 -0
- data/test/lib/rubycritic/source_control_systems/interfaces/basic.rb +7 -0
- data/test/lib/rubycritic/source_control_systems/interfaces/time_travel.rb +7 -0
- data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +11 -0
- data/test/lib/rubycritic/source_locator_test.rb +8 -2
- data/test/test_helper.rb +29 -0
- metadata +49 -13
- data/lib/rubycritic/cli.rb +0 -46
- data/lib/rubycritic/modules_initializer.rb +0 -14
- data/lib/rubycritic/orchestrator.rb +0 -23
@@ -1,14 +0,0 @@
|
|
1
|
-
require "rubycritic/source_locator"
|
2
|
-
require "rubycritic/core/analysed_module"
|
3
|
-
|
4
|
-
module Rubycritic
|
5
|
-
|
6
|
-
module ModulesInitializer
|
7
|
-
def self.init(paths)
|
8
|
-
SourceLocator.new(paths).pathnames.map do |pathname|
|
9
|
-
AnalysedModule.new(:pathname => pathname)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require "rubycritic/source_control_systems/base"
|
2
|
-
require "rubycritic/modules_initializer"
|
3
|
-
require "rubycritic/analysers_runner"
|
4
|
-
require "rubycritic/revision_comparator"
|
5
|
-
|
6
|
-
module Rubycritic
|
7
|
-
|
8
|
-
class Orchestrator
|
9
|
-
def initialize
|
10
|
-
@source_control_system = SourceControlSystem::Base.create
|
11
|
-
end
|
12
|
-
|
13
|
-
def critique(paths)
|
14
|
-
analysed_modules = ModulesInitializer.init(paths)
|
15
|
-
AnalysersRunner.new(analysed_modules, @source_control_system).run
|
16
|
-
if @source_control_system.has_revision?
|
17
|
-
RevisionComparator.new(analysed_modules, @source_control_system, paths).set_statuses
|
18
|
-
end
|
19
|
-
analysed_modules
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|