Sha256: 97b790fbd23c44492e94eabd6e847d3af77b284b41532f83115dca8a2bc82876
Contents?: true
Size: 596 Bytes
Versions: 34
Compression:
Stored size: 596 Bytes
Contents
# -*- coding: utf-8 -*- module SmalrubyEditor # app/assets以下のJavaScriptからBlocklyのメッセージを扱いやすくするた # めのヘルパーモジュール module BlocklyMessageHelper def bm(name) if /\A\./ =~ name md = /(.*?):(?:\d+)/.match(caller[0]) filename = md[1] prefix = filename.slice(%r"app/assets/javascripts/(.*)$", 1) .gsub(/\..*\z/, '') name = prefix + name end name = name.gsub(/[\/.]/, '_') "Smalruby.bm('#{name.upcase}')" end end end include SmalrubyEditor::BlocklyMessageHelper
Version data entries
34 entries across 34 versions & 1 rubygems