Permalink
Browse files

Merge pull request #25 from nikuph/master

Write json-files as json into the document
  • Loading branch information...
2 parents 5668802 + 886b46c commit 6133bb6c28112266a99158e80e034f0c21da1b2c @quirkey committed Nov 15, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/soca/pusher.rb
View
@@ -147,7 +147,11 @@ def map_file(path, hash)
while !parts.empty?
part = parts.shift
if parts.empty?
- current_hash[part] = file_data
+ if part =~ /.json$/
+ current_hash[part.gsub(/.json$/, '')] = JSON.parse(file_data)
+ else
+ current_hash[part] = file_data
+ end
else
current_hash[part] ||= {}
current_hash = current_hash[part]

0 comments on commit 6133bb6

Please sign in to comment.