teapot 3.5.4 → 3.6.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: 5b04440536c596d23f4366487b76b954e6c10a6acc7a4371ca2d3dc158a3b78c
4
- data.tar.gz: 99bda0d60b0e24fde2dd01f2a50b793173970de35c99483745e304b961dafd43
3
+ metadata.gz: a21ff20aa745863cf4e91ffa997690d86c4de3a3f0fd3355f63b74ff432000ea
4
+ data.tar.gz: 53011f5117cc8c25437dbf2a5ea762298107761f58cc35c9df8d2030f5dc7777
5
5
  SHA512:
6
- metadata.gz: f3fd801e262145f214df86c5a59b33bffee8a884279a5d35df832f0831567e3cad1566bf00c02d99e999c2fd44698cacb13d071a212eb1fe51aa8e4a74e85ba0
7
- data.tar.gz: a089693d16dee80e067096f7c58bf352a7bae602a2ba54e8c6ada092709db235f273ff957553ad882d75bc77dc0f2532f1288fc4e9ef770290a4245f5f109734
6
+ metadata.gz: d3bb453fc48543c8ad03c681c2945c421cd4e9828ff5658961d3308e4eae6a354e0ba678fd394d7554e2f6dbdc6a70f32e02ca6b58210c8b1fcaaeb3f4658c2d
7
+ data.tar.gz: 0c7b89c76b6f1e045071a9137d3b387003ed9b4bf6e659b80f64a417f1e7558fe2851fa7f47b0bbc05ae13868ae77389d10f281c7ba0595ee640f2edfedf0374
checksums.yaml.gz.sig CHANGED
Binary file
data/bin/teapot CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
5
  #
@@ -20,6 +21,6 @@
20
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
22
  # THE SOFTWARE.
22
23
 
23
- require_relative '../lib/teapot/command'
24
+ require_relative "../lib/teapot/command"
24
25
 
25
26
  Teapot::Command::Top.call
@@ -1,26 +1,11 @@
1
- # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'selection'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
22
5
 
23
- require 'build/controller'
6
+ require_relative "selection"
7
+
8
+ require "build/controller"
24
9
 
25
10
  module Teapot
26
11
  module Command
@@ -31,8 +16,8 @@ module Teapot
31
16
  self.description = "Build the specified target."
32
17
 
33
18
  options do
34
- option '-j/-l/--limit <n>', "Limit the build to <n> concurrent processes.", type: Integer
35
- option '-c/--continuous', "Run the build graph continually (experimental)."
19
+ option "-j/-l/--limit <n>", "Limit the build to <n> concurrent processes.", type: Integer
20
+ option "-c/--continuous", "Run the build graph continually (experimental)."
36
21
  end
37
22
 
38
23
  many :targets, "Build these targets, or use them to help the dependency resolution process."
@@ -51,7 +36,7 @@ module Teapot
51
36
  chain = selection.chain
52
37
  environment = context.configuration.environment
53
38
 
54
- controller = ::Build::Controller.new(logger: parent.logger, limit: @options[:limit]) do |controller|
39
+ controller = ::Build::Controller.new(limit: @options[:limit]) do |controller|
55
40
  controller.add_chain(chain, self.argv, environment)
56
41
  end
57
42
 
@@ -67,7 +52,7 @@ module Teapot
67
52
  if walker.failed?
68
53
  raise BuildFailedError.new("Failed to build all nodes successfully!")
69
54
  end
70
-
55
+
71
56
  break
72
57
  end
73
58
  end
@@ -1,24 +1,9 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'samovar'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
5
+
6
+ require "samovar"
22
7
 
23
8
  module Teapot
24
9
  module Command
@@ -32,7 +17,7 @@ module Teapot
32
17
 
33
18
  logger.info "Removing #{configuration.build_path}..."
34
19
  FileUtils.rm_rf configuration.build_path
35
-
20
+
36
21
  logger.info "Removing #{configuration.packages_path}..."
37
22
  FileUtils.rm_rf configuration.packages_path
38
23
  end
@@ -1,30 +1,15 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'samovar'
22
- require 'build/name'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
23
5
 
24
- require_relative 'fetch'
25
- require 'rugged'
6
+ require "samovar"
7
+ require "build/name"
26
8
 
27
- require 'build/uri'
9
+ require_relative "fetch"
10
+ require "rugged"
11
+
12
+ require "build/uri"
28
13
 
29
14
  module Teapot
30
15
  module Command
@@ -38,7 +23,7 @@ module Teapot
38
23
 
39
24
  name = File.basename(::Build::URI[@source].path, ".git")
40
25
 
