This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
populate_projects = (url, ul_id) -> | |
JSON_GET url, { | |
success: (data) -> | |
console.log(data) | |
$header = $(ul_id).find('li').first() | |
$(ul_id).empty() | |
$(ul_id).append($header) | |
$.each data, (index, value) -> | |
$li = $("<li />") | |
$li.attr('data-theme', 'c') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON_GET = (url, settings) -> | |
settings = $.extend({}, settings, { type: 'GET' }) | |
return JSON_REQUEST(url, settings) | |
JSON_POST = (url, settings) -> | |
settings = $.extend({}, settings, { type: 'POST' }) | |
return JSON_REQUEST(url, settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<base_image> | |
<name>MyFirstBaseImage</name> | |
<description>ThisIsABaseImage</description> | |
<template> | |
<name>mock</name> | |
<os> | |
<name>RHEL-6</name> | |
<version>1</version> | |
<arch>x86_64</arch> | |
<install type='iso'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template_xml = "<template><name>mock</name><os><name>RHELMock</name><version>1</version><arch>x86_64</arch><install type=\"iso\"><iso>http://mockhost/RHELMock1-x86_64-DVD.iso</iso></install><rootpw>password</rootpw></os><description>Mock Template</description></template>" | |
template = Tim::Template.create(:xml => template_xml) | |
base_image = Tim::BaseImage.new | |
base_image.template = template | |
base_image.save | |
image_version = Tim::ImageVersion.new | |
image_version.base_image = base_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"provider_image": { | |
"target_image": { | |
"target":"Mock", | |
"template":"...", | |
"callbacks":["...", "..."] | |
}, | |
"provider": "MockSphere", | |
"credentials": "...", | |
"callbacks":["...", "..."] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"provider_image": { | |
"target":"Mock", | |
"template":"...", | |
"provider": "MockSphere", | |
"credentials": "...", | |
"callbacks":["...", "..."] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"provider_image": { | |
"target":"Mock", | |
"template":"...", | |
"provider": "MockSphere", | |
"credentials": "...", | |
"callbacks":["...", "..."] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
banana.rb | |
class Banana | |
def self.who_am_i | |
puts "I'm a stand alone Banana" | |
end | |
end | |
foor/bar.rb | |
module Foo | |
class Bar < Banana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def image_version_attributes(attrs) | |
image_versions = [] | |
attrs.each do |map| | |
if map.contains_key? "id" | |
image_versions << ImageVersion.find(map["id"]) | |
end | |
end | |
self.image_version = image_versions | |
super(attrs) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params = {"base_image" => {"image_versions_attributes" => [{"id" => "2"}]}} | |
Tim::BaseImage.new(params["base_image"]) |
OlderNewer