rspec-support 3.1.0 → 3.1.1

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: 4617d19ee06926ebbcff3a74a7b9f4f4b33c5cea
4
- data.tar.gz: d604a3eea3884a0bfdb9e6752d0c9661cab04a57
3
+ metadata.gz: efadb64f091d8522dfb7255f4fe79bc84cb968cb
4
+ data.tar.gz: 82b59e13eaac79b3dc6e3e20416a2cc81232cc1d
5
5
  SHA512:
6
- metadata.gz: 7e1921b73a9af0bd4c3877d51eeac845c47708e1c3bfbe2c4a33a1501d41b2260ca567ee7f5e9c9f46d2102a5a85705c53d37dddf823eedf14fa07d826a649c4
7
- data.tar.gz: 98b5498e60ee2901a87243c33b28bc85f60d0815e7a04bf32fb69833dd5dd9f6973d81c52e9a46e726e15a3540ec3aef4987bfb1f5d2de63c6d51e622c4e05b4
6
+ metadata.gz: d53270f97d531e75a73efbb8312d0346374c6fb0cf0c2ac6cf9b70712b07a226e77c5992ef6af7653614ee10fbc2279c5015209cb61fbd2f4fb1d96057639336
7
+ data.tar.gz: 5dae6507a55c258d6ac3c061ae7d4f7a2d2fa8d05d3fd8b64c5d2b57703ae56c7c24c4f4c0744965c751ae6ca47d41dde88228be5adeaddb33f4964bc9dfcfc8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 3.1.1 / 2014-09-26
2
+ [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.1.0...v3.1.1)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix `RSpec::Support::DirectoryMaker` (used by `rspec --init` and
7
+ `rails generate rspec:install`) so that it detects absolute paths
8
+ on Windows properly. (Scott Archer, #107, #108, #109) (Jon Rowe, #110)
9
+
1
10
  ### 3.1.0 / 2014-09-04
2
11
  [Full Changelog](http://github.com/rspec/rspec-support/compare/v3.0.4...v3.1.0)
3
12
 
@@ -1,3 +1,5 @@
1
+ RSpec::Support.require_rspec_support 'os'
2
+
1
3
  module RSpec
2
4
  module Support
3
5
  # @api private
@@ -9,10 +11,9 @@ module RSpec
9
11
  #
10
12
  # Implements nested directory construction
11
13
  def self.mkdir_p(path)
12
- stack = path.start_with?(File::SEPARATOR) ? File::SEPARATOR : "."
14
+ stack = generate_stack(path)
13
15
  path.split(File::SEPARATOR).each do |part|
14
- stack = File.join(stack, part)
15
-
16
+ stack = generate_path(stack, part)
16
17
  begin
17
18
  Dir.mkdir(stack) unless directory_exists?(stack)
18
19
  rescue Errno::ENOTDIR => e
@@ -21,10 +22,40 @@ module RSpec
21
22
  end
22
23
  end
23
24
 
25
+ if OS.windows_file_path?
26
+ def self.generate_stack(path)
27
+ if path.start_with?(File::SEPARATOR)
28
+ File::SEPARATOR
29
+ elsif path[1] == ':'
30
+ ''
31
+ else
32
+ '.'
33
+ end
34
+ end
35
+ def self.generate_path(stack, part)
36
+ if stack == ''
37
+ part
38
+ elsif stack == File::SEPARATOR
39
+ File.join('', part)
40
+ else
41
+ File.join(stack, part)
42
+ end
43
+ end
44
+ else
45
+ def self.generate_stack(path)
46
+ path.start_with?(File::SEPARATOR) ? File::SEPARATOR : "."
47
+ end
48
+ def self.generate_path(stack, part)
49
+ File.join(stack, part)
50
+ end
51
+ end
52
+
24
53
  def self.directory_exists?(dirname)
25
54
  File.exist?(dirname) && File.directory?(dirname)
26
55
  end
27
56
  private_class_method :directory_exists?
57
+ private_class_method :generate_stack
58
+ private_class_method :generate_path
28
59
  end
29
60
  end
30
61
  end
@@ -0,0 +1,18 @@
1
+ module RSpec
2
+ module Support
3
+ # @api private
4
+ #
5
+ # Provides query methods for different OS or OS features.
6
+ module OS
7
+ def windows?
8
+ RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
9
+ end
10
+ module_function :windows?
11
+
12
+ def windows_file_path?
13
+ ::File::ALT_SEPARATOR == '\\'
14
+ end
15
+ module_function :windows_file_path?
16
+ end
17
+ end
18
+ end
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Support
3
3
  module Version
4
- STRING = '3.1.0'
4
+ STRING = '3.1.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -36,7 +36,7 @@ cert_chain:
36
36
  1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
37
37
  muA=
38
38
  -----END CERTIFICATE-----
39
- date: 2014-09-05 00:00:00.000000000 Z
39
+ date: 2014-09-26 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
@@ -84,6 +84,7 @@ files:
84
84
  - lib/rspec/support/hunk_generator.rb
85
85
  - lib/rspec/support/matcher_definition.rb
86
86
  - lib/rspec/support/method_signature_verifier.rb
87
+ - lib/rspec/support/os.rb
87
88
  - lib/rspec/support/recursive_const_methods.rb
88
89
  - lib/rspec/support/ruby_features.rb
89
90
  - lib/rspec/support/spec.rb
@@ -122,5 +123,5 @@ rubyforge_project: rspec
122
123
  rubygems_version: 2.2.2
123
124
  signing_key:
124
125
  specification_version: 4
125
- summary: rspec-support-3.1.0
126
+ summary: rspec-support-3.1.1
126
127
  test_files: []
metadata.gz.sig CHANGED
Binary file