torba 0.1.0 → 0.1.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: c693882d1f37d1cdf2ea156a9d6fd90aaa42409e
4
- data.tar.gz: d57f3ec19cf7274292a3bee7440f9102ddd2e3a6
3
+ metadata.gz: 8077046fe1ce43eba5020e6c3bf29c60ddbb5e78
4
+ data.tar.gz: bd3ebc23042ec750e0b7079b89b4b5cc5bc05886
5
5
  SHA512:
6
- metadata.gz: 3191c0a6b2610b78e148fe7f3cbf936f8fd3a82707e62d914c01378ea464bee951b3d6412530089792d10188fba62faa633b52a0ec81e72f1506f548c9418af5
7
- data.tar.gz: aa2e6571108e54d3fc76d35e99e5b8d90f23e47ee70c8dd456d7e3aa6cfb06831d6ad5e821b72c0c746f3f80c4b463a0d19e0c2a61c7acb8968b731b0a1c929f
6
+ metadata.gz: 2466b9ec97f44de5aec27493474978ec031679f1d6527b1365dbae4335a7725ccaf7acf4ff3a83c8e89b567b05c099d6210b0b3cded8710a123ae622e9f42c47
7
+ data.tar.gz: 19cb9f0cc57317562981ce3e795b0615a1082ad098ce4e5bb242ba7b253fcff14b05dda659282b81f07c68679c00bbcac1af26dfa55a17528d03c99092f23f83
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## Unreleased
2
+
3
+ ## Version 0.1.1
4
+
5
+ ### Bug fixes
6
+
7
+ * Fail fast and report on 404 resources
@@ -39,7 +39,7 @@ module Torba
39
39
  Torba.ui.info "downloading '#{url}'"
40
40
 
41
41
  [
42
- "curl -L -o #{tempfile.path} #{url}",
42
+ "curl -Lf -o #{tempfile.path} #{url}",
43
43
  "unzip -oqq -d #{cache_path} #{tempfile.path}",
44
44
  ].each do |command|
45
45
  system(command) || raise(Errors::ShellCommandFailed.new(command))
data/lib/torba.rb CHANGED
@@ -63,16 +63,19 @@ module Torba
63
63
  # @yield a block, converts common exceptions into useful messages
64
64
  def self.pretty_errors
65
65
  yield
66
- rescue Torba::Errors::UnbuiltPackage
66
+ rescue Errors::UnbuiltPackage
67
67
  ui.error "Your Torba is not packed yet."
68
68
  ui.suggest "Run `bundle exec torba pack` to install missing packages."
69
69
  exit(false)
70
- rescue Torba::Errors::NothingToImport => e
70
+ rescue Errors::ShellCommandFailed => e
71
+ ui.error "Couldn't execute command '#{e.message}'"
72
+ exit(false)
73
+ rescue Errors::NothingToImport => e
71
74
  ui.error "Couldn't import an asset(-s) '#{e.path}' from import list in '#{e.package}'."
72
75
  ui.suggest "Check for typos."
73
76
  ui.suggest "Make sure that the path has trailing '/' if its a directory."
74
77
  exit(false)
75
- rescue Torba::Errors::AssetNotFound => e
78
+ rescue Errors::AssetNotFound => e
76
79
  ui.error "Couldn't found an asset with path '#{e.message}'."
77
80
  ui.suggest "Make sure that you've imported all image assets mentioned in a stylesheet(-s)."
78
81
  exit(false)
@@ -17,5 +17,12 @@ module Torba
17
17
 
18
18
  refute_equal remote.digest, another_remote.digest
19
19
  end
20
+
21
+ def test_404
22
+ exception = assert_raises(Errors::ShellCommandFailed) do
23
+ RemoteSources::Zip.new("http://jquery.com/jquery.zip")["*"]
24
+ end
25
+ assert_includes exception.message, "curl"
26
+ end
20
27
  end
21
28
  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.1.0"
3
+ spec.version = "0.1.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.1.0
4
+ version: 0.1.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-04-24 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -77,6 +77,7 @@ files:
77
77
  - ".gitignore"
78
78
  - ".travis.yml"
79
79
  - ".yardopts"
80
+ - CHANGELOG.md
80
81
  - CONTRIBUTING.md
81
82
  - Gemfile
82
83
  - LICENSE.txt