41
- nested = parent['--root', parent.options[:root] || name]
26
+ nested = parent["--root", parent.options[:root] || name]
42
27
  root = nested.root
43
28
 
44
29
  if root.exist?
@@ -1,28 +1,13 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'samovar'
22
- require 'build/name'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
23
5
 
24
- require_relative 'fetch'
25
- require 'rugged'
6
+ require "samovar"
7
+ require "build/name"
8
+
9
+ require_relative "fetch"
10
+ require "rugged"
26
11
 
27
12
  module Teapot
28
13
  module Command
@@ -36,7 +21,7 @@ module Teapot
36
21
  def call
37
22
  logger = parent.logger
38
23
 
39
- nested = parent['--root', parent.options[:root] || name.gsub(/\s+/, '-').downcase]
24
+ nested = parent["--root", parent.options[:root] || name.gsub(/\s+/, "-").downcase]
40
25
  root = nested.root
41
26
 
42
27
  if root.exist?
@@ -75,7 +60,7 @@ module Teapot
75
60
  tree: index.write_tree(repository),
76
61
  message: "Initial project files.",
77
62
  parents: repository.empty? ? [] : [repository.head.target].compact,
78
- update_ref: 'HEAD'
63
+ update_ref: "HEAD"
79
64
  )
80
65
  end
81
66
 
@@ -89,17 +74,17 @@ module Teapot
89
74
 
90
75
  # A very basic teapot file to pull in the initial dependencies.
91
76
  File.open(root + TEAPOT_FILE, "w") do |output|
92
- output.puts "\# Teapot v#{VERSION} configuration generated at #{Time.now.to_s}", ''
93
-
94
- output.puts "required_version #{LOADER_VERSION.dump}", ''
77
+ output.puts "\# Teapot v#{VERSION} configuration generated at #{Time.now.to_s}", ""
78
+
79
+ output.puts "required_version #{LOADER_VERSION.dump}", ""
95
80
 
96
81
  output.puts "define_project #{name.target.dump} do |project|"
97
82
  output.puts "\tproject.title = #{name.text.dump}"
98
- output.puts "end", ''
99
-
100
- output.puts "\# Build Targets", ''
101
-
102
- output.puts "\# Configurations", ''
83
+ output.puts "end", ""
84
+
85
+ output.puts "\# Build Targets", ""
86
+
87
+ output.puts "\# Configurations", ""
103
88
 
104
89
  output.puts "define_configuration 'development' do |configuration|"
105
90
  output.puts "\tconfiguration[:source] = #{source.dump}"
@@ -107,7 +92,7 @@ module Teapot
107
92
  packages.each do |name|
108
93
  output.puts "\tconfiguration.require #{name.dump}"
109
94
  end
110
- output.puts "end", ''
95
+ output.puts "end", ""
111
96
 
112
97
  output.puts "define_configuration #{name.target.dump} do |configuration|"
113
98
  output.puts "\tconfiguration.public!"
@@ -1,25 +1,10 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'selection'
22
- require 'rugged'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
5
+
6
+ require_relative "selection"
7
+ require "rugged"
23
8
 
24
9
  module Teapot
25
10
  module Command
@@ -41,8 +26,8 @@ module Teapot
41
26
  # - update packages and update lockfile
42
27
 
43
28
  options do
44
- option '--update', "Update dependencies to the latest versions."
45
- option '--local', "Don't update from source, assume updated local packages."
29
+ option "--update", "Update dependencies to the latest versions."
30
+ option "--local", "Don't update from source, assume updated local packages."
46
31
  end
47
32
 
48
33
  many :packages, "Only update the specified packages, or all packages if none specified."
@@ -77,7 +62,7 @@ module Teapot
77
62
 
78
63
  packages = selection.unresolved
79
64
  end
80
-
65
+
81
66
  if selection.unresolved.count > 0
82
67
  logger.error(self) do |buffer|
83
68
  buffer.puts "Could not fetch all packages!"
@@ -98,21 +83,21 @@ module Teapot
98
83
 
