oaken 0.9.0 → 0.9.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/README.md +11 -0
- data/lib/oaken/loader.rb +1 -7
- data/lib/oaken/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26963660acac39f907c83e52191ce7e99e005e140df3bacf6ff70d7e02d17f49
|
4
|
+
data.tar.gz: 95227e2756e40db548630ac8e667192a8bb3d00230f1d8218dd595a68c6f2907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b61959db0e0a87609dbfb209c846a7696f051bd214cc125678499936c4879399eef9a37acdb0d65eeb1296b34d7c13142dd04bbc6ad23cb2137bcbefdf82a74f
|
7
|
+
data.tar.gz: 968f223df5ad49644a47c3fe3eeca04a62d51aeb0d9060ec3c04245428857ef6adc72fee5784c47570778ae95684b6347d80cdbc15d7877971240ece1d1281f0
|
data/README.md
CHANGED
@@ -120,11 +120,22 @@ So you get a cohesive & stable dataset with a story like fixtures & their fast l
|
|
120
120
|
|
121
121
|
The end result is you end up writing less data back & forth to the database because you aren’t cobbling stuff together.
|
122
122
|
|
123
|
+
## Praise from users
|
124
|
+
|
123
125
|
> But seriously; Oaken is one of the single greatest tools I've added to my belt in the past year
|
124
126
|
>
|
125
127
|
> It's made cross-environment shared data, data prepping for demos, edge-case tests, and overall development much more reliable & shareable across a team
|
128
|
+
>
|
126
129
|
> [@tcannonfodder](https://github.com/tcannonfodder)
|
127
130
|
|
131
|
+
> Thanks for this wonderful project! My head doesn't grok factories and I just want vanilla Rails testing with something better than fixtures, and this is so much better.
|
132
|
+
>
|
133
|
+
> The default YAML fixtures is somehow both too simple and too convoluted. It's hard to reference complex associations with it, and the fact that the data gets spread across many files makes it hard to read and harder to grasp.
|
134
|
+
>
|
135
|
+
> Oaken, on the other hand, is closer to using the console, which we already know, only in a repeatable and tidier way. The testing data/seeds setup process just feels more intentional this way.
|
136
|
+
>
|
137
|
+
> [@evenreven](https://github.com/evenreven)
|
138
|
+
|
128
139
|
## Design goals
|
129
140
|
|
130
141
|
### Consistent data & constrained Ruby
|
data/lib/oaken/loader.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Oaken::Loader
|
4
|
-
class NoSeedsFoundError < ArgumentError; end
|
5
|
-
|
6
4
|
autoload :Type, "oaken/loader/type"
|
7
5
|
|
8
6
|
attr_reader :lookup_paths, :locator, :provider, :context
|
@@ -75,7 +73,7 @@ class Oaken::Loader
|
|
75
73
|
def seed(*identifiers)
|
76
74
|
setup
|
77
75
|
|
78
|
-
identifiers.flat_map { glob
|
76
|
+
identifiers.flat_map { glob _1 }.each { load_one _1 }
|
79
77
|
self
|
80
78
|
end
|
81
79
|
|
@@ -91,10 +89,6 @@ class Oaken::Loader
|
|
91
89
|
private
|
92
90
|
def setup = @setup ||= glob(:setup).each { load_one _1 }
|
93
91
|
|
94
|
-
def glob!(identifier)
|
95
|
-
glob(identifier).then.find(&:any?) or raise NoSeedsFoundError, "found no seed files for #{identifier.inspect}"
|
96
|
-
end
|
97
|
-
|
98
92
|
def load_one(path)
|
99
93
|
context.class_eval path.read, path.to_s
|
100
94
|
end
|
data/lib/oaken/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oaken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Timm Hansen
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email:
|
15
13
|
- hey@kaspth.com
|
16
14
|
executables: []
|
@@ -40,7 +38,6 @@ metadata:
|
|
40
38
|
homepage_uri: https://github.com/kaspth/oaken
|
41
39
|
source_code_uri: https://github.com/kaspth/oaken
|
42
40
|
changelog_uri: https://github.com/kaspth/oaken/blob/main/CHANGELOG.md
|
43
|
-
post_install_message:
|
44
41
|
rdoc_options: []
|
45
42
|
require_paths:
|
46
43
|
- lib
|
@@ -55,8 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
52
|
- !ruby/object:Gem::Version
|
56
53
|
version: '0'
|
57
54
|
requirements: []
|
58
|
-
rubygems_version: 3.
|
59
|
-
signing_key:
|
55
|
+
rubygems_version: 3.6.9
|
60
56
|
specification_version: 4
|
61
57
|
summary: Oaken aims to blend your Fixtures/Factories and levels up your database seeds.
|
62
58
|
test_files: []
|