69 lines
2.4 KiB
Ruby
69 lines
2.4 KiB
Ruby
$:.push File.expand_path("../lib", __FILE__)
|
|
|
|
# Maintain your gem's version:
|
|
require "announcement/version"
|
|
app_path = File.expand_path(__dir__)
|
|
template_path = ENV['PWD'] + '/app/templates'
|
|
all_template = Dir.glob(template_path+'/*/')
|
|
puts 'editing files for sassc'
|
|
new_gemfile_text = File.read(app_path+'/temp_file/Gemfile')
|
|
old_gemfile_text = File.read(ENV['PWD']+'/Gemfile')
|
|
check_texts = ['@import "../../bootstrap/variables";',".response-content {\n position: relative;\n\n @media (min-width: $screen-sm) {\n width: 100%;\n }\n\n @media (min-width: $screen-md) {\n width: 970px;\n }\n\n @media (min-width: $screen-lg) {\n width: 1100px;\n }\n}\n"]
|
|
all_template.each do |folder|
|
|
if !folder.include?('mobile')
|
|
begin
|
|
if folder.split('/')[-1] != 'mobile'
|
|
@filename = folder+'assets/stylesheets/template/base/_variables.scss'
|
|
texts = File.read(@filename)
|
|
check_texts.each do |check_text|
|
|
if !texts.include?(check_text)
|
|
puts "editing #{folder}assets/stylesheets/template/base/_variables.scss"
|
|
File.open(@filename, 'a') do |file|
|
|
file.puts check_text
|
|
end
|
|
end
|
|
end
|
|
end
|
|
rescue => e
|
|
puts "not found #{folder}assets/stylesheets/template/base/_variables.scss"
|
|
end
|
|
end
|
|
end
|
|
puts ['old_path', ENV['PWD'] + '/app/templates','new',app_path+'/temp_file/Gemfile']
|
|
puts ['flag',old_gemfile_text != new_gemfile_text]
|
|
if old_gemfile_text != new_gemfile_text
|
|
File.open(ENV['PWD']+'/Gemfile', 'w') do |file|
|
|
file.write new_gemfile_text
|
|
end
|
|
mode = Rails.env.inspect
|
|
a = Thread.start do
|
|
Bundler.with_clean_env do
|
|
puts ENV['PWD']
|
|
puts mode
|
|
%x[gem install bundler -v 1.17.3 \r\n cd '#{ENV['PWD']}' \r\n mv -f Gemfile.lock Gemfile.lock.bak123 \r\n bundle update]
|
|
end
|
|
end
|
|
a.priority = 2
|
|
sleep 1
|
|
a.run
|
|
Thread.kill(Thread.current)
|
|
puts '123'
|
|
#Thread.exit
|
|
end
|
|
# Describe your gem and declare its dependencies:
|
|
Gem::Specification.new do |s|
|
|
s.name = "announcement"
|
|
s.version = Announcement::VERSION
|
|
s.authors = ["RulingDigital"]
|
|
s.email = ["orbit@rulingcom.com"]
|
|
s.homepage = "http://www.rulingcom.com"
|
|
s.summary = "Announcements for Orbit"
|
|
s.description = "Announcements for Orbit"
|
|
s.license = "MIT"
|
|
|
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
|
s.test_files = Dir["test/**/*"]
|
|
|
|
s.add_dependency "rufus-scheduler", "~> 3.6.0"
|
|
end
|