satisfactory 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bb15c794b5397907577dbe90ac97815f6636d7c0268db9c553a91a2b51b1a56
4
- data.tar.gz: 84336045dedaea44be72e4bd3a108624af18986b8d7cc7b5a07381b3910620c0
3
+ metadata.gz: 5f92a6520f9da8ca43a99ca37697bfc84c56ae52f78a35bab4b8b74a2c369bb0
4
+ data.tar.gz: ddf946cf48f563c8153ce34410e2bbf4dc625d4b7f455fed4dc06d8d11188d63
5
5
  SHA512:
6
- metadata.gz: e018c58477288a2eac77a10889d31ba5a3c20b4c4c280d248789693d2c115849f88e42b7a759d471e8eadd4d46a079cb5496910248bb99a3f158bc420fb62d9b
7
- data.tar.gz: bd5b099abce2a3d5b051a4c0e3343710d1305db4aa00a7b5c7e6a4c8614f84570afec990f86fe1d0c41228d803fd3db5bd61f1faaef9b2302e94e8fc4640573a
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.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
data/satisfactory.gemspec CHANGED
@@ -19,21 +19,15 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.files = Dir.chdir(File.expand_path(__dir__)) {
21
21
  Dir[
22
- "{bin,lib}/**/*",
22
+ "lib/**/*",
23
23
  "CHANGELOG.md",
24
24
  "LICENCE",
25
- "Rakefile",
26
25
  "README.md",
27
26
  "satisfactory.gemspec",
28
27
  ]
29
28
  }
30
29
 
31
- spec.bindir = "bin"
32
- spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
33
30
  spec.require_paths = ["lib"]
34
31
 
35
32
  spec.add_dependency "factory_bot_rails", "~> 6.2"
36
-
37
- spec.add_development_dependency "rubocop", "~> 1.40"
38
- spec.add_development_dependency "yard", "~> 0.9"
39
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.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-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,57 +24,16 @@ 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
58
- executables:
59
- - console
60
- - rubocop
61
- - setup
62
- - yard
63
- - yardoc
64
- - yri
30
+ executables: []
65
31
  extensions: []
66
32
  extra_rdoc_files: []
67
33
  files:
68
34
  - CHANGELOG.md
69
35
  - LICENCE
70
36
  - README.md
71
- - Rakefile
72
- - bin/console
73
- - bin/rubocop
74
- - bin/setup
75
- - bin/yard
76
- - bin/yardoc
77
- - bin/yri
78
37
  - lib/satisfactory.rb
79
38
  - lib/satisfactory/collection.rb
80
39
  - lib/satisfactory/loader.rb
@@ -87,7 +46,7 @@ homepage: https://github.com/SmartCasual/satisfactory
87
46
  licenses:
88
47
  - CC-BY-NC-SA-4.0
89
48
  metadata:
90
- changelog_uri: https://github.com/SmartCasual/satisfactory/blob/v0.2.0/CHANGELOG.md
49
+ changelog_uri: https://github.com/SmartCasual/satisfactory/blob/v0.3.0/CHANGELOG.md
91
50
  homepage_uri: https://github.com/SmartCasual/satisfactory
92
51
  source_code_uri: https://github.com/SmartCasual/satisfactory
93
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
data/bin/console DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require "bundler/setup"
3
- require "satisfactory"
4
-
5
- # You can add fixtures and/or initialization code here to make experimenting
6
- # with your gem easier. You can also use a different console, if you like.
7
-
8
- # (If you use this, don't forget to add pry to your Gemfile!)
9
- # require "pry"
10
- # Pry.start
11
-
12
- require "irb"
13
- IRB.start(__FILE__)
data/bin/rubocop DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rubocop' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
-
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
- require "rubygems"
25
- require "bundler/setup"
26
-
27
- load Gem.bin_path("rubocop", "rubocop")
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bin/yard DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'yard' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
-
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
- require "rubygems"
25
- require "bundler/setup"
26
-
27
- load Gem.bin_path("yard", "yard")
data/bin/yardoc DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'yardoc' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
-
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
- require "rubygems"
25
- require "bundler/setup"
26
-
27
- load Gem.bin_path("yard", "yardoc")
data/bin/yri DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'yri' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
-
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
- require "rubygems"
25
- require "bundler/setup"
26
-
27
- load Gem.bin_path("yard", "yri")