alephant-preview 0.3.8 → 0.3.9

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: d430f6e14a8245dbe00b0144d860337bd27b1033
4
- data.tar.gz: f4886aaed573977e2a013eb80d752b7817e7b6b8
3
+ metadata.gz: fcda4eb6c69ce0fb086ae7d9c213695497f1e79d
4
+ data.tar.gz: 136476e63d5eff470c063e08e0928a3473835cf3
5
5
  SHA512:
6
- metadata.gz: b44ff4b53544fe1f83c9fb92f30947c6b293e848447eb31caf59b5704defdc1d4786ea5a6fcc1be99bf190540487ec7dbe07a85c235b0ee5d1e49db15b017848
7
- data.tar.gz: 8aa7f6dd4b7aac34a7603bf5dd9904f3b9eee8a7d76c20491ef9cbd7d06c61dfe338575e7fdb457b02bb9691bab5abf903af1d010723f7c20e0a0aaf0e5abdd0
6
+ metadata.gz: af200493984a52bf0e820a57df296db0489ec9440a3ac89cd5b878c1c011ed6e4fd93a33c5cddcd222cd33bd5e0a695594bd5b02ae11257a6c9c7e202fc3a6ca
7
+ data.tar.gz: c1460d492c879c0dc57e4747a2410272fa8a4232953a781872cd793453e3df0b8b1288d1c5d4ae9327cefe314ef306d66b121ff5641e1894216edd0b452c1a6d
@@ -63,9 +63,18 @@ module Alephant
63
63
  'ok'
64
64
  end
65
65
 
66
+ not_found do
67
+ 'Not found'
68
+ end
69
+
66
70
  def find_id_from_template(template)
67
71
  files = Dir.glob(BASE_LOCATION + '/**/models/*')
68
72
  file = files.select! { |file| file.include? "/#{template}.rb" }.pop
73
+
74
+ if file.nil?
75
+ halt(404)
76
+ end
77
+
69
78
  result = /#{BASE_LOCATION}\/(\w+)/.match(file)
70
79
  result[1]
71
80
  end
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Preview
3
- VERSION = "0.3.8"
3
+ VERSION = "0.3.9"
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.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC News
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement