guard-templates-jshaml 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ # A sample Gemfile
2
+ source "http://rubygems.org"
3
+
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2013 by Sébastien Drouyer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ guard-templates-jshaml
2
+ ======================
3
+
4
+ Guard templates extension for [jshaml](https://github.com/thegreatape/guard-templates). All files suffixed by .jshaml is compiled from haml to js.
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'guard/jshaml/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'guard-templates-jshaml'
7
+ s.version = 0.1
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['Sébastien Drouyer']
10
+ s.email = ['sdrdis@hotmail.com']
11
+ s.homepage = 'https://github.com/sdrdis/guard-templates-jshaml/'
12
+ s.summary = %q{Guard templates extension for jshaml}
13
+ s.description = %q{Compiles file.jshaml into valid javascript}
14
+
15
+ s.rubyforge_project = 'guard-templates-jshaml'
16
+
17
+ s.add_dependency('guard', '>= 1.1')
18
+ s.add_dependency('haml_to_js')
19
+
20
+ s.add_development_dependency('rspec')
21
+ s.add_development_dependency('rake')
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.require_paths = ['lib']
25
+ end
@@ -0,0 +1,27 @@
1
+ require 'haml_to_js/compiler'
2
+
3
+ module Guard
4
+ class Templates
5
+ module Jshaml
6
+ class Compiler
7
+ def self.compile(str, target)
8
+ engine = ::Compiler.new
9
+ code = engine.convert_from_string(str)
10
+
11
+ return <<eos
12
+ function(locals) {
13
+ with(locals || {}) {
14
+ try {
15
+ #{code};
16
+ return _$output;
17
+ } catch(e) {
18
+ console.error(\"Error on file: #{target[:name]} around line \"+_$line+\"\\n Stack: \" + e.stack);
19
+ }
20
+ }
21
+ }
22
+ eos
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-templates-jshaml
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sébastien Drouyer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: guard
16
+ requirement: &76122270 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '1.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *76122270
25
+ - !ruby/object:Gem::Dependency
26
+ name: haml_to_js
27
+ requirement: &76121680 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *76121680
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &76121030 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *76121030
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: &76120490 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *76120490
58
+ description: Compiles file.jshaml into valid javascript
59
+ email:
60
+ - sdrdis@hotmail.com
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - Gemfile
66
+ - LICENSE
67
+ - README.md
68
+ - guard-templates-jshaml.gemspec
69
+ - lib/guard/templates/jshaml/compiler.rb
70
+ homepage: https://github.com/sdrdis/guard-templates-jshaml/
71
+ licenses: []
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project: guard-templates-jshaml
90
+ rubygems_version: 1.8.17
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Guard templates extension for jshaml
94
+ test_files: []