Class: OsCtl::Repo::Remote::Repository
- Inherits:
-
Object
- Object
- OsCtl::Repo::Remote::Repository
- Defined in:
- lib/osctl/repo/remote/repository.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #has_index? ⇒ Boolean
- #index_path ⇒ Object
- #index_url ⇒ Object
-
#initialize(url) ⇒ Repository
constructor
A new instance of Repository.
- #lock_index ⇒ Object
Constructor Details
#initialize(url) ⇒ Repository
Returns a new instance of Repository.
7 8 9 10 |
# File 'lib/osctl/repo/remote/repository.rb', line 7 def initialize(url) @url = File.join(url, "v#{SCHEMA}") @path = File.join('.', "v#{SCHEMA}") end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/osctl/repo/remote/repository.rb', line 5 def path @path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/osctl/repo/remote/repository.rb', line 5 def url @url end |
Instance Method Details
#has_index? ⇒ Boolean
16 17 18 |
# File 'lib/osctl/repo/remote/repository.rb', line 16 def has_index? File.exist?(index_path) end |
#index_path ⇒ Object
24 25 26 |
# File 'lib/osctl/repo/remote/repository.rb', line 24 def index_path File.join(path, 'INDEX.json') end |
#index_url ⇒ Object
28 29 30 |
# File 'lib/osctl/repo/remote/repository.rb', line 28 def index_url File.join(url, 'INDEX.json') end |
#lock_index ⇒ Object
20 21 22 |
# File 'lib/osctl/repo/remote/repository.rb', line 20 def lock_index(&) Filelock(File.join(path, '.INDEX.json.lock'), &) end |