torba 0.6.0 → 0.7.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/torba.rb +6 -0
- data/lib/torba/cli.rb +45 -0
- data/lib/torba/manifest.rb +10 -0
- data/lib/torba/ui.rb +13 -0
- data/test/acceptance-cli/open_test.rb +101 -0
- data/test/{acceptance_test.rb → acceptance-cli/pack_test.rb} +10 -34
- data/test/acceptance-cli/show_test.rb +61 -0
- data/test/acceptance-cli/verify_test.rb +25 -0
- data/test/fixtures/home_path/{04 → 03}/bourbon/_border-image.scss +0 -0
- data/test/fixtures/home_path/{04 → 03}/bourbon/_font-source-declaration.scss +0 -0
- data/test/fixtures/home_path/{04 → 03}/bourbon/_retina-image.scss +0 -0
- data/test/fixtures/torbafiles/{03_image_asset_not_specified.rb → 01_image_asset_not_specified.rb} +0 -0
- data/test/fixtures/torbafiles/{04_not_existed_assets.rb → 03_not_existed_assets.rb} +0 -0
- data/test/fixtures/torbafiles/04_similar_names.rb +2 -0
- data/test/manifest_test.rb +27 -0
- data/test/test_helper.rb +15 -4
- data/torba.gemspec +1 -1
- metadata +22 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a22c7a165ee7472c946d1071f7b0b0a7c4435048
|
4
|
+
data.tar.gz: a7df1df4c4f0557d90302c1a76c83e25ef1d0be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36462194a06c6b4ec1a48508f819ed4057f6ab401fc9a69d356d723dd67a99a64195bc594132309047121ae6e06a5af5079da310e4d42c854b2ff47027a8bcf1
|
7
|
+
data.tar.gz: 07fe683e3025332f05d11f60a735842e2b1f7b8b26c964a516acfd92470a1382090cbf02f8d05e354a86e1b6dc605b41790c76e63847be09fde509f823056115
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/torba.rb
CHANGED
@@ -78,6 +78,12 @@ module Torba
|
|
78
78
|
Digest::SHA1.hexdigest(string)[0..7]
|
79
79
|
end
|
80
80
|
|
81
|
+
# @see Manifest#find_packages_by_name
|
82
|
+
# @since 0.7.0
|
83
|
+
def self.find_packages_by_name(name)
|
84
|
+
manifest.find_packages_by_name(name)
|
85
|
+
end
|
86
|
+
|
81
87
|
# @yield a block, converts common exceptions into useful messages
|
82
88
|
def self.pretty_errors
|
83
89
|
yield
|
data/lib/torba/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "thor"
|
2
|
+
require "shellwords"
|
2
3
|
require "torba"
|
3
4
|
|
4
5
|
module Torba
|
@@ -15,5 +16,49 @@ module Torba
|
|
15
16
|
Torba.pretty_errors { Torba.verify }
|
16
17
|
Torba.ui.confirm "Torba is prepared!"
|
17
18
|
end
|
19
|
+
|
20
|
+
desc "show PACKAGE", "show the source location of a particular package"
|
21
|
+
def show(name)
|
22
|
+
Torba.pretty_errors do
|
23
|
+
Torba.pack
|
24
|
+
Torba.ui.info(find_package(name).load_path)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "open PACKAGE", "open a particular package in editor"
|
29
|
+
def open(name)
|
30
|
+
editor = [ENV["TORBA_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find { |e| !e.nil? && !e.empty? }
|
31
|
+
unless editor
|
32
|
+
Torba.ui.error("To open a package, set $EDITOR or $TORBA_EDITOR")
|
33
|
+
exit(false)
|
34
|
+
end
|
35
|
+
|
36
|
+
Torba.pretty_errors do
|
37
|
+
Torba.pack
|
38
|
+
|
39
|
+
command = Shellwords.split(editor) << find_package(name).load_path
|
40
|
+
system(*command) || Torba.ui.error("Could not run '#{command.join(" ")}'")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def find_package(name)
|
47
|
+
packages = Torba.find_packages_by_name(name)
|
48
|
+
case packages.size
|
49
|
+
when 0
|
50
|
+
Torba.ui.error "Could not find package '#{name}'."
|
51
|
+
exit(false)
|
52
|
+
when 1
|
53
|
+
packages.first
|
54
|
+
else
|
55
|
+
index = Torba.ui.choose_one(packages.map(&:name))
|
56
|
+
if index
|
57
|
+
packages[index]
|
58
|
+
else
|
59
|
+
exit(false)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
18
63
|
end
|
19
64
|
end
|
data/lib/torba/manifest.rb
CHANGED
@@ -15,6 +15,7 @@ module Torba
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
18
19
|
# Represents Torbafile.
|
19
20
|
class Manifest
|
20
21
|
# all packages defined in Torbafile
|
@@ -120,5 +121,14 @@ module Torba
|
|
120
121
|
raise Errors::MissingPackages.new(missing)
|
121
122
|
end
|
122
123
|
end
|
124
|
+
|
125
|
+
# @return [Array<Package>] where each package name at least partially matches given name.
|
126
|
+
# @since 0.7.0
|
127
|
+
def find_packages_by_name(name)
|
128
|
+
re = Regexp.new(name, Regexp::IGNORECASE)
|
129
|
+
packages.find_all do |package|
|
130
|
+
package.name =~ re
|
131
|
+
end
|
132
|
+
end
|
123
133
|
end
|
124
134
|
end
|
data/lib/torba/ui.rb
CHANGED
@@ -22,5 +22,18 @@ module Torba
|
|
22
22
|
def error(message)
|
23
23
|
@shell.say(message, :red)
|
24
24
|
end
|
25
|
+
|
26
|
+
# @return [Integer] index of chosen option.
|
27
|
+
# @return [nil] if exit was chosen.
|
28
|
+
# @since 0.7.0
|
29
|
+
def choose_one(options)
|
30
|
+
options.each_with_index do |option, index|
|
31
|
+
info("#{index + 1} : #{option}")
|
32
|
+
end
|
33
|
+
info("0 : - exit -")
|
34
|
+
|
35
|
+
index = @shell.ask("> ").to_i - 1
|
36
|
+
(0..options.size - 1).cover?(index) ? index : nil
|
37
|
+
end
|
25
38
|
end
|
26
39
|
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class OpenTest < Minitest::Test
|
5
|
+
def test_complains_no_editor_set
|
6
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
7
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => nil
|
8
|
+
})
|
9
|
+
refute status.success?, err
|
10
|
+
assert_includes out, "To open a package, set $EDITOR or $TORBA_EDITOR"
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_runs_pack
|
14
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
15
|
+
"TORBA_EDITOR" => "echo torba_editor", "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
16
|
+
})
|
17
|
+
assert status.success?, err
|
18
|
+
compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_uses_torba_editor_first
|
22
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
23
|
+
"TORBA_EDITOR" => "echo torba_editor", "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
24
|
+
})
|
25
|
+
assert status.success?, err
|
26
|
+
assert_includes out, "torba_editor #{path_to_packaged "trumbowyg"}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_uses_visual_editor_second
|
30
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
31
|
+
"TORBA_EDITOR" => nil, "VISUAL" => "echo visual", "EDITOR" => "echo editor"
|
32
|
+
})
|
33
|
+
assert status.success?, err
|
34
|
+
assert_includes out, "visual #{path_to_packaged "trumbowyg"}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_uses_editor_third
|
38
|
+
out, err, status = torba("open trumbowyg", torbafile: "01_zip.rb", env: {
|
39
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
40
|
+
})
|
41
|
+
assert status.success?, err
|
42
|
+
assert_includes out, "editor #{path_to_packaged "trumbowyg"}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_finds_by_partial_package_name
|
46
|
+
out, err, status = torba("open trumbo", torbafile: "01_zip.rb", env: {
|
47
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
48
|
+
})
|
49
|
+
assert status.success?, err
|
50
|
+
assert_includes out, "editor #{path_to_packaged "trumbowyg"}"
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_could_not_find_package
|
54
|
+
out, err, status = torba("open dumbo", torbafile: "01_zip.rb", env: {
|
55
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
56
|
+
})
|
57
|
+
refute status.success?, err
|
58
|
+
assert_includes out, "Could not find package 'dumbo'."
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_similar_names_show_options
|
62
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", env: {
|
63
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
64
|
+
})
|
65
|
+
refute status.success?, err
|
66
|
+
assert_includes out, <<OUT
|
67
|
+
1 : bourbon
|
68
|
+
2 : bourbon-neat
|
69
|
+
0 : - exit -
|
70
|
+
OUT
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_similar_names_chosen_option
|
74
|
+
skip_java_capture3_bug
|
75
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "2", env: {
|
76
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
77
|
+
})
|
78
|
+
assert status.success?, err
|
79
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
80
|
+
assert_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_similar_names_chosen_exit
|
84
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "0", env: {
|
85
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
86
|
+
})
|
87
|
+
refute status.success?, err
|
88
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
89
|
+
refute_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_similar_names_chosen_unexisted_option
|
93
|
+
out, err, status = torba("open bourbon", torbafile: "04_similar_names.rb", stdin_data: "7", env: {
|
94
|
+
"TORBA_EDITOR" => nil, "VISUAL" => nil, "EDITOR" => "echo editor"
|
95
|
+
})
|
96
|
+
refute status.success?, err
|
97
|
+
refute_includes out, "editor #{path_to_packaged "bourbon"}"
|
98
|
+
refute_includes out, "editor #{path_to_packaged "bourbon-neat"}"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -1,39 +1,37 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
3
|
module Torba
|
4
|
-
class
|
5
|
-
|
6
|
-
|
7
|
-
def test_pack_zip
|
4
|
+
class PackTest < Minitest::Test
|
5
|
+
def test_zip
|
8
6
|
out, err, status = torba("pack", torbafile: "01_zip.rb")
|
9
7
|
assert status.success?, err
|
10
8
|
assert_includes out, "Torba has been packed!"
|
11
9
|
compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
12
10
|
end
|
13
11
|
|
14
|
-
def
|
12
|
+
def test_targz
|
15
13
|
out, err, status = torba("pack", torbafile: "01_targz.rb")
|
16
14
|
assert status.success?, err
|
17
15
|
assert_includes out, "Torba has been packed!"
|
18
16
|
compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
19
17
|
end
|
20
18
|
|
21
|
-
def
|
19
|
+
def test_gh_release
|
22
20
|
out, err, status = torba("pack", torbafile: "01_gh_release.rb")
|
23
21
|
assert status.success?, err
|
24
22
|
assert_includes out, "Torba has been packed!"
|
25
23
|
compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
26
24
|
end
|
27
25
|
|
28
|
-
def
|
26
|
+
def test_npm
|
29
27
|
out, err, status = torba("pack", torbafile: "02_npm.rb")
|
30
28
|
assert status.success?, err
|
31
29
|
assert_includes out, "Torba has been packed!"
|
32
30
|
compare_dirs "test/fixtures/home_path/02", path_to_packaged("lo_dash")
|
33
31
|
end
|
34
32
|
|
35
|
-
def
|
36
|
-
out, err, status = torba("pack", torbafile: "
|
33
|
+
def test_without_image_asset_specified_in_import
|
34
|
+
out, err, status = torba("pack", torbafile: "01_image_asset_not_specified.rb")
|
37
35
|
refute status.success?, err
|
38
36
|
assert_includes out, <<OUT
|
39
37
|
Unknown asset to process with path '#{path_to_packaged "Trumbowyg", Test::TempHome.persistent_tmp_dir}/dist/ui/images/icons-2x.png'.
|
@@ -41,33 +39,11 @@ Make sure that you've imported all image/font assets mentioned in a stylesheet(-
|
|
41
39
|
OUT
|
42
40
|
end
|
43
41
|
|
44
|
-
def
|
45
|
-
out, err, status = torba("pack", torbafile: "
|
42
|
+
def test_with_not_existed_assets_mentioned_in_stylesheets
|
43
|
+
out, err, status = torba("pack", torbafile: "03_not_existed_assets.rb")
|
46
44
|
assert status.success?, err
|
47
45
|
assert_includes out, "Torba has been packed!"
|
48
|
-
compare_dirs "test/fixtures/home_path/
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_verify_unpacked
|
52
|
-
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
53
|
-
refute status.success?, err
|
54
|
-
assert_equal <<OUT, out
|
55
|
-
Your Torba is not packed yet.
|
56
|
-
Missing packages:
|
57
|
-
* trumbowyg
|
58
|
-
Run `bundle exec torba pack` to install missing packages.
|
59
|
-
OUT
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_verify_packed
|
63
|
-
_, err, status = torba("pack", torbafile: "01_zip.rb")
|
64
|
-
assert status.success?, err
|
65
|
-
|
66
|
-
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
67
|
-
assert status.success?, err
|
68
|
-
assert_equal <<OUT, out
|
69
|
-
Torba is prepared!
|
70
|
-
OUT
|
46
|
+
compare_dirs "test/fixtures/home_path/03", path_to_packaged("bourbon")
|
71
47
|
end
|
72
48
|
end
|
73
49
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class ShowTest < Minitest::Test
|
5
|
+
def test_runs_pack
|
6
|
+
out, err, status = torba("show trumbowyg", torbafile: "01_zip.rb")
|
7
|
+
assert status.success?, err
|
8
|
+
compare_dirs "test/fixtures/home_path/01", path_to_packaged("trumbowyg")
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_outputs_package_directory
|
12
|
+
out, err, status = torba("show trumbowyg", torbafile: "01_zip.rb")
|
13
|
+
assert status.success?, err
|
14
|
+
assert_includes out, path_to_packaged("trumbowyg")
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_finds_by_partial_package_name
|
18
|
+
out, err, status = torba("show trumbo", torbafile: "01_zip.rb")
|
19
|
+
assert status.success?, err
|
20
|
+
assert_includes out, path_to_packaged("trumbowyg")
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_could_not_find_package
|
24
|
+
out, err, status = torba("show dumbo", torbafile: "01_zip.rb")
|
25
|
+
refute status.success?, err
|
26
|
+
assert_includes out, "Could not find package 'dumbo'."
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_similar_names_show_options
|
30
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb")
|
31
|
+
refute status.success?, err
|
32
|
+
assert_includes out, <<OUT
|
33
|
+
1 : bourbon
|
34
|
+
2 : bourbon-neat
|
35
|
+
0 : - exit -
|
36
|
+
OUT
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_similar_names_chosen_option
|
40
|
+
skip_java_capture3_bug
|
41
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "2")
|
42
|
+
assert status.success?, err
|
43
|
+
refute_includes out, path_to_packaged("bourbon")
|
44
|
+
assert_includes out, path_to_packaged("bourbon-neat")
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_similar_names_chosen_exit
|
48
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "0")
|
49
|
+
refute status.success?, err
|
50
|
+
refute_includes out, path_to_packaged("bourbon")
|
51
|
+
refute_includes out, path_to_packaged("bourbon-neat")
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_similar_names_chosen_unexisted_option
|
55
|
+
out, err, status = torba("show bourbon", torbafile: "04_similar_names.rb", stdin_data: "7")
|
56
|
+
refute status.success?, err
|
57
|
+
refute_includes out, path_to_packaged("bourbon")
|
58
|
+
refute_includes out, path_to_packaged("bourbon-neat")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class VerifyTest < Minitest::Test
|
5
|
+
def test_unpacked
|
6
|
+
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
7
|
+
refute status.success?, err
|
8
|
+
assert_equal <<OUT, out
|
9
|
+
Your Torba is not packed yet.
|
10
|
+
Missing packages:
|
11
|
+
* trumbowyg
|
12
|
+
Run `bundle exec torba pack` to install missing packages.
|
13
|
+
OUT
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_packed
|
17
|
+
_, err, status = torba("pack", torbafile: "01_zip.rb")
|
18
|
+
assert status.success?, err
|
19
|
+
|
20
|
+
out, err, status = torba("verify", torbafile: "01_zip.rb")
|
21
|
+
assert status.success?, err
|
22
|
+
assert_includes out, "Torba is prepared!"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
data/test/fixtures/torbafiles/{03_image_asset_not_specified.rb → 01_image_asset_not_specified.rb}
RENAMED
File without changes
|
File without changes
|
data/test/manifest_test.rb
CHANGED
@@ -111,5 +111,32 @@ module Torba
|
|
111
111
|
|
112
112
|
assert_equal error.packages.map(&:name), %w(angular coffee-script)
|
113
113
|
end
|
114
|
+
|
115
|
+
def test_find_packages_by_name_empty
|
116
|
+
assert_equal [], manifest.find_packages_by_name("coffee-script")
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_find_packages_by_name_no_match
|
120
|
+
manifest.npm "coffee", package: "coffee-script", version: "1.8.3"
|
121
|
+
manifest.npm "angular", package: "angular", version: "1.3.5"
|
122
|
+
assert_equal [], manifest.find_packages_by_name("coffee-script")
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_find_packages_by_name_single_match
|
126
|
+
manifest.npm "coffee", package: "coffee-script", version: "1.8.3"
|
127
|
+
manifest.npm "angular", package: "angular", version: "1.3.5"
|
128
|
+
assert_equal [manifest.packages[0]], manifest.find_packages_by_name("coffee")
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_find_packages_by_name_multiple_match
|
132
|
+
manifest.npm "angular", package: "angular", version: "1.3.5"
|
133
|
+
manifest.npm "angular-routes", package: "angular-routes", version: "1.3.5"
|
134
|
+
assert_equal manifest.packages, manifest.find_packages_by_name("angular")
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_find_packages_by_name_ignorecase
|
138
|
+
manifest.npm "Angular", package: "angular", version: "1.3.5"
|
139
|
+
assert_equal manifest.packages, manifest.find_packages_by_name("angular")
|
140
|
+
end
|
114
141
|
end
|
115
142
|
end
|
data/test/test_helper.rb
CHANGED
@@ -84,20 +84,30 @@ module Torba
|
|
84
84
|
def torba(torba_cmd, options = {})
|
85
85
|
env = {"TORBA_HOME_PATH" => torba_tmp_dir, "TORBA_CACHE_PATH" => TempHome.persistent_tmp_dir}
|
86
86
|
|
87
|
-
if (torbafile = options
|
87
|
+
if (torbafile = options.delete(:torbafile))
|
88
88
|
env.merge!("TORBA_FILE" => "test/fixtures/torbafiles/#{torbafile}")
|
89
89
|
end
|
90
90
|
|
91
|
-
if (home_path = options
|
91
|
+
if (home_path = options.delete(:home_path))
|
92
92
|
env.merge!("TORBA_HOME_PATH" => home_path)
|
93
93
|
end
|
94
94
|
|
95
|
-
if (cache_path = options
|
95
|
+
if (cache_path = options.delete(:cache_path))
|
96
96
|
env.merge!("TORBA_CACHE_PATH" => cache_path)
|
97
97
|
end
|
98
98
|
|
99
|
+
if (additional_env = options.delete(:env))
|
100
|
+
env.merge!(additional_env)
|
101
|
+
end
|
102
|
+
|
99
103
|
cmd = "ruby bin/torba #{torba_cmd}"
|
100
|
-
Open3.capture3(env, cmd)
|
104
|
+
Open3.capture3(env, cmd, options)
|
105
|
+
end
|
106
|
+
|
107
|
+
def skip_java_capture3_bug
|
108
|
+
if RUBY_PLATFORM == "java"
|
109
|
+
skip "Skipping test due to Open3.capture3 bug in Jruby"
|
110
|
+
end
|
101
111
|
end
|
102
112
|
end
|
103
113
|
|
@@ -120,4 +130,5 @@ end
|
|
120
130
|
class Minitest::Test
|
121
131
|
include Torba::Test::TempHome
|
122
132
|
include Torba::Test::FileSystem
|
133
|
+
include Torba::Test::Exec
|
123
134
|
end
|
data/torba.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrii Malyshko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -114,22 +114,26 @@ files:
|
|
114
114
|
- lib/torba/remote_sources/zip.rb
|
115
115
|
- lib/torba/ui.rb
|
116
116
|
- lib/torba/verify.rb
|
117
|
-
- test/
|
117
|
+
- test/acceptance-cli/open_test.rb
|
118
|
+
- test/acceptance-cli/pack_test.rb
|
119
|
+
- test/acceptance-cli/show_test.rb
|
120
|
+
- test/acceptance-cli/verify_test.rb
|
118
121
|
- test/css_url_to_erb_asset_path_test.rb
|
119
122
|
- test/fixtures/home_path/01/trumbowyg/icons-2x.png
|
120
123
|
- test/fixtures/home_path/01/trumbowyg/icons.png
|
121
124
|
- test/fixtures/home_path/01/trumbowyg/trumbowyg.css.erb
|
122
125
|
- test/fixtures/home_path/01/trumbowyg/trumbowyg.js
|
123
126
|
- test/fixtures/home_path/02/lo_dash/lodash.js
|
124
|
-
- test/fixtures/home_path/
|
125
|
-
- test/fixtures/home_path/
|
126
|
-
- test/fixtures/home_path/
|
127
|
+
- test/fixtures/home_path/03/bourbon/_border-image.scss
|
128
|
+
- test/fixtures/home_path/03/bourbon/_font-source-declaration.scss
|
129
|
+
- test/fixtures/home_path/03/bourbon/_retina-image.scss
|
127
130
|
- test/fixtures/torbafiles/01_gh_release.rb
|
131
|
+
- test/fixtures/torbafiles/01_image_asset_not_specified.rb
|
128
132
|
- test/fixtures/torbafiles/01_targz.rb
|
129
133
|
- test/fixtures/torbafiles/01_zip.rb
|
130
134
|
- test/fixtures/torbafiles/02_npm.rb
|
131
|
-
- test/fixtures/torbafiles/
|
132
|
-
- test/fixtures/torbafiles/
|
135
|
+
- test/fixtures/torbafiles/03_not_existed_assets.rb
|
136
|
+
- test/fixtures/torbafiles/04_similar_names.rb
|
133
137
|
- test/import_list_test.rb
|
134
138
|
- test/manifest_test.rb
|
135
139
|
- test/package/import_list_test.rb
|
@@ -170,22 +174,26 @@ signing_key:
|
|
170
174
|
specification_version: 4
|
171
175
|
summary: Bundler for Sprockets
|
172
176
|
test_files:
|
173
|
-
- test/
|
177
|
+
- test/acceptance-cli/open_test.rb
|
178
|
+
- test/acceptance-cli/pack_test.rb
|
179
|
+
- test/acceptance-cli/show_test.rb
|
180
|
+
- test/acceptance-cli/verify_test.rb
|
174
181
|
- test/css_url_to_erb_asset_path_test.rb
|
175
182
|
- test/fixtures/home_path/01/trumbowyg/icons-2x.png
|
176
183
|
- test/fixtures/home_path/01/trumbowyg/icons.png
|
177
184
|
- test/fixtures/home_path/01/trumbowyg/trumbowyg.css.erb
|
178
185
|
- test/fixtures/home_path/01/trumbowyg/trumbowyg.js
|
179
186
|
- test/fixtures/home_path/02/lo_dash/lodash.js
|
180
|
-
- test/fixtures/home_path/
|
181
|
-
- test/fixtures/home_path/
|
182
|
-
- test/fixtures/home_path/
|
187
|
+
- test/fixtures/home_path/03/bourbon/_border-image.scss
|
188
|
+
- test/fixtures/home_path/03/bourbon/_font-source-declaration.scss
|
189
|
+
- test/fixtures/home_path/03/bourbon/_retina-image.scss
|
183
190
|
- test/fixtures/torbafiles/01_gh_release.rb
|
191
|
+
- test/fixtures/torbafiles/01_image_asset_not_specified.rb
|
184
192
|
- test/fixtures/torbafiles/01_targz.rb
|
185
193
|
- test/fixtures/torbafiles/01_zip.rb
|
186
194
|
- test/fixtures/torbafiles/02_npm.rb
|
187
|
-
- test/fixtures/torbafiles/
|
188
|
-
- test/fixtures/torbafiles/
|
195
|
+
- test/fixtures/torbafiles/03_not_existed_assets.rb
|
196
|
+
- test/fixtures/torbafiles/04_similar_names.rb
|
189
197
|
- test/import_list_test.rb
|
190
198
|
- test/manifest_test.rb
|
191
199
|
- test/package/import_list_test.rb
|