preval 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mergify.yml +10 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +4 -2
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +16 -16
- data/LICENSE +1 -1
- data/README.md +1 -0
- data/lib/preval/format.rb +3 -1
- data/lib/preval/version.rb +1 -1
- data/preval.gemspec +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d559e8c255c228460dbc054d0215d4cedd02db330c09791add966ede69e191c
|
4
|
+
data.tar.gz: 2367c273ffc505b30cecf509d2230c9ea87cd42ae6aa041366d8760c4298e247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe4455541218b8f592eed0a9fec19904adcedb769d8b2c7e3dc23a4e2922c8ba96c90f61ffc24b480866021c50403b43f4dac8e88a7819230bedbd267d93d51
|
7
|
+
data.tar.gz: 28135f03faebb4611188c5e38e9fa778267c3a9f7949380a5016bf0bf944033ede69b7241f123a8983f21660a262ab7ad550a3da3eb84b91069880478f5e9d86
|
data/.mergify.yml
ADDED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
preval (0.
|
4
|
+
preval (0.6.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.0)
|
10
|
-
bootsnap (1.4.
|
10
|
+
bootsnap (1.4.5)
|
11
11
|
msgpack (~> 1.0)
|
12
|
-
jaro_winkler (1.5.
|
13
|
-
minitest (5.
|
14
|
-
msgpack (1.
|
12
|
+
jaro_winkler (1.5.4)
|
13
|
+
minitest (5.13.0)
|
14
|
+
msgpack (1.3.1)
|
15
15
|
mustermann (1.0.3)
|
16
|
-
parallel (1.
|
17
|
-
parser (2.6.
|
16
|
+
parallel (1.19.1)
|
17
|
+
parser (2.6.5.0)
|
18
18
|
ast (~> 2.4.0)
|
19
|
-
rack (2.0.
|
20
|
-
rack-protection (2.0.
|
19
|
+
rack (2.0.8)
|
20
|
+
rack-protection (2.0.7)
|
21
21
|
rack
|
22
22
|
rainbow (3.0.0)
|
23
|
-
rake (
|
24
|
-
rubocop (0.
|
23
|
+
rake (13.0.1)
|
24
|
+
rubocop (0.78.0)
|
25
25
|
jaro_winkler (~> 1.5.1)
|
26
26
|
parallel (~> 1.10)
|
27
27
|
parser (>= 2.6)
|
@@ -29,12 +29,12 @@ GEM
|
|
29
29
|
ruby-progressbar (~> 1.7)
|
30
30
|
unicode-display_width (>= 1.4.0, < 1.7)
|
31
31
|
ruby-progressbar (1.10.1)
|
32
|
-
sinatra (2.0.
|
32
|
+
sinatra (2.0.7)
|
33
33
|
mustermann (~> 1.0)
|
34
34
|
rack (~> 2.0)
|
35
|
-
rack-protection (= 2.0.
|
35
|
+
rack-protection (= 2.0.7)
|
36
36
|
tilt (~> 2.0)
|
37
|
-
tilt (2.0.
|
37
|
+
tilt (2.0.10)
|
38
38
|
unicode-display_width (1.6.0)
|
39
39
|
|
40
40
|
PLATFORMS
|
@@ -45,9 +45,9 @@ DEPENDENCIES
|
|
45
45
|
bundler (~> 2.0)
|
46
46
|
minitest (~> 5.11)
|
47
47
|
preval!
|
48
|
-
rake (~>
|
48
|
+
rake (~> 13.0)
|
49
49
|
rubocop (~> 0.71)
|
50
50
|
sinatra
|
51
51
|
|
52
52
|
BUNDLED WITH
|
53
|
-
2.
|
53
|
+
2.1.2
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Preval
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.com/kddeisz/preval.svg?branch=master)](https://travis-ci.com/kddeisz/preval)
|
4
|
+
[![Gem](https://img.shields.io/gem/v/preval.svg)](https://rubygems.org/gems/preval)
|
4
5
|
|
5
6
|
`preval` is a gem that hooks into the Ruby compilation process and runs optimizations before it gets loaded by the virtual machine.
|
6
7
|
|
data/lib/preval/format.rb
CHANGED
@@ -20,6 +20,7 @@ module Preval
|
|
20
20
|
parts.join
|
21
21
|
end
|
22
22
|
to(:args_add_star) { starts_with?(:args_new) ? "*#{source(1)}" : "#{source(0)}, *#{source(1)}" }
|
23
|
+
to(:args_forward) { '...' }
|
23
24
|
to(:args_new) { '' }
|
24
25
|
to(:assign) { "#{source(0)} = #{source(1)}" }
|
25
26
|
to(:array) { body[0].nil? ? '[]' : "#{starts_with?(:args_add) ? '[' : ''}#{source(0)}]" }
|
@@ -72,6 +73,7 @@ module Preval
|
|
72
73
|
to(:if) { "if #{source(0)}\n#{source(1)}\n#{body[2] ? "#{source(2)}\n" : ''}end" }
|
73
74
|
to(:if_mod) { "#{source(1)} if #{source(0)}" }
|
74
75
|
to(:ifop) { "#{source(0)} ? #{source(1)} : #{source(2)}"}
|
76
|
+
to(:in) { "in #{source(0)}\n#{source(1)}" }
|
75
77
|
to(:kwrest_param) { "**#{body[0] ? source(0) : ''}" }
|
76
78
|
to(:lambda) { "->(#{starts_with?(:paren) ? body[0].body[0].to_source : source(0)}) { #{source(1)} }" }
|
77
79
|
to(:massign) { join(' = ') }
|
@@ -99,7 +101,7 @@ module Preval
|
|
99
101
|
parts << rest.to_source if rest
|
100
102
|
parts += post.map(&:to_source) if post
|
101
103
|
parts += kwargs.map { |(kwarg, value)| value ? "#{kwarg.to_source} #{value.to_source}" : kwarg.to_source } if kwargs
|
102
|
-
parts << kwarg_rest.to_source if kwarg_rest
|
104
|
+
parts << (kwarg_rest.is_a?(Symbol) ? "**#{kwarg_rest}" : kwarg_rest.to_source) if kwarg_rest
|
103
105
|
parts << block.to_source if block
|
104
106
|
|
105
107
|
parts.join(', ')
|
data/lib/preval/version.rb
CHANGED
data/preval.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
29
29
|
spec.add_development_dependency 'minitest', '~> 5.11'
|
30
|
-
spec.add_development_dependency 'rake', '~>
|
30
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
31
31
|
spec.add_development_dependency 'rubocop', '~> 0.71'
|
32
32
|
end
|
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
|
+
version: 0.6.0
|
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-
|
11
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubocop
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".mergify.yml"
|
77
78
|
- ".rubocop.yml"
|
78
79
|
- ".travis.yml"
|
79
80
|
- CHANGELOG.md
|
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
- !ruby/object:Gem::Version
|
122
123
|
version: '0'
|
123
124
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.1.2
|
125
126
|
signing_key:
|
126
127
|
specification_version: 4
|
127
128
|
summary: Automatically optimizes your Ruby code
|