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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04012bcf9d65a7b85dad2a539064f900dd6e8a4a
4
- data.tar.gz: 74f65331b8bfba26ed4386e331e2977721746f47
3
+ metadata.gz: 966e124f67c4b17a5f4108362e5778c61f01a0c1
4
+ data.tar.gz: 20d40476c80d2b66b77cacf7aff3036501b3053d
5
5
  SHA512:
6
- metadata.gz: 18d446a39a75ffb6725b078c45c90599c48b10b443e0cd81ebf870bd99d08824b4a4566418c5e5d4a916a845334c2f19c3428a21b47428176505857935125278
7
- data.tar.gz: 99f594515d3fa323bb9acfbb18c0ee34777ddfbcb02f1f093d863433d752f77311a3047d51a7bba065c6565f7dca3eccb6bd5042cdd34f37d470aed550c33b43
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 },
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Preview
3
- VERSION = "0.0.5.4"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
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.5.4
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-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec