preval 0.4.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: 9e8e8b1cc9579dafac71315c8138e9a07ece0a40e8c0e0ccdb3f9345574c4446
4
- data.tar.gz: 5bc5ccf467619084b2243f082466881e1f491ecb844cd622ff612b9c7242ae42
3
+ metadata.gz: a68492a84d002ce1287b7494fdeb2f7da2c1bf40f9001830c189b012679fff82
4
+ data.tar.gz: ee652180924518b7c95ecc4dd3d1453ad05bc72b87f550c8921b765fc1b17418
5
5
  SHA512:
6
- metadata.gz: aebce20a3d9332bf8e8eb20ea9f71789531b1462398713a22f9fb027c860aaee0d060bb94ddc6f400ceb1a6a94e0619638c54bedadcfa6eaea4a5cf3254cbb32
7
- data.tar.gz: 515570a0d77a859529530b9113a8309b974c9bf09c7117afc2eee605406725155d3f35995bcac674cd0d3577e4da00891faa189925a573dde08fdd3b2fc9cda6
6
+ metadata.gz: 79755ecb9e6b832a030d31052ffac72eccf86620562b7e82ec1b0f16a0dd5a9009e89c4c219ebad42a03984e144fbce042bd603b269b6970cdaf847e5c2969f4
7
+ data.tar.gz: 974140ac97093237681db2d8369a9ef295001bc6135dd6802ab55f35888627dbd571c4935a2d8091d6d2a6db17136eb9b3e5e55c1ac379c5388ceffc7c0d9ac7
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.1] - 2019-04-20
10
+ ### Changed
11
+ - Support `attr_writer` transformations even if there is a void statement at the beginning of the method.
12
+
9
13
  ## [0.4.0] - 2019-04-19
10
14
  ### Added
11
15
  - Replace `def foo=(value); @foo = value; end` with `attr_writer :foo`
@@ -36,7 +40,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
36
40
  ### Added
37
41
  - Initial release. 🎉
38
42
 
39
- [Unreleased]: https://github.com/kddeisz/preval/compare/v0.4.0...HEAD
43
+ [Unreleased]: https://github.com/kddeisz/preval/compare/v0.4.1...HEAD
44
+ [0.4.1]: https://github.com/kddeisz/preval/compare/v0.4.0...v0.4.1
40
45
  [0.4.0]: https://github.com/kddeisz/preval/compare/v0.3.0...v0.4.0
41
46
  [0.3.0]: https://github.com/kddeisz/preval/compare/v0.2.0...v0.3.0
42
47
  [0.2.0]: https://github.com/kddeisz/preval/compare/v0.1.0...v0.2.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- preval (0.4.0)
4
+ preval (0.4.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -11,7 +11,7 @@ get '/' do
11
11
  end
12
12
 
13
13
  post '/' do
14
- Preval.process(request.body.read).tap do |response|
14
+ Preval.process(request.body.read || '').tap do |response|
15
15
  halt 422 unless response
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Preval
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -29,10 +29,13 @@ module Preval
29
29
  # there is exactly one required param
30
30
  node[1, 0].body[1..-1].none? &&
31
31
  # there are no other params
32
- node[2, 0, 0, 0]&.is?(:stmts_new) &&
33
- # there is only one statement in the body
34
- node[2, 0, 1].is?(:assign) &&
35
- # the only statement is an assignment
32
+ (
33
+ node[2, 0].type_match?(:stmts_new, :assign) || (
34
+ node[2, 0, 0].type_match?(:stmts_new, :void_stmt) &&
35
+ node[2, 0].type_match?(:stmts_add, :assign)
36
+ )
37
+ ) &&
38
+ # there is only one statement in the body and it's an assignment
36
39
  node[2, 0, 1].type_match?(:var_field, :var_ref) &&
37
40
  # assigning a variable
38
41
  node[2, 0, 1, 0, 0].is?(:@ivar) &&
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preval
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Deisz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-19 00:00:00.000000000 Z
11
+ date: 2019-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler