azeroth 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/azeroth.gemspec +1 -0
- data/config/yardstick.yml +1 -0
- data/lib/azeroth.rb +1 -0
- data/lib/azeroth/decorator.rb +157 -0
- data/lib/azeroth/model.rb +36 -8
- data/lib/azeroth/resourceable.rb +12 -0
- data/lib/azeroth/resourceable/builder.rb +3 -0
- data/lib/azeroth/resourceable/class_methods.rb +9 -0
- data/lib/azeroth/routes_builder.rb +11 -1
- data/lib/azeroth/version.rb +1 -1
- data/spec/dummy/app/models/document/decorator.rb +7 -0
- data/spec/dummy/app/models/dummy_model.rb +8 -0
- data/spec/dummy/app/models/dummy_model/decorator.rb +13 -0
- data/spec/dummy/app/models/user.rb +4 -0
- data/spec/dummy/db/schema.rb +7 -0
- data/spec/integration/yard/azeroth/decorator_spec.rb +24 -0
- data/spec/lib/azeroth/decorator_spec.rb +95 -0
- data/spec/lib/azeroth/model_spec.rb +90 -0
- data/spec/support/factories/document.rb +7 -0
- data/spec/support/factories/dummy_model.rb +11 -0
- data/spec/support/factories/user.rb +8 -0
- data/spec/support/factory_bot.rb +7 -0
- metadata +37 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe08d469b1d7f7de1b5e506ecfb28bf25d0529f12cb0ed44e738373685ff2f86
|
4
|
+
data.tar.gz: f947cca246ca569dfad592f4a25d806bdc32f4c5071a409719590828f2fb0b36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd2677abcd53391963db5e8d4fb40cf35f3c0d86ad41a82bea3b9149a894bd6d8c7737e499c75cbb410106611f1c1c897c174069b9f5e74c8081f72e47fd258
|
7
|
+
data.tar.gz: 998012e33fe8abc53f81633a85d54181b4db805bb578b619b97c2a3974f1509ee06c260e0ef81e728b4965a9457bb805237cf711b334faded65ce399a25d07e3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/azeroth.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |gem|
|
|
25
25
|
gem.add_development_dependency 'actionpack', '~> 5.x'
|
26
26
|
gem.add_development_dependency 'activerecord', '~> 5.x'
|
27
27
|
gem.add_development_dependency 'bundler', '~> 1.16.1'
|
28
|
+
gem.add_development_dependency 'factory_bot', '~> 5.1.1'
|
28
29
|
gem.add_development_dependency 'pry', '0.12.2'
|
29
30
|
gem.add_development_dependency 'pry-nav', '0.3.0'
|
30
31
|
gem.add_development_dependency 'rails', '>= 5.2.0'
|
data/config/yardstick.yml
CHANGED
data/lib/azeroth.rb
CHANGED
@@ -0,0 +1,157 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'sinclair'
|
4
|
+
|
5
|
+
module Azeroth
|
6
|
+
# @api public
|
7
|
+
#
|
8
|
+
# Class to be used when decorating outputs
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# class DummyModel
|
12
|
+
# include ActiveModel::Model
|
13
|
+
#
|
14
|
+
# attr_accessor :id, :first_name, :last_name, :age,
|
15
|
+
# :favorite_pokemon
|
16
|
+
#
|
17
|
+
# class Decorator < Azeroth::Decorator
|
18
|
+
# expose :name
|
19
|
+
# expose :age
|
20
|
+
# expose :favorite_pokemon, as: :pokemon
|
21
|
+
#
|
22
|
+
# def name
|
23
|
+
# [object.first_name, object.last_name].join(' ')
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# model = DummyModel.new(
|
29
|
+
# id: 100,
|
30
|
+
# first_name: 'John',
|
31
|
+
# last_name: 'Wick',
|
32
|
+
# favorite_pokemon: 'Arcanine'
|
33
|
+
# )
|
34
|
+
#
|
35
|
+
# decorator = DummyModel::Decorator.new(model)
|
36
|
+
#
|
37
|
+
# decorator.as_json # returns {
|
38
|
+
# # 'name' => 'John Wick',
|
39
|
+
# # 'age' => nil,
|
40
|
+
# # 'pokemon' => 'Arcanine'
|
41
|
+
# # }
|
42
|
+
class Decorator
|
43
|
+
class << self
|
44
|
+
# @api private
|
45
|
+
#
|
46
|
+
# All attributes exposed
|
47
|
+
#
|
48
|
+
# @return [Array<Symbol>]
|
49
|
+
def attributes
|
50
|
+
@attributes ||= []
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
# rubocop:disable Naming/UncommunicativeMethodParamName
|
56
|
+
|
57
|
+
# @visibility public
|
58
|
+
# @api public
|
59
|
+
# @private
|
60
|
+
#
|
61
|
+
# Expose attributes on json decorated
|
62
|
+
#
|
63
|
+
# @param attribute [Symbol,String] attribute to be exposed
|
64
|
+
# @param as [Symbol,String] name of the attribute on the json
|
65
|
+
#
|
66
|
+
# @return [Array<Symbol>]
|
67
|
+
#
|
68
|
+
# @example
|
69
|
+
# class DummyModel
|
70
|
+
# include ActiveModel::Model
|
71
|
+
#
|
72
|
+
# attr_accessor :id, :first_name, :last_name, :age,
|
73
|
+
# :favorite_pokemon
|
74
|
+
#
|
75
|
+
# class Decorator < Azeroth::Decorator
|
76
|
+
# expose :name
|
77
|
+
# expose :age
|
78
|
+
# expose :favorite_pokemon, as: :pokemon
|
79
|
+
#
|
80
|
+
# def name
|
81
|
+
# [object.first_name, object.last_name].join(' ')
|
82
|
+
# end
|
83
|
+
# end
|
84
|
+
# end
|
85
|
+
def expose(attribute, as: attribute)
|
86
|
+
builder = Sinclair.new(self)
|
87
|
+
builder.add_method(as, "@object.#{attribute}")
|
88
|
+
builder.build
|
89
|
+
|
90
|
+
attributes << as.to_sym
|
91
|
+
end
|
92
|
+
# rubocop:enable Naming/UncommunicativeMethodParamName
|
93
|
+
end
|
94
|
+
|
95
|
+
# @api private
|
96
|
+
#
|
97
|
+
# @overload initialize(object)
|
98
|
+
# @param [Object] object to be decorated
|
99
|
+
# @overload initialize(array)
|
100
|
+
# @param array [Array] array of objects to be decorated
|
101
|
+
def initialize(object)
|
102
|
+
@object = object
|
103
|
+
end
|
104
|
+
|
105
|
+
# @api private
|
106
|
+
#
|
107
|
+
# Builds hash / Json from the given object
|
108
|
+
#
|
109
|
+
# When object is an iterator, decoration is applied to each
|
110
|
+
# and an array is returned
|
111
|
+
#
|
112
|
+
# @param *args [Hash] options (to be implemented)
|
113
|
+
#
|
114
|
+
# @return [Hash]
|
115
|
+
def as_json(*args)
|
116
|
+
return array_as_json(*args) if enum?
|
117
|
+
|
118
|
+
{}.tap do |hash|
|
119
|
+
self.class.attributes.each do |method|
|
120
|
+
hash[method.to_s] = public_send(method)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
private
|
126
|
+
|
127
|
+
attr_reader :object
|
128
|
+
# @method object
|
129
|
+
# @api private
|
130
|
+
#
|
131
|
+
# Object to be decorated
|
132
|
+
#
|
133
|
+
# @return [Object]
|
134
|
+
|
135
|
+
# @api private
|
136
|
+
# @private
|
137
|
+
#
|
138
|
+
# Checks if object is an enumerable
|
139
|
+
#
|
140
|
+
# @return [TrueClass,FalseClass]
|
141
|
+
def enum?
|
142
|
+
object.is_a?(Enumerable)
|
143
|
+
end
|
144
|
+
|
145
|
+
# @api private
|
146
|
+
# @private
|
147
|
+
#
|
148
|
+
# Iterate over enumerable decorating each entry
|
149
|
+
#
|
150
|
+
# @return [Array<Hash>]
|
151
|
+
def array_as_json(*args)
|
152
|
+
object.map do |item|
|
153
|
+
self.class.new(item).as_json(*args)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
data/lib/azeroth/model.rb
CHANGED
@@ -6,17 +6,20 @@ module Azeroth
|
|
6
6
|
#
|
7
7
|
# Model responsible for making the conection to the resource model class
|
8
8
|
class Model
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
# @param name [String,Symbol] name of the resource
|
10
|
+
def initialize(name)
|
11
|
+
if name.is_a?(Class)
|
12
|
+
@klass = name
|
13
|
+
else
|
14
|
+
@name = name.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
13
18
|
# Returns the name of the resource represented by the model
|
14
19
|
#
|
15
20
|
# @return [String]
|
16
|
-
|
17
|
-
|
18
|
-
def initialize(name)
|
19
|
-
@name = name.to_s
|
21
|
+
def name
|
22
|
+
@name ||= klass.name.gsub(/.*::/, '').underscore
|
20
23
|
end
|
21
24
|
|
22
25
|
# Resource class (real model class)
|
@@ -32,5 +35,30 @@ module Azeroth
|
|
32
35
|
def plural
|
33
36
|
name.pluralize
|
34
37
|
end
|
38
|
+
|
39
|
+
# Decorates object to return a hash
|
40
|
+
#
|
41
|
+
# Decorate uses klass::Decorator to decorate.
|
42
|
+
#
|
43
|
+
# When no decorator has been defined, object will
|
44
|
+
# receive an +#as_json+ call instead
|
45
|
+
#
|
46
|
+
# @return [Hash]
|
47
|
+
def decorate(object)
|
48
|
+
decorator_class.new(object).as_json
|
49
|
+
rescue NameError
|
50
|
+
object.as_json
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
# @private
|
56
|
+
#
|
57
|
+
# Returns decorator class for the object
|
58
|
+
#
|
59
|
+
# @return [Class] subclass of {Decorator}
|
60
|
+
def decorator_class
|
61
|
+
@decorator_class ||= klass::Decorator
|
62
|
+
end
|
35
63
|
end
|
36
64
|
end
|
data/lib/azeroth/resourceable.rb
CHANGED
@@ -19,6 +19,12 @@ module Azeroth
|
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
+
# @api private
|
23
|
+
# @private
|
24
|
+
#
|
25
|
+
# Perform rendering of an action based on the requested format
|
26
|
+
#
|
27
|
+
# @return [String]
|
22
28
|
def render_basic
|
23
29
|
action = params[:action]
|
24
30
|
respond_to do |format|
|
@@ -27,6 +33,12 @@ module Azeroth
|
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
36
|
+
# @api private
|
37
|
+
# @private
|
38
|
+
#
|
39
|
+
# returns 404 as HTTP status
|
40
|
+
#
|
41
|
+
# @return [TrueClass]
|
30
42
|
def not_found
|
31
43
|
head :not_found
|
32
44
|
end
|
@@ -135,6 +135,9 @@ module Azeroth
|
|
135
135
|
RoutesBuilder.new(model, builder, options).append
|
136
136
|
end
|
137
137
|
|
138
|
+
# Returns all updatable attributes
|
139
|
+
#
|
140
|
+
# @return [Array<String>]
|
138
141
|
def permitted_attributes
|
139
142
|
@permitted_attributes ||= klass.attribute_names - ['id']
|
140
143
|
end
|
@@ -11,6 +11,15 @@ module Azeroth
|
|
11
11
|
#
|
12
12
|
# @param name [String, Symbol] Name of the resource
|
13
13
|
# @param options [Hash]
|
14
|
+
#
|
15
|
+
# @return [Array<MethodDefinition>]
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# class DocumentsController < ApplicationController
|
19
|
+
# include Azeroth::Resourceable
|
20
|
+
#
|
21
|
+
# resource_for :document
|
22
|
+
# end
|
14
23
|
def resource_for(name, **options)
|
15
24
|
Builder.new(
|
16
25
|
self, name, Azeroth::Options.new(options)
|
@@ -57,12 +57,22 @@ module Azeroth
|
|
57
57
|
#
|
58
58
|
# @return [Array<Sinclair::MethodDefinition>]
|
59
59
|
|
60
|
+
# @private
|
61
|
+
#
|
62
|
+
# Method code to update route
|
63
|
+
#
|
64
|
+
# @return [String]
|
60
65
|
def update_code
|
61
66
|
<<-RUBY
|
62
67
|
render json: update_resource
|
63
68
|
RUBY
|
64
69
|
end
|
65
70
|
|
71
|
+
# @private
|
72
|
+
#
|
73
|
+
# Method code to create route
|
74
|
+
#
|
75
|
+
# @return [String]
|
66
76
|
def create_code
|
67
77
|
<<-RUBY
|
68
78
|
render json: create_resource
|
@@ -71,7 +81,7 @@ module Azeroth
|
|
71
81
|
|
72
82
|
# @private
|
73
83
|
#
|
74
|
-
# Method code to
|
84
|
+
# Method code to destroy route
|
75
85
|
#
|
76
86
|
# @return [String]
|
77
87
|
def destroy_code
|
data/lib/azeroth/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe Azeroth::Decorator do
|
4
|
+
subject(:decorator) { DummyModel::Decorator.new(object) }
|
5
|
+
|
6
|
+
let(:object) do
|
7
|
+
DummyModel.new(
|
8
|
+
id: 100,
|
9
|
+
first_name: 'John',
|
10
|
+
last_name: 'Wick',
|
11
|
+
favorite_pokemon: 'Arcanine'
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#as_json' do
|
16
|
+
it 'returns exposed attributes' do
|
17
|
+
expect(decorator.as_json).to eq(
|
18
|
+
'name' => 'John Wick',
|
19
|
+
'age' => nil,
|
20
|
+
'pokemon' => 'Arcanine'
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe Azeroth::Decorator do
|
4
|
+
subject(:decorator) { DummyModel::Decorator.new(object) }
|
5
|
+
|
6
|
+
let(:model) { build(:dummy_model) }
|
7
|
+
let(:object) { model }
|
8
|
+
|
9
|
+
describe '#as_json' do
|
10
|
+
context 'when object is just a model' do
|
11
|
+
let(:expected_json) do
|
12
|
+
{
|
13
|
+
name: "#{model.first_name} #{model.last_name}",
|
14
|
+
age: model.age,
|
15
|
+
pokemon: model.favorite_pokemon
|
16
|
+
}.stringify_keys
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'returns meta data defined json' do
|
20
|
+
expect(decorator.as_json).to eq(expected_json)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when object is an array' do
|
25
|
+
let(:object) { [model, other_model] }
|
26
|
+
|
27
|
+
let(:other_model) do
|
28
|
+
build(
|
29
|
+
:dummy_model,
|
30
|
+
first_name: 'dum',
|
31
|
+
age: 65,
|
32
|
+
favorite_pokemon: :bulbasaur
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
let(:expected_json) do
|
37
|
+
[
|
38
|
+
{
|
39
|
+
name: "#{model.first_name} #{model.last_name}",
|
40
|
+
age: model.age,
|
41
|
+
pokemon: model.favorite_pokemon
|
42
|
+
}, {
|
43
|
+
name: "#{other_model.first_name} #{other_model.last_name}",
|
44
|
+
age: other_model.age,
|
45
|
+
pokemon: other_model.favorite_pokemon
|
46
|
+
}
|
47
|
+
].map(&:stringify_keys)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'returns meta data defined json' do
|
51
|
+
expect(decorator.as_json).to eq(expected_json)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when object is just an active record model' do
|
56
|
+
subject(:decorator) { Document::Decorator.new(object) }
|
57
|
+
|
58
|
+
let(:reference) { SecureRandom.uuid }
|
59
|
+
let!(:model) { create(:document, reference: reference) }
|
60
|
+
|
61
|
+
let(:expected_json) do
|
62
|
+
{
|
63
|
+
name: model.name
|
64
|
+
}.stringify_keys
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'returns meta data defined json' do
|
68
|
+
expect(decorator.as_json).to eq(expected_json)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context 'when object is an active record relation' do
|
73
|
+
subject(:decorator) { Document::Decorator.new(object) }
|
74
|
+
|
75
|
+
let(:reference) { SecureRandom.uuid }
|
76
|
+
let!(:model) { create(:document, reference: reference) }
|
77
|
+
let(:object) { Document.where(reference: reference) }
|
78
|
+
let!(:other_model) { create(:document, reference: reference) }
|
79
|
+
|
80
|
+
let(:expected_json) do
|
81
|
+
[
|
82
|
+
{
|
83
|
+
name: model.name
|
84
|
+
}, {
|
85
|
+
name: other_model.name
|
86
|
+
}
|
87
|
+
].map(&:stringify_keys)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'returns meta data defined json' do
|
91
|
+
expect(decorator.as_json).to eq(expected_json)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -30,4 +30,94 @@ describe Azeroth::Model do
|
|
30
30
|
|
31
31
|
it_behaves_like 'a model wrapper'
|
32
32
|
end
|
33
|
+
|
34
|
+
context 'when initializing with string' do
|
35
|
+
let(:input) { 'document' }
|
36
|
+
|
37
|
+
it_behaves_like 'a model wrapper'
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'when initializing with model' do
|
41
|
+
let(:input) { Document }
|
42
|
+
|
43
|
+
it_behaves_like 'a model wrapper'
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#decorate' do
|
47
|
+
context 'when model has a decorator' do
|
48
|
+
let(:input) { :document }
|
49
|
+
let(:reference) { SecureRandom.uuid }
|
50
|
+
let!(:object) { create(:document, reference: reference) }
|
51
|
+
|
52
|
+
context 'when object is just a model and has decorator' do
|
53
|
+
let!(:object) { create(:document, reference: reference) }
|
54
|
+
|
55
|
+
let(:expected_json) do
|
56
|
+
{
|
57
|
+
name: object.name
|
58
|
+
}.stringify_keys
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'returns meta data defined json' do
|
62
|
+
expect(model.decorate(object)).to eq(expected_json)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'when object is an active record relation' do
|
67
|
+
let(:relation) { Document.where(reference: reference) }
|
68
|
+
let!(:other_object) { create(:document, reference: reference) }
|
69
|
+
|
70
|
+
let(:expected_json) do
|
71
|
+
[
|
72
|
+
{
|
73
|
+
name: object.name
|
74
|
+
}, {
|
75
|
+
name: other_object.name
|
76
|
+
}
|
77
|
+
].map(&:stringify_keys)
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'returns meta data defined json' do
|
81
|
+
expect(model.decorate(relation)).to eq(expected_json)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context 'when model is an active record that does not have a decorator' do
|
87
|
+
let(:input) { Class.new(User) }
|
88
|
+
let(:reference) { SecureRandom.uuid }
|
89
|
+
let!(:object) { create(:user, reference: reference) }
|
90
|
+
|
91
|
+
context 'when object is just a model' do
|
92
|
+
it 'returns regular as_json' do
|
93
|
+
expect(model.decorate(object)).to eq(object.as_json)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context 'when object is an active record relation' do
|
98
|
+
let(:relation) { User.where(reference: reference) }
|
99
|
+
|
100
|
+
before { create(:user, reference: reference) }
|
101
|
+
|
102
|
+
it 'returns regular as_json' do
|
103
|
+
expect(model.decorate(relation)).to eq(relation.as_json)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
context 'when model is an active model that does not have a decorator' do
|
109
|
+
let(:input) do
|
110
|
+
Class.new do
|
111
|
+
include ActiveModel::Model
|
112
|
+
attr_accessor :id, :name
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
let(:object) { input.new(id: 1, name: 'my name') }
|
117
|
+
|
118
|
+
it 'returns regular as_json' do
|
119
|
+
expect(model.decorate(object)).to eq(object.as_json)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
33
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azeroth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darthjee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.16.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: factory_bot
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 5.1.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 5.1.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: pry
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -386,6 +400,7 @@ files:
|
|
386
400
|
- config/yardstick.yml
|
387
401
|
- docker-compose.yml
|
388
402
|
- lib/azeroth.rb
|
403
|
+
- lib/azeroth/decorator.rb
|
389
404
|
- lib/azeroth/model.rb
|
390
405
|
- lib/azeroth/options.rb
|
391
406
|
- lib/azeroth/resource_builder.rb
|
@@ -415,6 +430,10 @@ files:
|
|
415
430
|
- spec/dummy/app/models/application_record.rb
|
416
431
|
- spec/dummy/app/models/concerns/.keep
|
417
432
|
- spec/dummy/app/models/document.rb
|
433
|
+
- spec/dummy/app/models/document/decorator.rb
|
434
|
+
- spec/dummy/app/models/dummy_model.rb
|
435
|
+
- spec/dummy/app/models/dummy_model/decorator.rb
|
436
|
+
- spec/dummy/app/models/user.rb
|
418
437
|
- spec/dummy/app/views/documents/edit.html
|
419
438
|
- spec/dummy/app/views/documents/index.html
|
420
439
|
- spec/dummy/app/views/documents/new.html
|
@@ -464,6 +483,8 @@ files:
|
|
464
483
|
- spec/dummy/storage/.keep
|
465
484
|
- spec/dummy/tmp/.keep
|
466
485
|
- spec/dummy/tmp/storage/.keep
|
486
|
+
- spec/integration/yard/azeroth/decorator_spec.rb
|
487
|
+
- spec/lib/azeroth/decorator_spec.rb
|
467
488
|
- spec/lib/azeroth/model_spec.rb
|
468
489
|
- spec/lib/azeroth/resource_builder_spec.rb
|
469
490
|
- spec/lib/azeroth/resource_route_builder_spec.rb
|
@@ -474,6 +495,10 @@ files:
|
|
474
495
|
- spec/support/app/controllers/resource_builder_controller.rb
|
475
496
|
- spec/support/app/controllers/resource_route_builder_controller.rb
|
476
497
|
- spec/support/app/controllers/routes_builder_controller.rb
|
498
|
+
- spec/support/factories/document.rb
|
499
|
+
- spec/support/factories/dummy_model.rb
|
500
|
+
- spec/support/factories/user.rb
|
501
|
+
- spec/support/factory_bot.rb
|
477
502
|
- spec/support/matchers/add_method.rb
|
478
503
|
- spec/support/shared_examples/resource_routes.rb
|
479
504
|
homepage: https://github.com/darthjee/azeroth
|
@@ -520,6 +545,10 @@ test_files:
|
|
520
545
|
- spec/dummy/app/models/application_record.rb
|
521
546
|
- spec/dummy/app/models/concerns/.keep
|
522
547
|
- spec/dummy/app/models/document.rb
|
548
|
+
- spec/dummy/app/models/document/decorator.rb
|
549
|
+
- spec/dummy/app/models/dummy_model.rb
|
550
|
+
- spec/dummy/app/models/dummy_model/decorator.rb
|
551
|
+
- spec/dummy/app/models/user.rb
|
523
552
|
- spec/dummy/app/views/documents/edit.html
|
524
553
|
- spec/dummy/app/views/documents/index.html
|
525
554
|
- spec/dummy/app/views/documents/new.html
|
@@ -569,6 +598,8 @@ test_files:
|
|
569
598
|
- spec/dummy/storage/.keep
|
570
599
|
- spec/dummy/tmp/.keep
|
571
600
|
- spec/dummy/tmp/storage/.keep
|
601
|
+
- spec/integration/yard/azeroth/decorator_spec.rb
|
602
|
+
- spec/lib/azeroth/decorator_spec.rb
|
572
603
|
- spec/lib/azeroth/model_spec.rb
|
573
604
|
- spec/lib/azeroth/resource_builder_spec.rb
|
574
605
|
- spec/lib/azeroth/resource_route_builder_spec.rb
|
@@ -579,5 +610,9 @@ test_files:
|
|
579
610
|
- spec/support/app/controllers/resource_builder_controller.rb
|
580
611
|
- spec/support/app/controllers/resource_route_builder_controller.rb
|
581
612
|
- spec/support/app/controllers/routes_builder_controller.rb
|
613
|
+
- spec/support/factories/document.rb
|
614
|
+
- spec/support/factories/dummy_model.rb
|
615
|
+
- spec/support/factories/user.rb
|
616
|
+
- spec/support/factory_bot.rb
|
582
617
|
- spec/support/matchers/add_method.rb
|
583
618
|
- spec/support/shared_examples/resource_routes.rb
|