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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 304d59789fe54ce68f808bc36a0c8026b3991b43
4
- data.tar.gz: e9469925268294ca0437cf71cda2c06ff783fde5
3
+ metadata.gz: 5bb36ff238b91a06e9cb2788a7c2a5339dc8d2a6
4
+ data.tar.gz: 4d839159e03cd18ec8e50e7f97a60b2a4adb3b25
5
5
  SHA512:
6
- metadata.gz: 0946ea1475abe8ae990bbc595def4c7dd44eb9f24d74895a9752ad52b93ce12ad341130f52f5fece3e35627aaa09c3efabfd63ead2928e45c50ce19e74a702c0
7
- data.tar.gz: 8061d80dcc3b29bd94ec3da40bc97dd575cd288386dc0d41d601d507a9458c717b3b987c36b5f5776af37dcaa149e7d143c5c48b4afea15d76bebd7e96042686
6
+ metadata.gz: 14a1d7b3f7c6051b0e07b6fe29954c29cc776bc2dd2f8004eaec9020ed093b9930822d163bfab026393fa2066fa05def72c2a1ece6f0d88783df2671a9230e1c
7
+ data.tar.gz: 51026c6b225deac5efab13f9e2578c91aa6070c9aa3f816b9406e33d693d232ce8175f2965378283fddea821dfbb614b9b801b2e263d2b46f182f7a956c02143
@@ -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 File.read(file) if File.exist?(file)
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
- File.extname(content).match(/\.[a-z]+$/)
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.instance_eval { include mod }
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
 
@@ -1,5 +1,5 @@
1
1
  module WIP
2
2
  module Runner
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
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.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-08 00:00:00.000000000 Z
11
+ date: 2015-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline