diff --git a/archive.gemspec b/archive.gemspec index 18bf21e..24c866f 100644 --- a/archive.gemspec +++ b/archive.gemspec @@ -2,6 +2,7 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "archive/version" +require 'json' env_pwd = ENV['PWD'] app_path = File.expand_path(__dir__) template_path = env_pwd + '/app/templates' @@ -12,7 +13,7 @@ all_template.each do |folder| next unless File.exist?("#{folder}modules/archive/info.json") info_json_file = "#{folder}modules/archive/info.json" info_json = JSON.parse(File.read(info_json_file)) - check_files = ["archive_index7","archive_index8"] + check_files = ["archive_index7.html.erb","archive_index8.html.erb"] file_infos = [ { "filename" => "archive_index7", @@ -33,7 +34,7 @@ all_template.each do |folder| ] flags = [] check_files.each_with_index do |check_file,i| - flag = (info_json["frontend"].select{|h| h["filename"] == check_file}.count == 0 rescue false) + flag = (info_json["frontend"].select{|h| h["filename"] == check_file.split(".").first}.count == 0 rescue false) if flag info_json["frontend"].push(file_infos[i]) end