trax_core 0.0.71 → 0.0.72
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 +4 -4
- data/lib/trax/core/concern.rb +20 -18
- data/lib/trax/core/configuration.rb +63 -23
- data/lib/trax/core/definition.rb +6 -0
- data/lib/trax/core/eager_autoload_namespace.rb +0 -8
- data/lib/trax/core/errors.rb +17 -1
- data/lib/trax/core/ext/array.rb +26 -0
- data/lib/trax/core/ext/class.rb +10 -0
- data/lib/trax/core/ext/hash.rb +50 -0
- data/lib/trax/core/ext/is.rb +21 -0
- data/lib/trax/core/ext/object.rb +8 -2
- data/lib/trax/core/ext/string.rb +4 -0
- data/lib/trax/core/ext/symbol.rb +6 -0
- data/lib/trax/core/ext/uri.rb +9 -0
- data/lib/trax/core/inheritance_hooks.rb +56 -0
- data/lib/trax/core/primitives/enum.rb +219 -0
- data/lib/trax/core/primitives/enum_value.rb +56 -0
- data/lib/trax/core.rb +11 -2
- data/lib/trax_core/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/spec/support/category_enum.rb +6 -0
- data/spec/support/inheritance_chain_namespace.rb +15 -0
- data/spec/support/some_mixin.rb +26 -0
- data/spec/trax/array_spec.rb +13 -0
- data/spec/trax/core/concern_spec.rb +15 -0
- data/spec/trax/core/ext/array_spec.rb +11 -0
- data/spec/trax/core/ext/class_spec.rb +12 -0
- data/spec/trax/core/ext/object_spec.rb +1 -1
- data/spec/trax/core/ext/uri_spec.rb +15 -0
- data/spec/trax/core/inheritance_spec.rb +0 -0
- data/spec/trax/enum_spec.rb +69 -0
- data/spec/trax/hash_spec.rb +90 -0
- data/trax_core.gemspec +7 -7
- metadata +32 -102
- data/lib/trax/array.rb +0 -7
- data/lib/trax/core/inheritance.rb +0 -22
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'trax/core/abstract_methods'
|
2
|
+
class EnumValue
|
3
|
+
include ::Trax::Core::AbstractMethods
|
4
|
+
|
5
|
+
abstract_class_attribute :tag, :value
|
6
|
+
|
7
|
+
def self.as_json(options={})
|
8
|
+
tag.to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.enum
|
12
|
+
parent
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.to_s
|
16
|
+
tag.to_s
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.to_sym
|
20
|
+
tag
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.to_i
|
24
|
+
value
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.is_enum_value?(val)
|
28
|
+
val == parent
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.to_schema
|
32
|
+
::Trax::Core::Definition.new(
|
33
|
+
:source => self.name,
|
34
|
+
:name => to_s,
|
35
|
+
:type => :enum_value,
|
36
|
+
:integer_value => to_i
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.inspect
|
41
|
+
":#{tag}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.include?(val)
|
45
|
+
self.=== val
|
46
|
+
end
|
47
|
+
|
48
|
+
#maybe this is a bad idea, not entirely sure
|
49
|
+
def self.==(val)
|
50
|
+
self.=== val
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.===(val)
|
54
|
+
[tag, to_s, to_i].include?(val)
|
55
|
+
end
|
56
|
+
end
|
data/lib/trax/core.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
require 'active_support/all'
|
2
|
-
require_relative './
|
2
|
+
require_relative './core/fs'
|
3
|
+
require_relative './core/ext/array'
|
4
|
+
require_relative './core/ext/class'
|
3
5
|
require_relative './core/ext/enumerable'
|
4
6
|
require_relative './core/ext/module'
|
7
|
+
require_relative './core/ext/hash'
|
5
8
|
require_relative './core/ext/object'
|
6
9
|
require_relative './core/ext/string'
|
10
|
+
require_relative './core/ext/symbol'
|
11
|
+
require_relative './core/ext/is'
|
12
|
+
require_relative './core/ext/uri'
|
13
|
+
require_relative './core/primitives/enum_value'
|
14
|
+
require_relative './core/primitives/enum'
|
7
15
|
|
8
16
|
module Trax
|
9
17
|
module Core
|
@@ -12,12 +20,13 @@ module Trax
|
|
12
20
|
autoload :AbstractMethods
|
13
21
|
autoload :Configuration
|
14
22
|
autoload :Concern
|
23
|
+
autoload :Definition
|
15
24
|
autoload :EagerLoadNamespace
|
16
25
|
autoload :EagerAutoloadNamespace
|
17
26
|
autoload :Errors
|
18
27
|
autoload :FS
|
19
28
|
autoload :HasMixins
|
20
|
-
autoload :
|
29
|
+
autoload :InheritanceHooks
|
21
30
|
autoload :Mixin
|
22
31
|
autoload :Mixable
|
23
32
|
end
|
data/lib/trax_core/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
module SomeConcern
|
2
|
+
extend ::Trax::Core::Concern
|
3
|
+
|
4
|
+
SOME_MOD_CONST = :Blahgity
|
5
|
+
|
6
|
+
included do
|
7
|
+
self.instance_variable_set(:@something_on_included, "something_on_included")
|
8
|
+
end
|
9
|
+
|
10
|
+
after_included do
|
11
|
+
self.const_set("SOMETHING", "ANYTHING")
|
12
|
+
self.instance_variable_set(:@otherthing, "otherthing")
|
13
|
+
end
|
14
|
+
|
15
|
+
after_extended do |base|
|
16
|
+
self.module_attribute(:some_mod_attribute) { [ base::SOME_MOD_CONST ] }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module SomeConcernConcern
|
21
|
+
extend ::SomeConcern
|
22
|
+
end
|
23
|
+
|
24
|
+
class SomeKlass
|
25
|
+
include ::SomeConcern
|
26
|
+
end
|
data/spec/trax/array_spec.rb
CHANGED
@@ -12,5 +12,18 @@ describe ::Array do
|
|
12
12
|
it{
|
13
13
|
subject.map(&[:name, :price]).map(&:last).sum.should eq 90
|
14
14
|
}
|
15
|
+
|
16
|
+
context "array of non hash objects" do
|
17
|
+
subject {
|
18
|
+
[
|
19
|
+
OpenStruct.new({:name => "something", :price => 40}),
|
20
|
+
OpenStruct.new({:name => "else", :price => 50})
|
21
|
+
]
|
22
|
+
}
|
23
|
+
|
24
|
+
it {
|
25
|
+
subject.map(&[:name, :price]).map(&[:price]).sum.should eq 90
|
26
|
+
}
|
27
|
+
end
|
15
28
|
end
|
16
29
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Trax::Core::Concern do
|
4
|
+
subject { ::SomeKlass }
|
5
|
+
|
6
|
+
context "class including concern" do
|
7
|
+
it { expect(subject.instance_variable_get(:@otherthing) ).to eq "otherthing" }
|
8
|
+
it { expect(subject::SOMETHING).to eq "ANYTHING" }
|
9
|
+
end
|
10
|
+
|
11
|
+
context "module extending concern" do
|
12
|
+
subject { ::SomeConcernConcern }
|
13
|
+
it { expect(subject.some_mod_attribute ).to eq [ :Blahgity ] }
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Array do
|
4
|
+
subject { ["one", "two", "three", "one", ["two"]]}
|
5
|
+
|
6
|
+
it { subject.flat_compact_uniq!.should eq ["one", "two", "three"] }
|
7
|
+
it "modifies array in place" do
|
8
|
+
test_subject = subject.flat_compact_uniq!
|
9
|
+
test_subject.object_id.should eq subject.object_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Class do
|
4
|
+
describe ".superclasses_until" do
|
5
|
+
it {
|
6
|
+
::InheritanceChainNamespace::D.superclasses_until(::InheritanceChainNamespace::A).should eq [
|
7
|
+
::InheritanceChainNamespace::B,
|
8
|
+
::InheritanceChainNamespace::C
|
9
|
+
]
|
10
|
+
}
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe URI do
|
4
|
+
subject{ URI.parse("http://www.google.com") }
|
5
|
+
|
6
|
+
it { expect(subject.join("something", "else")).to eq URI("http://www.google.com/something/else") }
|
7
|
+
|
8
|
+
describe "#join" do
|
9
|
+
context "is passed a uri as arg" do
|
10
|
+
it {
|
11
|
+
expect(subject.join("one", "two", URI("three"))).to eq URI("http://www.google.com/one/two/three")
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
File without changes
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Enum do
|
4
|
+
subject do
|
5
|
+
::CategoryEnum
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:expected_names) { [:default, :clothing, :shoes, :accessories] }
|
9
|
+
let(:expected_values) { [1,2,3,4] }
|
10
|
+
|
11
|
+
describe ".key?" do
|
12
|
+
it { subject.key?(:default).should eq true }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "[](val)" do
|
16
|
+
it { subject[:default].to_i.should eq 1 }
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "[](val)" do
|
20
|
+
it { subject["default"].to_i.should eq 1 }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ".value?" do
|
24
|
+
it { subject.value?(1).should eq true }
|
25
|
+
end
|
26
|
+
|
27
|
+
describe ".keys" do
|
28
|
+
it { subject.keys.should eq [:default, :clothing, :shoes, :accessories] }
|
29
|
+
end
|
30
|
+
|
31
|
+
describe ".names" do
|
32
|
+
it { subject.keys.should eq expected_names }
|
33
|
+
end
|
34
|
+
|
35
|
+
describe ".values" do
|
36
|
+
it { subject.values.should eq expected_values }
|
37
|
+
end
|
38
|
+
|
39
|
+
context "duplicate enum name" do
|
40
|
+
it { expect{subject.define_enum_value(:default, 6)}.to raise_error(::Trax::Core::Errors::DuplicateEnumValue) }
|
41
|
+
end
|
42
|
+
|
43
|
+
context "duplicate enum value" do
|
44
|
+
it {expect{subject.define_enum_value(:newthing, 1)}.to raise_error(::Trax::Core::Errors::DuplicateEnumValue) }
|
45
|
+
end
|
46
|
+
|
47
|
+
context "InstanceMethods" do
|
48
|
+
subject { ::CategoryEnum.new(:clothing) }
|
49
|
+
|
50
|
+
it { subject.choice.should eq :clothing }
|
51
|
+
it { subject.choice.should eq 2 }
|
52
|
+
it { expect(subject.next_value.to_sym).to eq :shoes }
|
53
|
+
it { expect(subject.previous_value.to_sym).to eq :default }
|
54
|
+
|
55
|
+
context "selection of values" do
|
56
|
+
it { subject.select_next_value.should eq ::CategoryEnum.new(:shoes).choice }
|
57
|
+
end
|
58
|
+
context "value is last" do
|
59
|
+
subject { ::CategoryEnum.new(:accessories) }
|
60
|
+
it { subject.next_value?.should eq false }
|
61
|
+
it { subject.previous_value?.should eq true }
|
62
|
+
|
63
|
+
context "selection of value" do
|
64
|
+
it { expect(subject.select_next_value).to eq ::CategoryEnum.new(:accessories) }
|
65
|
+
it { expect(subject.select_previous_value).to eq ::CategoryEnum.new(:shoes) }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Hash do
|
4
|
+
subject do
|
5
|
+
[
|
6
|
+
{:name => "something", :price => 40},
|
7
|
+
{:name => "else", :price => 50 }
|
8
|
+
]
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#to_proc" do
|
12
|
+
it{
|
13
|
+
subject.map(&{:name => :name, :cost => :price }).map(&[:cost]).sum.should eq 90
|
14
|
+
}
|
15
|
+
|
16
|
+
context "single hash" do
|
17
|
+
subject do
|
18
|
+
{ :name => "something", :price => 40 }
|
19
|
+
end
|
20
|
+
|
21
|
+
it do
|
22
|
+
result = subject.tap(&{:cost => :price})
|
23
|
+
result[:cost].should eq 40
|
24
|
+
end
|
25
|
+
|
26
|
+
context "transforming of values" do
|
27
|
+
subject { { :name => "something", :price => 40 } }
|
28
|
+
|
29
|
+
it do
|
30
|
+
result = subject.tap(&{
|
31
|
+
:name => :name,
|
32
|
+
:sale_price => {:price => ->(val){ val / 2 } }
|
33
|
+
})
|
34
|
+
|
35
|
+
result[:sale_price].should eq 20
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "non hash object" do
|
41
|
+
subject { ::OpenStruct.new({:name => "something", :price => 40}) }
|
42
|
+
|
43
|
+
it do
|
44
|
+
subject.as!(&{:cost => :price})[:cost].should eq 40
|
45
|
+
end
|
46
|
+
|
47
|
+
context "transforming of values" do
|
48
|
+
let(:original_subject) { ::OpenStruct.new({:name => "something", :price => 40 }) }
|
49
|
+
|
50
|
+
subject do
|
51
|
+
original_subject.as!(&{
|
52
|
+
:name => :name,
|
53
|
+
:sale_price => { :price => ->(val){ val / 2 } }
|
54
|
+
})
|
55
|
+
end
|
56
|
+
|
57
|
+
it do
|
58
|
+
subject[:sale_price].should eq 20
|
59
|
+
end
|
60
|
+
|
61
|
+
context "can transform into a new value while reusing value" do
|
62
|
+
subject do
|
63
|
+
original_subject.as!(&{
|
64
|
+
:name => :name,
|
65
|
+
:price => :price,
|
66
|
+
:sale_price => { :price => ->(val){ val / 2 } }
|
67
|
+
})
|
68
|
+
end
|
69
|
+
|
70
|
+
it { [subject[:sale_price], subject[:price]].should eq [20, 40] }
|
71
|
+
|
72
|
+
context "order dependency" do
|
73
|
+
subject do
|
74
|
+
original_subject.as!(&{
|
75
|
+
:name => :name,
|
76
|
+
:sale_price => { :price => ->(val){ val / 2 } },
|
77
|
+
:price => :price
|
78
|
+
})
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should not matter" do
|
82
|
+
[subject[:sale_price], subject[:price]].should eq [20, 40]
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
data/trax_core.gemspec
CHANGED
@@ -24,16 +24,16 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.6"
|
26
26
|
spec.add_development_dependency "rake"
|
27
|
-
spec.add_development_dependency "sqlite3"
|
27
|
+
# spec.add_development_dependency "sqlite3"
|
28
28
|
spec.add_development_dependency "rspec"
|
29
29
|
spec.add_development_dependency "rspec-pride"
|
30
|
-
spec.add_development_dependency "pry-nav"
|
30
|
+
# spec.add_development_dependency "pry-nav"
|
31
31
|
spec.add_development_dependency "simplecov"
|
32
32
|
spec.add_development_dependency 'rspec-its', '~> 1'
|
33
33
|
spec.add_development_dependency 'rspec-collection_matchers', '~> 1'
|
34
|
-
spec.add_development_dependency 'guard', '~> 2'
|
35
|
-
spec.add_development_dependency 'guard-rspec', '~> 4'
|
36
|
-
spec.add_development_dependency 'guard-bundler', '~> 2'
|
37
|
-
spec.add_development_dependency 'rb-fsevent'
|
38
|
-
spec.add_development_dependency 'terminal-notifier-guard'
|
34
|
+
# spec.add_development_dependency 'guard', '~> 2'
|
35
|
+
# spec.add_development_dependency 'guard-rspec', '~> 4'
|
36
|
+
# spec.add_development_dependency 'guard-bundler', '~> 2'
|
37
|
+
# spec.add_development_dependency 'rb-fsevent'
|
38
|
+
# spec.add_development_dependency 'terminal-notifier-guard'
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trax_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.72
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Ayre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: sqlite3
|
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
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rspec
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,20 +108,6 @@ dependencies:
|
|
122
108
|
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: pry-nav
|
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
111
|
- !ruby/object:Gem::Dependency
|
140
112
|
name: simplecov
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,76 +150,6 @@ dependencies:
|
|
178
150
|
- - "~>"
|
179
151
|
- !ruby/object:Gem::Version
|
180
152
|
version: '1'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: guard
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - "~>"
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '2'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '2'
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: guard-rspec
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - "~>"
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '4'
|
202
|
-
type: :development
|
203
|
-
prerelease: false
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
205
|
-
requirements:
|
206
|
-
- - "~>"
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: '4'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: guard-bundler
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - "~>"
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '2'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - "~>"
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '2'
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: rb-fsevent
|
225
|
-
requirement: !ruby/object:Gem::Requirement
|
226
|
-
requirements:
|
227
|
-
- - ">="
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0'
|
230
|
-
type: :development
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
requirements:
|
234
|
-
- - ">="
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '0'
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: terminal-notifier-guard
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - ">="
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: '0'
|
244
|
-
type: :development
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - ">="
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: '0'
|
251
153
|
description: Trax core dependencies and utilities
|
252
154
|
email:
|
253
155
|
- jasonayre@gmail.com
|
@@ -263,43 +165,61 @@ files:
|
|
263
165
|
- README.md
|
264
166
|
- Rakefile
|
265
167
|
- lib/trax.rb
|
266
|
-
- lib/trax/array.rb
|
267
168
|
- lib/trax/core.rb
|
268
169
|
- lib/trax/core/abstract_methods.rb
|
269
170
|
- lib/trax/core/concern.rb
|
270
171
|
- lib/trax/core/configuration.rb
|
172
|
+
- lib/trax/core/definition.rb
|
271
173
|
- lib/trax/core/eager_autoload_namespace.rb
|
272
174
|
- lib/trax/core/eager_load_namespace.rb
|
273
175
|
- lib/trax/core/errors.rb
|
176
|
+
- lib/trax/core/ext/array.rb
|
177
|
+
- lib/trax/core/ext/class.rb
|
274
178
|
- lib/trax/core/ext/enumerable.rb
|
179
|
+
- lib/trax/core/ext/hash.rb
|
180
|
+
- lib/trax/core/ext/is.rb
|
275
181
|
- lib/trax/core/ext/module.rb
|
276
182
|
- lib/trax/core/ext/object.rb
|
277
183
|
- lib/trax/core/ext/string.rb
|
184
|
+
- lib/trax/core/ext/symbol.rb
|
185
|
+
- lib/trax/core/ext/uri.rb
|
278
186
|
- lib/trax/core/fs.rb
|
279
187
|
- lib/trax/core/has_mixins.rb
|
280
|
-
- lib/trax/core/
|
188
|
+
- lib/trax/core/inheritance_hooks.rb
|
281
189
|
- lib/trax/core/isolated_mixin.rb
|
282
190
|
- lib/trax/core/mixable.rb
|
283
191
|
- lib/trax/core/mixin.rb
|
192
|
+
- lib/trax/core/primitives/enum.rb
|
193
|
+
- lib/trax/core/primitives/enum_value.rb
|
284
194
|
- lib/trax_core.rb
|
285
195
|
- lib/trax_core/version.rb
|
286
196
|
- spec/spec_helper.rb
|
197
|
+
- spec/support/category_enum.rb
|
287
198
|
- spec/support/ecom.rb
|
288
199
|
- spec/support/ecom/widget.rb
|
289
200
|
- spec/support/ecom/widget_category.rb
|
290
201
|
- spec/support/errors.rb
|
291
202
|
- spec/support/fake_namespace.rb
|
292
203
|
- spec/support/fake_namespace/priceable.rb
|
204
|
+
- spec/support/inheritance_chain_namespace.rb
|
205
|
+
- spec/support/some_mixin.rb
|
293
206
|
- spec/support/storefront.rb
|
294
207
|
- spec/support/storefront/category.rb
|
295
208
|
- spec/support/storefront/product.rb
|
296
209
|
- spec/trax/array_spec.rb
|
210
|
+
- spec/trax/core/concern_spec.rb
|
297
211
|
- spec/trax/core/eager_autoload_namespace_spec.rb
|
298
212
|
- spec/trax/core/errors_spec.rb
|
213
|
+
- spec/trax/core/ext/array_spec.rb
|
214
|
+
- spec/trax/core/ext/class_spec.rb
|
299
215
|
- spec/trax/core/ext/module_spec.rb
|
300
216
|
- spec/trax/core/ext/object_spec.rb
|
217
|
+
- spec/trax/core/ext/uri_spec.rb
|
301
218
|
- spec/trax/core/has_mixins_spec.rb
|
219
|
+
- spec/trax/core/inheritance_spec.rb
|
302
220
|
- spec/trax/core_spec.rb
|
221
|
+
- spec/trax/enum_spec.rb
|
222
|
+
- spec/trax/hash_spec.rb
|
303
223
|
- trax_core.gemspec
|
304
224
|
homepage: http://github.com/jasonayre/trax_core
|
305
225
|
licenses:
|
@@ -327,19 +247,29 @@ specification_version: 4
|
|
327
247
|
summary: Core Trax Dependencies
|
328
248
|
test_files:
|
329
249
|
- spec/spec_helper.rb
|
250
|
+
- spec/support/category_enum.rb
|
330
251
|
- spec/support/ecom.rb
|
331
252
|
- spec/support/ecom/widget.rb
|
332
253
|
- spec/support/ecom/widget_category.rb
|
333
254
|
- spec/support/errors.rb
|
334
255
|
- spec/support/fake_namespace.rb
|
335
256
|
- spec/support/fake_namespace/priceable.rb
|
257
|
+
- spec/support/inheritance_chain_namespace.rb
|
258
|
+
- spec/support/some_mixin.rb
|
336
259
|
- spec/support/storefront.rb
|
337
260
|
- spec/support/storefront/category.rb
|
338
261
|
- spec/support/storefront/product.rb
|
339
262
|
- spec/trax/array_spec.rb
|
263
|
+
- spec/trax/core/concern_spec.rb
|
340
264
|
- spec/trax/core/eager_autoload_namespace_spec.rb
|
341
265
|
- spec/trax/core/errors_spec.rb
|
266
|
+
- spec/trax/core/ext/array_spec.rb
|
267
|
+
- spec/trax/core/ext/class_spec.rb
|
342
268
|
- spec/trax/core/ext/module_spec.rb
|
343
269
|
- spec/trax/core/ext/object_spec.rb
|
270
|
+
- spec/trax/core/ext/uri_spec.rb
|
344
271
|
- spec/trax/core/has_mixins_spec.rb
|
272
|
+
- spec/trax/core/inheritance_spec.rb
|
345
273
|
- spec/trax/core_spec.rb
|
274
|
+
- spec/trax/enum_spec.rb
|
275
|
+
- spec/trax/hash_spec.rb
|
data/lib/trax/array.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
module Trax
|
2
|
-
module Core
|
3
|
-
module Inheritance
|
4
|
-
extend ::ActiveSupport::Concern
|
5
|
-
|
6
|
-
module ClassMethods
|
7
|
-
def inherited(subklass)
|
8
|
-
klass = super(subklass)
|
9
|
-
klass.class_attribute(:_after_inherited_block)
|
10
|
-
|
11
|
-
trace = ::TracePoint.new(:end) do |tracepoint|
|
12
|
-
if tracepoint.self == subklass
|
13
|
-
trace.disable
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
trace.enable
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|