torba 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75e1e95a66cde782c37ba9ccf8d2f721d803b794
4
- data.tar.gz: a15d3348dcd9f0fbd6b3fa8c5776f5321f101729
3
+ metadata.gz: 5391cc5aa1ed3603ff47fcffeab1bf2c0b2c168f
4
+ data.tar.gz: 454aa67e4144f8c303603cedccc7a55d483e8816
5
5
  SHA512:
6
- metadata.gz: 5e206200cdcd65c93721a5dd71dbc9a2fa14186157de91d848017d567823e18a7e9c98a2800315ee169553995def7c0bb6c72dd8038ddd766e2269306822fd91
7
- data.tar.gz: eea4d450cdb3d0f8803373b518f1a1da51e0e3ed93723f3e3293fb786fc77f15dea8c4d5c62578254d2bd6ebbee76c4d634226ac1720eb459ab4f51d3b575386
6
+ metadata.gz: 389f26e6a2ca7769f74b30edc661d66cd02686b89d2a5643e41f6d78876e80338ff7f3195f37ff04e69ed8b8ff4d830ed34d8977ce7f8bbfde7574c538f82ea0
7
+ data.tar.gz: 6427d86f0ab997e465efa4b01272ebc64f0eb7728cf5dd8d9bdf18184246791e793f1dfc666378d02d3729cb74904868aee38009e2f729124466a74fd0199c98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## Version 0.4.1
4
+
5
+ ### Bug fixes
6
+
7
+ * Do not add the `.erb` extension for stylesheets that don't need it.
8
+
3
9
  ## Version 0.4.0
4
10
 
5
11
  ### Enhancements
data/README.md CHANGED
@@ -17,7 +17,7 @@ Production ready.
17
17
 
18
18
  ## Documentation
19
19
 
20
- [Released version](http://rubydoc.info/gems/torba/0.4.0)
20
+ [Released version](http://rubydoc.info/gems/torba/0.4.1)
21
21
 
22
22
  ## Why
23
23
 
data/lib/torba/package.rb CHANGED
@@ -163,7 +163,12 @@ module Torba
163
163
  image_asset.logical_path
164
164
  end
165
165
 
166
- new_absolute_path = File.join(load_path, asset.logical_path + ".erb")
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
@@ -48,6 +48,8 @@ module Torba
48
48
  end
49
49
 
50
50
  def ensure_cached; end
51
+
52
+ def digest; '' end
51
53
  end
52
54
  end
53
55
  end
data/torba.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "torba"
3
- spec.version = "0.4.0"
3
+ spec.version = "0.4.1"
4
4
  spec.authors = ["Andrii Malyshko"]
5
5
  spec.email = ["mail@nashbridges.me"]
6
6
  spec.description = "Bundler for Sprockets"
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.0
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: 2015-08-20 00:00:00.000000000 Z
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.2.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