deep-cover 0.7.0 → 0.7.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: 8b1f81b23d211ad08949890b4bc4267613e18b566b5e8129aa2ec575cc1cf28e
4
- data.tar.gz: 3f80f743ba78813f2218aeed63bc9a8ba889447f446367f1df34a9054b59bb8b
3
+ metadata.gz: f31d42c2a220b9de98c530372bf1990b2ac17080b58e1c8c22a68018b9e77c49
4
+ data.tar.gz: 75959af396239daf95c3efd80e1f3b5fc75a0361baaa6fd0e66caea8eda6a768
5
5
  SHA512:
6
- metadata.gz: e0763b964b08399a871dc36b4da0bd0b227a58eabf15c98b0144abae98222d0fb44a67ed4ea11cf91c64350bef1072d539c5f45f6075043f2b6a559a4cc6a24d
7
- data.tar.gz: 342d74b8ffbc0c56c062635c66b799ae9926fecf060d3d62188adcb6aea09a957ae3a3d97b4662c1538ef407bbdc60888675930f3db4f2fc20b75c35eca3da82
6
+ metadata.gz: 15f6425a117f94fd89998e6977b1a7095775ffd7762b640620d8e82f1cca9f1a62c9370fe7bb93f96822653023f25a1e3e81782a0e9de6e12af1b9c28ce01513
7
+ data.tar.gz: 64dc5b3714f9504817f8eb344cbdbf1cd46504655c2a4ee4f9d35ff29d191699ba64783d066236908fff1d3eb40b7a98b51eccaa68d36a29116267191aaeadaa
@@ -7,8 +7,23 @@ AllCops:
7
7
  - '**/spec/specs_tools.rb'
8
8
  - 'bin/**/*'
9
9
  - '_*/**/*'
10
- TargetRubyVersion: 2.1
10
+ TargetRubyVersion: 2.2
11
11
 
12
+ Gemspec/RequiredRubyVersion:
13
+ # Yes, we still support ruby 2.1...
14
+ Enabled: false
15
+
16
+ Layout/AlignHash:
17
+ Enabled: false
18
+
19
+ Layout/ClosingParenthesisIndentation:
20
+ # It seems to want to indent things more than they should be...
21
+ # Not sure I like where the discussion is going...
22
+ # https://github.com/rubocop-hq/rubocop/issues/5975
23
+ Enabled: false
24
+
25
+ Layout/EmptyLineAfterGuardClause:
26
+ Enabled: false
12
27
 
13
28
  Layout/EmptyLines:
14
29
  Enabled: false
@@ -34,6 +49,9 @@ Layout/MultilineArrayBraceLayout:
34
49
  Layout/MultilineHashBraceLayout:
35
50
  EnforcedStyle: new_line
36
51
 
52
+ Layout/RescueEnsureAlignment:
53
+ Enabled: false
54
+
37
55
  # Annoying when used with some api that have blocks with sometimes useful parameters
38
56
  Lint/UnusedBlockArgument:
39
57
  Enabled: false
@@ -80,6 +98,9 @@ Performance/RedundantBlockCall:
80
98
  Rails/FilePath:
81
99
  Enabled: false
82
100
 
101
+ Style/AccessModifierDeclarations:
102
+ Enabled: false
103
+
83
104
  Style/AsciiComments:
84
105
  Enabled: false
85
106
 
@@ -2,21 +2,20 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - ruby-head
5
+ - 2.6.0
5
6
  - 2.5.0
6
7
  - 2.4.1
7
8
  - 2.3.4
8
9
  - 2.2.7
9
10
  - 2.1.10
11
+ - jruby-head
10
12
  - jruby-9.1.9.0
11
- before_install:
12
- - gem update --system
13
+
14
+ install:
13
15
  - gem install bundler
16
+ - rake dev:install
14
17
  - npm install -g nyc
15
- before_script:
16
- - bundle exec rake dev:install
17
18
  script:
18
19
  - bundle exec rake test:all
19
20
  matrix:
20
21
  allow_failures:
21
- - rvm: jruby-9.1.9.0
22
- - rvm: ruby-head
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ * We now officially support JRuby. Our test-suite passes with it.
4
+
3
5
  ## 0.7.0
4
6
 
5
7
  * Switched CLI to rely on Thor instead of Slop
data/Rakefile CHANGED
@@ -19,12 +19,17 @@ task release: ['core:sass', 'core:release', 'global:release']
19
19
 
20
20
  ### Tests tasks
21
21
  begin
22
- require 'rspec/core/rake_task'
23
22
  require 'rubocop/rake_task'
24
23
 
25
24
  RuboCop::RakeTask.new(:rubocop) do |t|
26
25
  t.options = ['-a'] unless ENV['TRAVIS']
27
26
  end
27
+ rescue LoadError
28
+ puts 'Note: rubocop not installed'
29
+ end
30
+
31
+ begin
32
+ require 'rspec/core/rake_task'
28
33
 
29
34
  spec_path = 'spec/*_spec.rb, core_gem/spec/**/*_spec.rb'
30
35
  RSpec::Core::RakeTask.new(:spec).tap { |task| task.pattern = spec_path }
@@ -34,13 +39,13 @@ begin
34
39
  task.pattern = spec_path
35
40
  task.rspec_opts = '-O .rspec_all'
36
41
  end
37
-
38
- multitask default: RUBY_VERSION > '2.1' ? [:rubocop, :spec] : :spec
39
- multitask 'test:all' => RUBY_VERSION > '2.1' ? [:rubocop, 'spec:all'] : 'spec:all'
40
42
  rescue LoadError
41
- puts 'Note: rspec or rubocop not installed'
43
+ puts 'Note: rspec not installed'
42
44
  end
43
45
 
46
+ multitask default: RUBY_VERSION > '2.2' ? [:rubocop, :spec] : :spec
47
+ multitask 'test:all' => RUBY_VERSION > '2.2' ? [:rubocop, 'spec:all'] : 'spec:all'
48
+
44
49
  #### Utilities
45
50
  namespace :dev do
46
51
  desc 'Self cover'
@@ -54,13 +59,14 @@ namespace :dev do
54
59
  task :install do
55
60
  commands = []
56
61
 
57
- if RUBY_VERSION >= '2.2.2' && (!defined?(RUBY_ENGINE) || RUBY_ENGINE != 'jruby')
58
- commands << 'bundle install --gemfile=core_gem/spec/code_fixtures/rails51_project/Gemfile'
59
- end
60
- commands << 'bundle install --gemfile=spec/code_fixtures/simple_rails42_app/Gemfile'
61
- commands << 'bundle install --gemfile=spec/code_fixtures/rails_like_gem/Gemfile'
62
- commands << 'bundle install --gemfile=core_gem/Gemfile'
63
- commands << 'bundle install'
62
+ gemfiles = ['',
63
+ 'core_gem/Gemfile',
64
+ 'spec/code_fixtures/simple_rails42_app/Gemfile',
65
+ 'spec/code_fixtures/rails_like_gem/Gemfile',
66
+ ]
67
+ gemfiles << 'core_gem/spec/code_fixtures/rails51_project/Gemfile' if RUBY_VERSION >= '2.2.2' && RUBY_PLATFORM != 'java'
68
+
69
+ commands += gemfiles.map { |gemfile| "bundle install --gemfile=#{gemfile} --jobs=3 --retry=3" }
64
70
 
65
71
  commands.each do |command|
66
72
  puts "Running: #{command}"
@@ -27,16 +27,17 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency 'deep-cover-core', DeepCover::VERSION
28
28
 
29
29
  # CLI
30
- spec.add_runtime_dependency 'bundler'
31
30
  spec.add_runtime_dependency 'highline'
32
31
  spec.add_runtime_dependency 'thor', '>= 0.20.3'
33
32
  spec.add_runtime_dependency 'with_progress'
34
33
 
35
34
  ### Dev dependencies
36
35
  spec.add_development_dependency 'bundler', '~> 1.15'
37
- spec.add_development_dependency 'psych', '>= 2.0'
38
36
  spec.add_development_dependency 'rake', '~> 12.0'
39
37
  spec.add_development_dependency 'rspec', '~> 3.0'
40
- spec.add_development_dependency 'rubocop', '0.53.0' # About every single release breaks something
41
38
  spec.add_development_dependency 'sass'
39
+
40
+ # About every single release breaks something
41
+ # Ruby 2.1 is no longer supported
42
+ spec.add_development_dependency 'rubocop', '0.61.1' if RUBY_VERSION >= '2.2.0'
42
43
  end
@@ -66,7 +66,7 @@ module DeepCover
66
66
  root_path = File.expand_path(options[:change_directory])
67
67
  unless File.exist?(root_path)
68
68
  warn set_color(DeepCover::Tools.strip_heredoc(<<-MSG), :red)
69
- bad value for option --change_directory: #{root_path.inspect} is not a valid directory
69
+ bad value for option --change-directory: #{root_path.inspect} is not a valid directory
70
70
  MSG
71
71
  exit(1)
72
72
  end
@@ -27,8 +27,7 @@ module DeepCover
27
27
  }
28
28
 
29
29
  DeepCover.delete_trackers
30
- system(env_var, *command_parts)
31
- exit_code = $?.exitstatus
30
+ exit_code = Tools.run_command_or_exit(shell, env_var, *command_parts)
32
31
  coverage = Coverage.load
33
32
  puts coverage.report(**processed_options)
34
33
  exit(exit_code)
@@ -20,17 +20,8 @@ module DeepCover
20
20
  'DEEP_COVER_OPTIONS' => YAML.dump(processed_options.slice(*DEFAULTS.keys)),
21
21
  }
22
22
 
23
- # Clear inspiration from Bundler's kernel_exec
24
- # https://github.com/bundler/bundler/blob/d44d803357506895555ff97f73e60d593820a0de/lib/bundler/cli/exec.rb#L50
25
- begin
26
- Kernel.exec(env_var, *command_parts)
27
- rescue Errno::EACCES, Errno::ENOEXEC
28
- warn set_color("not executable: #{command_parts.first}", :red)
29
- exit 126 # Default exit code for that
30
- rescue Errno::ENOENT
31
- warn set_color("command not found: #{command_parts.first}", :red)
32
- exit 127 # Default exit code for that
33
- end
23
+ exit_code = Tools.run_command_or_exit(shell, env_var, *command_parts)
24
+ exit(exit_code)
34
25
  end
35
26
  end
36
27
  end
@@ -13,6 +13,25 @@ module DeepCover
13
13
  remains = commands - matching
14
14
  [matching, remains]
15
15
  end
16
+
17
+ # Basically does the same as Kernel.system, but:
18
+ # * exits with an error message when unable to start the command
19
+ # * returns the error code instead of just true/false
20
+ def self.run_command_or_exit(shell, env_var, *command_parts)
21
+ # Clear inspiration from Bundler's kernel_exec
22
+ # https://github.com/bundler/bundler/blob/d44d803357506895555ff97f73e60d593820a0de/lib/bundler/cli/exec.rb#L50
23
+ begin
24
+ pid = Kernel.spawn(env_var, *command_parts)
25
+ rescue Errno::EACCES, Errno::ENOEXEC
26
+ warn shell.set_color("not executable: #{command_parts.first}", :red)
27
+ exit 126 # Default exit code for that
28
+ rescue Errno::ENOENT
29
+ warn shell.set_color("command not found: #{command_parts.first}", :red)
30
+ exit 127 # Default exit code for that
31
+ end
32
+ Process.wait pid
33
+ $?.exitstatus
34
+ end
16
35
  end
17
36
  end
18
37
  end
@@ -42,7 +42,15 @@ module DeepCover
42
42
 
43
43
  def create_entry_point_file
44
44
  require 'tempfile'
45
- file = Tempfile.new(['deep_cover_entry_point', '.rb'])
45
+
46
+ file = nil
47
+ # Basically creating a Tempfile, but we don't want it to be automatically removed...
48
+ # We can't use `ObjectSpace.undefine_finalizer` because it doesn't appear to work on JRuby.
49
+ # Simplified code straight from `Tempfile#initialize`
50
+ ::Dir::Tmpname.create(['deep_cover_entry_point', '.rb']) do |tmpname|
51
+ file = File.open(tmpname, File::RDWR | File::CREAT | File::EXCL, perm: 0o600)
52
+ end
53
+
46
54
  template = File.read(DeepCover::CORE_GEM_LIB_DIRECTORY + '/deep_cover/setup/clone_mode_entry_template.rb')
