Class: AdminModule::Command::Gdl

Inherits:
Thor
  • Object
show all
Includes:
ClientAccess
Defined in:
lib/admin_module/command/gdl.rb

Instance Method Summary collapse

Instance Method Details

#deploy(srcdir, comments = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/admin_module/command/gdl.rb', line 29

def deploy(srcdir, comments = nil)
  gdl = client.guideline

  if options[:file]
    srcfile = Pathname(srcdir) + options[:file]
    gdl.deploy_file(srcfile, comments)
  else
    gdl.deploy(srcdir, comments)
  end

  client.logout
end

#download(guideline, to_path) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/admin_module/command/gdl.rb', line 77

def download(guideline, to_path)
  gdl = client.guideline

  gdl.download(guideline, to_path)

  client.logout
end

#version(comments = nil) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/admin_module/command/gdl.rb', line 55

def version(comments = nil)
  gdl = client.guideline

  gdls = [options[:target]] unless options[:target].nil?
  gdls = AdminModule.configuration.xmlmaps.values.uniq if options[:target].nil?
  if gdls.empty?
    say "aborting version. no guidelines configured", :red
    return
  end

  gdl.version(gdls, comments)

  client.logout
end