trekky 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/trekky +2 -3
- data/lib/trekky.rb +1 -1
- data/lib/trekky/context.rb +4 -4
- data/lib/trekky/haml_source.rb +10 -6
- data/lib/trekky/sass_source.rb +7 -6
- data/lib/trekky/static_source.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 390f90e19c233cd7d43cd50f0529294d81ef92e8
|
4
|
+
data.tar.gz: df0ae3e0f3be95610d90e039949f017fcd5593c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf4f75bcc8e9eaa547b9c715fd5f0a9d041d67a651b6ac7d1222cdf6b97c87e86fa7b46b034eb6aa298ef0f3341ff18da6360b6462a8ec437f3e329c28d83d1e
|
7
|
+
data.tar.gz: 89a0941b374a5cacf4686b858edfd6b477a4e2b1f1ac34b117a68962c9162b62f57540ebc6810b17e14240e8ed9883c0d7e59c3a787b6134a9ef5956cae37555
|
data/bin/trekky
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
$LOAD_PATH.unshift File.join(Dir.pwd, 'lib')
|
3
2
|
require 'clap'
|
4
3
|
require 'rb-fsevent'
|
5
|
-
|
4
|
+
require_relative '../lib/trekky'
|
6
5
|
|
7
6
|
source = 'source'
|
8
7
|
target = 'public'
|
@@ -30,4 +29,4 @@ else
|
|
30
29
|
STDOUT.puts "-> Done processing. "
|
31
30
|
end
|
32
31
|
fsevent.run
|
33
|
-
end
|
32
|
+
end
|
data/lib/trekky.rb
CHANGED
data/lib/trekky/context.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require_relative 'haml_source'
|
2
|
+
require_relative 'static_source'
|
3
|
+
require_relative 'sass_source'
|
4
4
|
|
5
5
|
class Trekky
|
6
6
|
class Context
|
@@ -33,7 +33,7 @@ class Trekky
|
|
33
33
|
|
34
34
|
def build
|
35
35
|
Dir.glob(File.join(source_dir, "**/*")).each do |path|
|
36
|
-
|
36
|
+
|
37
37
|
next if File.directory?(path)
|
38
38
|
|
39
39
|
source = build_source(path)
|
data/lib/trekky/haml_source.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'haml'
|
2
|
-
|
2
|
+
require_relative 'source'
|
3
3
|
|
4
4
|
class Trekky
|
5
5
|
class HamlSource < Source
|
@@ -16,12 +16,16 @@ class Trekky
|
|
16
16
|
render_input(&block)
|
17
17
|
else
|
18
18
|
output = render_input
|
19
|
-
layout
|
20
|
-
|
21
|
-
regions
|
22
|
-
|
23
|
-
|
19
|
+
if layout
|
20
|
+
layout.render do |name|
|
21
|
+
if regions.has_key?(name)
|
22
|
+
regions[name]
|
23
|
+
else
|
24
|
+
output
|
25
|
+
end
|
24
26
|
end
|
27
|
+
else
|
28
|
+
output
|
25
29
|
end
|
26
30
|
end
|
27
31
|
rescue Exception => error
|
data/lib/trekky/sass_source.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
require_relative 'source'
|
2
2
|
require 'sass'
|
3
3
|
|
4
|
-
class Trekky
|
4
|
+
class Trekky
|
5
5
|
class SassSource < Source
|
6
6
|
|
7
7
|
def render
|
8
|
-
Sass
|
8
|
+
Sass.load_paths << @context.source_dir
|
9
|
+
Sass::Engine.new(input, options).render
|
9
10
|
end
|
10
|
-
|
11
|
-
|
12
|
-
:sass
|
11
|
+
|
12
|
+
def options
|
13
|
+
{ :syntax => :sass }
|
13
14
|
end
|
14
15
|
|
15
16
|
end
|
data/lib/trekky/static_source.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trekky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Florio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clap
|