rspec-core 3.1.4 → 3.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8d443beb68dc62c6262fe56753f49aaf78d185a
4
- data.tar.gz: 09e2c21ad474f97b97ace68c74d63e1c1d64e289
3
+ metadata.gz: 35ac596a199f064ae9b3002b53abd89c610828a0
4
+ data.tar.gz: 79d6993acfd0a779f412dbaeb76fbd69a76c3fe6
5
5
  SHA512:
6
- metadata.gz: 17c41f5e26ba11c31020e0f6be81192f9045578721b005a0594db764a53f16280abb8ab0e462f3a58680abf4cd62068e800a6eb7eb70b1fa0c79dacd7973e353
7
- data.tar.gz: daa45d7357c26db4db246e35292c5783281b5340c93fac275a1ac9917460ad1ea3a2b18b1b35f4692c96bbf630ce0df7aa547c310b515d24187b893b6af6e786
6
+ metadata.gz: e8c9201434ac482cc45b97a9e9d879e4877879339c1cc13bf77fd14ec7c385e9c3ccb6c7ea3c8042d220f71fab8140102d57f3561e512037be7a038e382c034d
7
+ data.tar.gz: 3325b9ab89c7aa273354e0db5c55ab17e2d1c1b92870cf2d3e6d90f7c81428ff68d024c515cf54c26440c43f43dd603a1e23c82d5f4428b773183610b55ad008
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,16 @@
1
+ ### 3.1.5 / 2014-09-29
2
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.1.4...v3.1.5)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix issue with the rake task incorrectly escaping strings on Windows.
7
+ (Jon Rowe #1718)
8
+ * Support absolute path patterns. While this wasn't officially supported
9
+ previously, setting `rake_task.pattern` to an absolute path pattern in
10
+ RSpec 3.0 and before worked since it delegated to `FileList` internally
11
+ (but now just forwards the pattern on to the `rspec` command).
12
+ (Myron Marston, #1726)
13
+
1
14
  ### 3.1.4 / 2014-09-18
2
15
  [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.1.3...v3.1.4)
3
16
 
@@ -1336,9 +1336,28 @@ module RSpec
1336
1336
  end
1337
1337
 
1338
1338
  def get_matching_files(path, pattern)
1339
+ Dir[file_glob_from(path, pattern)].map { |file| File.expand_path(file) }
1340
+ end
1341
+
1342
+ def file_glob_from(path, pattern)
1339
1343
  stripped = "{#{pattern.gsub(/\s*,\s*/, ',')}}"
1340
- files = (pattern =~ /^(\.\/)?#{Regexp.escape path}/) ? Dir[stripped] : Dir["#{path}/#{stripped}"]
1341
- files.map { |file| File.expand_path(file) }
1344
+ return stripped if pattern =~ /^(\.\/)?#{Regexp.escape path}/ || absolute_pattern?(pattern)
1345
+ File.join(path, stripped)
1346
+ end
1347
+
1348
+ if RSpec::Support::OS.windows?
1349
+ def absolute_pattern?(pattern)
1350
+ pattern =~ /\A[A-Z]:\\/ || windows_absolute_network_path?(pattern)
1351
+ end
1352
+
1353
+ def windows_absolute_network_path?(pattern)
1354
+ return false unless ::File::ALT_SEPARATOR
1355
+ pattern.start_with?(::File::ALT_SEPARATOR + ::File::ALT_SEPARATOR)
1356
+ end
1357
+ else
1358
+ def absolute_pattern?(pattern)
1359
+ pattern.start_with?(File::Separator)
1360
+ end
1342
1361
  end
1343
1362
 
1344
1363
  def extract_location(path)
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/tasklib'
3
- require 'shellwords'
3
+ require 'rbconfig'
4
4
 
5
5
  module RSpec
6
6
  module Core
@@ -115,7 +115,7 @@ module RSpec
115
115
  if ENV['SPEC']
116
116
  FileList[ ENV['SPEC']].sort
117
117
  elsif String === pattern && !File.exist?(pattern)
118
- "--pattern #{pattern.shellescape}"
118
+ "--pattern #{escape pattern}"
119
119
  else
120
120
  # Before RSpec 3.1, we used `FileList` to get the list of matched files, and
121
121
  # then pass that along to the `rspec` command. Starting with 3.1, we prefer to
@@ -135,12 +135,26 @@ module RSpec
135
135
  # a `pattern` option that will not work with `--pattern`.
136
136
  #
137
137
  # TODO: consider deprecating support for this and removing it in RSpec 4.
138
- FileList[pattern].sort.map(&:shellescape)
138
+ FileList[pattern].sort.map { |file| escape file }
139
+ end
140
+ end
141
+
142
+ # Manaully comparing because in 3.2 we have RSpec::Support::OS.windows?
143
+ # but in 3.1 we don't and requiring rspec/world would be weighty here.
144
+ if RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
145
+ def escape(shell_command)
146
+ "'#{shell_command.gsub("'", "\'")}'"
147
+ end
148
+ else
149
+ require 'shellwords'
150
+
151
+ def escape(shell_command)
152
+ shell_command.shellescape
139
153
  end
140
154
  end
141
155
 
142
156
  def file_exclusion_specification
143
- " --exclude-pattern #{exclude_pattern.shellescape}" if exclude_pattern
157
+ " --exclude-pattern #{escape exclude_pattern}" if exclude_pattern
144
158
  end
145
159
 
146
160
  def spec_command
@@ -165,7 +179,7 @@ module RSpec
165
179
  /#{File::SEPARATOR}rspec-(core|support)[^#{File::SEPARATOR}]*#{File::SEPARATOR}lib/
166
180
  )
167
181
 
168
- "-I#{core_and_support.map(&:shellescape).join(File::PATH_SEPARATOR)}"
182
+ "-I#{core_and_support.map { |file| escape file }.join(File::PATH_SEPARATOR)}"
169
183
  end
170
184
  end
171
185
  end
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec Core.
4
4
  module Version
5
5
  # Current version of RSpec Core, in semantic versioning format.
6
- STRING = '3.1.4'
6
+ STRING = '3.1.5'
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,5 @@
1
+ require 'rbconfig'
2
+
1
3
  module RSpec
2
4
  module Core
3
5
  # @api private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -34,7 +34,7 @@ cert_chain:
34
34
  1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
35
35
  muA=
36
36
  -----END CERTIFICATE-----
37
- date: 2014-09-18 00:00:00.000000000 Z
37
+ date: 2014-09-30 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: rspec-support
@@ -266,6 +266,6 @@ rubyforge_project: rspec
266
266
  rubygems_version: 2.2.2
267
267
  signing_key:
268
268
  specification_version: 4
269
- summary: rspec-core-3.1.4
269
+ summary: rspec-core-3.1.5
270
270
  test_files: []
271
271
  has_rdoc:
metadata.gz.sig CHANGED
Binary file