Skip to content

Commit

Permalink
updating import to add extension entries
Browse files Browse the repository at this point in the history
  • Loading branch information
rdingwell committed Jul 13, 2012
1 parent 8d441fd commit 11d3b42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Binary file modified db/bundle.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/measures/importer.rb
Expand Up @@ -26,11 +26,14 @@ def import(zip)
end
end

bundle_def = JSON.parse(entries_by_type[:bundle])
bundle_def["extensions"] ||=[]
entries_by_type[:libraries].each do |key,contents|
bundle_def["extensions"] <<key
save_system_js_fn(key, contents)
end

bundle_def = JSON.parse(entries_by_type[:bundle])

bundle_def["measures"] ||= []
measure_defs = []
entries_by_type[:json].each do |key, contents|
Expand Down
5 changes: 3 additions & 2 deletions lib/tasks/measures.rake
Expand Up @@ -39,7 +39,8 @@ namespace :measures do
Date.parse(b["created_at"] ) <=> Date.parse(a["created_at"])
}
begin

@loader.drop_collection("bundles")
@loader.drop_collection("measures")
entry = json[0]
if entry
puts "updating to measures #{entry['name']}"
Expand All @@ -63,7 +64,7 @@ namespace :measures do
task :load_local_bundle, [:bundle_name] => [:setup ] do |t, args|
bundle_name = args[:bundle_name] || 'bundle'
@loader.drop_collection("measures")
@importer.import(File.new("./db/" + bundle_name + ".zip"))
@importer.import(open("./db/" + bundle_name + ".zip"))
end


Expand Down

0 comments on commit 11d3b42

Please sign in to comment.