multi_dir 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/.gitignore +20 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +116 -0
- data/Rakefile +6 -0
- data/lib/multi_dir.rb +26 -0
- data/lib/multi_dir/pathname_patch.rb +22 -0
- data/lib/multi_dir/paths.rb +124 -0
- data/lib/multi_dir/version.rb +11 -0
- data/multi_dir.gemspec +27 -0
- data/spec/multi_dir/paths_spec.rb +79 -0
- data/spec/multi_dir_spec.rb +54 -0
- data/spec/spec_helper.rb +28 -0
- data/spec/support/multi_dir.yml +10 -0
- data/spec/support/multi_dir_2.yml +2 -0
- metadata +138 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ce861e1b857ef81a8a7b636fefca4baefe2a05bc
|
4
|
+
data.tar.gz: e382dcb44de085b9ebcffedc2a4916aaf4949782
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8a82b06f595a738d2a4bd493536f76b1260fc72251ef8e8690b1f52dc8aec26553ac0856a02e62989f8382cad47fc7e3de54c94149edcbc1dc99c71a7a68578c
|
7
|
+
data.tar.gz: 79eecdaa711d5edfeb68a15941e52f82719749c56c4777ebd159fcd2040057485f590d127c1a5186f37815a73b2c7107d55adc1736083627829589b5a2ecf4be
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Jan Graichen
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
# MultiDir
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/jgraichen/multi_dir.png?branch=master)](https://travis-ci.org/jgraichen/multi_dir)
|
4
|
+
|
5
|
+
**MultiDir** allow libraries and frameworks to request paths in a semantic
|
6
|
+
way. This allows administrators to define real paths in one global
|
7
|
+
standardized way.
|
8
|
+
|
9
|
+
No more `Rails.root.join *%w(tmp uploaded)` anymore. Give administrators the
|
10
|
+
freedom to link the temp directory to `/tmp/myapp` or any other system
|
11
|
+
specific place by just using `MultiDir.tmp.join 'uploaded'`.
|
12
|
+
|
13
|
+
*Note: MultiDir as a library is still under development but the concept sounds nice.*
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile:
|
18
|
+
|
19
|
+
gem 'multi_dir'
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle
|
24
|
+
|
25
|
+
Or install it yourself as:
|
26
|
+
|
27
|
+
$ gem install multi_dir
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
### For All
|
32
|
+
|
33
|
+
MultiDir allows to define any semantic path your app, library or framework may
|
34
|
+
need. By default the following paths are specified:
|
35
|
+
|
36
|
+
```
|
37
|
+
MultiDir.bin # => 'bin'
|
38
|
+
MultiDir.lib # => 'lib'
|
39
|
+
MultiDir.tmp # => 'tmp'
|
40
|
+
MultiDir.cache # => 'tmp/cache'
|
41
|
+
MultiDir.files # => 'files'
|
42
|
+
MultiDir.config # => 'config
|
43
|
+
```
|
44
|
+
|
45
|
+
### For Administrators
|
46
|
+
|
47
|
+
**MultiDir** provides everything you need to integrate some hipster app into
|
48
|
+
your well known and proven operating system structure. It allows you to
|
49
|
+
specify which content should live where without manual patching every piece of
|
50
|
+
code.
|
51
|
+
|
52
|
+
Create or edit `dirs.yml` in the application root directory (or whereever
|
53
|
+
you're running the app) or specific the path using `MULTI_DIR_CONFIG` env
|
54
|
+
variable with the following content:
|
55
|
+
|
56
|
+
```yaml
|
57
|
+
paths:
|
58
|
+
tmp: /tmp/myapp-srv2
|
59
|
+
files: /mnt/nfs2/storage
|
60
|
+
cache: /var/cache/apps/myapp
|
61
|
+
log: /var/log/myapp
|
62
|
+
```
|
63
|
+
|
64
|
+
This file allows you to specify the base paths for the application.
|
65
|
+
|
66
|
+
### For Developers
|
67
|
+
|
68
|
+
**MultiDir** makes you a developer loved by administrators as you given them
|
69
|
+
the freedom to adjust you app or library according there needs. It also makes
|
70
|
+
you happy reaching another stage of more semantic programming.
|
71
|
+
|
72
|
+
You can just use **MultiDir** like you've used `Rails.root.join` in the past.
|
73
|
+
|
74
|
+
See the following examples:
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
# Request a specific file
|
78
|
+
MultiDir.cache.join *%(pdfgen page5.pdf) # => "cache/pdfgen/page5.pdf"
|
79
|
+
|
80
|
+
# Request a file with a temporary name
|
81
|
+
MultiDir.tmp.temp_file ['basename', '.jpg'] # => "tmp/basename74hf4727f834.jpg"
|
82
|
+
|
83
|
+
# Get list of files in a additional configurable directory
|
84
|
+
MultiDir.cache[:uploads].glob '**/*.zip' # This allows admins to configure a special path for :uploads
|
85
|
+
# that if not given will be placed in 'cache'.
|
86
|
+
# => ["/media/uploads/a/virus.zip", "/media/uploads/attachments/ppt.zip"]
|
87
|
+
```
|
88
|
+
|
89
|
+
You can even define your own new top level *semantic path*:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
MultiDir::Paths.define :uploads, in: :tmp
|
93
|
+
```
|
94
|
+
|
95
|
+
This allows you to use `uploads` as a top level path that will be placed in `tmp` if not configured otherwise:
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
MultiDir.uploads.join 'abrng.pdf' # => "/tmp/uploads/abrng.pdf"
|
99
|
+
```
|
100
|
+
|
101
|
+
*More features will follow.*
|
102
|
+
|
103
|
+
## Contributing
|
104
|
+
|
105
|
+
1. Fork it
|
106
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
107
|
+
3. Add specs for your feature
|
108
|
+
4. Implement your feature
|
109
|
+
5. Check that all specs are passing
|
110
|
+
6. Commit your changes (`git commit -am 'Add some feature'`)
|
111
|
+
7. Push to the branch (`git push origin my-new-feature`)
|
112
|
+
8. Create new Pull Request
|
113
|
+
|
114
|
+
## License
|
115
|
+
|
116
|
+
Copyright (c) 2013 Jan Graichen - MIT License
|
data/Rakefile
ADDED
data/lib/multi_dir.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'active_support/core_ext/kernel/singleton_class'
|
2
|
+
require 'active_support/core_ext/hash/keys'
|
3
|
+
|
4
|
+
require 'multi_dir/version'
|
5
|
+
require 'multi_dir/paths'
|
6
|
+
require 'multi_dir/pathname_patch'
|
7
|
+
|
8
|
+
module MultiDir
|
9
|
+
class << self
|
10
|
+
def define_path_method(name)
|
11
|
+
name = name.to_sym
|
12
|
+
singleton_class.instance_eval do
|
13
|
+
define_method(name) { self.resolve name }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def [](symbol)
|
18
|
+
Pathname.new MultiDir::Paths.instance.resolve symbol
|
19
|
+
end
|
20
|
+
alias_method :resolve, :[]
|
21
|
+
end
|
22
|
+
|
23
|
+
[ :root, :bin, :lib, :tmp, :config, :cache, :files ].each do |path|
|
24
|
+
define_path_method path
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module MultiDir
|
2
|
+
|
3
|
+
# Provide additional function to operate
|
4
|
+
# on directories.
|
5
|
+
#
|
6
|
+
module PathnamePatch
|
7
|
+
|
8
|
+
def glob(pattern)
|
9
|
+
Dir.glob File.join(to_s, pattern)
|
10
|
+
end
|
11
|
+
|
12
|
+
def [](path)
|
13
|
+
if MultiDir::Paths.instance.paths.include? path.to_sym
|
14
|
+
return MultiDir::Paths.instance.resolve(path)
|
15
|
+
end
|
16
|
+
|
17
|
+
join path.to_s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
::Pathname.send :include, PathnamePatch
|
22
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module MultiDir
|
4
|
+
|
5
|
+
# Can resolve paths using symbols.
|
6
|
+
#
|
7
|
+
class Paths
|
8
|
+
|
9
|
+
def initialize(paths = {})
|
10
|
+
self.paths.merge! paths.symbolize_keys unless paths.nil? or paths.empty?
|
11
|
+
end
|
12
|
+
|
13
|
+
# Resolve symbolic path to real path.
|
14
|
+
#
|
15
|
+
def resolve(symbol)
|
16
|
+
case symbol
|
17
|
+
when :root
|
18
|
+
resolve_root
|
19
|
+
else
|
20
|
+
raise ArgumentError.new "Path symbol `#{symbol.inspect}` does not exist." unless paths.has_key? symbol
|
21
|
+
|
22
|
+
path = paths[symbol]
|
23
|
+
if path.is_a? Array
|
24
|
+
File.join resolve(path[0]), path[1].to_s
|
25
|
+
else
|
26
|
+
path.to_s
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Resolve root path.
|
32
|
+
#
|
33
|
+
def resolve_root
|
34
|
+
return paths[:root] if paths.has_key? :root
|
35
|
+
return ::Rails.root.to_s if Object.const_defined?(:Rails) && ::Rails.respond_to?(:root)
|
36
|
+
Pathname.pwd.to_s
|
37
|
+
end
|
38
|
+
|
39
|
+
def paths
|
40
|
+
@paths ||= load_paths
|
41
|
+
end
|
42
|
+
|
43
|
+
def load_paths
|
44
|
+
paths = default_paths
|
45
|
+
|
46
|
+
[ 'multi_dir.yml', ENV['MULTI_DIR_CONFIG'] ].reject(&:nil?).each do |file|
|
47
|
+
next unless File.exists? file
|
48
|
+
paths.merge! load_yaml file
|
49
|
+
end
|
50
|
+
|
51
|
+
paths
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_paths
|
55
|
+
{
|
56
|
+
:bin => [:root, 'bin'],
|
57
|
+
:lib => [:root, 'lib'],
|
58
|
+
:tmp => [:root, 'tmp'],
|
59
|
+
:cache => [:tmp, 'cache'],
|
60
|
+
:config => [:root, 'config'],
|
61
|
+
:files => [:root, 'files']
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
def load_yaml(file)
|
66
|
+
raise ArgumentError.new "File `#{file}` does not exists." unless File.exists? file
|
67
|
+
raise ArgumentError.new "File `#{file}` is not readable." unless File.readable? file
|
68
|
+
data = YAML.load_file(file).symbolize_keys
|
69
|
+
|
70
|
+
unless data.is_a? Hash and data.has_key? :paths
|
71
|
+
raise ArgumentError.new "File `#{file}` does not contain a valid MultiDir YAML definition."
|
72
|
+
end
|
73
|
+
|
74
|
+
data[:paths].inject({}) do |memo, row|
|
75
|
+
key, path = row[0].to_sym, row[1].to_s
|
76
|
+
memo[key] = if %w(/ .).include? path[0].chr
|
77
|
+
File.expand_path path.to_s
|
78
|
+
else
|
79
|
+
[ :root, path.to_s ]
|
80
|
+
end
|
81
|
+
|
82
|
+
memo
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def load_yaml!(file)
|
87
|
+
paths.merge! load_yaml file
|
88
|
+
end
|
89
|
+
|
90
|
+
def define(name, options = {})
|
91
|
+
name = name.to_s
|
92
|
+
|
93
|
+
if MultiDir.methods.include?(name)
|
94
|
+
raise ArgumentError.new "Path name `#{name}` would override already defined method on MultiDir."
|
95
|
+
end
|
96
|
+
|
97
|
+
parent = options[:id] || options[:parent]
|
98
|
+
paths[name] = [ parent, name.to_s ]
|
99
|
+
|
100
|
+
MultiDir.define_path_method name
|
101
|
+
end
|
102
|
+
|
103
|
+
class << self
|
104
|
+
|
105
|
+
def instance
|
106
|
+
@instance ||= new
|
107
|
+
end
|
108
|
+
|
109
|
+
def reset_instance
|
110
|
+
@instance = nil
|
111
|
+
end
|
112
|
+
|
113
|
+
def load_yaml(file)
|
114
|
+
instance.load_yaml! file
|
115
|
+
end
|
116
|
+
|
117
|
+
# Define a new semantic path.
|
118
|
+
#
|
119
|
+
def define(name, options = {})
|
120
|
+
instance.define name, options
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
data/multi_dir.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'multi_dir/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'multi_dir'
|
8
|
+
spec.version = MultiDir::VERSION
|
9
|
+
spec.authors = ['Jan Graichen']
|
10
|
+
spec.email = %w(jg@altimos.de)
|
11
|
+
spec.description = %q{Library for semantic path configuration to make developers and operators happy.}
|
12
|
+
spec.summary = %q{Library for semantic path configuration to make developers and operators happy.}
|
13
|
+
spec.homepage = 'https://github.com/jgraichen/multi_dir'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = %w(lib)
|
20
|
+
|
21
|
+
spec.add_runtime_dependency 'activesupport'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec'
|
26
|
+
spec.add_development_dependency 'coveralls'
|
27
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MultiDir::Paths do
|
4
|
+
let(:config) { nil }
|
5
|
+
let(:paths) { MultiDir::Paths.new config }
|
6
|
+
|
7
|
+
describe '#load_paths' do
|
8
|
+
context 'with local file' do
|
9
|
+
it 'should load local configuration' do
|
10
|
+
Dir.chdir 'spec/support' do
|
11
|
+
expect(paths.resolve :root).to be == '/usr/lib/myapp'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#load_yaml' do
|
18
|
+
let(:cfg) { paths.load_yaml 'spec/support/multi_dir.yml' }
|
19
|
+
|
20
|
+
it 'should load configuration from YAML file' do
|
21
|
+
expect(cfg).to include(:root, :bin, :cache, :config, :tmp, :files, :uploads)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should detect absolute paths' do
|
25
|
+
expect(cfg[:bin]).to be == '/usr/bin'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should detect relative paths' do
|
29
|
+
expect(cfg[:spec_support]).to be == [ :root, 'spec/support' ]
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should detect working dir relative path' do
|
33
|
+
expect(cfg[:spec_support2]).to be == Pathname.pwd.join('spec/support').to_s
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#resolve' do
|
38
|
+
let(:config) { { :root => '/root', :tmp => [:root, 'tmp'] } }
|
39
|
+
|
40
|
+
it 'should resolve direct path symbol' do
|
41
|
+
expect(paths.resolve :root).to be == '/root'
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should resolve indirect path symbol' do
|
45
|
+
expect(paths.resolve :tmp).to be == '/root/tmp'
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should raise error on not existing path symbols' do
|
49
|
+
expect {
|
50
|
+
paths.resolve :not_existing_symbol
|
51
|
+
}.to raise_error(ArgumentError)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe '#resovle_root' do
|
56
|
+
context 'with configure root path' do
|
57
|
+
let(:config) { { :root => '/var/app/root' } }
|
58
|
+
|
59
|
+
it 'should resolve to configured root path' do
|
60
|
+
expect(paths.resolve_root).to be == '/var/app/root'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'with not configured path but loaded Rails app' do
|
65
|
+
before { module ::Rails; def self.root; Pathname.new 'app'; end end }
|
66
|
+
after { Object.send :remove_const, :Rails }
|
67
|
+
|
68
|
+
it 'should resolve to Rails root' do
|
69
|
+
expect(paths.resolve_root).to be == 'app'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'without configured path and rails root' do
|
74
|
+
it 'should resolve to current working dir' do
|
75
|
+
expect(paths.resolve_root).to be == Pathname.pwd.to_s
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MultiDir do
|
4
|
+
before { MultiDir::Paths.reset_instance }
|
5
|
+
before { MultiDir::Paths.load_yaml 'spec/support/multi_dir.yml' }
|
6
|
+
|
7
|
+
it 'should resolve root path' do
|
8
|
+
expect(MultiDir.root.to_s).to be == '/usr/lib/myapp'
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should resolve bin path' do
|
12
|
+
expect(MultiDir.bin.to_s).to be == '/usr/bin'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should resolve config path' do
|
16
|
+
expect(MultiDir.config.to_s).to be == '/etc/myapp'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should resolve files path' do
|
20
|
+
expect(MultiDir.files.to_s).to be == '/var/files/myapp'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should resolve tmp path' do
|
24
|
+
expect(MultiDir.tmp.to_s).to be == '/tmp/myapp'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should resolve cache path' do
|
28
|
+
expect(MultiDir.cache.to_s).to be == '/var/cache/myapp'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should resolve custom path' do
|
32
|
+
MultiDir::Paths.define :uploads, :in => :files
|
33
|
+
expect(MultiDir.uploads.to_s).to be == '/mnt/nfs/storage0/files'
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should resolve quick path' do
|
37
|
+
expect(MultiDir.files[:uploads].to_s).to be == '/mnt/nfs/storage0/files'
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should resolve not configured quick path' do
|
41
|
+
expect(MultiDir.files[:attachments].to_s).to be == '/var/files/myapp/attachments'
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should allow to glob path' do
|
45
|
+
expect(MultiDir[:spec_support2].glob('*.yml').sort).to be == [
|
46
|
+
File.expand_path('spec/support/multi_dir.yml'),
|
47
|
+
File.expand_path('spec/support/multi_dir_2.yml')
|
48
|
+
]
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should allow to join path' do
|
52
|
+
expect(MultiDir.root.join('app', 'controllers').to_s).to be == '/usr/lib/myapp/app/controllers'
|
53
|
+
end
|
54
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'multi_dir'
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear! do
|
4
|
+
add_filter 'spec'
|
5
|
+
end
|
6
|
+
|
7
|
+
Dir[File.expand_path('spec/support/**/*.rb')].each {|f| require f}
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
# ## Mock Framework
|
11
|
+
#
|
12
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
13
|
+
#
|
14
|
+
# config.mock_with :mocha
|
15
|
+
# config.mock_with :flexmock
|
16
|
+
# config.mock_with :rr
|
17
|
+
|
18
|
+
# Run specs in random order to surface order dependencies. If you find an
|
19
|
+
# order dependency and want to debug it, you can fix the order by providing
|
20
|
+
# the seed, which is printed after each run.
|
21
|
+
# --seed 1234
|
22
|
+
config.order = 'random'
|
23
|
+
|
24
|
+
config.expect_with :rspec do |c|
|
25
|
+
# Only allow expect syntax
|
26
|
+
c.syntax = :expect
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: multi_dir
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Graichen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
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: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Library for semantic path configuration to make developers and operators
|
84
|
+
happy.
|
85
|
+
email:
|
86
|
+
- jg@altimos.de
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- .gitignore
|
92
|
+
- .travis.yml
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- lib/multi_dir.rb
|
98
|
+
- lib/multi_dir/pathname_patch.rb
|
99
|
+
- lib/multi_dir/paths.rb
|
100
|
+
- lib/multi_dir/version.rb
|
101
|
+
- multi_dir.gemspec
|
102
|
+
- spec/multi_dir/paths_spec.rb
|
103
|
+
- spec/multi_dir_spec.rb
|
104
|
+
- spec/spec_helper.rb
|
105
|
+
- spec/support/multi_dir.yml
|
106
|
+
- spec/support/multi_dir_2.yml
|
107
|
+
homepage: https://github.com/jgraichen/multi_dir
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.0.3
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Library for semantic path configuration to make developers and operators
|
131
|
+
happy.
|
132
|
+
test_files:
|
133
|
+
- spec/multi_dir/paths_spec.rb
|
134
|
+
- spec/multi_dir_spec.rb
|
135
|
+
- spec/spec_helper.rb
|
136
|
+
- spec/support/multi_dir.yml
|
137
|
+
- spec/support/multi_dir_2.yml
|
138
|
+
has_rdoc:
|