stylr 0.0.12 → 0.0.13

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: af287a79ab685ebece192375bd645072349e7f7a
4
- data.tar.gz: 04458957182c9bed33c6c96cc55d93d768101ae5
3
+ metadata.gz: 2b6c5c561144b3451f609f05fa568125170b5e10
4
+ data.tar.gz: f6ddc8e22a2febd98984ebefef01a730edbd1368
5
5
  SHA512:
6
- metadata.gz: 790a3ade92275cbd9acc52c33e9c96eb6fe2096c106d15785fd0df3a76027aa1a8bd1b1675e726e1cb24785c1221f9e6755139e2debc9ad308a1b6f25a76f8f6
7
- data.tar.gz: 0e45d465d74969a1d3ae112f10b8067856071c7ea061a0a1a1e24da3717b4261344fe0cb91fb200cf865dc6a23726a7b52c12e8ee437b1ec9177bd9603616a19
6
+ metadata.gz: e5ea60e64c2ee010d37e88af1e12243025e878f165826a810a208252412afcba9b9b57a771a50fee8a0c61b3742cf52db7575be242dd95e3f86d3a06751fae1d
7
+ data.tar.gz: 8a86db0eed7d016c89e7d846f9a582348b7fe408e82b5c2be08b9c3554b50bda8a365caa4ba18339cec243a722426cc5c63d5e3be874645df3e647933eb4d5fd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stylr (0.0.12)
4
+ stylr (0.0.13)
5
5
  main (~> 5.2, >= 5.2.0)
6
6
 
7
7
  GEM
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Mark Billie & ThoughtWorks, Inc.
1
+ Copyright (c) 2014 Mark Billie & ThoughtWorks, Inc.
2
2
 
3
3
  MIT License
4
4
 
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). Obviously it does not check against the subjective elements of the styleguide.
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, but should support 1.9.3 and up (stylr uses the Ripper found in 1.9.3+; in 1.8.7, Ripper has been backported [here](https://github.com/lsegal/ripper18)). 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
 
@@ -102,7 +102,9 @@ class Lint
102
102
  /\bmodule_eval\b/ => :used_module_eval,
103
103
  /\binstance_eval\b/ => :used_instance_eval,
104
104
  /\bdefine_method\b/ => :used_define_method,
105
- /\w+\.send.*".*#\{/ => :dynamic_invocation
105
+ /\w+\.send.*".*#\{/ => :dynamic_invocation,
106
+ /def\s+method_missing/ => :used_method_missing,
107
+ /def\s+respond_to_missing\?/ => :used_respond_to_missing
106
108
  }.delete_if { |_, v| !@config[v.to_s] }
107
109
 
108
110
  @commented_line = [
@@ -124,6 +126,8 @@ class Lint
124
126
  :used_class_eval => "Used class_eval.",
125
127
  :used_module_eval => "Used module_eval.",
126
128
  :used_instance_eval => "Used instance_eval.",
129
+ :used_method_missing => "Please do not override method_missing.",
130
+ :used_respond_to_missing => "Please do not use respond_to_missing?.",
127
131
  :paren_spacing => "Space after ( or before ).",
128
132
  :bracket_spacing => "Space after [ or before ].",
129
133
  :brace_spacing => "No space around { or before }.",
@@ -1,3 +1,3 @@
1
1
  module Stylr
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -270,6 +270,14 @@ module Stylr
270
270
  it "and even instance eval!" do
271
271
  l.meta_violation?("instance_eval &block").should be_true
272
272
  end
273
+
274
+ it "checks for method_missing of course" do
275
+ l.meta_violation?("def method_missing").should be_true
276
+ end
277
+
278
+ it "also checks for respond_to_missing" do
279
+ l.meta_violation?("def respond_to_missing?").should be_true
280
+ end
273
281
  end
274
282
 
275
283
  context "#exception_violation?" do
data/stylr.yml CHANGED
@@ -18,5 +18,7 @@ used_class_eval: true
18
18
  used_module_eval: true
19
19
  used_instance_eval: true
20
20
  used_define_method: true
21
+ used_method_missing: true
22
+ used_respond_to_missing: true
21
23
  dynamic_invocation: true
22
24
  triple_equals: true
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.12
4
+ version: 0.0.13
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-11 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: main
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.2.0.rc.1
136
+ rubygems_version: 2.2.1
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: stylr - enforcing Ruby coding style standards