cartage 1.2 → 2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cartage.yml.rdoc +51 -215
- data/Contributing.md +71 -0
- data/Extending.md +520 -0
- data/History.md +106 -0
- data/{Licence.rdoc → Licence.md} +5 -5
- data/Manifest.txt +19 -12
- data/README.rdoc +64 -109
- data/Rakefile +37 -32
- data/bin/cartage +2 -2
- data/cartage-cli.md +137 -0
- data/cartage.yml.sample +43 -153
- data/lib/cartage.rb +296 -366
- data/lib/cartage/backport.rb +66 -0
- data/lib/cartage/cli.rb +234 -0
- data/lib/cartage/commands/echo.rb +23 -0
- data/lib/cartage/commands/info.rb +57 -0
- data/lib/cartage/commands/manifest.rb +88 -0
- data/lib/cartage/commands/pack.rb +18 -0
- data/lib/cartage/config.rb +118 -125
- data/lib/cartage/core.rb +112 -0
- data/lib/cartage/gli_ext.rb +58 -0
- data/lib/cartage/minitest.rb +140 -0
- data/lib/cartage/plugin.rb +137 -25
- data/lib/cartage/plugins/build_tarball.rb +40 -0
- data/lib/cartage/{manifest.rb → plugins/manifest.rb} +47 -35
- data/test/minitest_config.rb +3 -65
- data/test/test_cartage.rb +253 -109
- data/test/test_cartage_build_tarball.rb +57 -0
- data/test/test_cartage_config.rb +100 -28
- data/test/test_cartage_core.rb +172 -0
- data/test/test_cartage_manifest.rb +234 -13
- data/test/test_cartage_plugin.rb +85 -0
- metadata +63 -79
- data/.autotest +0 -8
- data/.gemtest +0 -1
- data/.minitest.rb +0 -2
- data/.travis.yml +0 -36
- data/Contributing.rdoc +0 -66
- data/Gemfile +0 -9
- data/History.rdoc +0 -43
- data/lib/cartage/command.rb +0 -59
- data/lib/cartage/manifest/commands.rb +0 -106
- data/lib/cartage/pack_command.rb +0 -14
data/Gemfile
DELETED
data/History.rdoc
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
=== 1.2 / 2015-05-27
|
2
|
-
|
3
|
-
* 1 minor enhancement:
|
4
|
-
|
5
|
-
* Added the chosen timestamp as the second line of the release hashref
|
6
|
-
files.
|
7
|
-
|
8
|
-
* 2 minor bugfixes:
|
9
|
-
|
10
|
-
* Fixed {#3}[https://github.com/KineticCafe/issues/3] so that spec and
|
11
|
-
feature directories are excluded by default. Provided by @jsutlovic.
|
12
|
-
* Fixed {#5}[https://github.com/KineticCafe/pulls/5] so that the manifest
|
13
|
-
* is deduplicated prior to write. Provided by @jsutlovic.
|
14
|
-
|
15
|
-
=== 1.1.1 / 2015-03-26
|
16
|
-
|
17
|
-
* 1 minor bugfix
|
18
|
-
|
19
|
-
* Fixed a Ruby syntax issue with Ruby 2.0.
|
20
|
-
|
21
|
-
=== 1.1 / 2015-03-26
|
22
|
-
|
23
|
-
* 1 major enhancement
|
24
|
-
|
25
|
-
* Added a Cartage::StatusError with an exitstatus support.
|
26
|
-
Cartage::QuietError is now based on this.
|
27
|
-
|
28
|
-
* 1 minor bugfix
|
29
|
-
|
30
|
-
* Restored an accidentally removed method,
|
31
|
-
Cartage::#create_bundle_cache.
|
32
|
-
|
33
|
-
* 2 documentation improvements
|
34
|
-
|
35
|
-
* Identified postbuild script stages.
|
36
|
-
|
37
|
-
* Improved the Slack notifier example postbuild script.
|
38
|
-
|
39
|
-
=== 1.0 / 2015-03-24
|
40
|
-
|
41
|
-
* 1 major enhancement
|
42
|
-
|
43
|
-
* Birthday!
|
data/lib/cartage/command.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'cartage'
|
2
|
-
require 'cmdparse'
|
3
|
-
|
4
|
-
class Cartage
|
5
|
-
# The base Cartage command object. This is used to provide commands with a
|
6
|
-
# reference to the Cartage instance (<tt>@cartage</tt>) that is running under
|
7
|
-
# the main command-line program.
|
8
|
-
#
|
9
|
-
# class Cartage::InfoCommand < Cartage::Command
|
10
|
-
# def initialize(cartage)
|
11
|
-
# super(cartage, 'info')
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# def perform
|
15
|
-
# puts 'info'
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
#
|
19
|
-
# Cartage::Command changes the class-based command protocol from CmdParse so
|
20
|
-
# that you must define #perform instead of #execute. This is so that certain
|
21
|
-
# common behaviours (such as common config resolution) can be performed for
|
22
|
-
# all commands.
|
23
|
-
class Command < ::CmdParse::Command
|
24
|
-
# Create a ::CmdParse::Command with the given name. Save a reference to the
|
25
|
-
# provided cartage object.
|
26
|
-
def initialize(cartage, name, takes_commands: false)
|
27
|
-
if self.instance_of?(Cartage::Command)
|
28
|
-
raise ArgumentError, 'Cartage::Command cannot be instantiated.'
|
29
|
-
end
|
30
|
-
|
31
|
-
super(name, takes_commands: takes_commands)
|
32
|
-
|
33
|
-
@cartage = cartage
|
34
|
-
end
|
35
|
-
|
36
|
-
# Run the command. Children must *not* implement this method.
|
37
|
-
def execute(*args)
|
38
|
-
@cartage.send(:resolve_config!, *Array(with_plugins))
|
39
|
-
perform(*args)
|
40
|
-
end
|
41
|
-
|
42
|
-
##
|
43
|
-
# :method: perform
|
44
|
-
#
|
45
|
-
# Perform the action of the command. Children *must* implement this method.
|
46
|
-
|
47
|
-
# This optional method is implemented by a plug-in to instruct Cartage to
|
48
|
-
# resolve the plug-in configuration for the specified plug-ins. Specify the
|
49
|
-
# plug-ins to be resolved as an array of Symbols.
|
50
|
-
#
|
51
|
-
# Plug-ins resolve by overriding the private method
|
52
|
-
# Cartage::Plugin#resolve_config!.
|
53
|
-
def with_plugins
|
54
|
-
[]
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
require_relative 'pack_command'
|
@@ -1,106 +0,0 @@
|
|
1
|
-
class Cartage
|
2
|
-
class Manifest
|
3
|
-
# This module provides a command the ability to properly handle the
|
4
|
-
# Cartage::Manifest::MissingError.
|
5
|
-
module HandleMissingManifest #:nodoc:
|
6
|
-
def handle_missing_manifest
|
7
|
-
yield
|
8
|
-
rescue Cartage::Manifest::MissingError => e
|
9
|
-
$stderr.puts e.message
|
10
|
-
command = super_command.commands['manifest'].usage.
|
11
|
-
gsub(/^\s*Usage:\s+/, ' ')
|
12
|
-
$stderr.puts command
|
13
|
-
false
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# Implement <tt>cartage manifest</tt> to generate Manifest.txt.
|
18
|
-
class ManifestCommand < Cartage::Command #:nodoc:
|
19
|
-
def initialize(cartage)
|
20
|
-
super(cartage, 'manifest')
|
21
|
-
takes_commands(false)
|
22
|
-
short_desc('Update the Cartage Manifest.txt file.')
|
23
|
-
|
24
|
-
@manifest = cartage.manifest
|
25
|
-
end
|
26
|
-
|
27
|
-
def perform(*)
|
28
|
-
@manifest.generate
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# Implement <tt>cartage check</tt> to compare the repository against
|
33
|
-
# Manifest.txt.
|
34
|
-
class CheckCommand < Cartage::Command #:nodoc:
|
35
|
-
include HandleMissingManifest
|
36
|
-
|
37
|
-
def initialize(cartage)
|
38
|
-
super(cartage, 'check')
|
39
|
-
takes_commands(false)
|
40
|
-
short_desc('Check the Manifest.txt against the current repository.')
|
41
|
-
|
42
|
-
@manifest = cartage.manifest
|
43
|
-
end
|
44
|
-
|
45
|
-
def perform(*)
|
46
|
-
handle_missing_manifest do
|
47
|
-
@manifest.check
|
48
|
-
raise Cartage::QuietError.new($?.exitstatus) unless $?.success?
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
class InstallDefaultIgnoreCommand < Cartage::Command #:nodoc:
|
54
|
-
def initialize(cartage)
|
55
|
-
super(cartage, 'install-ignore')
|
56
|
-
takes_commands(false)
|
57
|
-
short_desc('Installs the default ignore file.')
|
58
|
-
|
59
|
-
self.options do |opts|
|
60
|
-
opts.on('-f', '--force', 'Force write .cartignore.') {
|
61
|
-
@mode = :force
|
62
|
-
}
|
63
|
-
opts.on('-m', '--merge', 'Merge .cartignore with the default.') {
|
64
|
-
@mode = :merge
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
@manifest = cartage.manifest
|
69
|
-
@mode = nil
|
70
|
-
end
|
71
|
-
|
72
|
-
def perform(*)
|
73
|
-
@manifest.install_default_ignore(mode: @mode)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
class ShowCommand < Cartage::Command #:nodoc:
|
78
|
-
include HandleMissingManifest
|
79
|
-
|
80
|
-
def initialize(cartage)
|
81
|
-
super(cartage, 'show')
|
82
|
-
takes_commands(false)
|
83
|
-
short_desc('Show the files that will be included in the package.')
|
84
|
-
|
85
|
-
@manifest = cartage.manifest
|
86
|
-
end
|
87
|
-
|
88
|
-
def perform(*)
|
89
|
-
handle_missing_manifest do
|
90
|
-
@manifest.resolve do |tmpfile|
|
91
|
-
puts Pathname(tmpfile).read
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def self.commands #:nodoc:
|
98
|
-
[
|
99
|
-
ManifestCommand,
|
100
|
-
CheckCommand,
|
101
|
-
InstallDefaultIgnoreCommand,
|
102
|
-
ShowCommand
|
103
|
-
]
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
data/lib/cartage/pack_command.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
class Cartage
|
2
|
-
class PackCommand < Command #:nodoc:
|
3
|
-
def initialize(cartage)
|
4
|
-
super(cartage, 'pack', takes_commands: false)
|
5
|
-
|
6
|
-
Cartage.common_build_options(options, cartage)
|
7
|
-
short_desc('Create a package with Cartage based on the Manifest.')
|
8
|
-
end
|
9
|
-
|
10
|
-
def perform
|
11
|
-
@cartage.pack
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|