From e4172bb200d542c82570764b763f0d54ef966da1 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Feb 2020 11:03:01 +0800 Subject: [PATCH] try --- announcement.gemspec | 38 +++++++++++++++- temp_file/Gemfile | 104 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 temp_file/Gemfile diff --git a/announcement.gemspec b/announcement.gemspec index 90c1f23..e475ecc 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -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" diff --git a/temp_file/Gemfile b/temp_file/Gemfile new file mode 100644 index 0000000..7c6f1ea --- /dev/null +++ b/temp_file/Gemfile @@ -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'