tilt-mote 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aab6268effc5af6bc6a4f6c5089916f0185612e9
4
+ data.tar.gz: 0d4d8f1ddc27b3d19423db0fff458b3f13ff9229
5
+ SHA512:
6
+ metadata.gz: fac9cef22b5f7ffa207fda127cda2b811012abc3ba03fe517da237b0e4e043f9252caecaca992f3483aaf97c8d35c66286e393b20434f68a80209ec7eee23b8d
7
+ data.tar.gz: e2c1ec8959d56f6dac13e208f4b4a36d969403c26a7ac2c73cadb6be1d540af2eb818b3e5d04c7cc4e0893179c7685939c145ba191362d2cdf31717d293c64fa
data/.gems ADDED
@@ -0,0 +1,3 @@
1
+ tilt -v 2.0.1
2
+ mote -v 1.1.2
3
+ cutest -v 1.2.1
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ .gs
2
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014 Horacio Bertorello
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.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ tilt-mote
2
+ =========
3
+
4
+ Use your Mote templates with Tilt.
5
+
6
+ Usage
7
+ -----
8
+
9
+ Suppose you have this Mote template:
10
+
11
+ ```
12
+ Dashboard {{dashboard.title}}
13
+ ```
14
+
15
+ You can render it with Tilt doing:
16
+
17
+ ```ruby
18
+ require 'tilt/mote'
19
+
20
+ # service object
21
+ @dashboard = Dashboard.new
22
+
23
+ template = Tilt.new('dashboard.mote')
24
+ template.render(nil, dashboard: @dashboard)
25
+ ```
26
+
27
+ Installation
28
+ ------------
29
+
30
+ You can install tilt-mote via RubyGems.
31
+
32
+ ```
33
+ $ gem install tilt-mote
34
+ ```
35
+
36
+ License
37
+ -------
38
+
39
+ Copyright (c) 2014 Horacio Bertorello
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a copy
42
+ of this software and associated documentation files (the "Software"), to deal
43
+ in the Software without restriction, including without limitation the rights
44
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
+ copies of the Software, and to permit persons to whom the Software is
46
+ furnished to do so, subject to the following conditions:
47
+
48
+ The above copyright notice and this permission notice shall be included in
49
+ all copies or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
57
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :default => :test
4
+
5
+ task :test do
6
+ exec("cutest test/*.rb")
7
+ end
data/lib/tilt/mote.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'tilt' unless defined?(Tilt)
2
+ require 'mote'
3
+
4
+ module Tilt
5
+ class MoteTemplate < Template
6
+ include Mote::Helpers
7
+
8
+ def prepare; end
9
+
10
+ def evaluate(scope, locals = {}, &block)
11
+ template = Mote.parse(data, scope, locals.keys)
12
+ template.call(locals)
13
+ end
14
+ end
15
+
16
+ register(MoteTemplate, 'mote')
17
+ end
@@ -0,0 +1 @@
1
+ If you cannot do great {{what}}, do small {{what}} in a great way.
@@ -0,0 +1,2 @@
1
+ require 'cutest'
2
+ require File.expand_path("../lib/tilt/mote", File.dirname(__FILE__))
@@ -0,0 +1,10 @@
1
+ require_relative 'test_helper'
2
+
3
+ test 'renders a template' do
4
+ template = Tilt.new('test/fixtures/template.mote')
5
+
6
+ result = template.render(nil, what: 'things')
7
+
8
+ assert result.strip == \
9
+ "If you cannot do great things, do small things in a great way."
10
+ end
data/tilt-mote.gemspec ADDED
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "tilt-mote"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["Horacio Bertorello"]
9
+ spec.email = ["syrii@msn.com"]
10
+ spec.summary = "User Mote templates with Tilt."
11
+ spec.homepage = "https://github.com/svankmajer/tilt-mote"
12
+ spec.license = "MIT"
13
+
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_dependency "mote", "~> 1.1"
18
+ spec.add_dependency "tilt", "~> 2.0"
19
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tilt-mote
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Horacio Bertorello
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mote
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: tilt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ description:
42
+ email:
43
+ - syrii@msn.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gems"
49
+ - ".gitignore"
50
+ - LICENSE
51
+ - README.md
52
+ - Rakefile
53
+ - lib/tilt/mote.rb
54
+ - test/fixtures/template.mote
55
+ - test/test_helper.rb
56
+ - test/tilt-mote_test.rb
57
+ - tilt-mote.gemspec
58
+ homepage: https://github.com/svankmajer/tilt-mote
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.4.1
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: User Mote templates with Tilt.
82
+ test_files: []