barista 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +17 -13
- data/barista.gemspec +5 -9
- data/lib/barista.rb +1 -1
- data/lib/barista/compiler.rb +7 -13
- data/lib/barista/filter.rb +2 -2
- data/lib/barista/rake_task.rb +2 -6
- data/lib/barista/version.rb +1 -1
- metadata +9 -10
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,31 +1,35 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
coffee-script (2.
|
4
|
+
coffee-script (2.2.0)
|
5
5
|
coffee-script-source
|
6
|
-
|
6
|
+
execjs
|
7
|
+
coffee-script-source (1.1.1)
|
7
8
|
diff-lcs (1.1.2)
|
9
|
+
execjs (1.1.0)
|
10
|
+
multi_json (~> 1.0)
|
8
11
|
git (1.2.5)
|
9
|
-
jeweler (1.
|
10
|
-
bundler (~> 1.0
|
12
|
+
jeweler (1.6.2)
|
13
|
+
bundler (~> 1.0)
|
11
14
|
git (>= 1.2.5)
|
12
15
|
rake
|
13
|
-
|
16
|
+
multi_json (1.0.3)
|
17
|
+
rake (0.9.1)
|
14
18
|
rr (1.0.2)
|
15
|
-
rspec (2.
|
16
|
-
rspec-core (~> 2.
|
17
|
-
rspec-expectations (~> 2.
|
18
|
-
rspec-mocks (~> 2.
|
19
|
-
rspec-core (2.
|
20
|
-
rspec-expectations (2.
|
19
|
+
rspec (2.6.0)
|
20
|
+
rspec-core (~> 2.6.0)
|
21
|
+
rspec-expectations (~> 2.6.0)
|
22
|
+
rspec-mocks (~> 2.6.0)
|
23
|
+
rspec-core (2.6.3)
|
24
|
+
rspec-expectations (2.6.0)
|
21
25
|
diff-lcs (~> 1.1.2)
|
22
|
-
rspec-mocks (2.
|
26
|
+
rspec-mocks (2.6.0)
|
23
27
|
|
24
28
|
PLATFORMS
|
25
29
|
ruby
|
26
30
|
|
27
31
|
DEPENDENCIES
|
28
|
-
coffee-script (~> 2.
|
32
|
+
coffee-script (~> 2.2)
|
29
33
|
jeweler (~> 1.0)
|
30
34
|
rr (~> 1.0)
|
31
35
|
rspec (~> 2.1)
|
data/barista.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{barista}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.2.0"
|
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"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-02}
|
13
13
|
s.description = %q{Barista provides simple, integrated support for CoffeeScript in Rack and Rails applications.
|
14
14
|
|
15
15
|
Much like Compass does for Sass, It also provides Frameworks (bundleable code which can be shared via Gems).
|
@@ -60,27 +60,23 @@ For more details, please see the the README file bundled with it.}
|
|
60
60
|
s.require_paths = ["lib"]
|
61
61
|
s.rubygems_version = %q{1.6.2}
|
62
62
|
s.summary = %q{Simple, transparent coffeescript integration for Rails and Rack applications.}
|
63
|
-
s.test_files = [
|
64
|
-
"spec/barista_spec.rb",
|
65
|
-
"spec/spec_helper.rb"
|
66
|
-
]
|
67
63
|
|
68
64
|
if s.respond_to? :specification_version then
|
69
65
|
s.specification_version = 3
|
70
66
|
|
71
67
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
72
|
-
s.add_runtime_dependency(%q<coffee-script>, ["~> 2.
|
68
|
+
s.add_runtime_dependency(%q<coffee-script>, ["~> 2.2"])
|
73
69
|
s.add_development_dependency(%q<jeweler>, ["~> 1.0"])
|
74
70
|
s.add_development_dependency(%q<rspec>, ["~> 2.1"])
|
75
71
|
s.add_development_dependency(%q<rr>, ["~> 1.0"])
|
76
72
|
else
|
77
|
-
s.add_dependency(%q<coffee-script>, ["~> 2.
|
73
|
+
s.add_dependency(%q<coffee-script>, ["~> 2.2"])
|
78
74
|
s.add_dependency(%q<jeweler>, ["~> 1.0"])
|
79
75
|
s.add_dependency(%q<rspec>, ["~> 2.1"])
|
80
76
|
s.add_dependency(%q<rr>, ["~> 1.0"])
|
81
77
|
end
|
82
78
|
else
|
83
|
-
s.add_dependency(%q<coffee-script>, ["~> 2.
|
79
|
+
s.add_dependency(%q<coffee-script>, ["~> 2.2"])
|
84
80
|
s.add_dependency(%q<jeweler>, ["~> 1.0"])
|
85
81
|
s.add_dependency(%q<rspec>, ["~> 2.1"])
|
86
82
|
s.add_dependency(%q<rr>, ["~> 1.0"])
|
data/lib/barista.rb
CHANGED
@@ -183,7 +183,7 @@ module Barista
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def compile_all!(force = false, silence_error = true)
|
186
|
-
debug "Compiling all coffeescripts"
|
186
|
+
debug "Compiling all coffeescripts" if Barista.auto_compile?
|
187
187
|
Barista.invoke_hook :before_full_compilation
|
188
188
|
Framework.exposed_coffeescripts.each do |coffeescript|
|
189
189
|
Compiler.autocompile_file coffeescript, force, silence_error
|
data/lib/barista/compiler.rb
CHANGED
@@ -3,6 +3,8 @@ require 'digest/sha2'
|
|
3
3
|
module Barista
|
4
4
|
class Compiler
|
5
5
|
|
6
|
+
UNAVAILABLE_MESSAGE = "No method of compiling coffee-script is currently available. Please see the ExecJS page (https://github.com/sstephenson/execjs) for details on how to set one up."
|
7
|
+
|
6
8
|
# TODO: Deprecate.
|
7
9
|
class << self
|
8
10
|
|
@@ -15,19 +17,11 @@ module Barista
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def bin_path
|
18
|
-
|
19
|
-
CoffeeScript::Engines::Node.binary
|
20
|
-
else
|
21
|
-
execjs_runtime_call :binary
|
22
|
-
end
|
20
|
+
execjs_runtime_call :binary
|
23
21
|
end
|
24
22
|
|
25
23
|
def bin_path=(path)
|
26
|
-
|
27
|
-
CoffeeScript::Engines::Node.binary = path
|
28
|
-
else
|
29
|
-
execjs_runtime_call :binary=, path
|
30
|
-
end
|
24
|
+
execjs_runtime_call :binary=, path
|
31
25
|
end
|
32
26
|
|
33
27
|
def execjs_runtime_call(method, *args)
|
@@ -40,13 +34,13 @@ module Barista
|
|
40
34
|
end
|
41
35
|
|
42
36
|
def available?
|
43
|
-
|
37
|
+
ExecJS.runtime and ExecJS.runtime.available?
|
44
38
|
end
|
45
39
|
|
46
40
|
def check_availability!(silence = false)
|
47
41
|
available = available?
|
48
42
|
if !available && Barista.exception_on_error? && !silence
|
49
|
-
raise CompilerUnavailableError,
|
43
|
+
raise CompilerUnavailableError, UNAVAILABLE_MESSAGE
|
50
44
|
end
|
51
45
|
available
|
52
46
|
end
|
@@ -73,7 +67,7 @@ module Barista
|
|
73
67
|
return File.read(destination_path) unless dirty?(origin_path, destination_path) || force
|
74
68
|
# Ensure we have a coffeescript compiler available.
|
75
69
|
if !check_availability!(silence_error)
|
76
|
-
Barista.debug
|
70
|
+
Barista.debug UNAVAILABLE_MESSAGE
|
77
71
|
return nil
|
78
72
|
end
|
79
73
|
Barista.debug "Compiling #{file} from framework '#{framework.name}'"
|
data/lib/barista/filter.rb
CHANGED
@@ -10,11 +10,11 @@ module Barista
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def _call(env)
|
13
|
-
Barista.debug 'Compiling all scripts for barista'
|
13
|
+
Barista.debug 'Compiling all scripts for barista' if Barista.auto_compile?
|
14
14
|
Barista.compile_all!
|
15
15
|
# Now, actually call the app.
|
16
16
|
@app.call env
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
20
|
-
end
|
20
|
+
end
|
data/lib/barista/rake_task.rb
CHANGED
@@ -55,12 +55,8 @@ module Barista
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def check_availability
|
58
|
-
|
59
|
-
|
60
|
-
$stderr.puts "CoffeeScript doesn't appear to be installed on this system and you're not using an embedded compiler."
|
61
|
-
else
|
62
|
-
$stderr.puts "'#{Barista::Compiler.bin_path}' was unavailable."
|
63
|
-
end
|
58
|
+
unless Barista::Compiler.available?
|
59
|
+
warn Barista::Compiler::UNAVAILABLE_MESSAGE
|
64
60
|
exit 1
|
65
61
|
end
|
66
62
|
end
|
data/lib/barista/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barista
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darcy Laycock
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-02 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -25,11 +25,11 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 7
|
29
29
|
segments:
|
30
30
|
- 2
|
31
|
-
-
|
32
|
-
version: "2.
|
31
|
+
- 2
|
32
|
+
version: "2.2"
|
33
33
|
version_requirements: *id001
|
34
34
|
name: coffee-script
|
35
35
|
prerelease: false
|
@@ -161,6 +161,5 @@ rubygems_version: 1.6.2
|
|
161
161
|
signing_key:
|
162
162
|
specification_version: 3
|
163
163
|
summary: Simple, transparent coffeescript integration for Rails and Rack applications.
|
164
|
-
test_files:
|
165
|
-
|
166
|
-
- spec/spec_helper.rb
|
164
|
+
test_files: []
|
165
|
+
|