warder 0.2.1 → 0.2.2

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: 8293a08b303f9d5b9eb1fa1159b437f251e6dfe9
4
- data.tar.gz: fd4341bbdf903230a80b2e2b600fd51e57ea0a7c
3
+ metadata.gz: 5ce6a5ae6fa2e132a1aa894be28bd683e83a5ea6
4
+ data.tar.gz: 8f56efcb997bd2ee849d7e978149cd0e1b133d3f
5
5
  SHA512:
6
- metadata.gz: 30aa9ddb458431940bc85e130ab887226cb2306838e0b86db9750c8212d399964de6b039e08f8577dfd3f3fb501a707883852f2961108913ea6ad7808685bbef
7
- data.tar.gz: 4d1a665377df8e920a214de587078489431428db44f68bec9e72056efd8258284288c50a05c760b70a77a9108611293d0a045f44864e58eb80cafe21338ddb68
6
+ metadata.gz: 78569d1fd5f6a23734c84775ef4508000cfec3db3ba65051281a46a7fa1a7cec3a64f83593fa18c729c06927b83eb82e4f1e572d055918440f9e0e885237efe7
7
+ data.tar.gz: 939efeec5ea2014a340eee05a10c9525744d98da150595ead00111fcc653ccc3e6431a3eb7a5ad8d470865388d426469246f82c97b2f1242c391a1e6513eb63f
data/README.md CHANGED
@@ -4,7 +4,56 @@
4
4
  [![Code Climate](https://codeclimate.com/github/yltsrc/warder.png)](https://codeclimate.com/github/yltsrc/warder)
5
5
  [![Dependency Status](https://gemnasium.com/yltsrc/warder.png)](https://gemnasium.com/yltsrc/warder)
6
6
 
7
- TODO: Write a gem description
7
+ ## Getting started
8
+
9
+ Main goal of this project was to provide you tool, which will help make code
10
+ better. I used these tools for a while and can provide some tips.
11
+
12
+ Just to start with warder, it would be great to do something simple.
13
+ And I will recommend to start with checking your bundle for security issues
14
+
15
+ $ warder --bundle-audit
16
+
17
+ Sooner or later you will start with code cleanup. There are two main ways to
18
+ deal with it, depending what you plan to achieve. If you are interested in clean
19
+ code, according to style guides, you may want to use
20
+
21
+ $ warder --style-guide
22
+
23
+ But if you want to see you code OOP-friendly, then you need different approach
24
+
25
+ $ warder --code-smells
26
+
27
+ Next steps for stylish code are:
28
+
29
+ $ warder --code-duplication
30
+ $ warder --magick-numbers
31
+
32
+ And for OOP-style code next steps will be:
33
+
34
+ $ warder --code-complexity
35
+
36
+ Then you can apply everything is left. But I strongly recommend to add
37
+ validations one by one, right after all issues are fixed from previous one.
38
+ Now it is not possible to compare results on feature branches without scripting,
39
+ so you must be careful, if you want to use all suitable validators and results
40
+ are not as good as it can be.
41
+
42
+ There are few rails specific validators, but the rules are the same. Security is
43
+ the first priority:
44
+
45
+ $ warder --rails-security
46
+
47
+ You may also want to see some advice, regarding rails best practices:
48
+
49
+ $ warder --rails-advice
50
+
51
+ but be careful with it, some reported advices may conflict with another
52
+ validators.
53
+
54
+ You may also see, how your rails app meets Sandi Metz rules:
55
+
56
+ $ warder --sandi-rules
8
57
 
9
58
  ## Installation
10
59
 
@@ -22,7 +71,51 @@ Or install it yourself as:
22
71
 
23
72
  ## Usage
24
73
 
25
- TODO: Write usage instructions here
74
+ First of all, RTFM!
75
+
76
+ $ warder --help
77
+
78
+ to see all supported scanners.
79
+ If you are too lazy, you will be confused with results.
80
+
81
+ $ warder
82
+
83
+ to see that everything is good (actually no one validator used) and you don't
84
+ need to fix any issues :)
85
+
86
+ You also can use shortcuts:
87
+
88
+ $ warder --all
89
+
90
+ to run all validations, even ones you don't really need.
91
+
92
+ To run only rails related validations:
93
+
94
+ $ warder --rails
95
+
96
+ or to validate your ruby project:
97
+
98
+ $ warder --all --no-rails
99
+
100
+ if you so tired looking at your code issues, you can use silent mode
101
+
102
+ $ warder --quiet
103
+
104
+ and you just will get result by exit code.
105
+
106
+ But if you, or your CI is really interested in statistics, there is statistics
107
+ mode for you:
108
+
109
+ $ warder --quiet --stats
110
+
111
+ if you working on multiple projects, you can pass path to another project
112
+ as an argument:
113
+
114
+ $ warder --quiet /path/to/another/project
115
+
116
+ The best thing I can do with warder is validate project itself, so anyone can
117
+ see, that it is not so hard to write good ruby code. Just check build status on
118
+ [Travis CI](https://travis-ci.org/yltsrc/warder).
26
119
 
27
120
  ## Contributing
28
121
 
@@ -1,6 +1,7 @@
1
1
  require 'optparse'
2
2
 
3
3
  module Warder
4
+ # responsible for hiding arguments from global scope
4
5
  class CLI
5
6
  # responsible for parsing cli arguments
6
7
  class Arguments
data/lib/warder/cli.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Warder
2
- # responsible for executing warder tools
2
+ # responsible for cli integration
3
3
  class CLI
4
4
  def initialize(argv, stdin = STDIN, stdout = STDOUT,
5
5
  stderr = STDERR, kernel = Kernel)
@@ -29,7 +29,7 @@ module Warder
29
29
  end
30
30
 
31
31
  def total?(line)
32
- TOTAL_REGEXP.match(line)
32
+ self.class::TOTAL_REGEXP.match(line)
33
33
  end
34
34
  end
35
35
  end
@@ -17,11 +17,11 @@ module Warder
17
17
  end
18
18
 
19
19
  def printable?(line)
20
- super && PRINTABLE_REGEXP.match(line)
20
+ super && self.class::PRINTABLE_REGEXP.match(line)
21
21
  end
22
22
 
23
23
  def number_of_issues(line)
24
- FAILURE_REGEXP.match(line) ? 1 : 0
24
+ self.class::FAILURE_REGEXP.match(line) ? 1 : 0
25
25
  end
26
26
  end
27
27
  end
@@ -1,4 +1,4 @@
1
1
  # define warder version
2
2
  module Warder
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 4.2.0'
3
+ gem 'rails', '~> 4.2.2'
4
4
 
5
5
  gem 'sqlite3'
@@ -1,36 +1,36 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actionmailer (4.2.0)
5
- actionpack (= 4.2.0)
6
- actionview (= 4.2.0)
7
- activejob (= 4.2.0)
4
+ actionmailer (4.2.2)
5
+ actionpack (= 4.2.2)
6
+ actionview (= 4.2.2)
7
+ activejob (= 4.2.2)
8
8
  mail (~> 2.5, >= 2.5.4)
9
9
  rails-dom-testing (~> 1.0, >= 1.0.5)
10
- actionpack (4.2.0)
11
- actionview (= 4.2.0)
12
- activesupport (= 4.2.0)
13
- rack (~> 1.6.0)
10
+ actionpack (4.2.2)
11
+ actionview (= 4.2.2)
12
+ activesupport (= 4.2.2)
13
+ rack (~> 1.6)
14
14
  rack-test (~> 0.6.2)
15
15
  rails-dom-testing (~> 1.0, >= 1.0.5)
16
16
  rails-html-sanitizer (~> 1.0, >= 1.0.1)
17
- actionview (4.2.0)
18
- activesupport (= 4.2.0)
17
+ actionview (4.2.2)
18
+ activesupport (= 4.2.2)
19
19
  builder (~> 3.1)
20
20
  erubis (~> 2.7.0)
21
21
  rails-dom-testing (~> 1.0, >= 1.0.5)
22
22
  rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
- activejob (4.2.0)
24
- activesupport (= 4.2.0)
23
+ activejob (4.2.2)
24
+ activesupport (= 4.2.2)
25
25
  globalid (>= 0.3.0)
26
- activemodel (4.2.0)
27
- activesupport (= 4.2.0)
26
+ activemodel (4.2.2)
27
+ activesupport (= 4.2.2)
28
28
  builder (~> 3.1)
29
- activerecord (4.2.0)
30
- activemodel (= 4.2.0)
31
- activesupport (= 4.2.0)
29
+ activerecord (4.2.2)
30
+ activemodel (= 4.2.2)
31
+ activesupport (= 4.2.2)
32
32
  arel (~> 6.0)
33
- activesupport (4.2.0)
33
+ activesupport (4.2.2)
34
34
  i18n (~> 0.7)
35
35
  json (~> 1.7, >= 1.7.7)
36
36
  minitest (~> 5.1)
@@ -39,62 +39,56 @@ GEM
39
39
  arel (6.0.0)
40
40
  builder (3.2.2)
41
41
  erubis (2.7.0)
42
- globalid (0.3.0)
42
+ globalid (0.3.5)
43
43
  activesupport (>= 4.1.0)
44
- hike (1.2.3)
45
44
  i18n (0.7.0)
46
- json (1.8.2)
47
- loofah (2.0.1)
45
+ json (1.8.3)
46
+ loofah (2.0.2)
48
47
  nokogiri (>= 1.5.9)
49
48
  mail (2.6.3)
50
49
  mime-types (>= 1.16, < 3)
51
- mime-types (2.4.3)
50
+ mime-types (2.6.1)
52
51
  mini_portile (0.6.2)
53
- minitest (5.5.1)
54
- multi_json (1.10.1)
52
+ minitest (5.7.0)
55
53
  nokogiri (1.6.6.2)
56
54
  mini_portile (~> 0.6.0)
57
- rack (1.6.0)
55
+ rack (1.6.4)
58
56
  rack-test (0.6.3)
59
57
  rack (>= 1.0)
60
- rails (4.2.0)
61
- actionmailer (= 4.2.0)
62
- actionpack (= 4.2.0)
63
- actionview (= 4.2.0)
64
- activejob (= 4.2.0)
65
- activemodel (= 4.2.0)
66
- activerecord (= 4.2.0)
67
- activesupport (= 4.2.0)
58
+ rails (4.2.2)
59
+ actionmailer (= 4.2.2)
60
+ actionpack (= 4.2.2)
61
+ actionview (= 4.2.2)
62
+ activejob (= 4.2.2)
63
+ activemodel (= 4.2.2)
64
+ activerecord (= 4.2.2)
65
+ activesupport (= 4.2.2)
68
66
  bundler (>= 1.3.0, < 2.0)
69
- railties (= 4.2.0)
67
+ railties (= 4.2.2)
70
68
  sprockets-rails
71
69
  rails-deprecated_sanitizer (1.0.3)
72
70
  activesupport (>= 4.2.0.alpha)
73
- rails-dom-testing (1.0.5)
71
+ rails-dom-testing (1.0.6)
74
72
  activesupport (>= 4.2.0.beta, < 5.0)
75
73
  nokogiri (~> 1.6.0)
76
74
  rails-deprecated_sanitizer (>= 1.0.1)
77
- rails-html-sanitizer (1.0.1)
75
+ rails-html-sanitizer (1.0.2)
78
76
  loofah (~> 2.0)
79
- railties (4.2.0)
80
- actionpack (= 4.2.0)
81
- activesupport (= 4.2.0)
77
+ railties (4.2.2)
78
+ actionpack (= 4.2.2)
79
+ activesupport (= 4.2.2)
82
80
  rake (>= 0.8.7)
83
81
  thor (>= 0.18.1, < 2.0)
84
82
  rake (10.4.2)
85
- sprockets (2.12.3)
86
- hike (~> 1.2)
87
- multi_json (~> 1.0)
83
+ sprockets (3.2.0)
88
84
  rack (~> 1.0)
89
- tilt (~> 1.1, != 1.3.0)
90
- sprockets-rails (2.2.4)
85
+ sprockets-rails (2.3.1)
91
86
  actionpack (>= 3.0)
92
87
  activesupport (>= 3.0)
93
88
  sprockets (>= 2.8, < 4.0)
94
89
  sqlite3 (1.3.10)
95
90
  thor (0.19.1)
96
- thread_safe (0.3.4)
97
- tilt (1.4.1)
91
+ thread_safe (0.3.5)
98
92
  tzinfo (1.2.2)
99
93
  thread_safe (~> 0.1)
100
94
 
@@ -102,5 +96,5 @@ PLATFORMS
102
96
  ruby
103
97
 
104
98
  DEPENDENCIES
105
- rails (~> 4.2.0)
99
+ rails (~> 4.2.1)
106
100
  sqlite3
data/warder.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'rubocop', '~> 0.31'
22
- spec.add_dependency 'reek', '~> 1.6'
22
+ spec.add_dependency 'reek', '~> 2.2'
23
23
  spec.add_dependency 'flay', '~> 2.6.1'
24
24
  spec.add_dependency 'flog', '~> 4.3'
25
25
  spec.add_dependency 'mago', '~> 0.1'
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_development_dependency 'bundler', '~> 1.3'
32
32
  spec.add_development_dependency 'rake', '~> 10.0'
33
- spec.add_development_dependency 'rspec', '~> 3.2'
33
+ spec.add_development_dependency 'rspec', '~> 3.3'
34
34
  spec.add_development_dependency 'cucumber', '~> 2.0'
35
35
  spec.add_development_dependency 'aruba', '~> 0.6'
36
36
  spec.add_development_dependency 'simplecov', '~> 0.10'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yura Tolstik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '2.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: flay
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '3.2'
173
+ version: '3.3'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '3.2'
180
+ version: '3.3'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: cucumber
183
183
  requirement: !ruby/object:Gem::Requirement