iced-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in iced_asset_pipeline.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Raphael Randschau
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # IcedRails
2
+
3
+ Add support for `.iced` files in the Rails Asset Pipeline
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'iced_asset_pipeline'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install iced_asset_pipeline
18
+
19
+ ## Usage
20
+
21
+ Place a new `.iced` file under `app/assets/javascripts`. E.g. `application.iced`.
22
+
23
+ Make sure to name to file `application.iced` and not `application.js.iced`.
24
+
25
+ See [IcedCoffeeScript][1] for an explanation about iced coffeescript.
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
34
+
35
+
36
+ [1]:http://maxtaco.github.com/coffee-script/
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,21 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'iced/rails/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "iced-rails"
7
+ gem.version = ::Iced::Rails::VERSION
8
+ gem.authors = ["Raphael Randschau"]
9
+ gem.email = ["nicolai86@me.com"]
10
+ gem.description = %q{IcedCoffeeScript adapter for the Rails asset pipeline.}
11
+ gem.summary = %q{IcedCoffeeScript adapter for the Rails asset pipeline.}
12
+ gem.homepage = "https://github.com/nicolai86/iced-rails"
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ["lib"]
18
+
19
+ gem.add_runtime_dependency 'iced-coffee-script'
20
+ gem.add_runtime_dependency 'rails', '~> 3.2.11'
21
+ end
@@ -0,0 +1,12 @@
1
+ # encoding: UTF-8
2
+ require 'rails/engine'
3
+
4
+ module Iced
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ initializer "iced-rails.environment" do |app|
8
+ app.assets.register_engine '.iced', ::Iced::Rails::TemplateHandler
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ require 'tilt/template'
3
+ require 'iced-coffee-script'
4
+
5
+ module Iced
6
+ module Rails
7
+ # IcedCoffeeScript template implementation. See:
8
+ # http://maxtaco.github.com/coffee-script/
9
+ #
10
+ # IcedCoffeeScript templates do not support object scopes, locals, or yield.
11
+ class TemplateHandler < ::Tilt::Template
12
+ self.default_mime_type = 'application/javascript'
13
+
14
+ @@default_bare = false
15
+
16
+ def self.default_bare
17
+ @@default_bare
18
+ end
19
+
20
+ def self.default_bare=(value)
21
+ @@default_bare = value
22
+ end
23
+
24
+ def self.engine_initialized?
25
+ defined?(::IcedCoffeeScript)
26
+ end
27
+
28
+ def initialize_engine
29
+ require_template_library 'iced-coffee-script'
30
+ end
31
+
32
+ def prepare
33
+ if !options.key?(:bare) and !options.key?(:no_wrap)
34
+ options[:bare] = self.class.default_bare
35
+ end
36
+ options[:runtime] = :inline
37
+ end
38
+
39
+ def evaluate(scope, locals, &block)
40
+ @output ||= ::IcedCoffeeScript.compile(data, options)
41
+ end
42
+
43
+ def allows_script?
44
+ false
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,5 @@
1
+ module Iced
2
+ module Rails
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
data/lib/iced-rails.rb ADDED
@@ -0,0 +1,6 @@
1
+ require 'tilt/template'
2
+ require 'iced-coffee-script'
3
+
4
+ require 'iced/rails/template_handler'
5
+ require 'iced/rails/engine'
6
+ require 'iced/rails/version'
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iced-rails
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.2
6
+ platform: ruby
7
+ authors:
8
+ - Raphael Randschau
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ none: false
21
+ name: iced-coffee-script
22
+ type: :runtime
23
+ prerelease: false
24
+ requirement: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ! '>='
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ none: false
30
+ - !ruby/object:Gem::Dependency
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 3.2.11
36
+ none: false
37
+ name: rails
38
+ type: :runtime
39
+ prerelease: false
40
+ requirement: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 3.2.11
45
+ none: false
46
+ description: IcedCoffeeScript adapter for the Rails asset pipeline.
47
+ email:
48
+ - nicolai86@me.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - LICENSE.txt
56
+ - README.md
57
+ - Rakefile
58
+ - iced-rails.gemspec
59
+ - lib/iced-rails.rb
60
+ - lib/iced/rails/engine.rb
61
+ - lib/iced/rails/template_handler.rb
62
+ - lib/iced/rails/version.rb
63
+ homepage: https://github.com/nicolai86/iced-rails
64
+ licenses: []
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ none: false
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ none: false
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 1.8.23
84
+ signing_key:
85
+ specification_version: 3
86
+ summary: IcedCoffeeScript adapter for the Rails asset pipeline.
87
+ test_files: []
88
+ has_rdoc: