barista 0.1.2 → 0.1.3

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.
data/barista.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{barista}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darcy Laycock"]
data/lib/barista.rb CHANGED
@@ -28,7 +28,7 @@ module Barista
28
28
  full_path = root.join("#{path.gsub(/(\A\/|\/\Z)/, '')}.coffee")
29
29
  return unless full_path.exist? && full_path.readable?
30
30
  Compiler.compile(full_path.read)
31
- rescue SysCallError
31
+ rescue SystemCallError
32
32
  nil
33
33
  end
34
34
 
@@ -42,7 +42,7 @@ module Barista
42
42
  f.write Compiler.compile(File.read(file))
43
43
  end
44
44
  true
45
- rescue SysCallError
45
+ rescue SystemCallError
46
46
  false
47
47
  end
48
48
 
@@ -60,6 +60,14 @@ module Barista
60
60
  Rails.env.test? || Rails.env.development?
61
61
  end
62
62
 
63
+ def no_wrap?
64
+ defined?(@no_wrap) && @no_wrap
65
+ end
66
+
67
+ def no_wrap=(value)
68
+ @no_wrap = !!value
69
+ end
70
+
63
71
  end
64
72
 
65
73
  if defined?(Rails::Engine)
@@ -32,12 +32,14 @@ module Barista
32
32
  protected
33
33
 
34
34
  def coffee_options
35
- "-p"
35
+ ["-p"].tap do |options|
36
+ options << "--no-wrap" if Barista.no_wrap?
37
+ end.join(" ")
36
38
  end
37
39
 
38
- def temp_file_for_content
40
+ def temp_file_for_content(content = @content)
39
41
  tf = Tempfile.new("barista-#{content_hash}.coffee")
40
- tf.write @content
42
+ tf.write content
41
43
  tf.close
42
44
  tf
43
45
  end
@@ -2,7 +2,7 @@ module Barista
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 2
5
+ PATCH = 3
6
6
  STRING = [MAJOR, MINOR, PATCH].join(".")
7
7
  end
8
8
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Darcy Laycock