deep-cover 0.1.10 → 0.1.11
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 +4 -4
- data/.rspec +1 -1
- data/.travis.yml +2 -0
- data/README.md +1 -1
- data/Rakefile +22 -0
- data/lib/deep_cover/node/case.rb +1 -1
- data/lib/deep_cover/node/empty_body.rb +9 -0
- data/lib/deep_cover/node/exceptions.rb +3 -3
- data/lib/deep_cover/parser_ext/range.rb +0 -5
- data/lib/deep_cover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 225bf8880e8e652cc99f0ac252fcdc19f52f8c6b
|
4
|
+
data.tar.gz: de20db239ece7cf37f8a8ea0bf01666dba80b879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c220edee5a7801901da5d21dae7f6fdf5a8de65edfc2c9e364466af86b1fd118683b20f34079f6fe79db3ab014912e74642eb3b78e08445210b2d96febc7166d
|
7
|
+
data.tar.gz: d45b80607275d437993728bb0a7ca90f5f434f7b59d54ab5eb7964bb2be6d432f5b4a4ec3945f70812f45490ba090eb2c479e9672167943264a4e08dd7690000
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -98,7 +98,7 @@ puts DeepCover.line_coverage('foo')
|
|
98
98
|
|
99
99
|
## Development
|
100
100
|
|
101
|
-
After checking out the repo, run `bundle` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
101
|
+
After checking out the repo, run `bundle` then `rake dev:install` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
102
102
|
|
103
103
|
For detailed analysis:
|
104
104
|
|
data/Rakefile
CHANGED
@@ -4,3 +4,25 @@ require "rspec/core/rake_task"
|
|
4
4
|
RSpec::Core::RakeTask.new(:spec).tap{|task| task.pattern = "spec/*_spec.rb, spec/*/*_spec.rb"}
|
5
5
|
|
6
6
|
task :default => :spec
|
7
|
+
|
8
|
+
|
9
|
+
namespace :dev do
|
10
|
+
desc "Setup extra things required to run the spec suite"
|
11
|
+
task :install do
|
12
|
+
commands = []
|
13
|
+
|
14
|
+
if RUBY_VERSION >= '2.2.2' && (!defined?(RUBY_ENGINE) || RUBY_ENGINE != 'jruby')
|
15
|
+
commands << 'bundle install --gemfile=spec/full_usage/rails51_project/Gemfile'
|
16
|
+
end
|
17
|
+
|
18
|
+
commands.each do |command|
|
19
|
+
puts "Running: #{command}"
|
20
|
+
unless system(command)
|
21
|
+
puts "Failed to run `#{command}`, see above for details. When it is fixed, try running this rake task again."
|
22
|
+
exit(1)
|
23
|
+
end
|
24
|
+
puts "Command succeeded: #{command}"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/deep_cover/node/case.rb
CHANGED
@@ -17,5 +17,14 @@ module DeepCover
|
|
17
17
|
def is_statement
|
18
18
|
false
|
19
19
|
end
|
20
|
+
|
21
|
+
# When parent rewrites us, the %{node} must always be at the beginning because our location can
|
22
|
+
# also be rewritten by out parent, and we want the rewrite to be after it.
|
23
|
+
def rewriting_rules
|
24
|
+
rules = super
|
25
|
+
rules.map do |expression, rule|
|
26
|
+
[expression, "%{node};#{rule.sub('%{node}', 'nil;')}"]
|
27
|
+
end
|
28
|
+
end
|
20
29
|
end
|
21
30
|
end
|
@@ -8,7 +8,7 @@ module DeepCover
|
|
8
8
|
has_child exception: [Node::Array, nil]
|
9
9
|
has_child assignment: [Lvasgn, nil], flow_entry_count: :entered_body_tracker_hits
|
10
10
|
has_child body: Node,
|
11
|
-
can_be_empty: -> { base_node.loc.expression.
|
11
|
+
can_be_empty: -> { base_node.loc.expression.end },
|
12
12
|
flow_entry_count: :entered_body_tracker_hits,
|
13
13
|
is_statement: true,
|
14
14
|
rewrite: '((%{entered_body_tracker};%{local}=nil;%{node}))'
|
@@ -28,7 +28,7 @@ module DeepCover
|
|
28
28
|
is_statement: true
|
29
29
|
has_extra_children resbodies: Resbody
|
30
30
|
has_child else: Node,
|
31
|
-
can_be_empty: -> { base_node.loc.expression.
|
31
|
+
can_be_empty: -> { base_node.loc.expression.end },
|
32
32
|
flow_entry_count: :execution_count,
|
33
33
|
is_statement: true
|
34
34
|
executed_loc_keys :else
|
@@ -62,7 +62,7 @@ module DeepCover
|
|
62
62
|
can_be_empty: -> { base_node.loc.expression.begin },
|
63
63
|
is_statement: true
|
64
64
|
has_child ensure: Node,
|
65
|
-
can_be_empty: -> { base_node.loc.expression.
|
65
|
+
can_be_empty: -> { base_node.loc.expression.end },
|
66
66
|
is_statement: true,
|
67
67
|
flow_entry_count: -> { body.flow_entry_count }
|
68
68
|
|
@@ -3,11 +3,6 @@ class Parser::Source::Range
|
|
3
3
|
Parser::Source::Range.new(@source_buffer, begin_pos, end_pos)
|
4
4
|
end
|
5
5
|
|
6
|
-
# Similar to `end`, but is just after the current Range
|
7
|
-
def succ
|
8
|
-
with begin_pos: @end_pos+1, end_pos: @end_pos+1
|
9
|
-
end
|
10
|
-
|
11
6
|
# (1...10).split(2...3, 6...8) => [1...2, 3...6, 7...10]
|
12
7
|
# Assumes inner_ranges are exclusive, and included in self
|
13
8
|
def split(*inner_ranges)
|
data/lib/deep_cover/version.rb
CHANGED