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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06dfe6edd70f452888cfeb3d5379a592a3d88983c5651024cdc634dad1af3ca5
4
- data.tar.gz: f50122a32a4068fd77e3fb6d4639957117ceaf7592af1530bf35e0b4a2b9594f
3
+ metadata.gz: 5f92a6520f9da8ca43a99ca37697bfc84c56ae52f78a35bab4b8b74a2c369bb0
4
+ data.tar.gz: ddf946cf48f563c8153ce34410e2bbf4dc625d4b7f455fed4dc06d8d11188d63
5
5
  SHA512:
6
- metadata.gz: 6fe4c14011c38c9b3116e20b501ce8d65dcc458cd63b9fe44dd1e8291db5ca535d61d63069bc95b118342d17550e5c424aea7217bb5802a51df0cc74e8a0cbf8
7
- data.tar.gz: 522edd69c8e2e31138e7a8cd0fe5521135b5bf42b544c2f9511ef8aa5144635a8cc3a3b953c9578446d041a6144b1e367723c6d7d00f3c679c2bdb0ce0955d17
6
+ metadata.gz: 59fba38663b4c69a4e3689a6122d6ad6a99f78ec9d4102a8242c23fe216dc554a6ba8ac6eb69aad6402eba42e6bb530989a26e1317ea1c602a0fad0259432583
7
+ data.tar.gz: aa609786510b01445fce671750ec1a713fe2312fe555cc449761a727ee15197ff7d3248153cdbd9a492dfa4a178a380353ea5f713ab4490c134f1cbca1275f84
@@ -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 *traits [Symbol, ...] The traits to apply.
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
  #
@@ -43,5 +43,8 @@ module Satisfactory
43
43
  def upstream
44
44
  nil
45
45
  end
46
+
47
+ # @api private
48
+ class FactoryNotDefinedError < StandardError; end
46
49
  end
47
50
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Satisfactory
2
- VERSION = "0.2.1".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
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.2.1
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-19 00:00:00.000000000 Z
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.2.1/CHANGELOG.md
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'
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rubocop/rake_task"
3
-
4
- RuboCop::RakeTask.new
5
-
6
- task default: :rubocop