Class: Bundler::InstallDashDocs::DashInstallUrl
- Inherits:
-
Object
- Object
- Bundler::InstallDashDocs::DashInstallUrl
- Defined in:
- lib/bundler/install_dash_docs/dash_install_url.rb
Overview
A dash-specific URL for installing the given gem’s documentation at specified version
documentation kapeli.com/dash_install
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(gem_name, version) ⇒ DashInstallUrl
constructor
A new instance of DashInstallUrl.
-
#to_str ⇒ String
Properly encoded URL to tell Dash.app to install this gem’s documentation.
Constructor Details
#initialize(gem_name, version) ⇒ DashInstallUrl
Returns a new instance of DashInstallUrl.
15 16 17 18 |
# File 'lib/bundler/install_dash_docs/dash_install_url.rb', line 15 def initialize(gem_name, version) @gem_name = gem_name @version = version end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
10 11 12 |
# File 'lib/bundler/install_dash_docs/dash_install_url.rb', line 10 def gem_name @gem_name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
10 11 12 |
# File 'lib/bundler/install_dash_docs/dash_install_url.rb', line 10 def version @version end |
Instance Method Details
#to_str ⇒ String
Returns properly encoded URL to tell Dash.app to install this gem’s documentation.
22 23 24 25 26 27 |
# File 'lib/bundler/install_dash_docs/dash_install_url.rb', line 22 def to_str enc_name = Addressable::URI.encode_component(@gem_name, Addressable::URI::CharacterClasses::UNRESERVED) enc_version = Addressable::URI.encode_component(@version, Addressable::URI::CharacterClasses::UNRESERVED) "dash-install://repo_name=Ruby%20Docsets&entry_name=#{enc_name}&version=#{enc_version}" end |