teapot 3.2.1 → 3.4.0

This diff has not been reviewed by any users.
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: 629d7c7614d378aca1f52df03b7f94fbbbd75bf99c60a2171d5cba2ab63b17ae
4
- data.tar.gz: 443aa45d4d4f4d732bb7fce592b35f9312d3a8abadabcd5c4b4a4191f82e3ff9
3
+ metadata.gz: 9ddf54a5f033a10d5fc574f0222df4cb5f567416d4d279d0a272052527eacfad
4
+ data.tar.gz: 147d1d9e73c9fd945cdc3d64beba318b2f660aa2aabd974ac3dd9ec487455cc5
5
5
  SHA512:
6
- metadata.gz: 40486dc53b3a879a786209091b2adc8d70a32c66baac7b12b830bd58dd8917cd5df8c2814621978f41351c0b128b9cc0fb92191b54d10d09c1de3d2483abf767
7
- data.tar.gz: 2d29b7ae0f9735121cebcb2b1f887257a2982035b258f50331e9787d47fbbcd2aa89f3ffaab4a9a50de4a9140412985875c000e8d269e60b989eb1d685e35fdc
6
+ metadata.gz: e394f73f673ac474050f75fbbe2d8a9a2f3eaf381c49b5f928814deb6ec7d32fae0143155025d06da768dad39eadaa39bb7ee7ad89e3588a13f20205b34a9c80
7
+ data.tar.gz: bc7f8a41f4b8ded58880e777cb3f412245a198885f9cc0002ed43944673956d03c98fbe5c4cb3bd11902b131547e3135ac3537e54233ff0892a2c5a19591b60a
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .rspec_status
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -15,4 +16,6 @@ spec/reports
15
16
  test/tmp
16
17
  test/version_tmp
17
18
  tmp
19
+
18
20
  kurocha
21
+ dependency.svg
data/bin/teapot CHANGED
@@ -22,40 +22,4 @@
22
22
 
23
23
  require_relative '../lib/teapot/command'
24
24
 
25
- if command = Teapot::Command.parse(ARGV)
26
- logger = command.logger
27
-
28
- begin
29
- command.invoke
30
- rescue Teapot::IncompatibleTeapotError => error
31
- logger.error(command, error) do
32
- "Supported minimum version #{Teapot::MINIMUM_LOADER_VERSION.dump} to #{Teapot::LOADER_VERSION.dump}."
33
- end
34
-
35
- exit 1
36
- rescue Build::Dependency::UnresolvedDependencyError => error
37
- logger.error(command, error) do |buffer|
38
- buffer.puts "Unresolved dependencies:"
39
-
40
- error.chain.unresolved.each do |name, parent|
41
- buffer.puts "#{parent} depends on #{name.inspect}"
42
-
43
- conflicts = error.chain.conflicts[name]
44
-
45
- if conflicts
46
- conflicts.each do |conflict|
47
- buffer.puts " - provided by #{conflict.name}"
48
- end
49
- end
50
- end
51
-
52
- buffer.puts "Cannot continue due to unresolved dependencies!"
53
- end
54
-
55
- exit 2
56
- rescue StandardError => error
57
- logger.error(command, error)
58
-
59
- exit 3
60
- end
61
- end
25
+ Teapot::Command::Top.call
@@ -39,10 +39,6 @@ require 'console'
39
39
 
40
40
  module Teapot
41
41
  module Command
42
- def self.parse(*args)
43
- Top.parse(*args)
44
- end
45
-
46
42
  class Top < Samovar::Command
47
43
  self.description = "A decentralised package manager and build tool."
48
44
 
@@ -97,14 +93,44 @@ module Teapot
97
93
  Context.new(root, configuration: configuration)
98
94
  end
99
95
 
100
- def invoke
96
+ def call
101
97
  if @options[:version]
102
98
  puts "teapot v#{Teapot::VERSION}"
103
99
  elsif @options[:help]
104
100
  print_usage(output: $stdout)
105
101
  else
106
- @command.invoke
102
+ @command.call
103
+ end
104
+ rescue Teapot::IncompatibleTeapotError => error
105
+ logger.error(command, error) do
106
+ "Supported minimum version #{Teapot::MINIMUM_LOADER_VERSION.dump} to #{Teapot::LOADER_VERSION.dump}."
107
+ end
108
+
109
+ raise
110
+ rescue ::Build::Dependency::UnresolvedDependencyError => error
111
+ logger.error(command, error) do |buffer|
112
+ buffer.puts "Unresolved dependencies:"
113
+
114
+ error.chain.unresolved.each do |name, parent|
115
+ buffer.puts "#{parent} depends on #{name.inspect}"
116
+
117
+ conflicts = error.chain.conflicts[name]
118
+
119
+ if conflicts
120
+ conflicts.each do |conflict|
121
+ buffer.puts " - provided by #{conflict.name}"
122
+ end
123
+ end
124
+ end
125
+
126
+ buffer.puts "Cannot continue due to unresolved dependencies!"
107
127
  end
