alephant-preview 0.0.5.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alephant/preview/server.rb +13 -0
- data/lib/alephant/preview/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: 966e124f67c4b17a5f4108362e5778c61f01a0c1
|
4
|
+
data.tar.gz: 20d40476c80d2b66b77cacf7aff3036501b3053d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ae2b13041e7fcf48ce5a92e8dfb91de0fbcb24bcbd1ca18ea56e5466d6ef20eb8a493eb14878ef1fbfc031ae4008f166cbc8d2f8298ce15bf786fad5cd346ef
|
7
|
+
data.tar.gz: 0b7d2df0211ef30e95b8c0cdb082c1a619d59cc19b8d15fa3fee9b2ab6105074052105a3c4c42796dbe47831960741d2770e9b3ff9c3aff4c023574743540e0a
|
@@ -27,10 +27,23 @@ module Alephant
|
|
27
27
|
render_component
|
28
28
|
end
|
29
29
|
|
30
|
+
get '/component/:template/?:fixture?' do
|
31
|
+
params['id'] = find_id_from_template params['template']
|
32
|
+
params['fixture'] = 'responsive'
|
33
|
+
render_component
|
34
|
+
end
|
35
|
+
|
30
36
|
get '/status' do
|
31
37
|
'ok'
|
32
38
|
end
|
33
39
|
|
40
|
+
def find_id_from_template(template)
|
41
|
+
files = Dir.glob(BASE_LOCATION + '/**/models/*')
|
42
|
+
file = files.select! { |file| file.include? template }.pop
|
43
|
+
result = /#{BASE_LOCATION}\/(\w+)/.match(file)
|
44
|
+
result[1]
|
45
|
+
end
|
46
|
+
|
34
47
|
def render_preview
|
35
48
|
Template::Base.new(
|
36
49
|
{ region => render_component },
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Kenny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|