Module: CruiseFace

Extended by:
CruiseFace
Included in:
CruiseFace
Defined in:
lib/cruise_face.rb,
lib/cruise_face/console.rb,
lib/cruise_face/resource.rb

Defined Under Namespace

Modules: Model Classes: Console, Resource

Constant Summary collapse

VERSION =
'1.0.1'

Instance Method Summary collapse

Instance Method Details

#console(pipeline_names) ⇒ Object



41
42
43
# File 'lib/cruise_face.rb', line 41

def console(pipeline_names)
  Console.new(pipeline_names).start
end

#get(pipeline_name) ⇒ Object



29
30
31
# File 'lib/cruise_face.rb', line 29

def get(pipeline_name)
  Model::Pipeline.new Resource.find_pipeline_history(pipeline_name)
end

#login(username, password) ⇒ Object



19
20
21
22
23
# File 'lib/cruise_face.rb', line 19

def (username, password)
  Resource.user = username
  Resource.password = password
  self
end

#output(pipeline) ⇒ Object



33
34
35
# File 'lib/cruise_face.rb', line 33

def output(pipeline)
  puts Console::UIBuilder.instance.fetch_pipeline_status(pipeline)
end

#output_text(pipeline) ⇒ Object



37
38
39
# File 'lib/cruise_face.rb', line 37

def output_text(pipeline)
  puts Console::UIBuilder.instance.to_string(Console::UIBuilder.instance.fetch_pipeline_status(pipeline))
end

#pipelinesObject



25
26
27
# File 'lib/cruise_face.rb', line 25

def pipelines
  Resource.find_pipeline_status.pipelines.collect(&:name)
end

#site(site) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/cruise_face.rb', line 10

def site(site)
  Resource.site = site
  Resource.format = :json
  # ignore the collection_name, we'll use action for find cruise resources,
  # for cruise REST API does not fit with ActiveResource
  Resource.collection_name = ''
  self
end