temporary_directory 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +12 -0
- data/.rspec +4 -0
- data/.travis.yml +7 -0
- data/.yardopts +9 -0
- data/Gemfile +25 -0
- data/HISTORY.md +4 -0
- data/LICENSE.md +15 -0
- data/README.md +219 -0
- data/Rakefile +53 -0
- data/features/step_definitions/execute_cucumber.rb +34 -0
- data/features/step_definitions/execute_rspec.rb +34 -0
- data/features/step_definitions/files.rb +24 -0
- data/features/step_definitions/temporary_directories.rb +43 -0
- data/features/support/env.rb +34 -0
- data/features/support/project.rb +26 -0
- data/features/support/separate_environment_execution.rb +48 -0
- data/features/support/subsequent_temporary_directory_root_directory.rb +30 -0
- data/features/temporary_directories_for_cucumber.feature +80 -0
- data/features/temporary_directories_for_rspec_examples.feature +92 -0
- data/lib/god_object/temporary_directory.rb +30 -0
- data/lib/god_object/temporary_directory/helper.rb +65 -0
- data/lib/god_object/temporary_directory/service.rb +38 -0
- data/lib/god_object/temporary_directory/version.rb +30 -0
- data/lib/temporary_directory.rb +20 -0
- data/spec/god_object/temporary_directory/helper_spec.rb +113 -0
- data/spec/god_object/temporary_directory/service_spec.rb +109 -0
- data/spec/spec_helper.rb +20 -0
- data/temporary_directory.gemspec +64 -0
- metadata +219 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
module GodObject
|
21
|
+
module TemporaryDirectory
|
22
|
+
|
23
|
+
class Service
|
24
|
+
def initialize(name_prefix: nil, base_directory: nil, backend_api: Dir, pathname_factory: Pathname)
|
25
|
+
@name_prefix = name_prefix
|
26
|
+
@base_directory = base_directory
|
27
|
+
@backend_api = backend_api
|
28
|
+
@pathname_factory = pathname_factory
|
29
|
+
end
|
30
|
+
|
31
|
+
def new
|
32
|
+
path = @backend_api.mktmpdir(@name_prefix, @base_directory)
|
33
|
+
@pathname_factory.new(path)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
module GodObject
|
21
|
+
module TemporaryDirectory
|
22
|
+
|
23
|
+
# The currently loaded version.
|
24
|
+
#
|
25
|
+
# Using Semantic Versioning (2.0.0) rules
|
26
|
+
# @see http://semver.org/spec/v2.0.0.html
|
27
|
+
VERSION = '0.1.0'
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
require_relative 'god_object/temporary_directory'
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
module GodObject
|
21
|
+
module TemporaryDirectory
|
22
|
+
|
23
|
+
describe Helper do
|
24
|
+
describe '.new' do
|
25
|
+
it 'returns a module' do
|
26
|
+
name_prefix = instance_double(String, :name_prefix)
|
27
|
+
result = described_class.new(name_prefix: name_prefix)
|
28
|
+
|
29
|
+
expect(result).to be_a Module
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'an object extended with the returned mixin module' do
|
33
|
+
[:temporary_directory, :ensure_presence_of_temporary_directory].each do |method|
|
34
|
+
describe "##{method}" do
|
35
|
+
it 'requests a temporary directory through the temporary_directory_service' do
|
36
|
+
temporary_directory_service = instance_spy(Service, :temporary_directory_service)
|
37
|
+
result = described_class.new(temporary_directory_service: temporary_directory_service)
|
38
|
+
extended_object = build_object(mixin: result)
|
39
|
+
|
40
|
+
extended_object.temporary_directory
|
41
|
+
|
42
|
+
expect(temporary_directory_service).to have_received(:new).with(no_args)
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
it 'returns the pathname' do
|
47
|
+
temporary_directory_service = instance_double(Service, :temporary_directory_service)
|
48
|
+
temporary_directory_pathname = instance_double(Pathname, :temporary_directory_pathname)
|
49
|
+
allow(temporary_directory_service).to receive(:new).and_return(temporary_directory_pathname)
|
50
|
+
result = described_class.new(temporary_directory_service: temporary_directory_service)
|
51
|
+
extended_object = build_object(mixin: result)
|
52
|
+
|
53
|
+
result = extended_object.temporary_directory
|
54
|
+
|
55
|
+
expect(result).to be temporary_directory_pathname
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'only once requests a temporary directory even when called multiple times' do
|
59
|
+
temporary_directory_service = instance_spy(Service, :temporary_directory_service)
|
60
|
+
result = described_class.new(temporary_directory_service: temporary_directory_service)
|
61
|
+
extended_object = build_object(mixin: result)
|
62
|
+
|
63
|
+
2.times do
|
64
|
+
extended_object.temporary_directory
|
65
|
+
end
|
66
|
+
|
67
|
+
expect(temporary_directory_service).to have_received(:new).with(no_args)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#ensure_absence_of_temporary_directory' do
|
73
|
+
it 'commands the pathname to recursively remove the temporary directory' do
|
74
|
+
temporary_directory_service = instance_spy(Service, :temporary_directory_service)
|
75
|
+
temporary_directory_pathname = instance_spy(Pathname, :temporary_directory_pathname)
|
76
|
+
allow(temporary_directory_service).to receive(:new).and_return(temporary_directory_pathname)
|
77
|
+
result = described_class.new(temporary_directory_service: temporary_directory_service)
|
78
|
+
extended_object = build_object(mixin: result)
|
79
|
+
|
80
|
+
extended_object.ensure_presence_of_temporary_directory
|
81
|
+
extended_object.ensure_absence_of_temporary_directory
|
82
|
+
|
83
|
+
expect(temporary_directory_pathname).to have_received(:rmtree).with(no_args)
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'does nothing if no temporary directory has been created before' do
|
87
|
+
temporary_directory_service = instance_spy(Service, :temporary_directory_service)
|
88
|
+
temporary_directory_pathname = instance_spy(Pathname, :temporary_directory_pathname)
|
89
|
+
allow(temporary_directory_service).to receive(:new).and_return(temporary_directory_pathname)
|
90
|
+
result = described_class.new(temporary_directory_service: temporary_directory_service)
|
91
|
+
extended_object = build_object(mixin: result)
|
92
|
+
|
93
|
+
extended_object.ensure_absence_of_temporary_directory
|
94
|
+
|
95
|
+
expect(temporary_directory_pathname).not_to have_received(:rmtree)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def build_name_prefix
|
101
|
+
instance_double(String, :name_prefix)
|
102
|
+
end
|
103
|
+
|
104
|
+
def build_object(mixin:)
|
105
|
+
object = Object.new
|
106
|
+
object.extend(mixin)
|
107
|
+
object
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
module GodObject
|
21
|
+
module TemporaryDirectory
|
22
|
+
|
23
|
+
describe Service do
|
24
|
+
describe '#new' do
|
25
|
+
it 'requests a temporary directory through the backend_api' do
|
26
|
+
backend_api = class_spy(Dir, :backend_api)
|
27
|
+
pathname_factory = class_double(Pathname, :pathname_factory).as_null_object
|
28
|
+
service = described_class.new(backend_api: backend_api, pathname_factory: pathname_factory)
|
29
|
+
|
30
|
+
service.new
|
31
|
+
|
32
|
+
expect(backend_api).to have_received(:mktmpdir).with(nil, nil)
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when initialized with a name_prefix' do
|
36
|
+
it 'requests a prefixed temporary directory through the backend_api' do
|
37
|
+
name_prefix = instance_double(String, :name_prefix)
|
38
|
+
backend_api = class_spy(Dir, :backend_api)
|
39
|
+
pathname_factory = class_double(Pathname, :pathname_factory).as_null_object
|
40
|
+
service = described_class.new(backend_api: backend_api,
|
41
|
+
pathname_factory: pathname_factory,
|
42
|
+
name_prefix: name_prefix)
|
43
|
+
|
44
|
+
service.new
|
45
|
+
|
46
|
+
expect(backend_api).to have_received(:mktmpdir).with(name_prefix, nil)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when initialized with a base_directory' do
|
51
|
+
it 'requests a temporary directory within the base_directory through the backend_api' do
|
52
|
+
base_directory = instance_double(Pathname, :name_prefix)
|
53
|
+
backend_api = class_spy(Dir, :backend_api)
|
54
|
+
pathname_factory = class_double(Pathname, :pathname_factory).as_null_object
|
55
|
+
service = described_class.new(backend_api: backend_api,
|
56
|
+
pathname_factory: pathname_factory,
|
57
|
+
base_directory: base_directory)
|
58
|
+
|
59
|
+
service.new
|
60
|
+
|
61
|
+
expect(backend_api).to have_received(:mktmpdir).with(nil, base_directory)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'when initialized with name_prefix and base_directory' do
|
66
|
+
it 'requests a prefixed temporary directory within the base_directory through the backend_api' do
|
67
|
+
name_prefix = instance_double(String, :name_prefix)
|
68
|
+
base_directory = instance_double(Pathname, :name_prefix)
|
69
|
+
backend_api = class_spy(Dir, :backend_api)
|
70
|
+
pathname_factory = class_double(Pathname, :pathname_factory).as_null_object
|
71
|
+
service = described_class.new(backend_api: backend_api,
|
72
|
+
pathname_factory: pathname_factory,
|
73
|
+
name_prefix: name_prefix,
|
74
|
+
base_directory: base_directory)
|
75
|
+
|
76
|
+
service.new
|
77
|
+
|
78
|
+
expect(backend_api).to have_received(:mktmpdir).with(name_prefix, base_directory)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'transforms the temporary directory path into a pathname using the pathname_factory' do
|
83
|
+
backend_api = class_double(Dir, :backend_api)
|
84
|
+
temporary_directory_path = instance_double(String, :temporary_directory_path)
|
85
|
+
allow(backend_api).to receive(:mktmpdir).and_return(temporary_directory_path)
|
86
|
+
pathname_factory = class_spy(Pathname, :pathname_factory)
|
87
|
+
service = described_class.new(backend_api: backend_api, pathname_factory: pathname_factory)
|
88
|
+
|
89
|
+
service.new
|
90
|
+
|
91
|
+
expect(pathname_factory).to have_received(:new).with(temporary_directory_path)
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'returns the pathname' do
|
95
|
+
backend_api = class_double(Dir, :backend_api).as_null_object
|
96
|
+
pathname_factory = class_double(Pathname, :pathname_factory)
|
97
|
+
temporary_directory_pathname = instance_double(Pathname, :temporary_directory_pathname)
|
98
|
+
allow(pathname_factory).to receive(:new).and_return(temporary_directory_pathname)
|
99
|
+
service = described_class.new(backend_api: backend_api, pathname_factory: pathname_factory)
|
100
|
+
|
101
|
+
result = service.new
|
102
|
+
|
103
|
+
expect(result).to be temporary_directory_pathname
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
require 'temporary_directory'
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
=begin
|
3
|
+
Copyright Alexander E. Fischer <aef@godobject.net>, 2016
|
4
|
+
|
5
|
+
This file is part of TemporaryDirectory.
|
6
|
+
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
13
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
18
|
+
=end
|
19
|
+
|
20
|
+
require 'English'
|
21
|
+
require_relative 'lib/god_object/temporary_directory/version'
|
22
|
+
|
23
|
+
Gem::Specification.new do |gem|
|
24
|
+
gem.name = 'temporary_directory'
|
25
|
+
gem.version = GodObject::TemporaryDirectory::VERSION.dup
|
26
|
+
gem.authors = ["Alexander E. Fischer"]
|
27
|
+
gem.email = ["aef@godobject.net"]
|
28
|
+
gem.description = <<-DESCRIPTION
|
29
|
+
TemporaryDirectory is a Ruby library that contains a service class that
|
30
|
+
creates temporary directories and returns Pathname objects to work with them.
|
31
|
+
Additionally a helper module for RSpec and Cucumber provides temporary
|
32
|
+
directories for examples and scenarios.
|
33
|
+
DESCRIPTION
|
34
|
+
gem.summary = 'Abstractions for creating temporary directories in tests and elsewhere.'
|
35
|
+
gem.homepage = 'https://www.godobject.net/'
|
36
|
+
gem.license = 'ISC'
|
37
|
+
gem.has_rdoc = 'yard'
|
38
|
+
gem.extra_rdoc_files = %w(HISTORY.md LICENSE.md)
|
39
|
+
gem.rubyforge_project = nil
|
40
|
+
|
41
|
+
`git ls-files 2> /dev/null`
|
42
|
+
|
43
|
+
if $CHILD_STATUS.success?
|
44
|
+
gem.files = `git ls-files`.split($\)
|
45
|
+
else
|
46
|
+
gem.files = `ls -1`.split($\)
|
47
|
+
end
|
48
|
+
|
49
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
50
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
51
|
+
gem.require_paths = %w(lib)
|
52
|
+
|
53
|
+
gem.required_ruby_version = '>= 2.1.8'
|
54
|
+
|
55
|
+
gem.add_development_dependency('rake')
|
56
|
+
gem.add_development_dependency('bundler')
|
57
|
+
gem.add_development_dependency('rspec', '~> 3.5')
|
58
|
+
gem.add_development_dependency('rspec-collection_matchers', '~> 1.1')
|
59
|
+
gem.add_development_dependency('cucumber', '~> 2.4')
|
60
|
+
gem.add_development_dependency('simplecov')
|
61
|
+
gem.add_development_dependency('pry')
|
62
|
+
gem.add_development_dependency('yard')
|
63
|
+
gem.add_development_dependency('kramdown')
|
64
|
+
end
|
metadata
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: temporary_directory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexander E. Fischer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-collection_matchers
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: cucumber
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: kramdown
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: |
|
140
|
+
TemporaryDirectory is a Ruby library that contains a service class that
|
141
|
+
creates temporary directories and returns Pathname objects to work with them.
|
142
|
+
Additionally a helper module for RSpec and Cucumber provides temporary
|
143
|
+
directories for examples and scenarios.
|
144
|
+
email:
|
145
|
+
- aef@godobject.net
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files:
|
149
|
+
- HISTORY.md
|
150
|
+
- LICENSE.md
|
151
|
+
files:
|
152
|
+
- ".coveralls.yml"
|
153
|
+
- ".gitignore"
|
154
|
+
- ".rspec"
|
155
|
+
- ".travis.yml"
|
156
|
+
- ".yardopts"
|
157
|
+
- Gemfile
|
158
|
+
- HISTORY.md
|
159
|
+
- LICENSE.md
|
160
|
+
- README.md
|
161
|
+
- Rakefile
|
162
|
+
- features/step_definitions/execute_cucumber.rb
|
163
|
+
- features/step_definitions/execute_rspec.rb
|
164
|
+
- features/step_definitions/files.rb
|
165
|
+
- features/step_definitions/temporary_directories.rb
|
166
|
+
- features/support/env.rb
|
167
|
+
- features/support/project.rb
|
168
|
+
- features/support/separate_environment_execution.rb
|
169
|
+
- features/support/subsequent_temporary_directory_root_directory.rb
|
170
|
+
- features/temporary_directories_for_cucumber.feature
|
171
|
+
- features/temporary_directories_for_rspec_examples.feature
|
172
|
+
- lib/god_object/temporary_directory.rb
|
173
|
+
- lib/god_object/temporary_directory/helper.rb
|
174
|
+
- lib/god_object/temporary_directory/service.rb
|
175
|
+
- lib/god_object/temporary_directory/version.rb
|
176
|
+
- lib/temporary_directory.rb
|
177
|
+
- spec/god_object/temporary_directory/helper_spec.rb
|
178
|
+
- spec/god_object/temporary_directory/service_spec.rb
|
179
|
+
- spec/spec_helper.rb
|
180
|
+
- temporary_directory.gemspec
|
181
|
+
homepage: https://www.godobject.net/
|
182
|
+
licenses:
|
183
|
+
- ISC
|
184
|
+
metadata: {}
|
185
|
+
post_install_message:
|
186
|
+
rdoc_options: []
|
187
|
+
require_paths:
|
188
|
+
- lib
|
189
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: 2.1.8
|
194
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
requirements: []
|
200
|
+
rubyforge_project:
|
201
|
+
rubygems_version: 2.5.1
|
202
|
+
signing_key:
|
203
|
+
specification_version: 4
|
204
|
+
summary: Abstractions for creating temporary directories in tests and elsewhere.
|
205
|
+
test_files:
|
206
|
+
- features/step_definitions/execute_cucumber.rb
|
207
|
+
- features/step_definitions/execute_rspec.rb
|
208
|
+
- features/step_definitions/files.rb
|
209
|
+
- features/step_definitions/temporary_directories.rb
|
210
|
+
- features/support/env.rb
|
211
|
+
- features/support/project.rb
|
212
|
+
- features/support/separate_environment_execution.rb
|
213
|
+
- features/support/subsequent_temporary_directory_root_directory.rb
|
214
|
+
- features/temporary_directories_for_cucumber.feature
|
215
|
+
- features/temporary_directories_for_rspec_examples.feature
|
216
|
+
- spec/god_object/temporary_directory/helper_spec.rb
|
217
|
+
- spec/god_object/temporary_directory/service_spec.rb
|
218
|
+
- spec/spec_helper.rb
|
219
|
+
has_rdoc: yard
|