If a class includes or prepends an anonymous and empty module and then a constant or class variable is added to the module, they cannot be referenced from the class.
m = Module.new
#M = m = Module.new
C = Class.new{include m}| # | |
| # Ubuntu 20.04 requires at least `gcc-mingw-w64-x86-64` package as a | |
| # cross compiler. | |
| # | |
| MRuby::CrossBuild.new("cross-mingw") do |conf| | |
| conf.toolchain :gcc | |
| conf.host_target = "x86_64-w64-mingw32" | |
| conf.cc.command = "#{conf.host_target}-gcc-posix" | |
| conf.linker.command = conf.cc.command |
| diff --git a/bin/diff-highlight b/bin/diff-highlight | |
| index c4404d4..b568c9f 100755 | |
| --- a/bin/diff-highlight | |
| +++ b/bin/diff-highlight | |
| @@ -2,6 +2,7 @@ | |
| use warnings FATAL => 'all'; | |
| use strict; | |
| +use Encode qw(decode_utf8 encode_utf8); | |
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'optparse' | |
| EXTENSION_URL = '"chrome://extensions-frame/"' | |
| options = {enablements: []} | |
| optparser = OptionParser.new(nil, 17, " ") do |o| | |
| o.banner = "Usage: #{File.basename $0} [OPTIONS] EXTENSION-NAME" |
| #!/bin/bash | |
| PLIST=~/Library/LaunchAgents/my.resume.plist | |
| RESUME=$(cd $(dirname $0); pwd)/mac-resume | |
| machine_suspend() { | |
| cat <<EOF > $PLIST | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
| "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| --- a/src/nsterm.m 2012-04-22 20:31:20.000000000 +0900 | |
| +++ b/src/nsterm.m 2012-05-03 13:57:40.000000000 +0900 | |
| @@ -284,6 +284,8 @@ | |
| int x_use_underline_position_properties, x_underline_at_descent_line; | |
| /* FIXME: figure out what to do with underline_minimum_offset. */ | |
| +EXFUN (Fbuffer_local_value, 2); | |
| +EXFUN (Fcurrent_buffer, 0); | |
| /* ========================================================================== |
以下を参考にした。
コンパイル:
$ wget http://ftp.gnu.org/pub/gnu/emacs/emacs-23.4.tar.bz2
$ tar xf emacs-23.4.tar.bz2
| module Kernel | |
| def less(obj) | |
| s = obj.kind_of?(String) ? obj : | |
| defined?(AwesomePrint) ? obj.ai : | |
| defined?(PrettyPrint) ? obj.pretty_inspect : | |
| obj.inspect | |
| Pry::Helpers::BaseHelpers.lesspipe(s, always: true, wrap: true) | |
| end | |
| end |
| module ActiveRecord | |
| class Base | |
| class << self | |
| def sqlite3_connection_with_foreign_key(config) | |
| sqlite3_connection_without_foreign_key(config).tap do |db| | |
| db.execute("PRAGMA foreign_keys = ON") if config[:foreign_key] | |
| end | |
| end | |
| alias_method_chain :sqlite3_connection, :foreign_key | |
| end |