official_module/official_module.gemspec

36 lines
1.3 KiB
Ruby
Raw Permalink Normal View History

2021-07-15 10:59:12 +00:00
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "official_module/version"
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
if bundle_update_flag
app_path = File.expand_path(__dir__)
#Add official module to Admin area
official_module_li = File.read(app_path+"/official_module_li.erb")
file_text = File.read(ENV['PWD']+'/app/views/shared/_side_bar.html.erb')
if !file_text.include?('master_key')
insert_index = file_text.index('<li title="<%= t(\'search_engine\') %>">')
file_text.insert(insert_index , official_module_li)
end
f = File.open(ENV['PWD']+'/app/views/shared/_side_bar.html.erb','w')
f.write(file_text)
f.close
puts "finish change official module in #{ENV['PWD']}/app/views/shared"
end
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "official_module"
s.version = OfficialModule::VERSION
s.authors = ["Harry Bomrah"]
s.email = ["harry@rulingcom.com"]
s.homepage = "http://www.rulingcom.com"
s.summary = "Summary of OfficialModule."
s.description = "Description of OfficialModule."
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_development_dependency "sqlite3"
end