code
stringlengths
1
1.73M
language
stringclasses
1 value
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
#!/usr/bin/env ruby # # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
Ruby
#!/usr/bin/env ruby # # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
# # Copyright 2011 Wade Alcorn wade@bindshell.net # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Ruby
require 'net/http' require 'uri' require 'mechanize' class Hub attr_reader :endpoint def initialize(endpoint) @endpoint = URI.parse(endpoint) @endpoint.path = '/' if @endpoint.path.empty? # This is for a hack to deal with non-auto running tasks on App Engine!? @is_gae = Net::HTTP.get(@endp...
Ruby
require 'webrick' class Subscriber PORT = 8089 VERIFY_TOKEN = 'qfwef9' attr_reader :callback_url attr_accessor :onrequest def initialize(hub) @hub = hub @server = WEBrick::HTTPServer.new(:Port => PORT, :Logger => WEBrick::Log.new(nil, 0), :AccessLog => WEBrick::Log.new(nil, 0)) @callback_ur...
Ruby
class RubyLibraryExample def get_server_language 'ruby' end # Basic communication def passing end def failing(message) raise message end def logging(message, level='INFO') puts "*#{level}* #{message}" end def returning 'returned string' end # Logging def one_message_w...
Ruby
# Copyright 2008-2009 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Ruby
#!/usr/bin/env ruby class ExampleRemoteLibrary def count_items_in_directory(path) Dir.entries(path).find_all{|i| not i.match('^\.')}.length end def strings_should_be_equal(str1, str2) puts "Comparing '#{str1}' to '#{str2}'" if str1 != str2 raise RuntimeError, "Given strings are not equal" ...
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
class CreateUsers < ActiveRecord::Migration def up create_table :users do |t| t.string :profile_id t.string :email t.string :refresh_token end add_index :users, :profile_id end def down drop_table :users end end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'sinatra-activerecord' gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client' group :development do gem 'rake' gem 'sqlite3-ruby' end
Ruby
require 'sinatra.rb' # Sinatra defines #set at the top level as a way to set application configuration set :run, false set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development) require './main' run Sinatra::Application
Ruby
require 'sinatra/activerecord/rake' require './main'
Ruby
require 'rubygems' require 'rake/gempackagetask' require 'rake/testtask' PKG_VERSION = "0.0.1" PKG_FILES = FileList["lib/ahp_tools.rb", "lib/**/*.rb", "../conf/**", "../jars/**"] spec = Gem::Specification.new do |s| s.authors = "John Smith" s.email = "john@smith.com" s.homepage = "http://wiki/display/...
Ruby
require 'test/unit' require File.expand_path(File.dirname(__FILE__) + '/../lib/cli/set_security') class OptionTests < Test::Unit::TestCase def test_resource_type_option_single options = AhpTools::CLI::SetSecurity.new.parse_options( [ '--resource_type', 'agent' ] ) assert_equal(true, options[:resource_type].is_a?...
Ruby
module AhpTools module Commands class AddStatusStepsCommand < Base import "com.urbancode.anthill3.domain.script.agentfilter" import "com.urbancode.anthill3.domain.workflow" import "com.urbancode.anthill3.domain.agentfilter.scripted" import "com.urbancode.anthill3.domain.agentfilter.any"...
Ruby
module AhpTools module Commands class AddAgentsCommand < Base import "com.urbancode.anthill3.domain.agent" # include Helpers::EnvironmentHelper import "com.urbancode.anthill3.domain.servergroup" import "com.urbancode.anthill3.domain.agent" def run authenticated_uow do ...
Ruby
module AhpTools module Commands class NewProjectCommand < Base import "com.urbancode.anthill3.domain.script.agentfilter" import "com.urbancode.anthill3.domain.workflow" import "com.urbancode.anthill3.domain.agentfilter.scripted" import "com.urbancode.anthill3.domain.agentfilter.any" ...
Ruby
module AhpTools module Commands class SetSecurityCommand < Base include Helpers::SecurityHelper def run if @options[:no_exec] print "no_exec set, not going to do anything\n" end @options[:role].each do |role_name| @options[:resource_type].each do |resource_type_name| @op...
Ruby
module AhpTools module Commands class NewEnvironmentsCommand < Base include AhpTools::Helpers::EnvironmentHelper def run authenticated_uow do |uow| environments = build_environments(@options[:environments]) build_environment_group(@options[:group], environments) ...
Ruby
module AhpTools module Commands class DeployCommand < Base import "com.urbancode.anthill3.domain.agent" import "com.urbancode.anthill3.domain.buildrequest.BuildRequest" import "com.urbancode.anthill3.domain.buildrequest.BuildRequestFactory" import "com.urbancode.anthill3.domain.buildreques...
Ruby
module AhpTools module Commands class ListEnvironmentsCommand < Base import "com.urbancode.anthill3.domain.agent" include Helpers::EnvironmentHelper def run agent_cache = {} authenticated_uow do find_environment_groups.each do |environment_group| next u...
Ruby
module AhpTools module Commands class Base include_class "com.urbancode.anthill3.main.client.AnthillClient" def initialize(options) @options = options @anthill = connect end def connect begin AnthillClient::connect(CONFIG[:host_name], CONFIG[:host_por...
Ruby
module AhpTools module Commands class SetPropertyCommand < Base include Helpers::PropertyHelper def run @options[:no_exec] and print "no_exec set, not going to do anything\n" @options[:resource_type].each do |resource_type_name| @options[:resource_name].each do |resource_name_filter| ...
Ruby
module AhpTools module Helpers module FileSourceConfigHelper import "com.urbancode.anthill3.domain.source.file" def build_file_source_config(project, repository, working_dir_script, &block) file_source_config = FileSourceConfig.new(@project, "dummy") file_source_config.repository =...
Ruby
module AhpTools module Helpers module JobHelper import "com.urbancode.anthill3.domain.jobconfig" import "com.urbancode.anthill3.domain.workflow" def find_library_job(name) JobConfigFactory::instance.restore_library_for_name(name) end def build_iterate_all_plan it...
Ruby
module AhpTools module Helpers module PropertyHelper class PropertySetter include ResourceHelper attr_reader :no_exec, :remove, :resource_type_name, :resource_name_filter, :key, :value, :append, :append_delimiter def initialize(key,value,resource_type_name,resource_name_filter,remove,no_exec,appen...
Ruby
module AhpTools module Helpers module BuildProfileHelper import "com.urbancode.anthill3.domain.profile" def build_profile(project, originating_workflow, source_config, &block) result = BuildProfile.new(project, "") result.set_workflow(originating_workflow) result.set_source...
Ruby
module AhpTools module Helpers module ResourceHelper import "com.urbancode.anthill3.domain.persistent" import "com.urbancode.anthill3.domain.agent.AgentFactory" import "com.urbancode.anthill3.domain.servergroup" import "com.urbancode.anthill3.domain.environmentgroup" import "com.urbancode.a...
Ruby
module AhpTools module Helpers module SecurityHelper class SecuritySetter include ResourceHelper import "com.urbancode.anthill3.domain.security" attr_reader :no_exec, :remove, :resource_type_name, :resource_name_filter, :action_name, :role_name, :op, :role def initialize(role_name,resource_t...
Ruby
module AhpTools module Helpers module RepositoryHelper import "com.urbancode.anthill3.domain.repository" import "com.urbancode.anthill3.domain.repository.file" def build_file_repository(name) repo = RepositoryFactory.instance.restore_for_name(name) if repo.nil? info...
Ruby
module AhpTools module Helpers module LifeCycleHelper import "com.urbancode.anthill3.domain.lifecycle" def find_life_cycle_model(name) life_cycle_model = LifeCycleModelFactory.instance.restore_for_name(name) if life_cycle_model.nil? raise "could not find the lifecyle name...
Ruby
module AhpTools module Helpers module WorkflowDefinitionHelper import "com.urbancode.anthill3.domain.workflow" def build_workflow_definition(workflow, &block) workflow_definition = WorkflowDefinition.new(workflow) workflow_definition.name = workflow.name yield workflow_defi...
Ruby
module AhpTools module Helpers module DependencyHelper import "com.urbancode.codestation2.domain.project" import "com.urbancode.anthill3.domain.profile" def build_dependency(dependent_project_name, dependency_project_name, &block) projects = CodestationProjectFactory::instance.restor...
Ruby
module AhpTools module Helpers module ScriptHelper import "com.urbancode.anthill3.domain.script.job" import "com.urbancode.anthill3.domain.workdir" def find_work_dir_script(name) WorkDirScriptFactory::instance.restore_for_name(name) end def find_job_pre_condition_script(...
Ruby
module AhpTools module Helpers module WorkflowHelper import "com.urbancode.anthill3.domain.workflow" def build_workflow(name, project, &block) workflow = Workflow.new(project) workflow.name = name yield workflow workflow.store workflow end def b...
Ruby
module AhpTools module Helpers module ProjectHelper import "com.urbancode.anthill3.domain.project" import "com.urbancode.anthill3.domain.folder" import "com.urbancode.anthill3.domain.agentfilter.any" import "com.urbancode.anthill3.domain.project.prop" def build_project(name, life...
Ruby
module AhpTools module Helpers module EnvironmentHelper import "com.urbancode.anthill3.domain.servergroup" import "com.urbancode.anthill3.domain.environmentgroup" def build_environments(environments) server_groups = [] environments.each do |name| environment = Serve...
Ruby
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) $: << File.dirname(__FILE__) + "/ahp_tools" require 'java' require 'yaml' include Java Dir[File.join(File.dirname(__FILE__), "..", "..", "jars", "*.jar")].each do |jar| require ...
Ruby
require 'optparse' module AhpTools module CLI class ListEnvironments def self.execute(stdout, arguments=[]) options = { :agents => true, :query => "", :env => "" } parser = OptionParser.new do |opts| opts.banner = <<-BANNER.gsub(/^ ...
Ruby
require 'optparse' module AhpTools module CLI class Deploy def self.execute(stdout, arguments=[]) options = { :agents => "", :buildlabel => "latest", :username => ENV['USER'] || ENV['USERNAME'], :timeout => 30, :debug => false, ...
Ruby
require 'optparse' module AhpTools module CLI class SetProperty attr_reader :options def initialize() @options = { :resource_type => nil, :resource_name => nil, :key => nil, :value => nil, :remove => false, :no_exec => false, :...
Ruby