Class: Dockdev::Workspace
- Inherits:
-
Object
- Object
- Dockdev::Workspace
- Defined in:
- lib/dockdev/workspace.rb
Instance Method Summary collapse
- #dockerfile ⇒ Object
- #has_docker_compose? ⇒ Boolean
- #has_dockerfile? ⇒ Boolean
-
#initialize(root = Dir.getwd) ⇒ Workspace
constructor
A new instance of Workspace.
- #name ⇒ Object
Constructor Details
#initialize(root = Dir.getwd) ⇒ Workspace
Returns a new instance of Workspace.
6 7 8 |
# File 'lib/dockdev/workspace.rb', line 6 def initialize(root = Dir.getwd) @root = root end |
Instance Method Details
#dockerfile ⇒ Object
18 19 20 |
# File 'lib/dockdev/workspace.rb', line 18 def dockerfile Dir.glob(File.join(@root,"Dockerfile")).first end |
#has_docker_compose? ⇒ Boolean
22 23 24 |
# File 'lib/dockdev/workspace.rb', line 22 def has_docker_compose? Dir.glob(File.join(@root,"docker-compose.yml")).length > 0 end |
#has_dockerfile? ⇒ Boolean
14 15 16 |
# File 'lib/dockdev/workspace.rb', line 14 def has_dockerfile? Dir.glob(File.join(@root,"Dockerfile")).length > 0 end |
#name ⇒ Object
10 11 12 |
# File 'lib/dockdev/workspace.rb', line 10 def name File.dirname(@root) end |