-
Open a browser
# start an instance of firefox with selenium-webdriver $browser_type = 'firefox' $host = 'http://localhost:4444/wd/hub'
$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
//增加固定長度的 validation rule | |
$.validator.addMethod("exactlength", function(value, element, param) { | |
return this.optional(element) || value.length == param; | |
}, $.validator.format("輸入長度必須為 {0} 個字元.")); | |
$.validator.addMethod("checkTWPID", function(value, element, param) { | |
var letters = new Array('A', 'B', 'C', 'D', | |
'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', | |
'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', | |
'X', 'Y', 'W', 'Z', 'I', 'O'); |
### part of config/deploy.rb | |
namespace :deploy do | |
namespace :check do | |
# desc 'Touches all linked files' | |
task :touch_all_linked_files do | |
on release_roles :all do | |
fetch(:linked_files, []).each do |file| | |
target = shared_path.join(file) | |
unless File.file?(target) | |
info "File.file?('#{target}') : #{File.file?(target)}" |
### lib/capistrano/tasks/touch_all_linked_files.rake | |
namespace :deploy do | |
namespace :check do | |
# desc 'Touches all linked files' | |
task :touch_all_linked_files do | |
on release_roles :all do | |
fetch(:linked_files, []).each do |file| | |
target = shared_path.join(file) | |
execute :touch, target | |
info "Touched : #{target}" |
#!/usr/bin/env bash | |
TAR_FILENAME=_production-upload.tar.gz | |
npm install | |
gulp --production | |
# 拿掉 dev 環境相依套件 | |
composer install --prefer-dist --no-dev |