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 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.0'
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.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, 'barista/compiler'
7
- autoload :AroundFilter, 'barista/around_filter'
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
- ApplicationController.around_filter(Barista::AroundFilter) if Barista.add_filter?
73
+ ActionController::Base.before_filter(Barista::Filter) if Barista.add_filter?
73
74
  end
74
75
 
75
76
  end
@@ -43,7 +43,7 @@ module Barista
43
43
  end
44
44
 
45
45
  def invoke_coffee(path)
46
- command = "#{self.class.bin_path} #{coffee_options} '#{path}'"
46
+ command = "#{self.class.bin_path} #{coffee_options} '#{path}'".squeeze(' ')
47
47
  %x(#{command})
48
48
  end
49
49
 
@@ -1,9 +1,9 @@
1
1
  module Barista
2
- class AroundFilter
2
+ class Filter
3
3
 
4
4
  def self.filter(controller)
5
+ Rails.logger.debug "[Barista] Compiling all scripts"
5
6
  Barista.compile_all!
6
- yield if block_given?
7
7
  end
8
8
 
9
9
  end
@@ -2,7 +2,7 @@ module Barista
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 1
5
+ PATCH = 2
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
- - 1
9
- version: 0.1.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