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

Version Path
smalruby-editor-0.4.1-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.4.2-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.4.2 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.4.1 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.4.0-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.4.0 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.5-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.5 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.4-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.4 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.3-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.3 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.2-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.2 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.1-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.1 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.0-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.3.0 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.2.7-x86-mingw32 lib/smalruby_editor/blockly_message_helper.rb
smalruby-editor-0.2.7 lib/smalruby_editor/blockly_message_helper.rb