This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.join(Rails.root, 'log/markdown.log') | |
File.new(file, 'w+') unless File.exist?(file) | |
logger = Logger.new(file) | |
logger.info("#{Time.now}: Share##{_id}'s price is from #{latest_price} to #{new_price}") | |
logger.close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
args **/*.txt | |
argsdo %s/oldword/newword/gc | |
/oldword/newword/# to disable the ignorecase options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :book_item do | |
task :free_all_if_due => :environment do | |
Book.free_book_items_if_due | |
puts 'Free the due book_item successfully' | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :delayed_job do | |
task :setup do | |
puts capture %Q(cd #{deploy_to}/current/ && RAILS_ENV=production script/rails runner 'Delayed::Backend::Mongoid::Job.create_indexes') | |
end | |
task :start do | |
puts capture %Q(cd #{deploy_to}/current/ && RAILS_ENV=production script/delayed_job start) | |
end | |
task :stop do |
NewerOlder