auto_decorator 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/auto_decorator/version.rb +1 -1
- data/lib/generators/decorator/decorator_generator.rb +22 -0
- metadata +4 -4
- data/lib/generators/auto_decorator/decorator_generator.rb +0 -26
- /data/lib/generators/{auto_decorator → decorator}/templates/decorator.rb.tt +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f93c72bc47588ec9342ebab2825ccd03a36addfe009e15fbd63044c4c2775b5
|
|
4
|
+
data.tar.gz: 8cded54933aefab27c97ec72000a409e7a5cc208ba2903cef06e264750d45e97
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39c051a8991cb1221d75914bbbdf41daf0d1c0516ab08a22abd24f47f3321aadeb2b7000a7d677d0d4ddf97345443631322e71208666894d42e4e39a4f9cd454
|
|
7
|
+
data.tar.gz: 7d61493e76c15c944dff7de49026ef48e04055460548d0046c46958839fc03937ac266e407d20ce2e7912a8701b12d842429853bd570237be442a78ffed543b1
|
data/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails/generators"
|
|
4
|
+
|
|
5
|
+
class DecoratorGenerator < Rails::Generators::NamedBase
|
|
6
|
+
source_root File.expand_path("templates", __dir__)
|
|
7
|
+
|
|
8
|
+
def create_decorator_file
|
|
9
|
+
template "decorator.rb.tt",
|
|
10
|
+
File.join("app/decorators", class_path.join("/"), "#{file_name}_decorator.rb")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def decorator_name
|
|
16
|
+
"#{class_name.demodulize}Decorator"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def namespaces
|
|
20
|
+
class_name.deconstantize.split("::").reject(&:empty?)
|
|
21
|
+
end
|
|
22
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: auto_decorator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexey Poimtsev
|
|
@@ -95,8 +95,8 @@ files:
|
|
|
95
95
|
- lib/auto_decorator/loader.rb
|
|
96
96
|
- lib/auto_decorator/railtie.rb
|
|
97
97
|
- lib/auto_decorator/version.rb
|
|
98
|
-
- lib/generators/
|
|
99
|
-
- lib/generators/
|
|
98
|
+
- lib/generators/decorator/decorator_generator.rb
|
|
99
|
+
- lib/generators/decorator/templates/decorator.rb.tt
|
|
100
100
|
homepage: https://github.com/alec-c4/auto_decorator
|
|
101
101
|
licenses:
|
|
102
102
|
- MIT
|
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
119
119
|
- !ruby/object:Gem::Version
|
|
120
120
|
version: '0'
|
|
121
121
|
requirements: []
|
|
122
|
-
rubygems_version: 4.0.
|
|
122
|
+
rubygems_version: 4.0.8
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: Convention-based decorator autoloading for Rails models
|
|
125
125
|
test_files: []
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rails/generators"
|
|
4
|
-
|
|
5
|
-
module AutoDecorator
|
|
6
|
-
module Generators
|
|
7
|
-
class DecoratorGenerator < Rails::Generators::NamedBase
|
|
8
|
-
source_root File.expand_path("templates", __dir__)
|
|
9
|
-
|
|
10
|
-
def create_decorator_file
|
|
11
|
-
template "decorator.rb.tt",
|
|
12
|
-
File.join("app/decorators", class_path.join("/"), "#{file_name}_decorator.rb")
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
def decorator_name
|
|
18
|
-
"#{class_name.demodulize}Decorator"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def namespaces
|
|
22
|
-
class_name.deconstantize.split("::").reject(&:empty?)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
File without changes
|