torba 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/torba/package.rb +6 -1
- data/test/package_test.rb +42 -0
- data/test/test_helper.rb +2 -0
- data/torba.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5391cc5aa1ed3603ff47fcffeab1bf2c0b2c168f
|
4
|
+
data.tar.gz: 454aa67e4144f8c303603cedccc7a55d483e8816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 389f26e6a2ca7769f74b30edc661d66cd02686b89d2a5643e41f6d78876e80338ff7f3195f37ff04e69ed8b8ff4d830ed34d8977ce7f8bbfde7574c538f82ea0
|
7
|
+
data.tar.gz: 6427d86f0ab997e465efa4b01272ebc64f0eb7728cf5dd8d9bdf18184246791e793f1dfc666378d02d3729cb74904868aee38009e2f729124466a74fd0199c98
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/torba/package.rb
CHANGED
@@ -163,7 +163,12 @@ module Torba
|
|
163
163
|
image_asset.logical_path
|
164
164
|
end
|
165
165
|
|
166
|
-
|
166
|
+
if content == new_content
|
167
|
+
new_absolute_path = File.join(load_path, asset.logical_path)
|
168
|
+
else
|
169
|
+
new_absolute_path = File.join(load_path, asset.logical_path + ".erb")
|
170
|
+
end
|
171
|
+
|
167
172
|
ensure_directory(new_absolute_path)
|
168
173
|
File.write(new_absolute_path, new_content)
|
169
174
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Torba
|
4
|
+
class PackageTest < Minitest::Test
|
5
|
+
def source_dir
|
6
|
+
@source_dir ||= File.join(Torba.home_path, "source")
|
7
|
+
end
|
8
|
+
|
9
|
+
def touch(path)
|
10
|
+
super File.join(source_dir, path)
|
11
|
+
end
|
12
|
+
|
13
|
+
def fixture(path, content = nil)
|
14
|
+
touch(path)
|
15
|
+
if content
|
16
|
+
File.write(File.join(source_dir, path), content)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_package_css_with_urls
|
21
|
+
touch "image.png"
|
22
|
+
fixture "hello.css" , "body {\nbackground-image: url(image.png)\n}"
|
23
|
+
source = Torba::Test::RemoteSource.new(source_dir)
|
24
|
+
package = Package.new("package", source, import: ["hello.css", "image.png"])
|
25
|
+
|
26
|
+
package.build
|
27
|
+
|
28
|
+
assert_exists File.join(package.load_path, "package", "hello.css.erb")
|
29
|
+
assert_exists File.join(package.load_path, "package", "image.png")
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_package_css_without_urls
|
33
|
+
fixture "hello.css"
|
34
|
+
source = Torba::Test::RemoteSource.new(source_dir)
|
35
|
+
package = Package.new("package", source, import: ["hello.css"])
|
36
|
+
|
37
|
+
package.build
|
38
|
+
|
39
|
+
assert_exists File.join(package.load_path, "package", "hello.css")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/test/test_helper.rb
CHANGED
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrii Malyshko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- test/manifest_test.rb
|
106
106
|
- test/package/import_list_test.rb
|
107
107
|
- test/package/logical_paths_test.rb
|
108
|
+
- test/package_test.rb
|
108
109
|
- test/remote_sources/common_test.rb
|
109
110
|
- test/remote_sources/get_file_test.rb
|
110
111
|
- test/remote_sources/github_release_test.rb
|
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
134
|
version: '0'
|
134
135
|
requirements: []
|
135
136
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.4.5.1
|
137
138
|
signing_key:
|
138
139
|
specification_version: 4
|
139
140
|
summary: Bundler for Sprockets
|
@@ -144,6 +145,7 @@ test_files:
|
|
144
145
|
- test/manifest_test.rb
|
145
146
|
- test/package/import_list_test.rb
|
146
147
|
- test/package/logical_paths_test.rb
|
148
|
+
- test/package_test.rb
|
147
149
|
- test/remote_sources/common_test.rb
|
148
150
|
- test/remote_sources/get_file_test.rb
|
149
151
|
- test/remote_sources/github_release_test.rb
|