40 lines
1.3 KiB
Ruby
40 lines
1.3 KiB
Ruby
$:.push File.expand_path("../lib", __FILE__)
|
|
|
|
# Maintain your gem's version:
|
|
require "payment_settup/version"
|
|
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
|
if bundle_update_flag
|
|
app_path = File.expand_path(__dir__)
|
|
#Add payment to Admin area
|
|
@payment_li = File.read(app_path+"/payment_li.erb")
|
|
@file_text = File.read(ENV['PWD']+'/app/views/shared/_side_bar.html.erb')
|
|
if !@file_text.include?('payment')
|
|
@insert_index = @file_text.index('<li title="<%= t(\'update_manager\') %>">')
|
|
if !@insert_index.nil?
|
|
@file_text.insert(@insert_index , @payment_li)
|
|
end
|
|
end
|
|
f = File.open(ENV['PWD']+'/app/views/shared/_side_bar.html.erb','w')
|
|
f.write(@file_text)
|
|
f.close
|
|
puts "finish change payment setup in #{ENV['PWD']}/app/views/shared"
|
|
end
|
|
# Describe your gem and declare its dependencies:
|
|
Gem::Specification.new do |s|
|
|
s.name = "payment_settup"
|
|
s.version = PaymentSettup::VERSION
|
|
s.authors = ["chiu"]
|
|
s.email = ["naruto0426@rulingcom.com"]
|
|
s.homepage = "http://www.rulingcom.com"
|
|
s.summary = "PaymentSettup module"
|
|
s.description = "PaymentSettup"
|
|
s.license = "MIT"
|
|
|
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
|
s.test_files = Dir["test/**/*"]
|
|
|
|
s.add_dependency "rails", ">= 4.1.16"
|
|
|
|
s.add_development_dependency "sqlite3"
|
|
end
|