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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjRmZDFmOTBlY2IxMzJlMjBhNTQwMDIwMjMzMmNlNWQyZDM2ODEyYQ==
4
+ YjExZDM4NmE3NWM0NjQ0MTc1MTY2MWQwYjc1MDkwZTRlNTFhMWI2Yg==
5
5
  data.tar.gz: !binary |-
6
- ZjQyYWJiNDNlY2RlNjk0YTIzYTQ2MGU2YTUwNDAwMWU2OWQ3M2ZjZQ==
6
+ YzkyZGE1OWEwNGNkYzBmN2Y3YTI5MGQ4M2JhYmYwMzA5OTcwMWEwYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzgxY2NjZGZjNTJhYmVhNmZhMDUxYmQ5MWQ2ZWEzNGMwZjA1ZTEyYTdjMjUy
10
- MmQ1ZTZiOGE5OTAyMzBmOTA3MGFmNmRlZjkzNjA1ZWI2MzJlMWUzMDdmNDNi
11
- MGJjZGFiMzNiNTI2OWIyOTI1YzBkMDNkZGQ0ZDg3ZTc1N2U2Zjc=
9
+ Nzg5NDI4NmE2Y2Y1NjZkNzEyYjEwYjI3OGI4NWM3OTE3N2RhYmFhY2Q1NTcz
10
+ NGM0MTFkZDc4NWQ0NjhjNDQxM2FkZGM0Yjc2ZDBmNWQyZjUyN2M5MTU0ZWJl
11
+ ZTIxNmQzZWRkMTIyNzY2Njc3ZjVmNDhmYmJmYzQ5YjhjOTQ4ZWM=
12
12
  data.tar.gz: !binary |-
13
- ZDMwMTA4NTA1ZTI3ZjU4OGVmYjI3MDMzMzQ2MGQ5Zjc3OGY0ZGZhYzA2Yjlm
14
- NzQ1ODg5NmYzMzc0NjZhMmU5ZjFiYmY1YmEyM2FjMWRmNjg5MTRjY2FmNjU4
15
- MDg1NmJmYjE1Mjc0NzU0YmQ1Y2M5ZDY0ZGRkMjM2YjlkMzMxZGY=
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'
@@ -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
- system "open sandi_meter/index.html"
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
@@ -13,7 +13,7 @@ module SandiMeter
13
13
 
14
14
  private
15
15
  def locs_size(first_line, last_line)
16
- file_lines[first_line - 1..last_line - 1].size
16
+ last_line - first_line - 1
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module SandiMeter
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -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 'finds properly indented classes with lines' do
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.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-08 00:00:00.000000000 Z
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