#coding: utf-8 NS_GEM_ROOT = File.expand_path('../..', __FILE__) #debug this gem #$LOAD_PATH.unshift("#{NS_GEM_ROOT}/lib") require 'fileutils' require 'ns_service_pack/code_hash' require 'ns_service_pack/global_const' require 'ns_service_pack/field_mapping' require 'ns_service_pack/result_packer' require 'ns_service_pack/application_controller_module' module NsServicePack #初始安装设置 def self.install init_file = "#{Rails.root}/config/initializers/ns_service_pack.rb" unless File.exists?(init_file) FileUtils.cp("#{NS_GEM_ROOT}/config/initializers/ns_service_pack.rb", init_file) puts "==>I have installed a intializer file: #{init_file}" GlobalConst.setup_sample puts "==>Now config your constants in folder: #{GlobalConst::APP_CODE_HASHES}" else puts "==>It seems you have installed ns service pack, happy with it or bug report to caory!" end end end