teapot 2.0.0.pre.rc2 → 2.0.0.pre.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teapot.rb +2 -0
- data/lib/teapot/command/build.rb +11 -2
- data/lib/teapot/command/create.rb +15 -14
- data/lib/teapot/command/fetch.rb +46 -8
- data/lib/teapot/configuration.rb +16 -2
- data/lib/teapot/context.rb +3 -5
- data/lib/teapot/project.rb +6 -0
- data/lib/teapot/version.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/teapot/command/fetch_spec.rb +107 -0
- data/spec/teapot/command/fetch_spec/repositories/thing/README.md +3 -0
- data/spec/teapot/command/fetch_spec/repositories/thing/teapot.rb +2 -0
- data/spec/teapot/command/fetch_spec/test-project/teapot.rb +8 -0
- data/spec/teapot/command_spec.rb +15 -5
- data/spec/teapot/configuration_spec.rb +42 -0
- data/teapot.gemspec +1 -1
- metadata +14 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c635c63b5b441f820b32101a3a3389eff2ef81e
|
4
|
+
data.tar.gz: 859cf5553f07d00409b76bcbadf81dae90c9dcb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd2eef8a30f2efd10420a2c786beebc400623807d19d64465540c839f9b5fceeae59c7d0b42fa0d8924c01224de3def5ae0e4e64b5a66cdb4407db28fb85ed2d
|
7
|
+
data.tar.gz: 4ca2c4261051631ae374f671346c683d59b79002064e5b9d88a3108633fc976ab00dc1ef837f2334df69dd8b360e3c8f72e53d0ae48b63b8e89dde7cec485c43
|
data/lib/teapot.rb
CHANGED
data/lib/teapot/command/build.rb
CHANGED
@@ -39,10 +39,19 @@ module Teapot
|
|
39
39
|
many :targets, "Build these targets, or use them to help the dependency resolution process."
|
40
40
|
split :argv, "Arguments passed to child process(es) of build if any."
|
41
41
|
|
42
|
+
# The targets to build:
|
43
|
+
def dependency_names(context)
|
44
|
+
if @targets.any?
|
45
|
+
@targets
|
46
|
+
else
|
47
|
+
context.configuration.targets[:build]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
42
51
|
def invoke(parent)
|
43
52
|
context = parent.context
|
44
53
|
|
45
|
-
chain = context.dependency_chain(
|
54
|
+
chain = context.dependency_chain(dependency_names(context), context.configuration)
|
46
55
|
|
47
56
|
ordered = chain.ordered
|
48
57
|
|
@@ -57,7 +66,7 @@ module Teapot
|
|
57
66
|
if target.build
|
58
67
|
environment = target.environment(context.configuration, chain)
|
59
68
|
|
60
|
-
controller.add_target(target, environment.flatten,
|
69
|
+
controller.add_target(target, environment.flatten, self.argv)
|
61
70
|
end
|
62
71
|
end
|
63
72
|
end
|
@@ -29,18 +29,10 @@ module Teapot
|
|
29
29
|
class Create < Samovar::Command
|
30
30
|
self.description = "Create a new teapot package using the specified repository."
|
31
31
|
|
32
|
-
options do
|
33
|
-
option "-t/--target-name <name>", "The target to use to create the project", default: 'Generate/Project/Initial'
|
34
|
-
end
|
35
|
-
|
36
32
|
one :project_name, "The name of the new project in title-case, e.g. 'My Project'."
|
37
33
|
one :source, "The source repository to use for fetching packages, e.g. https://github.com/kurocha."
|
38
34
|
many :packages, "Any additional packages you'd like to include in the project."
|
39
35
|
|
40
|
-
def target_name
|
41
|
-
@options[:target_name]
|
42
|
-
end
|
43
|
-
|
44
36
|
def invoke(parent)
|
45
37
|
logger = parent.logger
|
46
38
|
|
@@ -64,14 +56,22 @@ module Teapot
|
|
64
56
|
|
65
57
|
context = nested.context
|
66
58
|
|
67
|
-
|
59
|
+
# The targets to build to create the initial project:
|
60
|
+
target_names = context.configuration.targets[:create]
|
68
61
|
|
69
|
-
|
70
|
-
|
62
|
+
if target_names.any?
|
63
|
+
# Generate the initial project files:
|
64
|
+
Build[*target_names].invoke(nested)
|
65
|
+
|
66
|
+
# Fetch any additional packages:
|
67
|
+
Fetch[].invoke(nested)
|
68
|
+
end
|
71
69
|
|
70
|
+
# Stage all files:
|
72
71
|
index = repository.index
|
73
72
|
index.add_all
|
74
73
|
|
74
|
+
# Commit the initial project files:
|
75
75
|
Rugged::Commit.create(repository,
|
76
76
|
tree: index.write_tree(repository),
|
77
77
|
message: "Initial project files.",
|
@@ -93,19 +93,20 @@ module Teapot
|
|
93
93
|
output.puts "\# Teapot v#{VERSION} configuration generated at #{Time.now.to_s}", ''
|
94
94
|
|
95
95
|
output.puts "required_version #{LOADER_VERSION.dump}", ''
|
96
|
+
|
97
|
+
output.puts "define_project #{name.target.dump} do |project|"
|
98
|
+
output.puts "\tproject.title = #{name.text.dump}"
|
99
|
+
output.puts "end", ''
|
96
100
|
|
97
101
|
output.puts "\# Build Targets", ''
|
98
102
|
|
99
103
|
output.puts "\# Configurations", ''
|
100
104
|
|
101
105
|
output.puts "define_configuration #{name.target.dump} do |configuration|"
|
102
|
-
|
103
106
|
output.puts "\tconfiguration[:source] = #{source.dump}", ''
|
104
|
-
|
105
107
|
packages.each do |name|
|
106
108
|
output.puts "\tconfiguration.require #{name.dump}"
|
107
109
|
end
|
108
|
-
|
109
110
|
output.puts "end", ''
|
110
111
|
end
|
111
112
|
end
|
data/lib/teapot/command/fetch.rb
CHANGED
@@ -19,10 +19,20 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require 'samovar'
|
22
|
+
|
22
23
|
require 'rugged'
|
23
24
|
|
24
25
|
module Teapot
|
25
26
|
module Command
|
27
|
+
class FetchError < StandardError
|
28
|
+
def initialize(package, message)
|
29
|
+
super(message)
|
30
|
+
@package = package
|
31
|
+
end
|
32
|
+
|
33
|
+
attr :package
|
34
|
+
end
|
35
|
+
|
26
36
|
class Fetch < Samovar::Command
|
27
37
|
self.description = "Fetch remote packages according to the specified configuration."
|
28
38
|
|
@@ -51,7 +61,7 @@ module Teapot
|
|
51
61
|
next if resolved.include? package
|
52
62
|
|
53
63
|
# If specific packages were listed, limit updates to them.
|
54
|
-
if @packages.empty? || @packages.include?(package.name)
|
64
|
+
if @packages.nil? || @packages.empty? || @packages.include?(package.name)
|
55
65
|
fetch_package(context, configuration, package, logger, **@options)
|
56
66
|
end
|
57
67
|
|
@@ -120,27 +130,55 @@ module Teapot
|
|
120
130
|
base_uri = URI "file://" + File.expand_path(base_uri.path, context.root) + "/"
|
121
131
|
end
|
122
132
|
|
123
|
-
|
133
|
+
branch_name = package.options.fetch(:branch, 'master')
|
124
134
|
|
125
135
|
if package_lock
|
126
136
|
logger.info "Package locked to commit: #{package_lock[:branch]}/#{package_lock[:commit]}"
|
127
137
|
|
128
|
-
|
138
|
+
branch_name = package_lock[:branch]
|
139
|
+
commit_id = package_lock[:commit]
|
129
140
|
end
|
130
141
|
|
131
|
-
commit = package_lock ? package_lock[:commit] : nil
|
132
|
-
|
133
142
|
if destination_path.exist?
|
134
143
|
logger.info "Updating package at path #{destination_path}...".color(:cyan)
|
135
144
|
|
136
145
|
repository = Rugged::Repository.new(destination_path.to_s)
|
137
|
-
|
146
|
+
|
147
|
+
# Are there uncommitted changes in the work tree?
|
148
|
+
if repository.to_enum(:status).any?
|
149
|
+
raise FetchError.new(package, "Uncommited local modifications")
|
150
|
+
end
|
151
|
+
|
152
|
+
repository.fetch('origin')
|
153
|
+
repository.checkout(branch_name)
|
154
|
+
|
155
|
+
# Essentially implement git pull:
|
156
|
+
if commit_id
|
157
|
+
# Lookup the named branch:
|
158
|
+
branch = repository.branches[branch_name].resolve
|
159
|
+
else
|
160
|
+
# Lookup the current branch and upstream commit:
|
161
|
+
branch = repository.branches[repository.head.name]
|
162
|
+
commit_id = branch.upstream.target_id
|
163
|
+
end
|
164
|
+
|
165
|
+
# Reset it to the requested commit if required:
|
166
|
+
repository.reset(commit_id, :hard)
|
138
167
|
else
|
139
168
|
logger.info "Cloning package at path #{destination_path}...".color(:cyan)
|
140
169
|
|
141
170
|
external_url = package.external_url(context.root)
|
142
|
-
|
143
|
-
repository
|
171
|
+
|
172
|
+
# Clone the repository with the specified branch:
|
173
|
+
repository = Rugged::Repository.clone_at(external_url.to_s, destination_path.to_s, checkout_branch: branch_name)
|
174
|
+
|
175
|
+
# Reset it to the requested commit if required:
|
176
|
+
repository.reset(commit_id, :hard) if commit_id
|
177
|
+
end
|
178
|
+
|
179
|
+
# Rugged currently doesn't have good (any?) support for submodules, so we diretly invoke git here:
|
180
|
+
if repository.submodules.any?
|
181
|
+
system("git", "submodule", "update", "--init", "--recursive", chdir: package.path)
|
144
182
|
end
|
145
183
|
end
|
146
184
|
|
data/lib/teapot/configuration.rb
CHANGED
@@ -48,6 +48,9 @@ module Teapot
|
|
48
48
|
@imports = IdentitySet.new
|
49
49
|
|
50
50
|
@visibility = :private
|
51
|
+
|
52
|
+
# A list of named targets for specific purposes:
|
53
|
+
@targets = Hash.new{|hash,key| hash[key] = Array.new}
|
51
54
|
end
|
52
55
|
|
53
56
|
def freeze
|
@@ -56,6 +59,8 @@ module Teapot
|
|
56
59
|
@imports.freeze
|
57
60
|
@visibility.freeze
|
58
61
|
|
62
|
+
@targets.freeze
|
63
|
+
|
59
64
|
super
|
60
65
|
end
|
61
66
|
|
@@ -70,6 +75,9 @@ module Teapot
|
|
70
75
|
@visibility = :public
|
71
76
|
end
|
72
77
|
|
78
|
+
# A table of named targets for specific purposes.
|
79
|
+
attr :targets
|
80
|
+
|
73
81
|
# Options used to bind packages to this configuration.
|
74
82
|
attr :options
|
75
83
|
|
@@ -178,7 +186,7 @@ module Teapot
|
|
178
186
|
# Mark this as resolved
|
179
187
|
imported << import
|
180
188
|
|
181
|
-
updated = self.
|
189
|
+
updated = self.update(named_configuration, import.options) || updated
|
182
190
|
else
|
183
191
|
# It couldn't be resolved and hasn't already been resolved...
|
184
192
|
@imports << import
|
@@ -190,7 +198,7 @@ module Teapot
|
|
190
198
|
end
|
191
199
|
|
192
200
|
# Merge an external configuration into this configuration. We won't override already defined packages.
|
193
|
-
def
|
201
|
+
def update(configuration, options)
|
194
202
|
updated = false
|
195
203
|
|
196
204
|
configuration.packages.each do |external_package|
|
@@ -214,6 +222,12 @@ module Teapot
|
|
214
222
|
end
|
215
223
|
end
|
216
224
|
|
225
|
+
configuration.targets.each do |key, value|
|
226
|
+
@targets[key] += value
|
227
|
+
|
228
|
+
updated = true
|
229
|
+
end
|
230
|
+
|
217
231
|
return updated
|
218
232
|
end
|
219
233
|
|
data/lib/teapot/context.rb
CHANGED
@@ -44,7 +44,7 @@ module Teapot
|
|
44
44
|
# A context represents a specific root package instance with a given configuration and all related definitions.
|
45
45
|
# A context is stateful in the sense that package selection is specialized based on #select and #dependency_chain. These parameters are usually set up initially as part of the context setup.
|
46
46
|
class Context
|
47
|
-
def initialize(root, options
|
47
|
+
def initialize(root, **options)
|
48
48
|
@root = Path[root]
|
49
49
|
@options = options
|
50
50
|
|
@@ -58,9 +58,7 @@ module Teapot
|
|
58
58
|
|
59
59
|
@loaded = {}
|
60
60
|
|
61
|
-
unless options[:
|
62
|
-
load_root_package(options)
|
63
|
-
end
|
61
|
+
load_root_package(options) unless options[:load_root] == false
|
64
62
|
end
|
65
63
|
|
66
64
|
attr :root
|
@@ -96,7 +94,7 @@ module Teapot
|
|
96
94
|
substitutions['TEAPOT_VERSION'] = Teapot::VERSION
|
97
95
|
|
98
96
|
if @project
|
99
|
-
name =
|
97
|
+
name = @project.name
|
100
98
|
|
101
99
|
# e.g. Foo Bar, typically used as a title, directory, etc.
|
102
100
|
substitutions['PROJECT_NAME'] = name.text
|
data/lib/teapot/project.rb
CHANGED
@@ -31,7 +31,12 @@ module Teapot
|
|
31
31
|
@authors = []
|
32
32
|
end
|
33
33
|
|
34
|
+
def name
|
35
|
+
Build::Name.from_target(@name)
|
36
|
+
end
|
37
|
+
|
34
38
|
def freeze
|
39
|
+
@title.freeze
|
35
40
|
@summary.freeze
|
36
41
|
@license.freeze
|
37
42
|
@website.freeze
|
@@ -42,6 +47,7 @@ module Teapot
|
|
42
47
|
super
|
43
48
|
end
|
44
49
|
|
50
|
+
attr_accessor :title
|
45
51
|
attr_accessor :summary
|
46
52
|
attr_accessor :license
|
47
53
|
attr_accessor :website
|
data/lib/teapot/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -19,6 +19,11 @@ end
|
|
19
19
|
require "bundler/setup"
|
20
20
|
require "teapot"
|
21
21
|
|
22
|
+
RSpec.shared_context Teapot::Context do
|
23
|
+
let(:root) {Build::Files::Path[__dir__] + 'context'}
|
24
|
+
let(:context) {Teapot::Context.new(root, load_root: false)}
|
25
|
+
end
|
26
|
+
|
22
27
|
RSpec.configure do |config|
|
23
28
|
# Enable flags like --only-failures and --next-failure
|
24
29
|
config.example_status_persistence_file_path = ".rspec_status"
|
@@ -0,0 +1,107 @@
|
|
1
|
+
|
2
|
+
# Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'teapot/command'
|
23
|
+
|
24
|
+
RSpec.describe Teapot::Command::Fetch, order: :defined do
|
25
|
+
let(:root) {Build::Files::Path.new(__dir__) + "fetch_spec"}
|
26
|
+
let(:project_path) {root + 'test-project'}
|
27
|
+
let(:thing_path) {root + "repositories/thing"}
|
28
|
+
let(:thing_package_path) {project_path + "teapot/packages/test/thing"}
|
29
|
+
|
30
|
+
let(:top) {Teapot::Command::Top["--root", project_path.to_s]}
|
31
|
+
|
32
|
+
context "clean project" do
|
33
|
+
subject {top['clean']}
|
34
|
+
|
35
|
+
it "should delete all packages" do
|
36
|
+
expect{subject.invoke}.to_not raise_error
|
37
|
+
|
38
|
+
expect(File).to_not be_exist(root + "test-project/teapot/packages/test")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "can create thing repository" do
|
42
|
+
(thing_path + ".git").delete
|
43
|
+
|
44
|
+
system("git", "init", chdir: thing_path)
|
45
|
+
system("git", "add", "teapot.rb", chdir: thing_path)
|
46
|
+
system("git", "commit", "-m", "Teapot file for testing", chdir: thing_path)
|
47
|
+
end
|
48
|
+
|
49
|
+
let(:lockfile_path) {root + "test-project/test-lock.yml"}
|
50
|
+
|
51
|
+
it "should delete the lock file" do
|
52
|
+
lockfile_path.delete
|
53
|
+
|
54
|
+
expect(File).to_not be_exist(lockfile_path)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "initial fetch" do
|
59
|
+
subject {top['fetch']}
|
60
|
+
|
61
|
+
it "should fetch repositories" do
|
62
|
+
expect{subject.invoke}.to_not raise_error
|
63
|
+
|
64
|
+
# Did the thing package checkout correctly?
|
65
|
+
expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should fetch repositories with no changes" do
|
69
|
+
expect{subject.invoke}.to_not raise_error
|
70
|
+
|
71
|
+
# Did the thing package checkout correctly?
|
72
|
+
expect(File).to be_exist(root + "test-project/teapot/packages/test/thing/teapot.rb")
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context "fetch with worktree modifications" do
|
77
|
+
subject {top['fetch']}
|
78
|
+
let(:path) {root + "test-project/teapot/packages/test/thing/README.md"}
|
79
|
+
|
80
|
+
it "can make local modifications" do
|
81
|
+
path.write("Hello World")
|
82
|
+
|
83
|
+
expect(File).to be_exist(path)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "can't fetch with local modifications" do
|
87
|
+
expect{subject.invoke}.to raise_error(Teapot::Command::FetchError, /local modifications/)
|
88
|
+
|
89
|
+
path.delete
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
context "fetch with upstream changes" do
|
94
|
+
subject {top['fetch', '--update']}
|
95
|
+
|
96
|
+
it "can commit upstream changes" do
|
97
|
+
system("git", "add", "README.md", chdir: thing_path)
|
98
|
+
system("git", "commit", "-m", "Add documentation", chdir: thing_path)
|
99
|
+
end
|
100
|
+
|
101
|
+
it "can fetch changes" do
|
102
|
+
expect{subject.invoke}.to_not raise_error
|
103
|
+
|
104
|
+
expect(File).to be_exist(thing_package_path + "README.md")
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
data/spec/teapot/command_spec.rb
CHANGED
@@ -21,21 +21,23 @@
|
|
21
21
|
require 'teapot/command'
|
22
22
|
|
23
23
|
RSpec.describe Teapot::Command, order: :defined do
|
24
|
-
let
|
25
|
-
let
|
26
|
-
let
|
27
|
-
let
|
24
|
+
let(:source) {"https://github.com/kurocha"}
|
25
|
+
# let(:source) {File.expand_path("../../../../kurocha", __dir__)}
|
26
|
+
let(:root) {Build::Files::Path.new(__dir__) + "command_spec"}
|
27
|
+
let(:project_name) {"Test Project"}
|
28
|
+
let(:project_path) {root + 'test-project'}
|
28
29
|
|
29
30
|
let(:top) {Teapot::Command::Top["--root", project_path.to_s]}
|
30
31
|
|
31
32
|
context Teapot::Command::Create do
|
32
|
-
subject {top["create", project_name, source.to_s, "project"]}
|
33
|
+
subject {top["create", project_name, source.to_s, "generate-project", "generate-travis"]}
|
33
34
|
|
34
35
|
it "should create a new project" do
|
35
36
|
root.delete
|
36
37
|
|
37
38
|
expect{subject.invoke}.to_not raise_error
|
38
39
|
expect(project_path + "teapot.rb").to be_exist
|
40
|
+
expect(project_path + ".travis.yml").to be_exist
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
@@ -46,4 +48,12 @@ RSpec.describe Teapot::Command, order: :defined do
|
|
46
48
|
expect{subject.invoke}.to_not raise_error
|
47
49
|
end
|
48
50
|
end
|
51
|
+
|
52
|
+
context Teapot::Command::Fetch do
|
53
|
+
subject {top["fetch"]}
|
54
|
+
|
55
|
+
it "should fetch any changes" do
|
56
|
+
expect{subject.invoke}.to_not raise_error
|
57
|
+
end
|
58
|
+
end
|
49
59
|
end
|
@@ -0,0 +1,42 @@
|
|
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.
|
20
|
+
|
21
|
+
require 'teapot/context'
|
22
|
+
require 'teapot/configuration'
|
23
|
+
|
24
|
+
RSpec.describe Teapot::Configuration do
|
25
|
+
include_context Teapot::Context
|
26
|
+
|
27
|
+
let(:master) {Teapot::Configuration.new(context, Teapot::Package.new(root + 'master', 'master'), 'master')}
|
28
|
+
let(:embedded) {Teapot::Configuration.new(context, Teapot::Package.new(root + 'embedded', 'embedded'), 'embedded')}
|
29
|
+
|
30
|
+
context "with create targets" do
|
31
|
+
before(:each) do
|
32
|
+
master.targets[:create] << "hello"
|
33
|
+
embedded.targets[:create] << "world"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "can merge packages" do
|
37
|
+
expect(master.update(embedded, {})).to be_truthy
|
38
|
+
|
39
|
+
expect(master.targets[:create]).to be == ["hello", "world"]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/teapot.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency "build-uri", "~> 1.0"
|
39
39
|
spec.add_dependency "build-text", "~> 1.0"
|
40
40
|
|
41
|
-
spec.add_dependency "samovar", "~> 1.
|
41
|
+
spec.add_dependency "samovar", "~> 1.7"
|
42
42
|
|
43
43
|
# This could be a good option in the future for teapot fetch:
|
44
44
|
#spec.add_dependency "rugged"
|
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: 2.0.0.pre.
|
4
|
+
version: 2.0.0.pre.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
131
|
+
version: '1.7'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '1.
|
138
|
+
version: '1.7'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: bundler
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +220,12 @@ files:
|
|
220
220
|
- materials/teapot.png
|
221
221
|
- materials/teapot.svg
|
222
222
|
- spec/spec_helper.rb
|
223
|
+
- spec/teapot/command/fetch_spec.rb
|
224
|
+
- spec/teapot/command/fetch_spec/repositories/thing/README.md
|
225
|
+
- spec/teapot/command/fetch_spec/repositories/thing/teapot.rb
|
226
|
+
- spec/teapot/command/fetch_spec/test-project/teapot.rb
|
223
227
|
- spec/teapot/command_spec.rb
|
228
|
+
- spec/teapot/configuration_spec.rb
|
224
229
|
- spec/teapot/context_spec.rb
|
225
230
|
- spec/teapot/context_spec/teapot.rb
|
226
231
|
- spec/teapot/identity_set_spec.rb
|
@@ -253,7 +258,12 @@ specification_version: 4
|
|
253
258
|
summary: Teapot is a tool for managing complex cross-platform builds.
|
254
259
|
test_files:
|
255
260
|
- spec/spec_helper.rb
|
261
|
+
- spec/teapot/command/fetch_spec.rb
|
262
|
+
- spec/teapot/command/fetch_spec/repositories/thing/README.md
|
263
|
+
- spec/teapot/command/fetch_spec/repositories/thing/teapot.rb
|
264
|
+
- spec/teapot/command/fetch_spec/test-project/teapot.rb
|
256
265
|
- spec/teapot/command_spec.rb
|
266
|
+
- spec/teapot/configuration_spec.rb
|
257
267
|
- spec/teapot/context_spec.rb
|
258
268
|
- spec/teapot/context_spec/teapot.rb
|
259
269
|
- spec/teapot/identity_set_spec.rb
|