99
84
  return {
100
85
  commit: repository.head.target.oid,
101
- branch: repository.head.name.sub(/^refs\/heads\//, '')
86
+ branch: repository.head.name.sub(/^refs\/heads\//, "")
102
87
  }
103
88
  end
104
89
 
105
90
  def link_local_package(context, configuration, package, logger)
106
91
  logger.info "Linking local #{package}..." #.color(:cyan)
107
-
92
+
108
93
  local_path = context.root + package.options[:local]
109
-
94
+
110
95
  # Where we are going to put the package:
111
96
  destination_path = package.path
112
-
97
+
113
98
  # Make the top level directory if required:
114
99
  destination_path.dirname.create
115
-
100
+
116
101
  unless destination_path.exist?
117
102
  destination_path.make_symlink(local_path)
118
103
  end
@@ -133,36 +118,36 @@ module Teapot
133
118
 
134
119
  def clone_or_pull_package(context, configuration, package, package_lock, logger)
135
120
  logger.info "Processing #{package}..." #.color(:cyan)
136
-
121
+
137
122
  # Where we are going to put the package:
138
123
  destination_path = package.path
139
-
124
+
140
125
  base_uri = URI(package.options[:source].to_s)
141
-
142
- if base_uri.scheme == nil || base_uri.scheme == 'file'
126
+
127
+ if base_uri.scheme == nil || base_uri.scheme == "file"
143
128
  base_uri = URI "file://" + File.expand_path(base_uri.path, context.root) + "/"
144
129
  end
145
-
130
+
146
131
  branch_name = package.options[:branch]
147
-
132
+
148
133
  if package_lock
149
134
  logger.info "Package locked to commit: #{package_lock[:branch]}/#{package_lock[:commit]}"
150
-
135
+
151
136
  branch_name = package_lock[:branch]
152
137
  commit_id = package_lock[:commit]
153
138
  end
154
-
139
+
155
140
  if destination_path.exist?
156
141
  logger.info "Updating package at path #{destination_path}..."
157
-
142
+
158
143
  repository = Rugged::Repository.new(destination_path.to_s)
159
-
144
+
160
145
  # Are there uncommitted changes in the work tree?
161
146
  if modified?(repository)
162
147
  raise FetchError.new(package, "Uncommited local modifications")
163
148
  end
164
149
 
165
- repository.fetch('origin', credentials: self.method(:credentials))
150
+ repository.fetch("origin", credentials: self.method(:credentials))
166
151
  repository.checkout(branch_name) if branch_name
167
152
 
168
153
  # Essentially implement git pull:
@@ -194,7 +179,7 @@ module Teapot
194
179
  system("git", "submodule", "update", "--init", "--recursive", chdir: package.path)
195
180
  end
196
181
  end
197
-
182
+
198
183
  def fetch_package(context, configuration, package, logger, update: false, local: false)
199
184
  if package.local?
200
185
  link_local_package(context, configuration, package, logger)
@@ -1,27 +1,12 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'samovar'
22
- require 'console/terminal'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
23
5
 
24
- require_relative 'selection'
6
+ require "samovar"
7
+ require "console/terminal"
8
+
9
+ require_relative "selection"
25
10
 
26
11
  module Teapot
27
12
  module Command
@@ -1,24 +1,9 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'samovar'
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2026, by Samuel Williams.
5
+
6
+ require "samovar"
22
7
 
23
8
  module Teapot
24
9
  module Command
@@ -1,26 +1,11 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'selection'
22
- require 'rugged'
23
- require 'console/terminal'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
5
+
6
+ require_relative "selection"
7
+ require "rugged"
8
+ require "console/terminal"
24
9
 
25
10
  module Teapot
26
11
  module Command
@@ -1,25 +1,10 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'selection'
22
- require 'graphviz'
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2026, by Samuel Williams.
5
+
6
+ require_relative "selection"
7
+ require "graphviz"
23
8
 
24
9
  module Teapot
25
10
  module Command
@@ -27,8 +12,8 @@ module Teapot
27
12
  self.description = "Generate a picture of the dependency graph."
28
13
 
29
14
  options do
30
- option '-o/--output-path <path>', "The output path for the visualization.", default: "dependency.svg"
31
- option '-d/--dependency-name <name>', "Show the partial chain for the given named dependency."
15
+ option "-o/--output-path <path>", "The output path for the visualization.", default: "dependency.svg"
16
+ option "-d/--dependency-name <name>", "Show the partial chain for the given named dependency."
32
17
  end
33
18
 
34
19
  def dependency_names
@@ -42,23 +27,23 @@ module Teapot
42
27
  def process(selection)
43
28
  context = selection.context
44
29
  chain = selection.chain
45
-
30
+
46
31
  if dependency_name
47
32
  provider = selection.dependencies[dependency_name]
48
33
 
49
34
  chain = chain.partial(provider)
50
35
  end
51
-
36
+
52
37
  visualization = ::Build::Dependency::Visualization.new
53
-
38
+
54
39
  graph = visualization.generate(chain)
55
-
40
+
56
41
  if output_path = @options[:output_path]
57
42
  Graphviz.output(graph, path: output_path, format: :svg)
58
43
  else
59
44
  $stdout.puts graph.to_dot
60
45
  end
61
-
46
+
62
47
  return graph
63
48
  end
64
49
  end