dry-system 0.7.0 → 0.7.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: '0793e53e85b2a2fa0ea7da93bb11734362f87cd9'
4
- data.tar.gz: 9d0cc9e0989fe9f071468e4e6b310a3fc009b06f
3
+ metadata.gz: a21788fc7c60708d5a764c16be462eb0efba44d1
4
+ data.tar.gz: f147f16d6283e31fa9382392259b3313c481c92a
5
5
  SHA512:
6
- metadata.gz: 50818887822ec2a8130910a359d45690312cd10c28b1537d5dbf0a45f98eb2f1abc0d70bf6f709313a939927a22c2d8e29fc8f2aa5806f53206d0b6390c37b6d
7
- data.tar.gz: 1a350ffcba4a4bd7fca37be0976a55711aad5feaa70d493280aa477d4ea0723d5092fa35031c71c2b1d1ab6adaff6054d2a24e12fbdf4517b6eadb77e2850fe7
6
+ metadata.gz: 4f6252dd95293e42e307dbbf38991c07153b08f532ca222659625a166a29447e328c6a1acbe74070447ea8f143673fa86c4b3f7bbb13efa0aab50eb23015d21b
7
+ data.tar.gz: 8357c9d5e79c649d7d6794db762debf0056db52e213616a04e1660a2974b2d6c5ea75def5f43031385b794cd9d329063c81cec816e19ff8121ec3c35caf0b3d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.7.1 - 2017-06-16
2
+
3
+ ### Changed
4
+
5
+ - Accept string values for Container's `root` config (timriley)
6
+
1
7
  # 0.7.0 - 2017-06-15
2
8
 
3
9
  ### Added
data/dry-system.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_runtime_dependency 'dry-equalizer', '~> 0.2'
23
23
  spec.add_runtime_dependency 'dry-container', '~> 0.6'
24
24
  spec.add_runtime_dependency 'dry-auto_inject', '>= 0.4.0'
25
- spec.add_runtime_dependency 'dry-configurable', '~> 0.2'
25
+ spec.add_runtime_dependency 'dry-configurable', '~> 0.7', '>= 0.7.0'
26
26
 
27
27
  spec.add_development_dependency 'bundler'
28
28
  spec.add_development_dependency 'rake'
@@ -66,7 +66,7 @@ module Dry
66
66
 
67
67
  setting :name
68
68
  setting :default_namespace
69
- setting :root, Pathname.pwd.freeze
69
+ setting(:root, Pathname.pwd.freeze) { |path| Pathname(path) }
70
70
  setting :system_dir, 'system'.freeze
71
71
  setting :registrations_dir, 'container'.freeze
72
72
  setting :auto_register, []
@@ -1,4 +1,3 @@
1
- require 'pathname'
2
1
  require 'dry/system/constants'
3
2
 
4
3
  module Dry
@@ -50,7 +49,7 @@ module Dry
50
49
 
51
50
  # @api private
52
51
  def root
53
- Pathname(container.root)
52
+ container.root
54
53
  end
55
54
  end
56
55
  end
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module System
3
- VERSION = '0.7.0'.freeze
3
+ VERSION = '0.7.1'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,38 @@
1
+ require 'dry/system/container'
2
+
3
+ RSpec.describe Dry::System::Container, '.config' do
4
+ subject(:config) { Test::Container.config }
5
+ let(:configuration) { proc { } }
6
+
7
+ before do
8
+ class Test::Container < Dry::System::Container
9
+ end
10
+ Test::Container.configure(&configuration)
11
+ end
12
+
13
+ describe '#root' do
14
+ subject(:root) { config.root }
15
+
16
+ context 'no value' do
17
+ it 'defaults to pwd' do
18
+ expect(root).to eq Pathname.pwd
19
+ end
20
+ end
21
+
22
+ context 'string provided' do
23
+ let(:configuration) { proc { |config| config.root = '/tmp' } }
24
+
25
+ it 'coerces string paths to pathname' do
26
+ expect(root).to eq Pathname('/tmp')
27
+ end
28
+ end
29
+
30
+ context 'pathname provided' do
31
+ let(:configuration) { proc { |config| config.root = Pathname('/tmp') } }
32
+
33
+ it 'accepts the pathname' do
34
+ expect(root).to eq Pathname('/tmp')
35
+ end
36
+ end
37
+ end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-system
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
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-15 00:00:00.000000000 Z
11
+ date: 2017-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inflecto
@@ -86,14 +86,20 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.2'
89
+ version: '0.7'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 0.7.0
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
97
  - - "~>"
95
98
  - !ruby/object:Gem::Version
96
- version: '0.2'
99
+ version: '0.7'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 0.7.0
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: bundler
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -233,6 +239,7 @@ files:
233
239
  - spec/unit/auto_registrar/configuration_spec.rb
234
240
  - spec/unit/component_spec.rb
235
241
  - spec/unit/container/auto_register_spec.rb
242
+ - spec/unit/container/config_spec.rb
236
243
  - spec/unit/container/finalize_spec.rb
237
244
  - spec/unit/container/import_spec.rb
238
245
  - spec/unit/container/injector_spec.rb
@@ -315,6 +322,7 @@ test_files:
315
322
  - spec/unit/auto_registrar/configuration_spec.rb
316
323
  - spec/unit/component_spec.rb
317
324
  - spec/unit/container/auto_register_spec.rb
325
+ - spec/unit/container/config_spec.rb
318
326
  - spec/unit/container/finalize_spec.rb
319
327
  - spec/unit/container/import_spec.rb
320
328
  - spec/unit/container/injector_spec.rb