fabrication 2.20.2 → 2.21.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a0d6dabff5b3d58e4abf5704c0c05084edc8733655015c0e43f941b08d64f73
|
4
|
+
data.tar.gz: 5beb461b6679fbd5d4a73f29038dfdb85fccf22e7cb738e229771178b3020403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04671cb31da952388f8df09576c7fcfcfd810b0441e6ef204c2f442d10de3e7c2831bee095a3dad10e439fb887d6d8fbd0c9c630632c3bc10b07f2f588d0ba8
|
7
|
+
data.tar.gz: feb4242360e6236ec8c000257127365c2d095acbc0ad6d3c06a1f195e2d1bb8c0c57f43911da7fd4dbf910f4e6182b6b0d30dd1066abe32c5bbfabbcbfaab1bc
|
data/lib/fabrication/version.rb
CHANGED
@@ -9,7 +9,12 @@ module Fabrication
|
|
9
9
|
|
10
10
|
def create_fabrication_file
|
11
11
|
copy_attributes_from_model if attributes.empty?
|
12
|
-
|
12
|
+
template_file = File.join(
|
13
|
+
options[:dir],
|
14
|
+
class_path,
|
15
|
+
"#{file_name}_fabricator.#{options[:extension].to_s}"
|
16
|
+
)
|
17
|
+
template 'fabricator.erb', template_file
|
13
18
|
end
|
14
19
|
|
15
20
|
def self.source_root
|
@@ -1,6 +1,10 @@
|
|
1
|
+
<% if namespaced? -%>
|
2
|
+
Fabricator(<%= ":#{singular_name}, from: '#{namespace}::#{class_name}'" %>) do
|
3
|
+
<% else -%>
|
1
4
|
Fabricator(<%= class_name.match(/::/) ? "'#{class_name}'" : ":#{singular_name}" %>) do
|
5
|
+
<% end -%>
|
2
6
|
<% width = attributes.map{|a| a.name.size }.max.to_i -%>
|
3
7
|
<% attributes.each do |attribute| -%>
|
4
8
|
<%= "%-#{width}s %s" % [attribute.name, attribute.default.inspect] %>
|
5
9
|
<% end -%>
|
6
|
-
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabrication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fabrication is an object generation framework for ActiveRecord, Mongoid,
|
14
14
|
DataMapper, Sequel, or any other Ruby object.
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.0.
|
73
|
+
rubygems_version: 3.0.3
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Implementing the factory pattern in Ruby so you don't have to.
|