128
+
129
+ raise
130
+ rescue StandardError => error
131
+ logger.error(command, error)
132
+
133
+ raise
108
134
  end
109
135
  end
110
136
  end
@@ -38,7 +38,7 @@ module Teapot
38
38
  many :targets, "Build these targets, or use them to help the dependency resolution process."
39
39
  split :argv, "Arguments passed to child process(es) of build if any."
40
40
 
41
- def invoke
41
+ def call
42
42
  context = parent.context
43
43
 
44
44
  # The targets to build:
@@ -52,7 +52,6 @@ module Teapot
52
52
  environment = context.configuration.environment
53
53
 
54
54
  controller = ::Build::Controller.new(logger: parent.logger, limit: @options[:limit]) do |controller|
55
-
56
55
  controller.add_chain(chain, self.argv, environment)
57
56
  end
58
57
 
@@ -25,7 +25,7 @@ module Teapot
25
25
  class Clean < Samovar::Command
26
26
  self.description = "Delete everything in the teapot directory."
27
27
 
28
- def invoke
28
+ def call
29
29
  context = parent.context
30
30
  logger = parent.logger
31
31
  configuration = context.configuration
@@ -33,7 +33,7 @@ module Teapot
33
33
 
34
34
  one :source, "The source repository to clone.", required: true
35
35
 
36
- def invoke
36
+ def call
37
37
  logger = parent.logger
38
38
 
39
39
  name = File.basename(::Build::URI[@source].path, ".git")
@@ -49,7 +49,7 @@ module Teapot
49
49
  _repository = Rugged::Repository.clone_at(@source, root.to_s, credentials: self.method(:credentials))
50
50
 
51
51
  # Fetch the initial packages:
52
- Fetch[parent: nested].invoke
52
+ Fetch[parent: nested].call
53
53
  end
54
54
 
55
55
  def credentials(url, username, types)
@@ -33,7 +33,7 @@ module Teapot
33
33
  one :source, "The source repository to use for fetching packages, e.g. https://github.com/kurocha.", required: true
34
34
  many :packages, "Any packages you'd like to include in the project.", default: ["generate-project"]
35
35
 
36
- def invoke
36
+ def call
37
37
  logger = parent.logger
38
38
 
39
39
  nested = parent['--root', parent.options[:root] || name.gsub(/\s+/, '-').downcase]
@@ -52,7 +52,7 @@ module Teapot
52
52
  generate_project(root, @name, @source, @packages)
53
53
 
54
54
  # Fetch the initial packages:
55
- Fetch[parent: nested].invoke
55
+ Fetch[parent: nested].call
56
56
 
57
57
  context = nested.context
58
58
  selection = context.select
@@ -60,10 +60,10 @@ module Teapot
60
60
 
61
61
  if target_names.any?
62
62
  # Generate the initial project files:
63
- Build[*target_names, parent: nested].invoke
63
+ Build[*target_names, parent: nested].call
64
64
 
65
65
  # Fetch any additional packages:
66
- Fetch[parent: nested].invoke
66
+ Fetch[parent: nested].call
67
67
  end
68
68
 
69
69
  # Stage all files:
@@ -51,7 +51,7 @@ module Teapot
51
51
  parent.context
52
52
  end
53
53
 
54
- def invoke
54
+ def call
55
55
  selection = context.select
56
56
 
57
57
  packages = selection.configuration.packages
@@ -41,7 +41,7 @@ module Teapot
41
41
  end
42
42
  end
43
43
 
44
- def invoke
44
+ def call
45
45
  context = parent.context
46
46
 
47
47
  self.process(selection(parent.context))
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Teapot
22
- VERSION = "3.2.1"
22
+ VERSION = "3.4.0"
23
23
  end
@@ -35,7 +35,7 @@ RSpec.describe Teapot::Command::Clone, order: :defined do
35
35
  subject {top['clone', source]}
36
36
 
37
37
  it "should checkout files" do
38
- expect{subject.invoke}.to_not raise_error
38
+ expect{subject.call}.to_not raise_error
39
39
 
