junctions 0.0.6 → 0.0.7

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
  SHA256:
3
- metadata.gz: cc7a39d70a2ca7dc1b162531c974a3db6a787dc02ff285d3c5dc95fb6bdffd06
4
- data.tar.gz: 0f73f23dcfc062918a6b49e1ec1888d0fa8240611696a0047259a6557a1a8101
3
+ metadata.gz: 2f34a5f6716ebcc9cb8765c86de1932eab58872ab2103ba86088f5016f7a15fb
4
+ data.tar.gz: b10d5fb3f8b1da99c97ab58d0f0f634009dc765f6af5c5e05cf3b4b87e716543
5
5
  SHA512:
6
- metadata.gz: ce9466826c9f68435f1a8ab8b1139d2c110c7fd497790b3f9342120dcb176cbbb0dea6e79d088ad4e13ccef0455f4676c49e7a32f82d353c351b9d3afb89c92a
7
- data.tar.gz: 245092534323173cc80b27d0c00e4183b9b293febda885a820f78e6b15b08d4a1a438c746613ee0cb859d23812ca9a8451ac0d14ad79bdb9ad7f0c7114b25273
6
+ metadata.gz: acbf34a8056248c1b8235da5f26f73427d9822c31f658667d540d7e9bd63f69536982ca94c97df3d661fc2293e9c952728f732255b9f0d867a2084cacc329e12
7
+ data.tar.gz: b08ec8e43351e3814976df87b94cd7e8dd800c4398a152e1762e65a0da02c7e1c7a108a1f6dc4712a22fc9fd1b459c6fd24ba3bc199ec716eb8e9006226589f2
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junctions (0.0.2)
5
- activesupport
4
+ junctions (0.0.7)
5
+ activesupport (~> 5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (5.2.0)
10
+ activesupport (5.2.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
- concurrent-ruby (1.0.5)
15
+ concurrent-ruby (1.1.4)
16
16
  config_files (0.1.3)
17
17
  activesupport
18
- docile (1.3.0)
19
- i18n (1.0.1)
18
+ docile (1.3.1)
19
+ i18n (1.5.3)
20
20
  concurrent-ruby (~> 1.0)
21
- json (2.1.0)
21
+ json (2.2.0)
22
22
  minitest (5.11.3)
23
- rake (12.3.1)
23
+ rake (12.3.2)
24
24
  simplecov (0.16.1)
25
25
  docile (~> 1.1)
26
26
  json (>= 1.8, < 3)
@@ -34,12 +34,12 @@ PLATFORMS
34
34
  ruby
35
35
 
36
36
  DEPENDENCIES
37
- bundler
38
- config_files
37
+ bundler (~> 1)
38
+ config_files (~> 0.1.3)
39
39
  junctions!
40
- minitest
41
- rake
42
- simplecov
40
+ minitest (~> 5.11)
41
+ rake (~> 12.2)
42
+ simplecov (~> 0.16)
43
43
 
44
44
  BUNDLED WITH
45
- 1.16.1
45
+ 1.17.3
data/README.md CHANGED
@@ -6,23 +6,34 @@ in a module can be enabled or disable by creating them in a particular namespace
6
6
 
7
7
  ```ruby
8
8
  module Core
9
- include Junctions
10
- def overridden_method
11
- puts('You are in core')
12
- end
9
+ module Extensions
10
+ include Junctions
11
+ def overridden_method
12
+ puts('You are in core')
13
+ end
14
+ end
13
15
  end
14
16
 
15
17
  module Wibble
16
- def overridden_method
17
- puts('Wibble')
18
+ module Extensions
19
+ def overridden_method
20
+ puts('Wibble')
21
+ end
18
22
  end
19
23
  end
20
24
 
21
25
  module Wobble
22
- def overridden_method
23
- puts('Something else')
26
+ module Extensions
27
+ def overridden_method
28
+ puts('Something else')
29
+ end
24
30
  end
25
31
  end
32
+
33
+ class Demon
34
+ include Core::Extensions
35
+ end
36
+
26
37
  ```
27
38
  Including Junctions in Core means that if there is a 'junctions' setting as, for example, an environment variable
28
39
  ```bash
@@ -36,14 +47,14 @@ Likewise if the environment variable were:
36
47
  ```
37
48
  This would only include Wibble into the list of namespaces to override Core methods.
38
49
 
39
- Ruby and Rails Versions
40
-
41
- Junctions has been built for Ruby 2.5 and Rails 5. Although it was originally built for Ruby 1.8 and Rails 2,
42
- because of fundamental changes to later versions of rails and engines in particular, the decision was made to
43
- track the latest Rails version only.
44
-
45
-
46
-
50
+ You can also perform this override within the code entirely. Passing it in as an environment variable is the preferred
51
+ way to handle it, but there are other options since the Junctions core and junction_list setter functions are exposed
52
+ ```ruby
53
+ Junctions::Engine.core = 'common'
54
+ Junctions::Engine.junction_list = ['wibble', 'wobble']
55
+ ```
47
56
 
57
+ #Ruby and Rails Versions
48
58
 
59
+ Junctions is built for Ruby 2.4+ and Rails 5+.
49
60
 
data/junctions.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  # Maintain your gem's version:
4
- require 'junctions'
4
+ require 'junctions/version'
5
5
 
6
6
  # Describe your gem and declare its dependencies:
7
7
  Gem::Specification.new do |s|
@@ -21,9 +21,9 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency 'activesupport', '~> 5'
23
23
 
24
- s.add_development_dependency 'bundler', '~> 0'
25
- s.add_development_dependency 'rake', '~> 0'
26
- s.add_development_dependency 'minitest', '~> 0'
27
- s.add_development_dependency 'simplecov', '~> 0'
28
- s.add_development_dependency 'config_files', '~> 0'
24
+ s.add_development_dependency 'bundler', '~>1'
25
+ s.add_development_dependency 'rake','~>12.2'
26
+ s.add_development_dependency 'minitest', '~>5.11'
27
+ s.add_development_dependency 'simplecov', '~>0.16'
28
+ s.add_development_dependency 'config_files', '~>0.1.3'
29
29
  end
data/lib/junctions.rb CHANGED
@@ -6,7 +6,7 @@ module Junctions
6
6
  delegate :core=, :junction_list=, :activate, to: Junctions::Engine
7
7
 
8
8
  def included(base)
9
- Junctions::Engine.activate(base, self.name)
9
+ Junctions::Engine.activate(base, base.name)
10
10
  end
11
11
  end
12
12
  end
@@ -29,9 +29,7 @@ module Junctions
29
29
  name=base_name.gsub("#{core.classify}::", "#{junction_class}::")
30
30
  begin
31
31
  require(name.underscore)
32
- base.instance_eval {
33
- include name.constantize
34
- } if name.gsub(/::[^:]*$/, '').constantize.const_defined?(name.demodulize)
32
+ base.prepend name.constantize if name.gsub(/::[^:]*$/, '').constantize.const_defined?(name.demodulize)
35
33
  rescue NameError
36
34
  rescue LoadError
37
35
  rescue Exception => e
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Junctions
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
  end
@@ -13,7 +13,7 @@ class Junctions::Test < MiniTest::Spec
13
13
 
14
14
  describe ::Wibble do
15
15
  it 'has to_s overridden' do
16
- assert_equal Wibble.new.to_s, 'metal'
16
+ assert_equal 'metal', Wibble.new.to_s
17
17
  end
18
18
 
19
19
  it 'has a metal method' do
@@ -3,7 +3,7 @@ module Common
3
3
  include Junctions
4
4
  class << self
5
5
  def included(base)
6
- Junctions::activate(base, self.name)
6
+ Junctions::activate(base, name)
7
7
  end
8
8
  end
9
9
 
data/test/lib/wobble.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'junctions'
2
- Junctions.core = 'common'
3
- Junctions.junction_list = ['plastic', 'metal']
2
+ Junctions::Engine.core = 'common'
3
+ Junctions::Engine.junction_list = ['plastic', 'metal']
4
4
  require 'common/wibble_extensions'
5
5
 
6
6
  class Wobble
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junctions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul McKibbin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,70 +30,70 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '12.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '12.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '5.11'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '5.11'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '0.16'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '0.16'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: config_files
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.1.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 0.1.3
97
97
  description: Description of Junctions.
98
98
  email:
99
99
  - pmckibbin@gmail.com
@@ -136,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.7.6
139
+ rubygems_version: 3.0.2
141
140
  signing_key:
142
141
  specification_version: 4
143
142
  summary: Summary of Junctions.