This commit is contained in:
chiu 2020-02-14 11:03:01 +08:00
parent 036b3132b1
commit e4172bb200
2 changed files with 141 additions and 1 deletions

View File

@ -2,7 +2,43 @@ $:.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
puts "not found #{folder}assets/stylesheets/template/base/_variables.scss"
end
end
end
if old_gemfile_text != new_gemfile_text
File.open(ENV['PWD']+'/Gemfile', 'r') do |file|
file.write new_gemfile_text
end
Thread.current = Thread.new do
Bundler.with_clean_env
system("bundle update")
end
end
end
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "announcement"

104
temp_file/Gemfile Normal file
View File

@ -0,0 +1,104 @@
source 'https://rubygems.org'
#test!!!!!!!!
#social gems
gem "omniauth-google-oauth2"
#rails gem
gem 'rake','~> 12.3.3'
gem 'sassc-rails', '~>1.3.0'
gem 'rails', '~> 4.1.16'
gem 'sanitize', '~> 4.6.6'
gem 'faraday', '~>0.15.4'
#assets and templates
#gem 'sass-rails', '~> 4.0.2'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jquery-ui-rails', "5.0.0"
gem 'turbolinks'
gem 'normalize-rails', '~> 3.0.1'
#password
gem 'bcrypt-ruby', '~> 3.1.5'
#json
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', '~> 1.7.2', group: :development
gem 'active_model_serializers'
#parser
gem 'nokogiri', '~> 1.7.0.1'
#store api
gem 'httparty'
#database
# gem 'mongoid', github: "mongoid/mongoid"
gem 'mongoid', '~> 4.0.2'
# sockets
# gem "websocket-rails"
#file uploading and carrierwave
gem "mini_magick", "3.5.0"
gem 'carrierwave'
gem 'carrierwave-mongoid','~> 0.10.0', :require => 'carrierwave/mongoid'
gem 'zip-zip'
gem 'kaminari', '~> 1.0.1'
gem 'kaminari-mongoid', '~> 0.1.0'
gem 'impressionist', '~> 1.5.2'
gem 'chartkick', '~> 2.3.5'
gem 'usagewatch_ext'
gem 'ckeditor', '~> 4.2.4'
gem 'unicorn', '~> 5.4.0'
gem 'zhconv'
gem 'time_difference'
gem 'execjs'
gem 'therubyracer'
#excel
gem 'axlsx_rails'
gem 'spreadsheet'
gem 'rubyXL'
#form helpers
gem 'dynamic_form'
#built in modules
eval(File.read(File.dirname(__FILE__) + '/built_in_extensions.rb'))
#modules installed from the store
eval(File.read(File.dirname(__FILE__) + '/downloaded_extensions.rb'))
if File.exists?(File.dirname(__FILE__) + '/extra_gems.rb')
eval(File.read(File.dirname(__FILE__) + '/extra_gems.rb'))
end
#development related gems
group :development do
gem 'better_errors'
# gem 'guard-bundler'
# gem 'guard-rails'
gem 'rails_layout'
gem 'rb-fchange', :require=>false
gem 'rb-fsevent', :require=>false
gem 'rb-inotify', '~> 0.9.10', :require=>false
gem 'byebug', '~> 9.0.6'
gem "binding_of_caller"
end
#testing gems
group :test do
gem "minitest", '~>5.11.3'
gem 'minitest-spec-rails'
end
#ask
gem 'gotcha'
#caching observers
# gem 'mongoid-observers'
#desktop
# gem 'angularjs-rails', '~> 1.2.20'
# gem 'angular-ui-bootstrap-rails', '~> 0.11.0'
# gem 'jquery_mousewheel_rails', '~> 3.1.11.3'