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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3f105a140b63b188cb68c6d4bd8f6cf2f77a7ce
4
- data.tar.gz: e8b9ed82a66008e8c6ef344dd53335961cfa24b5
3
+ metadata.gz: 390f90e19c233cd7d43cd50f0529294d81ef92e8
4
+ data.tar.gz: df0ae3e0f3be95610d90e039949f017fcd5593c8
5
5
  SHA512:
6
- metadata.gz: 625341b4f4f9927a389ddb718484ff1131e999217573e7a9a435a0fae1f5c3097d2c2d1192613da7929b8c3f4ea422b3d499cda86df32e37c8601bd701b11aa9
7
- data.tar.gz: c9083da525505bb422fddda8f777c12d38f54de49940fc2c06fe9a52009302e7e4412092780547f2f001030f23164e0e578e2b5eee689b9982d1d2e239c07318
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
- require 'trekky'
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
@@ -1,5 +1,5 @@
1
1
  require 'fileutils'
2
- require 'trekky/context'
2
+ require_relative 'trekky/context'
3
3
 
4
4
  class Trekky
5
5
 
@@ -1,6 +1,6 @@
1
- require 'trekky/haml_source'
2
- require 'trekky/static_source'
3
- require 'trekky/sass_source'
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)
@@ -1,5 +1,5 @@
1
1
  require 'haml'
2
- require 'trekky/source'
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.render do |name|
20
- if regions.has_key?(name)
21
- regions[name]
22
- else
23
- output
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
@@ -1,15 +1,16 @@
1
- require 'trekky/source'
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::Engine.new(input, :syntax => :sass).render
8
+ Sass.load_paths << @context.source_dir
9
+ Sass::Engine.new(input, options).render
9
10
  end
10
-
11
- def type
12
- :sass
11
+
12
+ def options
13
+ { :syntax => :sass }
13
14
  end
14
15
 
15
16
  end
@@ -1,5 +1,5 @@
1
1
  require 'haml'
2
- require 'trekky/source'
2
+ require_relative 'source'
3
3
 
4
4
  class Trekky
5
5
  class StaticSource < Source
@@ -9,8 +9,8 @@ class Trekky
9
9
  end
10
10
 
11
11
  def type
12
-
12
+
13
13
  end
14
14
 
15
15
  end
16
- end
16
+ end
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.3
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-14 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clap