cane-hashcheck 0.9.0 → 1.0.0

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: 9e4a26f7dc5ae8c65a46f15a0cca16f037b33039
4
- data.tar.gz: c65ff8d79d6d702cdab50fb4c421af67efc67507
3
+ metadata.gz: ad5b2a9165abf78a92dcc3580fe11c26c96e831f
4
+ data.tar.gz: 75b1346acb4d209e86cfbf30c23f51177d02c8fb
5
5
  SHA512:
6
- metadata.gz: 374483c36079cd117b187481ab44d033e250594cb5c72cecc0b814005c52b56a092aea70803ced38a05b69ae5838c23a122acc4594c62c8c869f1153268aebce
7
- data.tar.gz: 4093494b70d4f0c491100fb0216b1493c9e48862a8c1683fba7b5cd5161c3329323865fe675a4b11fab925d30ef8baab41166173303b6db76adafa974a414ed7
6
+ metadata.gz: 0c574db145582aa594f27c6ef0342c3bebcff6255e16825a9092a0ea5b63e4e492fb50df8bc2fb02be0f9ceec5c49451f5b2e1eaabfdceb7adc157e1ec8d0734
7
+ data.tar.gz: 908465e611ffb9146b74dd7fdde825d25f816d43eefdb8fcf1f862499a495bccf48df31c62e1ca5f8b36efd81b9fd2b6a7bf7ecb6a8166706655df156056538b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cane Hash Check
1
+ # cane-hashcheck
2
2
 
3
3
  `cane-hashcheck` enforces Ruby 1.9 hash syntax in your Ruby project using
4
4
  [cane](https://github.com/square/cane).
@@ -19,8 +19,8 @@ def options
19
19
  end
20
20
  ```
21
21
 
22
- When we run run our quality rake task, we are scolded for using the old hash
23
- syntax and encouraged to make a change on three lines:
22
+ When we run our quality rake task, we are scolded for using the old hash syntax
23
+ and encouraged to make a change on three lines:
24
24
 
25
25
  ```bash
26
26
  $ rake quality
@@ -49,7 +49,7 @@ module Cane
49
49
  end
50
50
 
51
51
  def invalid?(line)
52
- line =~ /([^'A-Z])\s+=>\s+/
52
+ line =~ /([^'"A-Z\d])\s+=>\s+/
53
53
  end
54
54
 
55
55
  def file_names
@@ -1,5 +1,5 @@
1
1
  module Cane
2
2
  module Hashcheck
3
- VERSION = '0.9.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -19,24 +19,28 @@ describe Cane::HashCheck do
19
19
  { :not => 'valid' }
20
20
  {
21
21
  totally: 'valid',
22
- :not => :valid,
23
- TOTALLY => :valid
22
+ :not => :valid,
23
+ TOTALLY => :valid,
24
+ 18 => 1 # this is valid, hash rockets are required for ints
25
+ }
26
+ {
27
+ 'also' => 'valid',
28
+ "and also" => 'valid'
24
29
  }
25
- { 'also' => 'valid' }
26
30
  RUBY
27
31
  end
28
32
 
29
- it 'has a violation for each hash rocket' do
33
+ it 'has a violation for each invalid hash rocket' do
30
34
  expect(subject.violations.count).to eq 2
31
35
  end
32
36
 
33
- it 'returns the offending file names' do
37
+ it 'puts the offending file name in the violation' do
34
38
  subject.violations.each do |violation|
35
39
  expect(violation[:file]).to eq file.path
36
40
  end
37
41
  end
38
42
 
39
- it 'returns the offending file lines' do
43
+ it 'puts the offending line number in the violation' do
40
44
  expect(subject.violations[0][:line]).to eq 2
41
45
  expect(subject.violations[1][:line]).to eq 5
42
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cane-hashcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-30 00:00:00.000000000 Z
11
+ date: 2013-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler