class NetLinx::Rake::Workspace::CreateWorkspaceConfig

Create a workspace config.yaml file.

Attributes

name[RW]

Public Class Methods

new(name = :create_workspace_config) { |self| ... } click to toggle source
# File lib/netlinx/rake/workspace/create_workspace_config.rb, line 13
        def initialize name = :create_workspace_config
          @name = name
          yield self if block_given?
          
          desc "Create a workspace config.yaml file."
          
          task(name) do
            config_file = 'workspace.config.yaml'
            
            if File.exists? config_file
              puts "Aborted: #{config_file} already exists."
              next
            end
            
            File.open config_file, 'w' do |f|
              f.write <<EOS
systems:
  -
    name: Client - Room
    connection: 192.168.1.2
    touch_panels:
      -
        path: Touch Panel.TP4
        dps: 10001:1:0
    ir:
      -
        path: IR.irl
        dps: 5001:1:0
EOS
            end
          end
        end