teapot 3.2.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bin/teapot +1 -37
- data/lib/teapot/command/build.rb +1 -2
- data/lib/teapot/command/clean.rb +1 -1
- data/lib/teapot/command/clone.rb +2 -2
- data/lib/teapot/command/create.rb +4 -4
- data/lib/teapot/command/fetch.rb +4 -4
- data/lib/teapot/command/list.rb +5 -5
- data/lib/teapot/command/selection.rb +1 -1
- data/lib/teapot/command.rb +32 -6
- data/lib/teapot/definition.rb +4 -4
- data/lib/teapot/loader.rb +8 -8
- data/lib/teapot/select.rb +1 -1
- data/lib/teapot/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +97 -83
- metadata.gz.sig +0 -0
- data/.gitignore +0 -18
- data/.rspec +0 -4
- data/.travis.yml +0 -33
- data/Gemfile +0 -4
- data/Gemfile.local +0 -23
- data/README.md +0 -171
- data/Rakefile +0 -19
- data/materials/kurocha.png +0 -0
- data/materials/kurocha.svg +0 -101
- data/materials/teapot.png +0 -0
- data/materials/teapot.svg +0 -82
- data/spec/spec_helper.rb +0 -11
- data/spec/teapot/command/clone_spec.rb +0 -57
- data/spec/teapot/command/fetch_spec/repositories/thing/README.md +0 -3
- data/spec/teapot/command/fetch_spec/repositories/thing/teapot.rb +0 -2
- data/spec/teapot/command/fetch_spec/test-project/teapot.rb +0 -8
- data/spec/teapot/command/fetch_spec.rb +0 -107
- data/spec/teapot/command_spec.rb +0 -59
- data/spec/teapot/configuration_spec/teapot.rb +0 -13
- data/spec/teapot/configuration_spec.rb +0 -33
- data/spec/teapot/context_spec/teapot.rb +0 -40
- data/spec/teapot/context_spec.rb +0 -61
- data/spec/teapot/target_spec/teapot.rb +0 -52
- data/spec/teapot/target_spec.rb +0 -55
- data/teapot.gemspec +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58b6f1be99cfff7bcaa495193453f704e8b01a5285f15c22fec6ea2e05aa918
|
4
|
+
data.tar.gz: 753c3a24cb73ab459af7b200914a58624c668eaa59bc343b10a3b0ac3a307535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 607c931ec0e01cc6b5c79a14cda5bb99d7bef7710a61357ccaef1a9c73f6f26e5ada13654bff11c0c7335993b41dd998f3879ec881c2a45578ea3354a33d4469
|
7
|
+
data.tar.gz: e25dcade6d83f87e70ac24ee83c79857c9cb718f0d1a5c82334550be027cf1ab0fadb9ca07b25608899fe46e1481a472758bc73052f41bf3e7f535ee0ae74e8b
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/bin/teapot
CHANGED
@@ -22,40 +22,4 @@
|
|
22
22
|
|
23
23
|
require_relative '../lib/teapot/command'
|
24
24
|
|
25
|
-
|
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
|
data/lib/teapot/command/build.rb
CHANGED
@@ -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
|
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
|
|
data/lib/teapot/command/clean.rb
CHANGED
data/lib/teapot/command/clone.rb
CHANGED
@@ -33,7 +33,7 @@ module Teapot
|
|
33
33
|
|
34
34
|
one :source, "The source repository to clone.", required: true
|
35
35
|
|
36
|
-
def
|
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].
|
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
|
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].
|
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].
|
63
|
+
Build[*target_names, parent: nested].call
|
64
64
|
|
65
65
|
# Fetch any additional packages:
|
66
|
-
Fetch[parent: nested].
|
66
|
+
Fetch[parent: nested].call
|
67
67
|
end
|
68
68
|
|
69
69
|
# Stage all files:
|
data/lib/teapot/command/fetch.rb
CHANGED
@@ -51,7 +51,7 @@ module Teapot
|
|
51
51
|
parent.context
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
54
|
+
def call
|
55
55
|
selection = context.select
|
56
56
|
|
57
57
|
packages = selection.configuration.packages
|
@@ -135,7 +135,7 @@ module Teapot
|
|
135
135
|
base_uri = URI "file://" + File.expand_path(base_uri.path, context.root) + "/"
|
136
136
|
end
|
137
137
|
|
138
|
-
branch_name = package.options
|
138
|
+
branch_name = package.options[:branch]
|
139
139
|
|
140
140
|
if package_lock
|
141
141
|
logger.info "Package locked to commit: #{package_lock[:branch]}/#{package_lock[:commit]}"
|
@@ -145,7 +145,7 @@ module Teapot
|
|
145
145
|
end
|
146
146
|
|
147
147
|
if destination_path.exist?
|
148
|
-
logger.info "Updating package at path #{destination_path}..."
|
148
|
+
logger.info "Updating package at path #{destination_path}..."
|
149
149
|
|
150
150
|
repository = Rugged::Repository.new(destination_path.to_s)
|
151
151
|
|
@@ -155,7 +155,7 @@ module Teapot
|
|
155
155
|
end
|
156
156
|
|
157
157
|
repository.fetch('origin', credentials: self.method(:credentials))
|
158
|
-
repository.checkout(branch_name)
|
158
|
+
repository.checkout(branch_name) if branch_name
|
159
159
|
|
160
160
|
# Essentially implement git pull:
|
161
161
|
if commit_id
|
data/lib/teapot/command/list.rb
CHANGED
@@ -49,14 +49,14 @@ module Teapot
|
|
49
49
|
begin
|
50
50
|
script = context.load(package)
|
51
51
|
definitions = script.defined
|
52
|
-
|
52
|
+
|
53
53
|
definitions.each do |definition|
|
54
54
|
terminal.puts "\t#{definition}", style: :definition
|
55
|
-
|
55
|
+
|
56
56
|
definition.description.each_line do |line|
|
57
57
|
terminal.puts "\t\t#{line.chomp}", style: :description
|
58
58
|
end if definition.description
|
59
|
-
|
59
|
+
|
60
60
|
case definition
|
61
61
|
when Project
|
62
62
|
terminal.puts "\t\t- Summary: #{definition.summary}" if definition.summary
|
@@ -72,7 +72,7 @@ module Teapot
|
|
72
72
|
definition.dependencies.each do |dependency|
|
73
73
|
terminal.puts "\t\t- #{dependency}", style: :dependency
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
definition.provisions.each do |name, provision|
|
77
77
|
terminal.puts "\t\t- #{provision}", style: :provision
|
78
78
|
end
|
@@ -80,7 +80,7 @@ module Teapot
|
|
80
80
|
definition.packages.each do |package|
|
81
81
|
terminal.puts "\t\t- #{package}", style: :package
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
definition.imports.select(&:explicit).each do |import|
|
85
85
|
terminal.puts "\t\t- import #{import.name}", style: :import
|
86
86
|
end
|
data/lib/teapot/command.rb
CHANGED
@@ -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
|
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.
|
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
|
data/lib/teapot/definition.rb
CHANGED
data/lib/teapot/loader.rb
CHANGED
@@ -97,8 +97,8 @@ module Teapot
|
|
97
97
|
|
98
98
|
alias required_version teapot_version
|
99
99
|
|
100
|
-
def define_project(*
|
101
|
-
project = Project.new(@context, @package, *
|
100
|
+
def define_project(*arguments, **options)
|
101
|
+
project = Project.new(@context, @package, *arguments, **options)
|
102
102
|
|
103
103
|
yield project
|
104
104
|
|
@@ -106,8 +106,8 @@ module Teapot
|
|
106
106
|
@defined << project
|
107
107
|
end
|
108
108
|
|
109
|
-
def define_target(*
|
110
|
-
target = Target.new(@context, @package, *
|
109
|
+
def define_target(*arguments, **options)
|
110
|
+
target = Target.new(@context, @package, *arguments, **options)
|
111
111
|
|
112
112
|
yield target
|
113
113
|
|
@@ -116,8 +116,8 @@ module Teapot
|
|
116
116
|
@defined << target
|
117
117
|
end
|
118
118
|
|
119
|
-
def define_configuration(*
|
120
|
-
configuration = Configuration.new(@context, @package, *
|
119
|
+
def define_configuration(*arguments, **options)
|
120
|
+
configuration = Configuration.new(@context, @package, *arguments, **options)
|
121
121
|
|
122
122
|
yield configuration
|
123
123
|
|
@@ -127,11 +127,11 @@ module Teapot
|
|
127
127
|
end
|
128
128
|
|
129
129
|
# Checks the host patterns and executes the block if they match.
|
130
|
-
def host(*
|
130
|
+
def host(*arguments, **options, &block)
|
131
131
|
name = @context.options[:host_platform] || RUBY_PLATFORM
|
132
132
|
|
133
133
|
if block_given?
|
134
|
-
if
|
134
|
+
if arguments.find{|argument| argument === name}
|
135
135
|
yield
|
136
136
|
end
|
137
137
|
else
|
data/lib/teapot/select.rb
CHANGED
@@ -42,7 +42,7 @@ module Teapot
|
|
42
42
|
class Select
|
43
43
|
def initialize(context, configuration, names = [])
|
44
44
|
@context = context
|
45
|
-
@configuration = Configuration.new(context, configuration.package, configuration.name, [], configuration.options)
|
45
|
+
@configuration = Configuration.new(context, configuration.package, configuration.name, [], **configuration.options)
|
46
46
|
|
47
47
|
@targets = {}
|
48
48
|
@configurations = {}
|
data/lib/teapot/version.rb
CHANGED
data.tar.gz.sig
ADDED
Binary file
|