pakyow-slim 1.0.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +3 -19
- data/README.md +4 -36
- data/lib/pakyow/slim.rb +2 -0
- data/lib/pakyow/slim/framework.rb +15 -0
- data/lib/pakyow/slim/processor.rb +19 -0
- data/lib/pakyow/slim/version.rb +7 -0
- metadata +21 -88
- data/.gitignore +0 -42
- data/.travis.yml +0 -11
- data/Gemfile +0 -9
- data/lib/pakyow-slim.rb +0 -16
- data/lib/version.rb +0 -5
- data/pakyow-slim.gemspec +0 -23
- data/rakefile +0 -13
- data/test/processor_test.rb +0 -16
- data/test/support/helper.rb +0 -4
- data/test/support/processed.html +0 -8
- data/test/support/test_application.rb +0 -5
- data/test/support/views/_templates/pakyow.html +0 -10
- data/test/support/views/index.slim +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eb60e0d665da39be8a91fdb5c24189870ba1ebdf697df673e193af178f49e531
|
4
|
+
data.tar.gz: d0de3ac35aec20debfe2fcfce2bc0df6f78de6d20952f1517ca7dcc1aaec07f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c883f764b9f9277089c7193618c88a29e3db71ec614f1246eb5f1a76ba356033b0858a2e906dce7045eff2de3b413723e764a65209ad8477de90d4cdfceec90
|
7
|
+
data.tar.gz: d9a6733e105b3612bafd5f0289c8344221fe3afca3adcba9308db16cbfd4452b438e2d0559c7b801ed0653742d696ef454eb4d13f7f8665ad1057d56ee73e661
|
data/LICENSE
CHANGED
@@ -1,20 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) Metabahn, LLC
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
3
|
+
Pakyow Slim is an open-source project licensed under the terms of the LGPLv3 license.
|
4
|
+
See <https://choosealicense.com/licenses/gpl-3.0/> for license text.
|
data/README.md
CHANGED
@@ -1,39 +1,7 @@
|
|
1
|
-
# pakyow
|
1
|
+
# pakyow/slim
|
2
2
|
|
3
|
-
Slim
|
3
|
+
Slim support for [pakyow/presenter](https://github.com/pakyow/pakyow/tree/master/pakyow-presenter).
|
4
4
|
|
5
|
-
|
5
|
+
## Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
gem 'pakyow-slim'
|
10
|
-
|
11
|
-
Inside app.rb
|
12
|
-
|
13
|
-
require 'pakyow-slim'
|
14
|
-
|
15
|
-
Run `bundle install` and restart your app server. Now any `.slim` views will be compiled for you!
|
16
|
-
|
17
|
-
For more info on slim templating language visit [slim-lang.com](http://slim-lang.com/)
|
18
|
-
|
19
|
-
# Pakyow-Specific shortcuts:
|
20
|
-
|
21
|
-
`.klass@@skope`
|
22
|
-
|
23
|
-
translates to
|
24
|
-
|
25
|
-
<div class='klass' data-scope='skope'></div>
|
26
|
-
|
27
|
-
and `.klass@prop`
|
28
|
-
|
29
|
-
translates to
|
30
|
-
|
31
|
-
<div class='klass' data-prop='prop'></div>
|
32
|
-
|
33
|
-
# Status
|
34
|
-
|
35
|
-
[![Build Status](https://travis-ci.org/pakyow/pakyow-slim.png)](https://travis-ci.org/pakyow/pakyow-slim)
|
36
|
-
|
37
|
-
# License
|
38
|
-
|
39
|
-
pakyow-slim is released under the [MIT License](http://opensource.org/licenses/MIT).
|
7
|
+
Add `pakyow-slim` to your `Gemfile`. Any view template with a `slim` file extension will be processed during presentation and rendered as HTML.
|
data/lib/pakyow/slim.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pakyow/framework"
|
4
|
+
|
5
|
+
require "pakyow/slim/processor"
|
6
|
+
|
7
|
+
module Pakyow
|
8
|
+
module Slim
|
9
|
+
class Framework < Pakyow::Framework(:slim)
|
10
|
+
def boot
|
11
|
+
object.state(:processor) << Pakyow::Slim::Processor
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "slim"
|
4
|
+
|
5
|
+
require "pakyow/presenter/processor"
|
6
|
+
|
7
|
+
module Pakyow
|
8
|
+
module Slim
|
9
|
+
class Processor < Pakyow::Presenter::Processor
|
10
|
+
extensions :slim
|
11
|
+
|
12
|
+
def call(content)
|
13
|
+
::Slim::Template.new {
|
14
|
+
@data = content
|
15
|
+
}.render
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,124 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakyow-slim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: pakyow-support
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pakyow-core
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: pakyow-presenter
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
44
16
|
requirements:
|
45
|
-
- - "
|
17
|
+
- - ">="
|
46
18
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
19
|
+
version: 1.0.0.rc1
|
48
20
|
type: :runtime
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
|
-
- - "
|
24
|
+
- - ">="
|
53
25
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
26
|
+
version: 1.0.0.rc1
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: slim
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - "~>"
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
33
|
+
version: '4.0'
|
62
34
|
type: :runtime
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
38
|
- - "~>"
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
|
70
|
-
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '10.4'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '10.4'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '5.8'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '5.8'
|
97
|
-
description: Slim support for Pakyow views
|
98
|
-
email: dan@metabahn.com
|
40
|
+
version: '4.0'
|
41
|
+
description: Slim support for Pakyow Presenter
|
42
|
+
email: bryan@metabahn.com
|
99
43
|
executables: []
|
100
44
|
extensions: []
|
101
45
|
extra_rdoc_files: []
|
102
46
|
files:
|
103
|
-
- ".gitignore"
|
104
|
-
- ".travis.yml"
|
105
47
|
- CHANGELOG.md
|
106
|
-
- Gemfile
|
107
48
|
- LICENSE
|
108
49
|
- README.md
|
109
|
-
- lib/pakyow
|
110
|
-
- lib/
|
111
|
-
- pakyow
|
112
|
-
-
|
113
|
-
|
114
|
-
- test/support/helper.rb
|
115
|
-
- test/support/processed.html
|
116
|
-
- test/support/test_application.rb
|
117
|
-
- test/support/views/_templates/pakyow.html
|
118
|
-
- test/support/views/index.slim
|
119
|
-
homepage: http://pakyow.org
|
50
|
+
- lib/pakyow/slim.rb
|
51
|
+
- lib/pakyow/slim/framework.rb
|
52
|
+
- lib/pakyow/slim/processor.rb
|
53
|
+
- lib/pakyow/slim/version.rb
|
54
|
+
homepage: https://pakyow.org
|
120
55
|
licenses:
|
121
|
-
-
|
56
|
+
- LGPL-3.0
|
122
57
|
metadata: {}
|
123
58
|
post_install_message:
|
124
59
|
rdoc_options: []
|
@@ -128,17 +63,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
63
|
requirements:
|
129
64
|
- - ">="
|
130
65
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
66
|
+
version: 2.5.0
|
132
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
68
|
requirements:
|
134
|
-
- - "
|
69
|
+
- - ">"
|
135
70
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
71
|
+
version: 1.3.1
|
137
72
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.4.5
|
73
|
+
rubygems_version: 3.0.3
|
140
74
|
signing_key:
|
141
75
|
specification_version: 4
|
142
76
|
summary: Pakyow Slim
|
143
77
|
test_files: []
|
144
|
-
has_rdoc:
|
data/.gitignore
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/test/tmp/
|
9
|
-
/test/version_tmp/
|
10
|
-
/tmp/
|
11
|
-
|
12
|
-
## Specific to RubyMotion:
|
13
|
-
.dat*
|
14
|
-
.repl_history
|
15
|
-
build/
|
16
|
-
|
17
|
-
## Documentation cache and generated files:
|
18
|
-
/.yardoc/
|
19
|
-
/_yardoc/
|
20
|
-
/doc/
|
21
|
-
/rdoc/
|
22
|
-
|
23
|
-
## Environment normalisation:
|
24
|
-
/.bundle/
|
25
|
-
/lib/bundler/man/
|
26
|
-
|
27
|
-
# for a library or gem, you might want to ignore these files since the code is
|
28
|
-
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
Gemfile.lock
|
30
|
-
# .ruby-version
|
31
|
-
# .ruby-gemset
|
32
|
-
*.gem
|
33
|
-
|
34
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
35
|
-
.rvmrc
|
36
|
-
|
37
|
-
[._]*.s[a-w][a-z]
|
38
|
-
[._]s[a-w][a-z]
|
39
|
-
*.un~
|
40
|
-
Session.vim
|
41
|
-
.netrwhist
|
42
|
-
*~
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/lib/pakyow-slim.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'slim'
|
2
|
-
|
3
|
-
require 'version'
|
4
|
-
|
5
|
-
Slim::Engine.set_options(
|
6
|
-
shortcut: {
|
7
|
-
'@@' => { tag: 'div', attr: 'data-scope' },
|
8
|
-
'@' => { tag: 'div', attr: 'data-prop' },
|
9
|
-
'#' => { tag: 'div', attr: 'id' },
|
10
|
-
'.' => { tag: 'div', attr: 'class' }
|
11
|
-
}
|
12
|
-
)
|
13
|
-
|
14
|
-
Pakyow::App.processor :slim do |content|
|
15
|
-
Slim::Template.new { @data = content }.render
|
16
|
-
end
|
data/lib/version.rb
DELETED
data/pakyow-slim.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require File.expand_path('../lib/version', __FILE__)
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'pakyow-slim'
|
5
|
-
spec.summary = 'Pakyow Slim'
|
6
|
-
spec.description = 'Slim support for Pakyow views'
|
7
|
-
spec.author = 'Dan McGuire'
|
8
|
-
spec.email = 'dan@metabahn.com'
|
9
|
-
spec.homepage = 'http://pakyow.org'
|
10
|
-
spec.version = Pakyow::Slim::VERSION
|
11
|
-
spec.require_path = 'lib'
|
12
|
-
spec.files = `git ls-files`.split("\n")
|
13
|
-
spec.license = 'MIT'
|
14
|
-
|
15
|
-
spec.add_dependency('pakyow-support', '~> 0')
|
16
|
-
spec.add_dependency('pakyow-core', '~> 0')
|
17
|
-
spec.add_dependency('pakyow-presenter', '~> 0')
|
18
|
-
|
19
|
-
spec.add_dependency('slim', '~> 3.0')
|
20
|
-
|
21
|
-
spec.add_development_dependency('rake', '~> 10.4')
|
22
|
-
spec.add_development_dependency('minitest', '~> 5.8')
|
23
|
-
end
|
data/rakefile
DELETED
data/test/processor_test.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative 'support/helper'
|
2
|
-
|
3
|
-
class ProcessorTest < MiniTest::Test
|
4
|
-
def setup
|
5
|
-
@view_store = :test
|
6
|
-
Pakyow::App.stage(:test)
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_that_view_is_processed
|
10
|
-
v = Pakyow.app.presenter.store.composer('/')
|
11
|
-
assert_equal(
|
12
|
-
File.read('test/support/processed.html').gsub("\n", ''),
|
13
|
-
v.container(:default).to_html
|
14
|
-
)
|
15
|
-
end
|
16
|
-
end
|
data/test/support/helper.rb
DELETED
data/test/support/processed.html
DELETED