stylr 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ae7cc29466cf1d437a0344cb1b4fc845844a596
4
- data.tar.gz: 63c2662e200ccc82bf34679aef1b91dd295f0acd
3
+ metadata.gz: 775df439741f94f7d34cdaa9c3724df706d754c3
4
+ data.tar.gz: c45c8d3394e925ea541baf63d0787117d5813b2c
5
5
  SHA512:
6
- metadata.gz: 8c412b8bc12deb3882f95ffde0b917cf56bc06e95db5bd1dba34379cb30f77dfbe3468ef22b544c697b3ebeb2783f13ca0fdc41ccef73fbb8160b115f98c15a4
7
- data.tar.gz: 52a166bef116f6fca7f44d181613471c0ea0bb5d5eced8129bb02421c32568da50b5751a17b55d8a9a0a37acf3640e21e095b6bf5a0ec411d2b53648f6087c2a
6
+ metadata.gz: 71ed22808a68891bd9a7783140e1231ae1b26b54293b2b3b58a7b216a715d903de081ccd3f6d670dcd52ee3c329f8c8ee5b64dd1fcf9377b7a77e15a6be2b261
7
+ data.tar.gz: 9b68aae0b023f654a05bb640d6e8c2f31820348068b2fef4f5ea8226ccda33e72bd32b740d47b4f729ae602a26b89d3d877d333c8673cdf06aa5418999502c5a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stylr (0.0.7)
4
+ stylr (0.0.9)
5
5
  main (~> 5.2, >= 5.2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Dependency Status](https://gemnasium.com/yaaase/stylr.png)](https://gemnasium.com/yaaase/stylr)
5
5
  <img src="https://badge.fury.io/rb/stylr.png"/>
6
6
 
7
- This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0 (although it may work with earlier versions)
7
+ This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0 (although it may work with earlier versions). Obviously it does not check against the subjective elements of the styleguide.
8
8
 
9
9
  Kind of raw still. Currently supports checking against the following:
10
10
 
@@ -14,8 +14,8 @@ Kind of raw still. Currently supports checking against the following:
14
14
  * Use of the 'and' or 'or' operators (&& and || are preferred)
15
15
  * Use of 'then' on a multiline if/then construct
16
16
  * Spacing around parens
17
- * Spacing around brackets (this is a little broken on multi-line arrays)
18
- * Spacing around curly braces (this is also a little broken)
17
+ * Spacing around brackets
18
+ * Spacing around curly braces (this is broken when you interpolate into a regex)
19
19
  * Using the keyword 'for'
20
20
  * Spacing around commas
21
21
  * Using tab characters instead of soft tabs
data/bin/stylr CHANGED
@@ -6,6 +6,7 @@ require 'stylr'
6
6
  module Stylr
7
7
  Main {
8
8
  argument('directory') {
9
+ argument_optional
9
10
  description "The directory to be parsed."
10
11
  cast :string
11
12
  }
@@ -15,15 +16,24 @@ module Stylr
15
16
  description "Check for metaprogramming violations. Defaults to false."
16
17
  }
17
18
 
19
+ option('version') {
20
+ default false
21
+ description "Display the current version"
22
+ }
23
+
18
24
  def run
19
- directory = params['directory'].values.first
20
- meta = params['meta'].values.first ? true : false
21
- dir_loader = DirLoader.new
22
- dir_loader.load_dir(directory)
25
+ if params['version'].values.first
26
+ puts "stylr version #{Stylr::VERSION}"
27
+ else
28
+ directory = params['directory'].values.first
29
+ meta = params['meta'].values.first ? true : false
30
+ dir_loader = DirLoader.new
31
+ dir_loader.load_dir(directory)
23
32
 
24
- dir_loader.filenames.each do |filename|
25
- puts "Checking #{filename}..."
26
- FileParser.new(filename, Lint.new, true).violations?(meta)
33
+ dir_loader.filenames.each do |filename|
34
+ puts "Checking #{filename}..."
35
+ FileParser.new(filename, Lint.new, true).violations?(meta)
36
+ end
27
37
  end
28
38
  end
29
39
  }
@@ -1,3 +1,3 @@
1
1
  module Stylr
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Billie