faker_maker 2.1.1 → 3.0.0
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/.github/workflows/ruby.yml +13 -14
- data/.rubocop.yml +3 -3
- data/Gemfile +4 -0
- data/README.md +7 -1
- data/faker_maker.gemspec +2 -2
- data/lib/faker_maker/factory.rb +2 -2
- data/lib/faker_maker/version.rb +1 -1
- data/lib/faker_maker.rb +1 -1
- data/usefakermaker.com/.gitignore +5 -0
- data/usefakermaker.com/404.html +25 -0
- data/usefakermaker.com/Gemfile +39 -0
- data/usefakermaker.com/README.md +5 -0
- data/usefakermaker.com/_config.yml +299 -0
- data/usefakermaker.com/_config.yml.orig +55 -0
- data/usefakermaker.com/_data/navigation.yml +51 -0
- data/usefakermaker.com/_data/ui-text.yml +2132 -0
- data/usefakermaker.com/_site/assets/css/main.css +6 -0
- data/usefakermaker.com/_site/assets/css/main.css.map +1 -0
- data/usefakermaker.com/_site/assets/js/_main.js +230 -0
- data/usefakermaker.com/_site/assets/js/lunr/lunr-en.js +69 -0
- data/usefakermaker.com/_site/assets/js/lunr/lunr-gr.js +522 -0
- data/usefakermaker.com/_site/assets/js/lunr/lunr-store.js +1 -0
- data/usefakermaker.com/_site/assets/js/lunr/lunr.js +3475 -0
- data/usefakermaker.com/_site/assets/js/lunr/lunr.min.js +6 -0
- data/usefakermaker.com/_site/assets/js/main.min.js +7 -0
- data/usefakermaker.com/_site/assets/js/main.min.js.map +1 -0
- data/usefakermaker.com/_site/assets/js/plugins/gumshoe.js +484 -0
- data/usefakermaker.com/_site/assets/js/plugins/jquery.ba-throttle-debounce.js +252 -0
- data/usefakermaker.com/_site/assets/js/plugins/jquery.fitvids.js +82 -0
- data/usefakermaker.com/_site/assets/js/plugins/jquery.greedy-navigation.js +128 -0
- data/usefakermaker.com/_site/assets/js/plugins/jquery.magnific-popup.js +1860 -0
- data/usefakermaker.com/_site/assets/js/plugins/smooth-scroll.js +650 -0
- data/usefakermaker.com/_site/assets/js/vendor/jquery/jquery-3.6.0.js +10881 -0
- data/usefakermaker.com/_site/feed.xml +1 -0
- data/usefakermaker.com/_site/robots.txt +1 -0
- data/usefakermaker.com/_site/sitemap.xml +3 -0
- data/usefakermaker.com/about.markdown +18 -0
- data/usefakermaker.com/assets/images/pug.png +0 -0
- data/usefakermaker.com/assets/images/unipug.svg +135 -0
- data/usefakermaker.com/docs/contributing/index.md +7 -0
- data/{docs/installation.md → usefakermaker.com/docs/installing/index.md} +3 -5
- data/{docs/usage/arrays.md → usefakermaker.com/docs/usage/arrays/index.md} +2 -6
- data/{docs/usage/building_instances.md → usefakermaker.com/docs/usage/building-instances/index.md} +6 -10
- data/{docs/usage/chaos.md → usefakermaker.com/docs/usage/chaos/index.md} +6 -10
- data/{docs/usage/destroying_factories.md → usefakermaker.com/docs/usage/destroying-factories/index.md} +7 -9
- data/{docs/usage/embedding_factories.md → usefakermaker.com/docs/usage/embedding-factories/index.md} +2 -6
- data/{docs/usage → usefakermaker.com/docs/usage/getting-started}/index.md +12 -15
- data/{docs/usage/audit_logs.md → usefakermaker.com/docs/usage/history-logging/index.md} +4 -4
- data/{docs/usage/inheritance.md → usefakermaker.com/docs/usage/inheritance/index.md} +7 -9
- data/{docs/usage/json_field_names.md → usefakermaker.com/docs/usage/json-field-names/index.md} +2 -6
- data/{docs/usage/lifecycle_hooks.md → usefakermaker.com/docs/usage/lifecycle-hooks/index.md} +3 -7
- data/{docs/usage/dependencies.md → usefakermaker.com/docs/usage/managing-dependencies/index.md} +2 -6
- data/{docs/usage/omitting_fields copy.md → usefakermaker.com/docs/usage/omitting-fields/index.md} +4 -8
- data/usefakermaker.com/pages/index.markdown +27 -0
- metadata +53 -30
- data/docs/.bundle/config +0 -2
- data/docs/.keep +0 -1
- data/docs/_config.yml +0 -8
- data/docs/contributing.md +0 -9
- data/docs/credits.md +0 -9
- data/docs/index.md +0 -21
- data/docs/logo.png +0 -0
@@ -0,0 +1,230 @@
|
|
1
|
+
/* ==========================================================================
|
2
|
+
jQuery plugin settings and other scripts
|
3
|
+
========================================================================== */
|
4
|
+
|
5
|
+
$(document).ready(function () {
|
6
|
+
// FitVids init
|
7
|
+
$("#main").fitVids();
|
8
|
+
|
9
|
+
// Follow menu drop down
|
10
|
+
$(".author__urls-wrapper button").on("click", function () {
|
11
|
+
$(".author__urls").toggleClass("is--visible");
|
12
|
+
$(".author__urls-wrapper").find("button").toggleClass("open");
|
13
|
+
});
|
14
|
+
|
15
|
+
// Close search screen with Esc key
|
16
|
+
$(document).keyup(function (e) {
|
17
|
+
if (e.keyCode === 27) {
|
18
|
+
if ($(".initial-content").hasClass("is--hidden")) {
|
19
|
+
$(".search-content").toggleClass("is--visible");
|
20
|
+
$(".initial-content").toggleClass("is--hidden");
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
// Search toggle
|
26
|
+
$(".search__toggle").on("click", function () {
|
27
|
+
$(".search-content").toggleClass("is--visible");
|
28
|
+
$(".initial-content").toggleClass("is--hidden");
|
29
|
+
// set focus on input
|
30
|
+
setTimeout(function () {
|
31
|
+
$(".search-content input").focus();
|
32
|
+
}, 400);
|
33
|
+
});
|
34
|
+
|
35
|
+
// Smooth scrolling
|
36
|
+
var scroll = new SmoothScroll('a[href*="#"]', {
|
37
|
+
offset: 20,
|
38
|
+
speed: 400,
|
39
|
+
speedAsDuration: true,
|
40
|
+
durationMax: 500,
|
41
|
+
});
|
42
|
+
|
43
|
+
// Gumshoe scroll spy init
|
44
|
+
if ($("nav.toc").length > 0) {
|
45
|
+
var spy = new Gumshoe("nav.toc a", {
|
46
|
+
// Active classes
|
47
|
+
navClass: "active", // applied to the nav list item
|
48
|
+
contentClass: "active", // applied to the content
|
49
|
+
|
50
|
+
// Nested navigation
|
51
|
+
nested: false, // if true, add classes to parents of active link
|
52
|
+
nestedClass: "active", // applied to the parent items
|
53
|
+
|
54
|
+
// Offset & reflow
|
55
|
+
offset: 20, // how far from the top of the page to activate a content area
|
56
|
+
reflow: true, // if true, listen for reflows
|
57
|
+
|
58
|
+
// Event support
|
59
|
+
events: true, // if true, emit custom events
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
// Auto scroll sticky ToC with content
|
64
|
+
const scrollTocToContent = function (event) {
|
65
|
+
var target = event.target;
|
66
|
+
var scrollOptions = { behavior: "auto", block: "nearest", inline: "start" };
|
67
|
+
|
68
|
+
var tocElement = document.querySelector("aside.sidebar__right.sticky");
|
69
|
+
if (!tocElement) return;
|
70
|
+
if (window.getComputedStyle(tocElement).position !== "sticky") return;
|
71
|
+
|
72
|
+
if (target.parentElement.classList.contains("toc__menu") && target == target.parentElement.firstElementChild) {
|
73
|
+
// Scroll to top instead
|
74
|
+
document.querySelector("nav.toc header").scrollIntoView(scrollOptions);
|
75
|
+
} else {
|
76
|
+
target.scrollIntoView(scrollOptions);
|
77
|
+
}
|
78
|
+
};
|
79
|
+
|
80
|
+
// Has issues on Firefox, whitelist Chrome for now
|
81
|
+
if (!!window.chrome) {
|
82
|
+
document.addEventListener("gumshoeActivate", scrollTocToContent);
|
83
|
+
}
|
84
|
+
|
85
|
+
// add lightbox class to all image links
|
86
|
+
$(
|
87
|
+
"a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']"
|
88
|
+
).has("> img").addClass("image-popup");
|
89
|
+
|
90
|
+
// Magnific-Popup options
|
91
|
+
$(".image-popup").magnificPopup({
|
92
|
+
// disableOn: function() {
|
93
|
+
// if( $(window).width() < 500 ) {
|
94
|
+
// return false;
|
95
|
+
// }
|
96
|
+
// return true;
|
97
|
+
// },
|
98
|
+
type: "image",
|
99
|
+
tLoading: "Loading image #%curr%...",
|
100
|
+
gallery: {
|
101
|
+
enabled: true,
|
102
|
+
navigateByImgClick: true,
|
103
|
+
preload: [0, 1], // Will preload 0 - before current, and 1 after the current image
|
104
|
+
},
|
105
|
+
image: {
|
106
|
+
tError: '<a href="%url%">Image #%curr%</a> could not be loaded.',
|
107
|
+
},
|
108
|
+
removalDelay: 500, // Delay in milliseconds before popup is removed
|
109
|
+
// Class that is added to body when popup is open.
|
110
|
+
// make it unique to apply your CSS animations just to this exact popup
|
111
|
+
mainClass: "mfp-zoom-in",
|
112
|
+
callbacks: {
|
113
|
+
beforeOpen: function () {
|
114
|
+
// just a hack that adds mfp-anim class to markup
|
115
|
+
this.st.image.markup = this.st.image.markup.replace(
|
116
|
+
"mfp-figure",
|
117
|
+
"mfp-figure mfp-with-anim"
|
118
|
+
);
|
119
|
+
},
|
120
|
+
},
|
121
|
+
closeOnContentClick: true,
|
122
|
+
midClick: true, // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
|
123
|
+
});
|
124
|
+
|
125
|
+
// Add anchors for headings
|
126
|
+
document
|
127
|
+
.querySelector(".page__content")
|
128
|
+
.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
129
|
+
.forEach(function (element) {
|
130
|
+
var id = element.getAttribute("id");
|
131
|
+
if (id) {
|
132
|
+
var anchor = document.createElement("a");
|
133
|
+
anchor.className = "header-link";
|
134
|
+
anchor.href = "#" + id;
|
135
|
+
anchor.innerHTML =
|
136
|
+
'<span class="sr-only">Permalink</span><i class="fas fa-link"></i>';
|
137
|
+
anchor.title = "Permalink";
|
138
|
+
element.appendChild(anchor);
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
// Add copy button for <pre> blocks
|
143
|
+
var copyText = function (text) {
|
144
|
+
if (document.queryCommandEnabled("copy") && navigator.clipboard) {
|
145
|
+
navigator.clipboard.writeText(text).then(
|
146
|
+
() => true,
|
147
|
+
() => console.error("Failed to copy text to clipboard: " + text)
|
148
|
+
);
|
149
|
+
return true;
|
150
|
+
} else {
|
151
|
+
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
|
152
|
+
|
153
|
+
var textarea = document.createElement("textarea");
|
154
|
+
textarea.className = "clipboard-helper";
|
155
|
+
textarea.style[isRTL ? "right" : "left"] = "-9999px";
|
156
|
+
// Move element to the same position vertically
|
157
|
+
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
158
|
+
textarea.style.top = yPosition + "px";
|
159
|
+
|
160
|
+
textarea.setAttribute("readonly", "");
|
161
|
+
textarea.value = text;
|
162
|
+
document.body.appendChild(textarea);
|
163
|
+
|
164
|
+
var success = true;
|
165
|
+
try {
|
166
|
+
textarea.select();
|
167
|
+
success = document.execCommand("copy");
|
168
|
+
} catch (e) {
|
169
|
+
success = false;
|
170
|
+
}
|
171
|
+
textarea.parentNode.removeChild(textarea);
|
172
|
+
return success;
|
173
|
+
}
|
174
|
+
};
|
175
|
+
|
176
|
+
var copyButtonEventListener = function (event) {
|
177
|
+
var thisButton = event.target;
|
178
|
+
|
179
|
+
// Locate the <code> element
|
180
|
+
var codeBlock = thisButton.nextElementSibling;
|
181
|
+
while (codeBlock && codeBlock.tagName.toLowerCase() !== "code") {
|
182
|
+
codeBlock = codeBlock.nextElementSibling;
|
183
|
+
}
|
184
|
+
if (!codeBlock) {
|
185
|
+
// No <code> found - wtf?
|
186
|
+
console.warn(thisButton);
|
187
|
+
throw new Error("No code block found for this button.");
|
188
|
+
}
|
189
|
+
|
190
|
+
// Skip line numbers if present (i.e. {% highlight lineno %})
|
191
|
+
var realCodeBlock = codeBlock.querySelector("td.code, td.rouge-code");
|
192
|
+
if (realCodeBlock) {
|
193
|
+
codeBlock = realCodeBlock;
|
194
|
+
}
|
195
|
+
var result = copyText(codeBlock.innerText);
|
196
|
+
// Restore the focus to the button
|
197
|
+
thisButton.focus();
|
198
|
+
if (result) {
|
199
|
+
if (thisButton.interval !== null) {
|
200
|
+
clearInterval(thisButton.interval);
|
201
|
+
}
|
202
|
+
thisButton.classList.add('copied');
|
203
|
+
thisButton.interval = setTimeout(function () {
|
204
|
+
thisButton.classList.remove('copied');
|
205
|
+
clearInterval(thisButton.interval);
|
206
|
+
thisButton.interval = null;
|
207
|
+
}, 1500);
|
208
|
+
}
|
209
|
+
return result;
|
210
|
+
};
|
211
|
+
|
212
|
+
if (window.enable_copy_code_button) {
|
213
|
+
document
|
214
|
+
.querySelectorAll(".page__content pre.highlight > code")
|
215
|
+
.forEach(function (element, index, parentList) {
|
216
|
+
// Locate the <pre> element
|
217
|
+
var container = element.parentElement;
|
218
|
+
// Sanity check - don't add an extra button if there's already one
|
219
|
+
if (container.firstElementChild.tagName.toLowerCase() !== "code") {
|
220
|
+
return;
|
221
|
+
}
|
222
|
+
var copyButton = document.createElement("button");
|
223
|
+
copyButton.title = "Copy to clipboard";
|
224
|
+
copyButton.className = "clipboard-copy-button";
|
225
|
+
copyButton.innerHTML = '<span class="sr-only">Copy code</span><i class="far fa-fw fa-copy"></i><i class="fas fa-fw fa-check copied"></i>';
|
226
|
+
copyButton.addEventListener("click", copyButtonEventListener);
|
227
|
+
container.prepend(copyButton);
|
228
|
+
});
|
229
|
+
}
|
230
|
+
});
|
@@ -0,0 +1,69 @@
|
|
1
|
+
var idx = lunr(function () {
|
2
|
+
this.field('title')
|
3
|
+
this.field('excerpt')
|
4
|
+
this.field('categories')
|
5
|
+
this.field('tags')
|
6
|
+
this.ref('id')
|
7
|
+
|
8
|
+
this.pipeline.remove(lunr.trimmer)
|
9
|
+
|
10
|
+
for (var item in store) {
|
11
|
+
this.add({
|
12
|
+
title: store[item].title,
|
13
|
+
excerpt: store[item].excerpt,
|
14
|
+
categories: store[item].categories,
|
15
|
+
tags: store[item].tags,
|
16
|
+
id: item
|
17
|
+
})
|
18
|
+
}
|
19
|
+
});
|
20
|
+
|
21
|
+
$(document).ready(function() {
|
22
|
+
$('input#search').on('keyup', function () {
|
23
|
+
var resultdiv = $('#results');
|
24
|
+
var query = $(this).val().toLowerCase();
|
25
|
+
var result =
|
26
|
+
idx.query(function (q) {
|
27
|
+
query.split(lunr.tokenizer.separator).forEach(function (term) {
|
28
|
+
q.term(term, { boost: 100 })
|
29
|
+
if(query.lastIndexOf(" ") != query.length-1){
|
30
|
+
q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 })
|
31
|
+
}
|
32
|
+
if (term != ""){
|
33
|
+
q.term(term, { usePipeline: false, editDistance: 1, boost: 1 })
|
34
|
+
}
|
35
|
+
})
|
36
|
+
});
|
37
|
+
resultdiv.empty();
|
38
|
+
resultdiv.prepend('<p class="results__found">'+result.length+' Result(s) found</p>');
|
39
|
+
for (var item in result) {
|
40
|
+
var ref = result[item].ref;
|
41
|
+
if(store[ref].teaser){
|
42
|
+
var searchitem =
|
43
|
+
'<div class="list__item">'+
|
44
|
+
'<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">'+
|
45
|
+
'<h2 class="archive__item-title" itemprop="headline">'+
|
46
|
+
'<a href="'+store[ref].url+'" rel="permalink">'+store[ref].title+'</a>'+
|
47
|
+
'</h2>'+
|
48
|
+
'<div class="archive__item-teaser">'+
|
49
|
+
'<img src="'+store[ref].teaser+'" alt="">'+
|
50
|
+
'</div>'+
|
51
|
+
'<p class="archive__item-excerpt" itemprop="description">'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...</p>'+
|
52
|
+
'</article>'+
|
53
|
+
'</div>';
|
54
|
+
}
|
55
|
+
else{
|
56
|
+
var searchitem =
|
57
|
+
'<div class="list__item">'+
|
58
|
+
'<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">'+
|
59
|
+
'<h2 class="archive__item-title" itemprop="headline">'+
|
60
|
+
'<a href="'+store[ref].url+'" rel="permalink">'+store[ref].title+'</a>'+
|
61
|
+
'</h2>'+
|
62
|
+
'<p class="archive__item-excerpt" itemprop="description">'+store[ref].excerpt.split(" ").splice(0,20).join(" ")+'...</p>'+
|
63
|
+
'</article>'+
|
64
|
+
'</div>';
|
65
|
+
}
|
66
|
+
resultdiv.append(searchitem);
|
67
|
+
}
|
68
|
+
});
|
69
|
+
});
|