試験は twada/battlefield-sourcemaps で行っている
- SourceMap 対応が入った espower 0.9.0 を使う
- espower(ast, options) の第二引数 options に
sourceMap
というキーで上流の SourceMap オブジェクトを入れる
;;;;;;;;;; functions | |
(defun funcall-replace-region (start end func) | |
"replace region with funcall result. region content(between start/end) is passed to func as string" | |
(let ((orig (buffer-substring start end))) | |
(save-excursion | |
(save-restriction | |
(narrow-to-region start end) | |
(delete-region start end) | |
(insert-string (funcall func orig)))))) | |
# | |
# usage: ruby this_script.rb | git am --3way | |
# | |
require 'net/imap' | |
require 'rubygems' | |
require 'activesupport' | |
id = 'your.gmail.id' | |
pass = 'your.gmail.pass' | |
試験は twada/battlefield-sourcemaps で行っている
sourceMap
というキーで上流の SourceMap オブジェクトを入れるvar empower = require('empower'); | |
var formatter = require('power-assert-formatter'); | |
module.exports = function empowerZombie (browser) { | |
empower(browser.assert, formatter(), { | |
destructive: true, | |
modifyMessageOnRethrow: true, | |
saveContextOnRethrow: true, | |
patterns: [ | |
'browser.assert.redirected([message])', |
/** | |
* empower.js - Power Assert feature enhancer for assert function/object. | |
* | |
* https://github.com/twada/empower | |
* | |
* Copyright (c) 2013-2014 Takuto Wada | |
* Licensed under the MIT license. | |
* https://raw.github.com/twada/empower/master/MIT-LICENSE.txt | |
* | |
* A part of extend function is: |
# -*- coding: utf-8 -*- | |
# Find japanese entry for each en.wikipedia.org link in TARGET_URL (quick & dirty hack) | |
# USAGE: ruby wikipedia_ja.rb TARGET_URL | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def ja_url_for(url) | |
link_ja = Nokogiri::HTML(open(url)).css('li.interlanguage-link.interwiki-ja a').first |