Class: Proscenium::Middleware::RubyGems
- Inherits:
-
Esbuild
show all
- Defined in:
- lib/proscenium/middleware/ruby_gems.rb
Instance Method Summary
collapse
Methods inherited from Esbuild
#attempt
Methods inherited from Base
attempt, #initialize, #renderable!
Instance Method Details
#gem_name ⇒ Object
14
15
16
|
# File 'lib/proscenium/middleware/ruby_gems.rb', line 14
def gem_name
@gem_name ||= gem_request_path.split('/').first
end
|
#gem_request_path ⇒ Object
18
19
20
|
# File 'lib/proscenium/middleware/ruby_gems.rb', line 18
def gem_request_path
@gem_request_path ||= @request.path.delete_prefix('/node_modules/@rubygems/')
end
|
#real_path ⇒ Object
6
7
8
|
# File 'lib/proscenium/middleware/ruby_gems.rb', line 6
def real_path
@real_path ||= Pathname.new(gem_request_path.delete_prefix("#{gem_name}/")).to_s
end
|
#root_for_readable ⇒ Object
10
11
12
|
# File 'lib/proscenium/middleware/ruby_gems.rb', line 10
def root_for_readable
BundledGems.pathname_for!(gem_name)
end
|