satisfactory 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/satisfactory/record.rb +10 -6
- data/lib/satisfactory/root.rb +3 -0
- data/lib/satisfactory/upstream_record_finder.rb +17 -0
- data/lib/satisfactory/version.rb +1 -1
- data/satisfactory.gemspec +0 -4
- metadata +3 -32
- data/Rakefile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f92a6520f9da8ca43a99ca37697bfc84c56ae52f78a35bab4b8b74a2c369bb0
|
4
|
+
data.tar.gz: ddf946cf48f563c8153ce34410e2bbf4dc625d4b7f455fed4dc06d8d11188d63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59fba38663b4c69a4e3689a6122d6ad6a99f78ec9d4102a8242c23fe216dc554a6ba8ac6eb69aad6402eba42e6bb530989a26e1317ea1c602a0fad0259432583
|
7
|
+
data.tar.gz: aa609786510b01445fce671750ec1a713fe2312fe555cc449761a727ee15197ff7d3248153cdbd9a492dfa4a178a380353ea5f713ab4490c134f1cbca1275f84
|
data/lib/satisfactory/record.rb
CHANGED
@@ -65,6 +65,14 @@ module Satisfactory
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
# Same as {#with} but always creates a new record.
|
69
|
+
#
|
70
|
+
# @param (see #and)
|
71
|
+
# @return (see #with)
|
72
|
+
def with_new(count = nil, downstream_type, **attributes) # rubocop:disable Style/OptionalArguments
|
73
|
+
with(count, downstream_type, force: true, **attributes)
|
74
|
+
end
|
75
|
+
|
68
76
|
# Add a sibling record to the parent record's build plan.
|
69
77
|
# e.g. adding a second user to a project.
|
70
78
|
#
|
@@ -78,7 +86,7 @@ module Satisfactory
|
|
78
86
|
|
79
87
|
# Apply one or more traits to this record's build plan.
|
80
88
|
#
|
81
|
-
# @param
|
89
|
+
# @param traits [Symbol, ...] The traits to apply.
|
82
90
|
def which_is(*traits)
|
83
91
|
traits.each { |trait| self.traits << trait }
|
84
92
|
self
|
@@ -91,11 +99,7 @@ module Satisfactory
|
|
91
99
|
def and_same(upstream_type)
|
92
100
|
Satisfactory::UpstreamRecordFinder.new(upstream:).find(upstream_type)
|
93
101
|
end
|
94
|
-
|
95
|
-
# @api private
|
96
|
-
def modify
|
97
|
-
yield(self).upstream
|
98
|
-
end
|
102
|
+
alias return_to and_same
|
99
103
|
|
100
104
|
# Trigger the creation of this tree's build plan.
|
101
105
|
#
|
data/lib/satisfactory/root.rb
CHANGED
@@ -7,8 +7,24 @@ module Satisfactory
|
|
7
7
|
@upstream = upstream
|
8
8
|
end
|
9
9
|
|
10
|
+
# @api private
|
10
11
|
attr_accessor :upstream
|
11
12
|
|
13
|
+
# @!method create
|
14
|
+
# Delegates to the upstream record.
|
15
|
+
# @return (see Satisfactory::Record#create)
|
16
|
+
# @see Satisfactory::Record#create
|
17
|
+
# @!method with_new
|
18
|
+
# Delegates to the upstream record.
|
19
|
+
# @return (see Satisfactory::Record#with_new)
|
20
|
+
# @see Satisfactory::Record#with_new
|
21
|
+
delegate :create, :with_new, to: :upstream
|
22
|
+
|
23
|
+
# Find the upstream record of the given type.
|
24
|
+
#
|
25
|
+
# @api private
|
26
|
+
# @param type [Symbol] The type of upstream record to find.
|
27
|
+
# @return [Satisfactory::Record, Satisfactory::Collection, Satisfactory::Root]
|
12
28
|
def find(type)
|
13
29
|
raise MissingUpstreamRecordError, type if upstream.nil?
|
14
30
|
|
@@ -20,6 +36,7 @@ module Satisfactory
|
|
20
36
|
end
|
21
37
|
end
|
22
38
|
|
39
|
+
# (see Satisfactory::Record#with)
|
23
40
|
def with(*args, **kwargs)
|
24
41
|
upstream.with(*args, force: true, **kwargs)
|
25
42
|
end
|
data/lib/satisfactory/version.rb
CHANGED
data/satisfactory.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
"lib/**/*",
|
23
23
|
"CHANGELOG.md",
|
24
24
|
"LICENCE",
|
25
|
-
"Rakefile",
|
26
25
|
"README.md",
|
27
26
|
"satisfactory.gemspec",
|
28
27
|
]
|
@@ -31,7 +30,4 @@ Gem::Specification.new do |spec|
|
|
31
30
|
spec.require_paths = ["lib"]
|
32
31
|
|
33
32
|
spec.add_dependency "factory_bot_rails", "~> 6.2"
|
34
|
-
|
35
|
-
spec.add_development_dependency "rubocop", "~> 1.40"
|
36
|
-
spec.add_development_dependency "yard", "~> 0.9"
|
37
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: satisfactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Crosby-McCullough
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: factory_bot_rails
|
@@ -24,34 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rubocop
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.40'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.40'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: yard
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.9'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.9'
|
55
27
|
description:
|
56
28
|
email:
|
57
29
|
- elliot.cm@gmail.com
|
@@ -62,7 +34,6 @@ files:
|
|
62
34
|
- CHANGELOG.md
|
63
35
|
- LICENCE
|
64
36
|
- README.md
|
65
|
-
- Rakefile
|
66
37
|
- lib/satisfactory.rb
|
67
38
|
- lib/satisfactory/collection.rb
|
68
39
|
- lib/satisfactory/loader.rb
|
@@ -75,7 +46,7 @@ homepage: https://github.com/SmartCasual/satisfactory
|
|
75
46
|
licenses:
|
76
47
|
- CC-BY-NC-SA-4.0
|
77
48
|
metadata:
|
78
|
-
changelog_uri: https://github.com/SmartCasual/satisfactory/blob/v0.
|
49
|
+
changelog_uri: https://github.com/SmartCasual/satisfactory/blob/v0.3.0/CHANGELOG.md
|
79
50
|
homepage_uri: https://github.com/SmartCasual/satisfactory
|
80
51
|
source_code_uri: https://github.com/SmartCasual/satisfactory
|
81
52
|
rubygems_mfa_required: 'true'
|