Class: Dockdev::Workspace
- Inherits:
-
Object
- Object
- Dockdev::Workspace
- Defined in:
- lib/dockdev/workspace.rb
Instance Method Summary collapse
- #dockerfile ⇒ Object
- #dockerfiles ⇒ Object
- #found_dockerfile_count ⇒ Object
- #has_docker_compose? ⇒ Boolean
- #has_dockerfile? ⇒ Boolean
- #has_multiple_dockerfiles? ⇒ Boolean
-
#initialize(root = Dir.getwd) ⇒ Workspace
constructor
A new instance of Workspace.
- #name ⇒ Object
Constructor Details
Instance Method Details
#dockerfile ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/dockdev/workspace.rb', line 30 def dockerfile if has_dockerfile? dockerfiles.first else nil end end |
#dockerfiles ⇒ Object
26 27 28 |
# File 'lib/dockdev/workspace.rb', line 26 def dockerfiles Dir.glob(File.join(@root,"Dockerfile*")) end |
#found_dockerfile_count ⇒ Object
18 19 20 |
# File 'lib/dockdev/workspace.rb', line 18 def found_dockerfile_count dockerfiles.length end |
#has_docker_compose? ⇒ Boolean
38 39 40 |
# File 'lib/dockdev/workspace.rb', line 38 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? found_dockerfile_count > 0 end |
#has_multiple_dockerfiles? ⇒ Boolean
22 23 24 |
# File 'lib/dockdev/workspace.rb', line 22 def has_multiple_dockerfiles? found_dockerfile_count > 1 end |
#name ⇒ Object
10 11 12 |
# File 'lib/dockdev/workspace.rb', line 10 def name File.dirname(@root) end |