Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 63 lines (41 sloc) 2.011 kB
3442ea5 @Sutto Add the generator
authored
1 # Configure barista.
2 Barista.configure do |c|
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
3
3442ea5 @Sutto Add the generator
authored
4 # Change the root to use app/scripts
5 # c.root = Rails.root.join("app", "scripts")
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
6
3442ea5 @Sutto Add the generator
authored
7 # Change the output root, causing Barista to compile into public/coffeescripts
8 # c.output_root = Rails.root.join("public", "coffeescripts")
053f2b0 @allenwei Add auto_compile configuration
allenwei authored
9 #
10 # Disable auto compile, use generated file directly:
11 # c.auto_compile = false
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
12
151a5a0 @Sutto Expose the output_root option
authored
13 # Add a new framework:
14
15 # c.register :tests, :root => Rails.root.join('test', 'coffeescript'), :output_prefix => 'test'
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
16
3442ea5 @Sutto Add the generator
authored
17 # Disable wrapping in a closure:
151a5a0 @Sutto Expose the output_root option
authored
18 # c.bare = true
3442ea5 @Sutto Add the generator
authored
19 # ... or ...
151a5a0 @Sutto Expose the output_root option
authored
20 # c.bare!
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
21
85060b1 @Sutto Bump version, allow you to change prefixes for frameworks
authored
22 # Change the output root for a framework:
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
23
817c1e9 @Sutto Update, make each_framework work
authored
24 # c.change_output_prefix! 'framework-name', 'output-prefix'
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
25
85060b1 @Sutto Bump version, allow you to change prefixes for frameworks
authored
26 # or for all frameworks...
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
27
817c1e9 @Sutto Update, make each_framework work
authored
28 # c.each_framework do |framework|
151a5a0 @Sutto Expose the output_root option
authored
29 # c.change_output_prefix! framework, "vendor/#{framework.name}"
85060b1 @Sutto Bump version, allow you to change prefixes for frameworks
authored
30 # end
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
31
85060b1 @Sutto Bump version, allow you to change prefixes for frameworks
authored
32 # or, prefix the path for the app files:
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
33
34 # c.change_output_prefix! :default, 'my-app-name'
35
151a5a0 @Sutto Expose the output_root option
authored
36 # or, change the directory the framework goes into full stop:
37
38 # c.change_output_prefix! :tests, Rails.root.join('spec', 'javascripts')
39
fd82e0f @Sutto Update to support hooks
authored
40 # or, hook into the compilation:
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
41
fd82e0f @Sutto Update to support hooks
authored
42 # c.before_compilation { |path| puts "Barista: Compiling #{path}" }
43 # c.on_compilation { |path| puts "Barista: Successfully compiled #{path}" }
44 # c.on_compilation_error { |path, output| puts "Barista: Compilation of #{path} failed with:\n#{output}" }
45 # c.on_compilation_with_warning { |path, output| puts "Barista: Compilation of #{path} had a warning:\n#{output}" }
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
46
47 # Turn off preambles and exceptions on failure:
48
af37599 @Sutto Let users switch the compilers in a simpler manner, change version nu…
authored
49 # c.verbose = false
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
50
af37599 @Sutto Let users switch the compilers in a simpler manner, change version nu…
authored
51 # Or, make sure it is always on
52 # c.verbose!
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
53
55f3d2d @Sutto Rename the barista install generator, add backwards compatibility.
authored
54 # If you want to use a custom JS file, you can as well
55 # e.g. vendoring CoffeeScript in your application:
56 # c.js_path = Rails.root.join('public', 'javascripts', 'coffee-script.js')
ead4559 @Sutto Change the default for embedded_interpreter and update the generated …
authored
57
58 # Make helpers and the HAML filter output coffee-script instead of the compiled JS.
59 # Used in combination with the coffeescript_interpreter_js helper in Rails.
60 # c.embedded_interpreter = true
61
817c1e9 @Sutto Update, make each_framework work
authored
62 end
Something went wrong with that request. Please try again.