Class: GoodData::Command::Process
- Defined in:
- lib/gooddata/commands/process.rb
Class Method Summary collapse
- .delete(process_id, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
-
.deploy(dir, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
TODO: check files_to_exclude param.
- .execute_process(process_id, executable, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
- .get(options = {}) ⇒ Object
- .list(options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
- .run(dir, executable, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
Class Method Details
.delete(process_id, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/gooddata/commands/process.rb', line 31 def delete(process_id, = { :client => GoodData.connection, :project => GoodData.project }) c = [:client] pid = [:project_id] process = c.with_project(pid) do |project| project.processes(process_id) end process.delete end |
.deploy(dir, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
TODO: check files_to_exclude param. Does it do anything? It should check that in case of using CLI, it makes sure the files are not deployed
41 42 43 44 45 46 47 48 |
# File 'lib/gooddata/commands/process.rb', line 41 def deploy(dir, = { :client => GoodData.connection, :project => GoodData.project }) params = [:params].nil? ? [] : [[:params]] c = [:client] pid = [:project_id] c.with_project(pid) do |project| project.deploy_process(dir, .merge(:files_to_exclude => params)) end end |
.execute_process(process_id, executable, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
50 51 52 53 |
# File 'lib/gooddata/commands/process.rb', line 50 def execute_process(process_id, executable, = { :client => GoodData.connection, :project => GoodData.project }) process = GoodData::Process[process_id, ] process.execute_process(executable, ) end |
.get(options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/gooddata/commands/process.rb', line 19 def get( = {}) pid = [:project_id] fail ArgumentError, 'None or invalid project_id specified' if pid.nil? || pid.empty? id = [:process_id] fail ArgumentError, 'None or invalid process_id' if id.nil? || id.empty? c = [:client] c.with_project(pid) do |project| project.processes(id) end end |
.list(options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
15 16 17 |
# File 'lib/gooddata/commands/process.rb', line 15 def list( = { :client => GoodData.connection, :project => GoodData.project }) GoodData::Process[:all, ] end |
.run(dir, executable, options = { :client => GoodData.connection, :project => GoodData.project }) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/gooddata/commands/process.rb', line 55 def run(dir, executable, = { :client => GoodData.connection, :project => GoodData.project }) verbose = [:v] dir = Pathname(dir) name = [:name] || "Temporary deploy[#{dir}][#{[:project_name]}]" GoodData::Process.with_deploy(dir, .merge(:name => name, :project_id => ProjectHelper.project_id([:client]))) do |process| puts HighLine.color('Executing', HighLine::BOLD) if verbose process.execute(executable, ) end end |