stylr 0.0.7 → 0.0.8

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: bdf726c26f1e23ea59d8fc2e5d2cf49ab380affa
4
- data.tar.gz: 0fb13c52ebd99e2c4860e5f519d860c97a8a0a1a
3
+ metadata.gz: 9ae7cc29466cf1d437a0344cb1b4fc845844a596
4
+ data.tar.gz: 63c2662e200ccc82bf34679aef1b91dd295f0acd
5
5
  SHA512:
6
- metadata.gz: 50a0ea83435412f4c28761765fe4c559a8760ebd5903e7cac49faaa92712cfb3e86aeb13da54bcbb6593e7338a0f403b697b647d90d442f8ed8409d092847ed6
7
- data.tar.gz: a2f259890cc2fcd6d5d9135a40aed7871d84e5bfb16069fbf264b36469701f110992192343fd4bcb520c81a25a92a26085f1f4d5174193c46384c8435379d81a
6
+ metadata.gz: 8c412b8bc12deb3882f95ffde0b917cf56bc06e95db5bd1dba34379cb30f77dfbe3468ef22b544c697b3ebeb2783f13ca0fdc41ccef73fbb8160b115f98c15a4
7
+ data.tar.gz: 52a166bef116f6fca7f44d181613471c0ea0bb5d5eced8129bb02421c32568da50b5751a17b55d8a9a0a37acf3640e21e095b6bf5a0ec411d2b53648f6087c2a
@@ -0,0 +1,20 @@
1
+ language: ruby
2
+ script: 'bundle exec rake'
3
+ cache: bundler
4
+ rvm:
5
+ - 2.0.0
6
+ - 2.1.0
7
+ - ruby-head
8
+ env:
9
+ - RUBY_PLATFORM="x86_64-linux"
10
+ - RUBY_PLATFORM="x86_64-darwin11.3.0"
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
14
+ notifications:
15
+ email:
16
+ recipients:
17
+ - mbillie1@gmail.com
18
+ - ike18t@gmail.com
19
+ on_success: change
20
+ on_failure: change
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stylr (0.0.6)
4
+ stylr (0.0.7)
5
5
  main (~> 5.2, >= 5.2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  <h1>stylr</h1>
2
2
  <h4>a Ruby styleguide enforcer</h4>
3
+ [![Build Status](https://travis-ci.org/yaaase/stylr.png?branch=master)](https://travis-ci.org/yaaase/stylr)
4
+ [![Dependency Status](https://gemnasium.com/yaaase/stylr.png)](https://gemnasium.com/yaaase/stylr)
3
5
  <img src="https://badge.fury.io/rb/stylr.png"/>
4
- <img src="http://ike18t.no-ip.biz/job/Stylr/badge/icon"/>
5
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
8
 
@@ -48,7 +48,7 @@ module Stylr
48
48
  @file_string = @file_string.gsub(/\n/, UniqueConstant)
49
49
  @file_string = @lint.strip_multiline_strings(@file_string)
50
50
  @file_string = @file_string.gsub(/#{UniqueConstant}/, "#{UniqueConstant}\n")
51
- @file_string = @file_string.split(/#{UniqueConstant}/)
51
+ @file_string = @file_string.split(/#{UniqueConstant}/)
52
52
  end
53
53
 
54
54
  def display_no_error_message
@@ -69,7 +69,8 @@ class Lint
69
69
  /\bfor\b/ => :the_word_for,
70
70
  /\bif\b.*\bthen\b\n/ => :multiline_if_then,
71
71
  /\(\s|\s\)/ => :paren_spacing,
72
- /\[\s|\s\]/ => :bracket_spacing,
72
+ /\[[^\S\n]/ => :bracket_spacing,
73
+ /\S.*\s\]/ => :bracket_spacing,
73
74
  /[^\s][{}]|{[^\s]/ => :brace_spacing,
74
75
  /,[^ \n]/ => :comma_spacing,
75
76
  /\t/ => :no_soft_tabs,
@@ -1,3 +1,3 @@
1
1
  module Stylr
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -119,6 +119,14 @@ module Stylr
119
119
  it "space after open bracket is bad" do
120
120
  l.violation?("list = [ 1, 2, 3]").should be_true
121
121
  end
122
+
123
+ it "newline after open bracket is fine" do
124
+ l.violation?("list = [\n").should be_false
125
+ end
126
+
127
+ it "close bracket fine as only thing on a line" do
128
+ l.violation?(" ]").should be_false
129
+ end
122
130
  end
123
131
 
124
132
  context "space around { and } is good" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Billie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: main
@@ -81,6 +81,7 @@ extensions: []
81
81
  extra_rdoc_files: []
82
82
  files:
83
83
  - ".gitignore"
84
+ - ".travis.yml"
84
85
  - Gemfile
85
86
  - Gemfile.lock
86
87
  - LICENSE.txt