sandi_meter 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 373b45812e2e56fe45638fa58809d785e88938d5
4
+ data.tar.gz: 6d56c4f940d36e8af9752c85673885b7d9070822
5
+ SHA512:
6
+ metadata.gz: a7b7c50c7b8ef49169cd967423763b0a1aed277299d31e0727973ce665c0f1a88be3773cdb548c807c7411eccb3bc8d593634345fde03e83416bf11c1aa5dec5
7
+ data.tar.gz: e172d4204ca422e7b55538c03eb9d7aa8f39cbe535b12299faa0910cba0376b0c2ce42065cf86f1c48f8393b795a46f75331ade45a1ed16ac61368f75f995dc8
@@ -9,6 +9,7 @@ require 'sandi_meter/version'
9
9
  require 'sandi_meter/html_generator'
10
10
  require 'yaml'
11
11
  require 'json'
12
+ require 'launchy'
12
13
 
13
14
  module SandiMeter
14
15
  class CommandParser
@@ -111,7 +112,7 @@ module SandiMeter
111
112
  html_generator.generate_details!(cli.config[:path], data)
112
113
 
113
114
  index_html_path = File.join(cli.config[:path], 'sandi_meter/index.html')
114
- system "open #{index_html_path}"
115
+ open_in_browser(index_html_path)
115
116
  else
116
117
  puts "WARNING!!! HTML mode works only if you scan folder."
117
118
  end
@@ -154,6 +155,10 @@ module SandiMeter
154
155
  # stolen from gem 'bubs' :)
155
156
  "SandiMeter ".tr('A-Za-z1-90', 'Ⓐ-Ⓩⓐ-ⓩ①-⑨⓪').split('').join(' ') + SandiMeter::VERSION
156
157
  end
158
+
159
+ def open_in_browser(url)
160
+ Launchy.open(url)
161
+ end
157
162
  end
158
163
  end
159
164
  end
@@ -1,3 +1,3 @@
1
1
  module SandiMeter
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
@@ -24,7 +24,9 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec", "~> 2.13"
27
28
 
28
29
  spec.add_runtime_dependency "mixlib-cli"
29
30
  spec.add_runtime_dependency "json"
31
+ spec.add_runtime_dependency "launchy"
30
32
  end
@@ -66,7 +66,7 @@ describe SandiMeter::Calculator do
66
66
  end
67
67
  end
68
68
 
69
- describe 'no matchig ruby files found' do
69
+ describe 'no matching ruby files found' do
70
70
  it 'counts class lines' do
71
71
  output = calculator.calculate!(false)
72
72
  output[:first_rule][:total_classes_amount].should eql(0)
@@ -0,0 +1,28 @@
1
+ require 'test_helper'
2
+ require_relative '../lib/sandi_meter/cli'
3
+
4
+ describe SandiMeter::CLI do
5
+ let(:cli) { SandiMeter::CLI }
6
+
7
+ describe '#execute' do
8
+ before do
9
+ @original_argv = ARGV
10
+ ARGV.clear
11
+ end
12
+
13
+ after do
14
+ ARGV.clear
15
+ ARGV.concat(@original_argv)
16
+ end
17
+
18
+ context 'with the graph flag passed in' do
19
+ before { ARGV.push('-g') }
20
+ after { ARGV.pop }
21
+
22
+ it 'opens the graph in a web browser' do
23
+ cli.should_receive(:open_in_browser)
24
+ expect { cli.execute }.to raise_error(SystemExit)
25
+ end
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandi_meter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
5
- prerelease:
4
+ version: 1.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Anatoli Makarevich
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-10 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,49 +27,71 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '2.13'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.13'
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: mixlib-cli
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - '>='
52
60
  - !ruby/object:Gem::Version
53
61
  version: '0'
54
62
  type: :runtime
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - '>='
60
67
  - !ruby/object:Gem::Version
61
68
  version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: json
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: launchy
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
68
88
  - !ruby/object:Gem::Version
69
89
  version: '0'
70
90
  type: :runtime
71
91
  prerelease: false
72
92
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
93
  requirements:
75
- - - ! '>='
94
+ - - '>='
76
95
  - !ruby/object:Gem::Version
77
96
  version: '0'
78
97
  description: Sandi Metz rules checker
@@ -115,6 +134,7 @@ files:
115
134
  - bin/sandi_meter
116
135
  - spec/analyzer_spec.rb
117
136
  - spec/calculator_spec.rb
137
+ - spec/cli_spec.rb
118
138
  - spec/loc_checker_spec.rb
119
139
  - spec/method_arguments_counter_spec.rb
120
140
  - spec/rules_checker_spec.rb
@@ -144,29 +164,25 @@ files:
144
164
  homepage: https://github.com/makaroni4/sandi_meter
145
165
  licenses:
146
166
  - MIT
167
+ metadata: {}
147
168
  post_install_message:
148
169
  rdoc_options: []
149
170
  require_paths:
150
171
  - lib
151
172
  required_ruby_version: !ruby/object:Gem::Requirement
152
- none: false
153
173
  requirements:
154
- - - ! '>='
174
+ - - '>='
155
175
  - !ruby/object:Gem::Version
156
176
  version: 1.9.0
157
177
  required_rubygems_version: !ruby/object:Gem::Requirement
158
- none: false
159
178
  requirements:
160
- - - ! '>='
179
+ - - '>='
161
180
  - !ruby/object:Gem::Version
162
181
  version: '0'
163
- segments:
164
- - 0
165
- hash: 3255714450703413671
166
182
  requirements: []
167
183
  rubyforge_project:
168
- rubygems_version: 1.8.24
184
+ rubygems_version: 2.0.5
169
185
  signing_key:
170
- specification_version: 3
186
+ specification_version: 4
171
187
  summary: Sandi Metz rules checker
172
188
  test_files: []