sandi_meter 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/html/script.js +12 -4
- data/lib/sandi_meter/cli.rb +2 -1
- data/lib/sandi_meter/loc_checker.rb +1 -1
- data/lib/sandi_meter/version.rb +1 -1
- data/spec/analyzer_spec.rb +22 -1
- data/spec/test_classes/14.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjExZDM4NmE3NWM0NjQ0MTc1MTY2MWQwYjc1MDkwZTRlNTFhMWI2Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzkyZGE1OWEwNGNkYzBmN2Y3YTI5MGQ4M2JhYmYwMzA5OTcwMWEwYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Nzg5NDI4NmE2Y2Y1NjZkNzEyYjEwYjI3OGI4NWM3OTE3N2RhYmFhY2Q1NTcz
|
10
|
+
NGM0MTFkZDc4NWQ0NjhjNDQxM2FkZGM0Yjc2ZDBmNWQyZjUyN2M5MTU0ZWJl
|
11
|
+
ZTIxNmQzZWRkMTIyNzY2Njc3ZjVmNDhmYmJmYzQ5YjhjOTQ4ZWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzQxZTNhNjg0MWQwMmY0YjU0ZjY3Y2Q0MjhmZjZlMDhjZGVkNmE2NmRjODFm
|
14
|
+
YTUzOWEzMzQ2OWYyZjllNjUwYTczZTAyNmNhMWMwNjU1OWEzNTRhY2I5ZjZj
|
15
|
+
YWRiNzM5MDI1NjM1ZDlmNzM5ZTg0MmZkZWE2NGVkZGJlMDEzNzg=
|
data/html/script.js
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
function plotDonut(value1, value2, label1, label2, id) {
|
2
|
+
var data = [];
|
3
|
+
|
4
|
+
if(value1 > 0) {
|
5
|
+
data.push({ value: value1, label: label1 });
|
6
|
+
}
|
7
|
+
|
8
|
+
if(value2 > 2){
|
9
|
+
data.push({ value: value2, label: label2 });
|
10
|
+
}
|
11
|
+
|
12
|
+
console.log(data);
|
2
13
|
Morris.Donut({
|
3
14
|
element: id,
|
4
|
-
data:
|
5
|
-
{value: value1, label: label1},
|
6
|
-
{value: value2, label: label2},
|
7
|
-
],
|
15
|
+
data: data,
|
8
16
|
colors: [
|
9
17
|
'#0C0',
|
10
18
|
'#F00'
|
data/lib/sandi_meter/cli.rb
CHANGED
@@ -75,7 +75,8 @@ module SandiMeter
|
|
75
75
|
html_generator.generate_data!(cli.config[:path])
|
76
76
|
html_generator.generate_details!(cli.config[:path], data)
|
77
77
|
|
78
|
-
|
78
|
+
index_html_path = File.join(cli.config[:path], 'sandi_meter/index.html')
|
79
|
+
system "open #{index_html_path}"
|
79
80
|
else
|
80
81
|
puts "WARNING!!! HTML mode works only if you scan folder."
|
81
82
|
end
|
data/lib/sandi_meter/version.rb
CHANGED
data/spec/analyzer_spec.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/sandi_meter/analyzer'
|
|
4
4
|
describe SandiMeter::Analyzer do
|
5
5
|
let(:analyzer) { SandiMeter::Analyzer.new }
|
6
6
|
|
7
|
-
describe '
|
7
|
+
describe 'properly indented classes with lines' do
|
8
8
|
let(:test_class) { test_file_path(3) }
|
9
9
|
|
10
10
|
before do
|
@@ -226,4 +226,25 @@ describe SandiMeter::Analyzer do
|
|
226
226
|
analyzer.method_calls.should be_empty
|
227
227
|
end
|
228
228
|
end
|
229
|
+
|
230
|
+
describe 'analazing complex methods' do
|
231
|
+
let(:test_class) { test_file_path(14) }
|
232
|
+
let(:methods) { analyzer.methods["TestClass"] }
|
233
|
+
|
234
|
+
before do
|
235
|
+
analyzer.analyze(test_class)
|
236
|
+
end
|
237
|
+
|
238
|
+
it 'mark 4line methods good' do
|
239
|
+
methods.should include(["render4", 2, 7, 0, true, "#{test_file_path(14)}:2"])
|
240
|
+
end
|
241
|
+
|
242
|
+
it 'mark 5line methods good' do
|
243
|
+
methods.should include(["render5", 9, 15, 0, true, "#{test_file_path(14)}:9"])
|
244
|
+
end
|
245
|
+
|
246
|
+
it 'mark 6line methods bad' do
|
247
|
+
methods.should include(["render6", 17, 24, 0, false, "#{test_file_path(14)}:17"])
|
248
|
+
end
|
249
|
+
end
|
229
250
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class TestClass
|
2
|
+
def render4
|
3
|
+
return '' if @elements.empty?
|
4
|
+
@context.content_tag :ol, class: 'breadcrumb' do
|
5
|
+
render_collection
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def render5
|
10
|
+
return '' if @elements.empty?
|
11
|
+
@context.content_tag :ol, class: 'breadcrumb' do
|
12
|
+
render_collection
|
13
|
+
end
|
14
|
+
puts "5th line!"
|
15
|
+
end
|
16
|
+
|
17
|
+
def render6
|
18
|
+
return '' if @elements.empty?
|
19
|
+
@context.content_tag :ol, class: 'breadcrumb' do
|
20
|
+
render_collection
|
21
|
+
end
|
22
|
+
puts "5th line!"
|
23
|
+
puts "6th line!"
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sandi_meter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoli Makarevich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- spec/test_classes/11.rb
|
95
95
|
- spec/test_classes/12.rb
|
96
96
|
- spec/test_classes/13.rb
|
97
|
+
- spec/test_classes/14.rb
|
97
98
|
- spec/test_classes/14_controller.rb
|
98
99
|
- spec/test_classes/15_controller.rb
|
99
100
|
- spec/test_classes/2.rb
|