class Mononame
Attributes
name[R]
note: org and name for now required
- make name optional too - why? why not?!!!
use some different names / attributes ??
org[R]
note: org and name for now required
- make name optional too - why? why not?!!!
use some different names / attributes ??
Public Class Methods
new( org, name )
click to toggle source
# File lib/monofile/mononame.rb, line 70 def initialize( org, name ) if org.is_a?(String) && name.is_a?(String) @org = org @name = name else raise ArgumentError, "[Mononame] expected two strings (org, name); got >#{org}< of type #{org.class.name}, >#{name}< of type #{name.class.name}" end end
parse( line )
click to toggle source
# File lib/monofile/mononame.rb, line 48 def self.parse( line ) values = Mono.parse_name( line ) raise ArgumentError, "[Mononame] expected two parts (org/name); got #{values.pretty_inspect}" if values.size != 2 new( *values ) end
real_path( line )
click to toggle source
# File lib/monofile/mononame.rb, line 54 def self.real_path( line ) ## add one-time (quick) usage convenience shortcut mononame = parse( line ) mononame.real_path end
Also aliased as: realpath
Public Instance Methods
exist?()
click to toggle source
todo/check: also check for /.git subfolder - why? why not?
# File lib/monofile/mononame.rb, line 86 def exist?() Dir.exist?( real_path ); end
real_path()
click to toggle source
# File lib/monofile/mononame.rb, line 82 def real_path() "#{Mono.root}/#{to_path}"; end
Also aliased as: realpath
to_path()
click to toggle source
# File lib/monofile/mononame.rb, line 79 def to_path() "#{@org}/#{@name}"; end
to_s()
click to toggle source
# File lib/monofile/mononame.rb, line 80 def to_s() "@#{to_path}"; end