Sha256: 24f7dedcd69a5f5d7044b59f1ec0fd425e8c37c9c04a27e49bbe5f51d7fe23dd

Contents?: true

Size: 552 Bytes

Versions: 3

Compression:

Stored size: 552 Bytes

Contents

require 'rake'

namespace 'motion-provisioning' do
  desc 'Add a device to the provisioning portal: rake "motion-provisioning:add-device[device_name,device_id]"'
  task 'add-device', [:name, :id] do |t, args|
    name = args[:name]
    id = args[:id]
    if name.nil? || id.nil?
      puts "Missing device name or id."
      puts "Syntax: rake \"motion-provisioning:add-device[device_name,device_id]\""
      exit
    end
    MotionProvisioning.client.create_device!(name, id)
    puts "Successfully added device (name: #{name}, id: #{id})."
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-provisioning-1.1.0 lib/motion-provisioning/tasks.rb
motion-provisioning-1.0.4 lib/motion-provisioning/tasks.rb
motion-provisioning-1.0.3 lib/motion-provisioning/tasks.rb