coffee-script-2.4.1/0000755000004100000410000000000012524754314014306 5ustar www-datawww-datacoffee-script-2.4.1/lib/0000755000004100000410000000000012524754314015054 5ustar www-datawww-datacoffee-script-2.4.1/lib/coffee-script.rb0000644000004100000410000000003012524754314020123 0ustar www-datawww-datarequire 'coffee_script' coffee-script-2.4.1/lib/coffee_script.rb0000644000004100000410000000354412524754314020222 0ustar www-datawww-datarequire 'execjs' require 'coffee_script/source' module CoffeeScript Error = ExecJS::Error EngineError = ExecJS::RuntimeError CompilationError = ExecJS::ProgramError module Source def self.path @path ||= ENV['COFFEESCRIPT_SOURCE_PATH'] || bundled_path end def self.path=(path) @contents = @version = @bare_option = @context = nil @path = path end COMPILE_FUNCTION_SOURCE = <<-JS ;function compile(script, options) { try { return CoffeeScript.compile(script, options); } catch (err) { if (err instanceof SyntaxError && err.location) { throw new SyntaxError([ err.filename || "[stdin]", err.location.first_line + 1, err.location.first_column + 1 ].join(":") + ": " + err.message) } else { throw err; } } } JS def self.contents @contents ||= File.read(path) + COMPILE_FUNCTION_SOURCE end def self.version @version ||= contents[/CoffeeScript Compiler v([\d.]+)/, 1] end def self.bare_option @bare_option ||= contents.match(/noWrap/) ? 'noWrap' : 'bare' end def self.context @context ||= ExecJS.compile(contents) end end class << self def engine end def engine=(engine) end def version Source.version end # Compile a script (String or IO) to JavaScript. def compile(script, options = {}) script = script.read if script.respond_to?(:read) if options.key?(:bare) elsif options.key?(:no_wrap) options[:bare] = options[:no_wrap] else options[:bare] = false end # Stringify keys options = options.inject({}) { |h, (k, v)| h[k.to_s] = v; h } Source.context.call("compile", script, options) end end end coffee-script-2.4.1/metadata.yml0000644000004100000410000000471012524754314016613 0ustar www-datawww-data--- !ruby/object:Gem::Specification name: coffee-script version: !ruby/object:Gem::Version version: 2.4.1 platform: ruby authors: - Jeremy Ashkenas - Joshua Peek - Sam Stephenson autorequire: bindir: bin cert_chain: [] date: 2015-04-06 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: coffee-script-source requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: execjs requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: json requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' description: |2 Ruby CoffeeScript is a bridge to the JS CoffeeScript compiler. email: josh@joshpeek.com executables: [] extensions: [] extra_rdoc_files: [] files: - LICENSE - README.md - lib/coffee-script.rb - lib/coffee_script.rb homepage: http://github.com/josh/ruby-coffee-script licenses: - MIT metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.2.2 signing_key: specification_version: 4 summary: Ruby CoffeeScript Compiler test_files: [] coffee-script-2.4.1/LICENSE0000644000004100000410000000203712524754314015315 0ustar www-datawww-dataCopyright (c) 2010 Joshua Peek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. coffee-script-2.4.1/README.md0000644000004100000410000000264712524754314015576 0ustar www-datawww-dataRuby CoffeeScript ================= Ruby CoffeeScript is a bridge to the official CoffeeScript compiler. CoffeeScript.compile File.read("script.coffee") Installation ------------ gem install coffee-script *Note: This compiler library has replaced the original CoffeeScript compiler that was written in Ruby.* Dependencies ------------ This library depends on the `coffee-script-source` gem which is updated any time a new version of CoffeeScript is released. (The `coffee-script-source` gem's version number is synced with each official CoffeeScript release.) This way you can build against different versions of CoffeeScript by requiring the correct version of the `coffee-script-source` gem. In addition, you can use this library with unreleased versions of CoffeeScript by setting the `COFFEESCRIPT_SOURCE_PATH` environment variable: export COFFEESCRIPT_SOURCE_PATH=/path/to/coffee-script/extras/coffee-script.js ### JSON The `json` library is also required but is not explicitly stated as a gem dependency. If you're on Ruby 1.8 you'll need to install the `json` or `json_pure` gem. On Ruby 1.9, `json` is included in the standard library. ### ExecJS The [ExecJS](https://github.com/sstephenson/execjs) library is used to automatically choose the best JavaScript engine for your platform. Check out its [README](https://github.com/sstephenson/execjs/blob/master/README.md) for a complete list of supported engines.