fixture_fox 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fox.dsl.rb +42 -0
- data/lib/fixture_fox/analyzer.rb +1 -1
- data/lib/fixture_fox/version.rb +1 -1
- data/lib/fixture_fox.rb +6 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 559cb3c1dc15071bcb9ddb4dd8dbb7f31e212cfa131093aa29db1a8d8be5137e
|
4
|
+
data.tar.gz: 919e1f0458dc7d632dfd37c5cc62851adaedd05cb9a927477d021f637a1b9480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c8e37e8ced79cf730949f3bf7c05e53cca8d63c617071fb27c69693f2e025387a29941672fa59ec5a4f001c8d4e258660be64ea6e29a1992103f06492783a02
|
7
|
+
data.tar.gz: db3e0a16ee29fa1f31b33b27c05da0d702e70ce90617200a91b474ce29ae36eca40f9238c14e4ff7507a583de5c1ceeb481f7fd3b3784a14de283f2e0ce85953
|
data/fox.dsl.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# En DSL implementation kan også løse problemet med ordinals med en simpel
|
4
|
+
# method med en tæller
|
5
|
+
|
6
|
+
record Users, :alice do
|
7
|
+
name "Alice", :alices_name # Label on value is possible syntax
|
8
|
+
age 20
|
9
|
+
groups [supers, users]
|
10
|
+
picture do
|
11
|
+
title "Picture of Alice"
|
12
|
+
blob "image.jpg"
|
13
|
+
end
|
14
|
+
role :alices_role do
|
15
|
+
name "Administrator"
|
16
|
+
active true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
record Users, :alice do # Merge with "alice" above
|
21
|
+
last_post ref(:alices_first_post)
|
22
|
+
end
|
23
|
+
|
24
|
+
record Blogs, :alices_blog do
|
25
|
+
user ref(:alice)
|
26
|
+
title "Alice's Blog"
|
27
|
+
end
|
28
|
+
|
29
|
+
table Roles do
|
30
|
+
record :user_role do
|
31
|
+
name "User"
|
32
|
+
active true
|
33
|
+
end
|
34
|
+
record :anon_role do
|
35
|
+
name "Anon"
|
36
|
+
active true
|
37
|
+
end
|
38
|
+
record do
|
39
|
+
name "RoleWithoutALabel"
|
40
|
+
active false
|
41
|
+
end
|
42
|
+
end
|
data/lib/fixture_fox/analyzer.rb
CHANGED
@@ -180,7 +180,7 @@ module FixtureFox
|
|
180
180
|
value =~ /^\d\d\d\d-\d\d-\d\d(?: \d\d:\d\d(?::\d\d)?)?$/
|
181
181
|
;
|
182
182
|
else
|
183
|
-
f.value.error("Data type mismatch - expected #{klass}, got #{value.class}")
|
183
|
+
f.value.error("Data type mismatch - expected #{klass}, got #{value.class}: #{value.inspect}")
|
184
184
|
end
|
185
185
|
}
|
186
186
|
when AstReferenceMember
|
data/lib/fixture_fox/version.rb
CHANGED
data/lib/fixture_fox.rb
CHANGED
@@ -190,7 +190,12 @@ module FixtureFox
|
|
190
190
|
end
|
191
191
|
|
192
192
|
def to_sql(format: :psql, ids: nil, delete: :all)
|
193
|
-
|
193
|
+
if [:touched, :recursive, :all].include?(delete)
|
194
|
+
# Ugly quick-fix because pg_graph doens't to dependencies(!)
|
195
|
+
data.to_sql(format: format, ids: ids || {}, delete: :none, truncate: delete, files: files)
|
196
|
+
else
|
197
|
+
data.to_sql(format: format, ids: ids || {}, delete: delete, files: files)
|
198
|
+
end
|
194
199
|
end
|
195
200
|
|
196
201
|
def self.read_ids(file) YAML.load(IO.read(file)) end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixture_fox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- examples/views.sql
|
218
218
|
- exe/fox
|
219
219
|
- fixture_fox.gemspec
|
220
|
+
- fox.dsl.rb
|
220
221
|
- lib/fixture_fox.rb
|
221
222
|
- lib/fixture_fox/analyzer.rb
|
222
223
|
- lib/fixture_fox/anchor.rb
|
@@ -248,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
249
|
- !ruby/object:Gem::Version
|
249
250
|
version: '0'
|
250
251
|
requirements: []
|
251
|
-
rubygems_version: 3.3.
|
252
|
+
rubygems_version: 3.3.7
|
252
253
|
signing_key:
|
253
254
|
specification_version: 4
|
254
255
|
summary: fixture_fox gem
|