barista 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -1
- data/barista.gemspec +2 -2
- data/lib/barista.rb +4 -3
- data/lib/barista/compiler.rb +1 -1
- data/lib/barista/{around_filter.rb → filter.rb} +2 -2
- data/lib/barista/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -14,10 +14,13 @@ your coffeescripts will be automatically provided, ready for bundling.
|
|
14
14
|
|
15
15
|
To add to your project, simply add:
|
16
16
|
|
17
|
-
gem 'barista', '>= 0.1.
|
17
|
+
gem 'barista', '>= 0.1.2'
|
18
18
|
|
19
19
|
To your Gemfile and run bundle install.
|
20
20
|
|
21
21
|
As you place .coffee files in app/scripts, it will automatically handle them for you.
|
22
22
|
|
23
|
+
Please note that for Jammit compatibility etc, by default in test and dev mode it will
|
24
|
+
automatically compile all coffeescripts that have changed before rendering the page.
|
25
|
+
|
23
26
|
Barista require rails 3+ (but patches for Rails 2 will be accepted.)
|
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.
|
8
|
+
s.version = "0.1.2"
|
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"]
|
@@ -26,8 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
"barista.gemspec",
|
27
27
|
"config/routes.rb",
|
28
28
|
"lib/barista.rb",
|
29
|
-
"lib/barista/around_filter.rb",
|
30
29
|
"lib/barista/compiler.rb",
|
30
|
+
"lib/barista/filter.rb",
|
31
31
|
"lib/barista/tasks/barista.rake",
|
32
32
|
"lib/barista/version.rb"
|
33
33
|
]
|
data/lib/barista.rb
CHANGED
@@ -3,8 +3,8 @@ require 'pathname'
|
|
3
3
|
|
4
4
|
module Barista
|
5
5
|
|
6
|
-
autoload :Compiler,
|
7
|
-
autoload :
|
6
|
+
autoload :Compiler, 'barista/compiler'
|
7
|
+
autoload :Filter, 'barista/filter'
|
8
8
|
|
9
9
|
class << self
|
10
10
|
|
@@ -37,6 +37,7 @@ module Barista
|
|
37
37
|
file = root.join(file).to_s unless file.include?(root.to_s)
|
38
38
|
destination_path = file.gsub(/\.(coffee|js)\Z/, '').gsub(root.to_s, output_root.to_s) + ".js"
|
39
39
|
return unless force || should_compile_file?(file, destination_path)
|
40
|
+
Rails.logger.debug "[Barista] Compiling #{file} to #{destination_path}"
|
40
41
|
File.open(destination_path, "w+") do |f|
|
41
42
|
f.write Compiler.compile(File.read(file))
|
42
43
|
end
|
@@ -69,7 +70,7 @@ module Barista
|
|
69
70
|
end
|
70
71
|
|
71
72
|
initializer "barista.wrap_filter" do
|
72
|
-
|
73
|
+
ActionController::Base.before_filter(Barista::Filter) if Barista.add_filter?
|
73
74
|
end
|
74
75
|
|
75
76
|
end
|
data/lib/barista/compiler.rb
CHANGED
data/lib/barista/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Darcy Laycock
|
@@ -37,8 +37,8 @@ files:
|
|
37
37
|
- barista.gemspec
|
38
38
|
- config/routes.rb
|
39
39
|
- lib/barista.rb
|
40
|
-
- lib/barista/around_filter.rb
|
41
40
|
- lib/barista/compiler.rb
|
41
|
+
- lib/barista/filter.rb
|
42
42
|
- lib/barista/tasks/barista.rake
|
43
43
|
- lib/barista/version.rb
|
44
44
|
has_rdoc: true
|