This file contains 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
# coding: utf-8 | |
require 'rest-client' | |
require 'json' | |
require 'date' | |
require 'gmail' | |
require 'yaml' | |
#google-api-clientはv0.6.4が必要です | |
require "google/api_client" |
This file contains 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
# coding: utf-8 | |
require 'rest-client' | |
require 'json' | |
require 'date' | |
require 'holiday_jp' | |
require 'gmail' | |
require 'rexml/document' | |
class MyMail |
This file contains 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
require "openssl" | |
require "base64" | |
def encrypt(data, passwd) | |
enc = OpenSSL::Cipher.new("AES-256-CBC") | |
enc.encrypt | |
salt = OpenSSL::Random.random_bytes(8) | |
enc.pkcs5_keyivgen(passwd, salt, 1) | |
enc_data = enc.update(data) + enc.final | |
ret = "Salted__" + salt + enc_data |
This file contains 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
Myapp::Application.config.generators do |g| | |
g.stylesheets false | |
g.javascripts false | |
g.helper false | |
g.template_engine false | |
g.orm :active_record, migration: false | |
end |
This file contains 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 :db do | |
config_file = 'config/database.yml' | |
schema_file = 'db/schemas/Schemafile' | |
desc 'apply Schemafile and update schema.rb' | |
task apply: :environment do | |
ENV['ALLOW_DROP_TABLE'] ||= '0' | |
ENV['ALLOW_REMOVE_COLUMN'] ||= '0' | |
ENV['RAILS_ENV'] ||= 'development' | |
task_return = `ridgepole -E #{ENV['RAILS_ENV']} --diff #{config_file} #{schema_file}` |
OlderNewer