Class: Closx
- Inherits:
-
Object
- Object
- Closx
- Defined in:
- lib/closx.rb
Constant Summary collapse
- VERSION =
"0.0.5"
Instance Attribute Summary collapse
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(full_name) ⇒ Closx
constructor
A new instance of Closx.
- #script ⇒ Object
Constructor Details
#initialize(full_name) ⇒ Closx
Returns a new instance of Closx.
18 19 20 21 |
# File 'lib/closx.rb', line 18 def initialize full_name @full_name = full_name @name = full_name.gsub(' ', '').downcase end |
Instance Attribute Details
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
16 17 18 |
# File 'lib/closx.rb', line 16 def full_name @full_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/closx.rb', line 16 def name @name end |
Class Method Details
.from_path(path) ⇒ Object
5 6 7 |
# File 'lib/closx.rb', line 5 def from_path path new strip(path) end |
Instance Method Details
#script ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/closx.rb', line 23 def script <<-EOS #!/bin/sh # # Quick shortcut to #{full_name} # # USAGE: # $ #{name} # # => opens #{full_name} # # $ #{name} . # $ #{name} /path/to/some_file # # => opens the specified directory/file in #{full_name} open -a "#{full_name}" "$1" EOS end |