40
40
  expect(File).to be_exist(root + "teapot.rb")
41
41
 
@@ -33,7 +33,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
33
33
  subject {top['clean']}
34
34
 
35
35
  it "should delete all packages" do
36
- expect{subject.invoke}.to_not raise_error
36
+ expect{subject.call}.to_not raise_error
37
37
 
38
38
  expect(File).to_not be_exist(root + "test-project/teapot/packages/test")
39
39
  end
@@ -59,14 +59,14 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
59
59
  subject {top['fetch']}
60
60
 
61
61
  it "should fetch repositories" do
62
- expect{subject.invoke}.to_not raise_error
62
+ expect{subject.call}.to_not raise_error
63
63
 
64
64
  # Did the thing package checkout correctly?
65
65
  expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
66
66
  end
67
67
 
68
68
  it "should fetch repositories with no changes" do
69
- expect{subject.invoke}.to_not raise_error
69
+ expect{subject.call}.to_not raise_error
70
70
 
71
71
  # Did the thing package checkout correctly?
72
72
  expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
@@ -84,7 +84,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
84
84
  end
85
85
 
86
86
  it "can't fetch with local modifications" do
87
- expect{subject.invoke}.to raise_error(Teapot::Command::FetchError, /local modifications/)
87
+ expect{subject.call}.to raise_error(Teapot::Command::FetchError, /local modifications/)
88
88
 
89
89
  path.delete
90
90
  end
@@ -99,7 +99,7 @@ RSpec.describe Teapot::Command::Fetch, order: :defined do
99
99
  end
100
100
 
101
101
  it "can fetch changes" do
102
- expect{subject.invoke}.to_not raise_error
102
+ expect{subject.call}.to_not raise_error
103
103
 
104
104
  expect(File).to be_exist(thing_package_path + "README.md")
105
105
  end
@@ -35,7 +35,7 @@ RSpec.describe Teapot::Command, order: :defined do
35
35
  it "should create a new project" do
36
36
  root.delete
37
37
 
38
- expect{subject.invoke}.to_not raise_error
38
+ expect{subject.call}.to_not raise_error
39
39
  expect(project_path + "teapot.rb").to be_exist
40
40
  expect(project_path + ".travis.yml").to be_exist
41
41
  end
@@ -45,7 +45,7 @@ RSpec.describe Teapot::Command, order: :defined do
45
45
  subject {top["build", "Run/TestProject"]}
46
46
 
47
47
  it "should build project" do
48
- expect{subject.invoke}.to_not raise_error
48
+ expect{subject.call}.to_not raise_error
49
49
  end
50
50
  end
51
51
 
@@ -53,7 +53,7 @@ RSpec.describe Teapot::Command, order: :defined do
53
53
  subject {top["fetch"]}
54
54
 
55
55
  it "should fetch any changes" do
56
- expect{subject.invoke}.to_not raise_error
56
+ expect{subject.call}.to_not raise_error
57
57
  end
58
58
  end
59
59
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 2.1.0'
26
26
 
27
27
  spec.add_dependency "graphviz", "~> 1.0"
28
- spec.add_dependency "rugged", "~> 0.27.0"
28
+ spec.add_dependency "rugged", "~> 1.0"
29
29
 
30
30
  spec.add_dependency "build", "~> 2.4"
31
31
  spec.add_dependency "build-environment", "~> 1.10"
@@ -34,6 +34,8 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "build-uri", "~> 1.0"
35
35
  spec.add_dependency "build-text", "~> 1.0"
36
36
 
37
+ spec.add_dependency "process-group", "~> 1.2"
38
+
37
39
  spec.add_dependency "console", "~> 1.0"
38
40
  spec.add_dependency "samovar", "~> 2.0"
39
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teapot
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-14 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphviz
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.27.0
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.27.0
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: build
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: process-group
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.2'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.2'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: console
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -267,7 +281,7 @@ homepage: http://www.teapot.nz
267
281
  licenses:
268
282
  - MIT
269
283
  metadata: {}
270
- post_install_message:
284
+ post_install_message:
271
285
  rdoc_options: []
272
286
  require_paths:
273
287
  - lib
@@ -282,8 +296,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
296
  - !ruby/object:Gem::Version
283
297
  version: '0'
284
298
  requirements: []
285
- rubygems_version: 3.0.4
286
- signing_key:
299
+ rubygems_version: 3.1.2
300
+ signing_key:
287
301
  specification_version: 4
288
302
  summary: Teapot is a tool for managing complex cross-platform builds.
289
303
  test_files: