wip-runner 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wip/runner/renderer.rb +8 -2
- data/lib/wip/runner/renderer/context.rb +3 -1
- data/lib/wip/runner/renderer/helper.rb +3 -3
- data/lib/wip/runner/version.rb +1 -1
- 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: 5bb36ff238b91a06e9cb2788a7c2a5339dc8d2a6
|
4
|
+
data.tar.gz: 4d839159e03cd18ec8e50e7f97a60b2a4adb3b25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14a1d7b3f7c6051b0e07b6fe29954c29cc776bc2dd2f8004eaec9020ed093b9930822d163bfab026393fa2066fa05def72c2a1ece6f0d88783df2671a9230e1c
|
7
|
+
data.tar.gz: 51026c6b225deac5efab13f9e2578c91aa6070c9aa3f816b9406e33d693d232ce8175f2965378283fddea821dfbb614b9b801b2e263d2b46f182f7a956c02143
|
data/lib/wip/runner/renderer.rb
CHANGED
@@ -2,10 +2,16 @@ module WIP
|
|
2
2
|
module Runner
|
3
3
|
module Renderer
|
4
4
|
def asset(path)
|
5
|
+
File.read(asset_path(path))
|
6
|
+
end
|
7
|
+
|
8
|
+
def asset_path(path)
|
9
|
+
return File.expand_path(path) if File.exist?(path)
|
10
|
+
|
5
11
|
paths = WIP::Runner::CLI.assets
|
6
12
|
paths.each do |base|
|
7
13
|
file = File.join("#{base}/#{path}")
|
8
|
-
return
|
14
|
+
return file if File.exist?(file)
|
9
15
|
end
|
10
16
|
|
11
17
|
raise WIP::Runner::InvalidArgument,
|
@@ -21,7 +27,7 @@ module WIP
|
|
21
27
|
private
|
22
28
|
|
23
29
|
def path?(content)
|
24
|
-
|
30
|
+
(content.match(/\n/) == nil) && (content.match(/^.+\.[a-z]+$/) != nil)
|
25
31
|
end
|
26
32
|
|
27
33
|
def handler(key, content)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module WIP::Runner::Renderer
|
2
2
|
class Context
|
3
|
+
include WIP::Runner::Renderer
|
4
|
+
|
3
5
|
class << self
|
4
6
|
def for(context = {})
|
5
7
|
self.new(context).send(:__binding__)
|
@@ -18,7 +20,7 @@ module WIP::Runner::Renderer
|
|
18
20
|
private
|
19
21
|
|
20
22
|
def __binding__
|
21
|
-
binding
|
23
|
+
binding.taint
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module WIP::Runner::Renderer
|
2
2
|
class Helper
|
3
3
|
def self.for(context, mod)
|
4
|
-
self.
|
5
|
-
self.new(context)
|
4
|
+
self.new(context, mod)
|
6
5
|
end
|
7
6
|
|
8
|
-
def initialize(context)
|
7
|
+
def initialize(context, mod)
|
8
|
+
self.instance_eval { extend mod }
|
9
9
|
@context = context
|
10
10
|
end
|
11
11
|
|
data/lib/wip/runner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wip-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Innis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|