metric_abc 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/metric_abc.rb +7 -3
  3. data/metric_abc.gemspec +3 -3
  4. metadata +7 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -20,9 +20,13 @@ class MetricABC
20
20
 
21
21
  if node[0] == :def
22
22
  @nesting << node[1][1]
23
- @complexity[@nesting.join("#")] = calculate_abc(node)
24
- elsif node[0] == :class || node[0] == :const
25
- @nesting << node[1][1][1]
23
+ @complexity[@nesting.join(" > ")] = calculate_abc(node)
24
+ elsif node[0] == :class || node[0] == :module
25
+ if node[1][1][1].is_a? Symbol
26
+ @nesting << node[1][1][1]
27
+ else
28
+ @nesting << node[1][-1][1]
29
+ end
26
30
  end
27
31
 
28
32
  node[1..-1].each { |n| process_ast(n) if n } if node.is_a? Array
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{metric_abc}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hubert Lepicki"]
@@ -36,9 +36,9 @@ Gem::Specification.new do |s|
36
36
  s.rubygems_version = %q{1.3.7}
37
37
  s.summary = %q{Quick and *DIRTY* ABC metric for Ruby 1.9 code}
38
38
  s.test_files = [
39
- "spec/fixtures/example.rb",
39
+ "spec/spec_helper.rb",
40
40
  "spec/fixtures/not_valid.rb",
41
- "spec/spec_helper.rb",
41
+ "spec/fixtures/example.rb",
42
42
  "spec/functional/metric_abc_spec.rb"
43
43
  ]
44
44
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metric_abc
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 2
9
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Hubert Lepicki
@@ -52,6 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
53
  requirements:
53
54
  - - ">="
54
55
  - !ruby/object:Gem::Version
56
+ hash: 3
55
57
  segments:
56
58
  - 0
57
59
  version: "0"
@@ -60,6 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
62
  requirements:
61
63
  - - ">="
62
64
  - !ruby/object:Gem::Version
65
+ hash: 3
63
66
  segments:
64
67
  - 0
65
68
  version: "0"
@@ -71,7 +74,7 @@ signing_key:
71
74
  specification_version: 3
72
75
  summary: Quick and *DIRTY* ABC metric for Ruby 1.9 code
73
76
  test_files:
74
- - spec/fixtures/example.rb
75
- - spec/fixtures/not_valid.rb
76
77
  - spec/spec_helper.rb
78
+ - spec/fixtures/not_valid.rb
79
+ - spec/fixtures/example.rb
77
80
  - spec/functional/metric_abc_spec.rb