47
55
 
48
56
  cache_directory = DeepCover.config.cache_directory.to_s
@@ -56,9 +64,6 @@ module DeepCover
56
64
  file.write(template)
57
65
  file.close
58
66
 
59
- # We dont want the file to be removed, this way it stays as long as the clones directory does.
60
- ObjectSpace.undefine_finalizer(file)
61
-
62
67
  file.path
63
68
  end
64
69
 
@@ -104,8 +109,12 @@ module DeepCover
104
109
 
105
110
  def process
106
111
  DeepCover.delete_trackers
107
- system({'DISABLE_SPRING' => 'true', 'DEEP_COVER_OPTIONS' => nil}, *@options[:command], chdir: @main_path)
108
- $?.exitstatus
112
+ # JRuby has a weird behavior with chdir. You can't use it with system if you already did a Dir.chdir (which
113
+ # we may have done to handle the --change-directory option)...
114
+ Dir.chdir(@main_path) do
115
+ system({'DISABLE_SPRING' => 'true', 'DEEP_COVER_OPTIONS' => nil}, *@options[:command])
116
+ $?.exitstatus
117
+ end
109
118
  end
110
119
 
111
120
  def report
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep-cover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-11-20 00:00:00.000000000 Z
12
+ date: 2018-12-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deep-cover-core
@@ -17,28 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.7.0
20
+ version: 0.7.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.7.0
28
- - !ruby/object:Gem::Dependency
29
- name: bundler
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
27
+ version: 0.7.1
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: highline
44
30
  requirement: !ruby/object:Gem::Requirement
@@ -95,20 +81,6 @@ dependencies:
95
81
  - - "~>"
96
82
  - !ruby/object:Gem::Version
97
83
  version: '1.15'
98
- - !ruby/object:Gem::Dependency
99
- name: psych
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '2.0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '2.0'
112
84
  - !ruby/object:Gem::Dependency
113
85
  name: rake
114
86
  requirement: !ruby/object:Gem::Requirement
@@ -138,33 +110,33 @@ dependencies:
138
110
  - !ruby/object:Gem::Version
139
111
  version: '3.0'
140
112
  - !ruby/object:Gem::Dependency
141
- name: rubocop
113
+ name: sass
142
114
  requirement: !ruby/object:Gem::Requirement
143
115
  requirements:
144
- - - '='
116
+ - - ">="
145
117
  - !ruby/object:Gem::Version
146
- version: 0.53.0
118
+ version: '0'
147
119
  type: :development
148
120
  prerelease: false
149
121
  version_requirements: !ruby/object:Gem::Requirement
150
122
  requirements:
151
- - - '='
123
+ - - ">="
152
124
  - !ruby/object:Gem::Version
153
- version: 0.53.0
125
+ version: '0'
154
126
  - !ruby/object:Gem::Dependency
155
- name: sass
127
+ name: rubocop
156
128
  requirement: !ruby/object:Gem::Requirement
157
129
  requirements:
158
- - - ">="
130
+ - - '='
159
131
  - !ruby/object:Gem::Version
160
- version: '0'
132
+ version: 0.61.1
161
133
  type: :development
162
134
  prerelease: false
163
135
  version_requirements: !ruby/object:Gem::Requirement
164
136
  requirements:
165
- - - ">="
137
+ - - '='
166
138
  - !ruby/object:Gem::Version
167
- version: '0'
139
+ version: 0.61.1
168
140
  description: expression and branch coverage for Ruby.
169
141
  email:
170
142
  - github@marc-andre.ca
@@ -224,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
196
  version: '0'
225
197
  requirements: []
226
198
  rubyforge_project:
227
- rubygems_version: 2.7.7
199
+ rubygems_version: 2.7.6
228
200
  signing_key:
229
201
  specification_version: 4
230
202
  summary: In depth coverage of your Ruby code.