dead_code_terminator 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 35a0026a3312154a1c97d73ae012b264a34c32c9d338737aa22ac6922f8635ad
4
- data.tar.gz: '079e266498ab09e5a82568a189418befc50890ef7461eecb2b1bce54f5cc7a75'
3
+ metadata.gz: '0594405128f563ed209b13acac45f6d1dcfebb56c36f51bee071cab04e208ecf'
4
+ data.tar.gz: 3c16615d8ed48a12d1284908a35e580d90c008eb85ec4e7c3aa94a133fe0e775
5
5
  SHA512:
6
- metadata.gz: fc50239484be93bda9bcb7d015cece2b06f5a4dcc091861b304ead379a0f4253de8195cb1581fe630df122ec8f4c196f311580d636ad8d91691c47c84585622d
7
- data.tar.gz: 3ee1ca75f87a1402e1b6e14d7f9d390300759340aef3445d5ed8ab9dd39259056963c5fbe815bebe30413f60ca79a96d08c3cbdc762b8111c89ff83ace3f3d63
6
+ metadata.gz: 215e88c2977706899fb2d312b483cd46e8d9311f1cb411f62d9cce8a3d64fce29891ebdaf02497fb9e200efc805830af06104840a9e9da0bdc825f3a2085933b
7
+ data.tar.gz: aeb91248beb05727ae810e98833a70c19df8e6b34f6641a40d477a3f71773943453cdcf8aa706387002ba04db471acdb33c15afcf234b3a93f6aadac4d845c19
@@ -14,3 +14,6 @@ jobs:
14
14
  bundler-cache: true
15
15
  - name: Run the default task
16
16
  run: bundle exec rake
17
+ env:
18
+ CI: true
19
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  Gemfile.lock
13
+ *gem
data/.rubocop.yml CHANGED
@@ -23,15 +23,6 @@ Layout/TrailingWhitespace:
23
23
  Lint/BooleanSymbol:
24
24
  Enabled: false
25
25
 
26
- # Metrics/AbcSize:
27
- # Enabled: false
28
-
29
- # Metrics/MethodLength:
30
- # Enabled: false
31
-
32
26
  Metrics/BlockLength:
33
27
  Exclude:
34
28
  - spec/**/*rb
35
-
36
- # Lint/UnusedMethodArgument:
37
- # Enabled: false
data/Gemfile CHANGED
@@ -13,4 +13,7 @@ gem "rubocop", "~> 1.7"
13
13
  gem "rubocop-rake", "~> 0.5"
14
14
  gem "rubocop-rspec", "~> 2.3"
15
15
 
16
+ gem "codecov", require: false
17
+ gem "simplecov", "~> 0.21"
18
+
16
19
  gem "pry-byebug" unless ENV["CI"]
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # DeadCodeTerminator
2
2
 
3
+ ![ci](https://github.com/razum2um/dead_code_terminator/actions/workflows/main.yml/badge.svg)
4
+ [![gem](https://badge.fury.io/rb/dead_code_terminator.svg)](https://rubygems.org/gems/dead_code_terminator)
5
+ [![codecov](https://codecov.io/gh/razum2um/dead_code_terminator/branch/master/graph/badge.svg)](https://app.codecov.io/gh/razum2um/dead_code_terminator)
6
+
3
7
  This acts like [webpack's DefinePlugin](https://webpack.js.org/plugins/define-plugin/) with minification pass. It allows to eliminate dead code statically, which can be required by regulations.
4
8
 
5
9
  ```ruby
@@ -53,11 +53,7 @@ module DeadCodeTerminator
53
53
  @rewriter ||= Parser::Source::TreeRewriter.new(buf)
54
54
  end
55
55
 
56
- def range(from, len = nil)
57
- unless len
58
- len = from.end - from.begin
59
- from = from.begin
60
- end
56
+ def range(from, len)
61
57
  Parser::Source::Range.new(buf, from, from + len)
62
58
  end
63
59
 
@@ -81,6 +77,8 @@ module DeadCodeTerminator
81
77
  return else_branch if value == Cond::Base::ELSE
82
78
  end
83
79
  end
80
+
81
+ ast
84
82
  end
85
83
  end
86
84
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeadCodeTerminator
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dead_code_terminator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Bokov