rubycritic 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ebaa6d00a861b24f55c474cec020a8377a7e392
4
- data.tar.gz: 5cc6f6804dd52505d93e65e1faab58429fc1f168
3
+ metadata.gz: 2cadbe30732bfef380e3d5c275bff418ca9cd43e
4
+ data.tar.gz: 9cbd00db54cdd293eece8d0623162f39fd800f9d
5
5
  SHA512:
6
- metadata.gz: 586b8ad529ef714157aa4c95c5c69edf6e0c4c66a6a392763168af534845febb273bdcb6ecebcc04122d86f2d176ec6bd9afa86a6af6be0382630b65853f8b85
7
- data.tar.gz: 0ac6a82d16c51b59958a32d6e55a76d255c55fd47080c7951c2be1ce43b6f9becbefdf338a2a16fd18f31d4ba5a2adafb907acffdda0f972914507941431e69d
6
+ metadata.gz: 0c1572d4af36f34a8036b956ac04180dc13d52ae200000235edcaf97750fd2bca08bb1329525e7b3d81822254be1289413777a0f575e2b412672f1af93caa2e8
7
+ data.tar.gz: 00699f036ae23d4f3219cc0aa605b7a47d87d19c9bd3c10350c3020018ac23af4354f61de9ca620668a775417834bc07df817ab6b1a61107ed035289990437c3
@@ -19,7 +19,7 @@ module Rubycritic
19
19
  end.parse!
20
20
 
21
21
  ARGV << "." if ARGV.empty?
22
- Rubycritic.new(ARGV).critique
22
+ puts "New critique at #{Rubycritic.new.critique(ARGV)}"
23
23
  exit 0
24
24
 
25
25
  end
@@ -4,6 +4,10 @@ module Rubycritic
4
4
  REPORT_DIR = File.expand_path("tmp/rubycritic", Dir.getwd)
5
5
  TEMPLATES_DIR = File.expand_path("../templates", __FILE__)
6
6
 
7
+ def file_href
8
+ "file://#{file_pathname}"
9
+ end
10
+
7
11
  def file_pathname
8
12
  File.join(file_directory, file_name)
9
13
  end
@@ -21,6 +21,7 @@ module Rubycritic
21
21
  end
22
22
  end
23
23
  FileUtils.cp_r(ASSETS_DIR, BaseGenerator::REPORT_DIR)
24
+ index_generator.file_href
24
25
  end
25
26
 
26
27
  private
@@ -30,7 +31,7 @@ module Rubycritic
30
31
  end
31
32
 
32
33
  def index_generator
33
- IndexGenerator.new(file_generators)
34
+ @index_generator ||= IndexGenerator.new(file_generators)
34
35
  end
35
36
 
36
37
  def file_generators
@@ -1,3 +1,3 @@
1
1
  module Rubycritic
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/rubycritic.rb CHANGED
@@ -8,19 +8,19 @@ require "rubycritic/report_generators/reporter"
8
8
  module Rubycritic
9
9
 
10
10
  class Rubycritic
11
- def initialize(dirs)
12
- @source = SourceLocator.new(dirs)
11
+ def initialize
13
12
  @source_control_system = SourceControlSystem.create
14
13
  end
15
14
 
16
- def critique
15
+ def critique(dirs)
16
+ source = SourceLocator.new(dirs)
17
17
  if @source_control_system.has_revision?
18
- smelly_pathnames = RevisionComparator.new(@source.paths, @source_control_system).compare
18
+ smelly_pathnames = RevisionComparator.new(source.paths, @source_control_system).compare
19
19
  else
20
- smell_adapters = AnalysersRunner.new(@source.paths).run
20
+ smell_adapters = AnalysersRunner.new(source.paths).run
21
21
  smelly_pathnames = SmellsAggregator.new(smell_adapters).smelly_pathnames
22
22
  end
23
- Reporter.new(@source.pathnames, smelly_pathnames).generate_report
23
+ Reporter.new(source.pathnames, smelly_pathnames).generate_report
24
24
  end
25
25
  end
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Simoes