projectdx_pipeline 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.rvmrc +25 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +28 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/projectdx_pipeline/database_configuration_template.rb +82 -0
- data/lib/projectdx_pipeline/railtie.rb +12 -0
- data/lib/projectdx_pipeline.rb +3 -0
- data/lib/tasks/projectdx_pipeline.rake +30 -0
- data/projectdx_pipeline.gemspec +65 -0
- data/spec/database_configuration_template_spec.rb +106 -0
- data/spec/spec_helper.rb +12 -0
- metadata +151 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rvmrc
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
PROJECT_RUBY="ree-1.8.7-2011.03"
|
2
|
+
PROJECT_GEMSET="projectdx_pipeline"
|
3
|
+
|
4
|
+
# use the global gemset in order to check for and install bundler, since we
|
5
|
+
# don't need it to be different for different projects
|
6
|
+
rvm use $PROJECT_RUBY@global --create --install
|
7
|
+
|
8
|
+
echo -n "Checking if bundler gem is installed... "
|
9
|
+
if `ruby -rubygems -e "gem 'bundler'" &>/dev/null`; then
|
10
|
+
echo "Yup, good to go."
|
11
|
+
else
|
12
|
+
echo "Nope. Doing that now."
|
13
|
+
gem install bundler
|
14
|
+
fi
|
15
|
+
|
16
|
+
# now use the gemset for this project and check the bundle
|
17
|
+
rvm use $PROJECT_RUBY@$PROJECT_GEMSET --create
|
18
|
+
bundle check
|
19
|
+
|
20
|
+
# Tweak GC configuration settings for Ruby Enterprise Edition; these make the tests run faster.
|
21
|
+
export RUBY_HEAP_MIN_SLOTS=1000000
|
22
|
+
export RUBY_HEAP_SLOTS_INCREMENT=1000000
|
23
|
+
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
|
24
|
+
export RUBY_GC_MALLOC_LIMIT=1000000000
|
25
|
+
export RUBY_HEAP_FREE_MIN=500000
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 2.3.0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.6.4"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.3)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.6.4)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rake (0.9.2.2)
|
11
|
+
rcov (0.9.11)
|
12
|
+
rspec (2.3.0)
|
13
|
+
rspec-core (~> 2.3.0)
|
14
|
+
rspec-expectations (~> 2.3.0)
|
15
|
+
rspec-mocks (~> 2.3.0)
|
16
|
+
rspec-core (2.3.1)
|
17
|
+
rspec-expectations (2.3.0)
|
18
|
+
diff-lcs (~> 1.1.2)
|
19
|
+
rspec-mocks (2.3.0)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
bundler (~> 1.0.0)
|
26
|
+
jeweler (~> 1.6.4)
|
27
|
+
rcov
|
28
|
+
rspec (~> 2.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Renewable Funding
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= projectdx_pipeline
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to projectdx_pipeline
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 Renewable Funding. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "projectdx_pipeline"
|
18
|
+
gem.homepage = "http://github.com/projectdx/projectdx_pipeline"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Rake tasks for ProjectDX deployment pipeline}
|
21
|
+
gem.description = %Q{Common pipeline tasks and libraries to be used for all components of the ProjectDX platform}
|
22
|
+
gem.email = "devteam@renewfund.com"
|
23
|
+
gem.authors = ["Renewable Funding"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "projectdx_pipeline #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Used in the pipeline:commit:configure:database Rake task to transform a YAML
|
2
|
+
# file containing common elements from an ActiveRecord database.yml
|
3
|
+
# configuration into a YAML file containing a section for each specified
|
4
|
+
# database environment. It names the databases according to the environment as
|
5
|
+
# well as a client ID. The client ID ensures that multiple build agents can run
|
6
|
+
# tests at the same time even when using a central DB server.
|
7
|
+
#
|
8
|
+
# Example call:
|
9
|
+
# template = ProjectdxPipeline::DatabaseConfigurationTemplate.new('config/database.pipeline.yml')
|
10
|
+
# template.render_to_file('config/database.yml')
|
11
|
+
#
|
12
|
+
# Example template YAML file:
|
13
|
+
# ---
|
14
|
+
# adapter: postgresql
|
15
|
+
# username: postgres_user
|
16
|
+
# password: blahblahblah
|
17
|
+
# host: db.example.com
|
18
|
+
# encoding: UTF8
|
19
|
+
# min_messages: warning
|
20
|
+
# database_prefix: an_awesome_app
|
21
|
+
# pool: 5
|
22
|
+
# environments:
|
23
|
+
# - development
|
24
|
+
# - test
|
25
|
+
#
|
26
|
+
class ProjectdxPipeline::DatabaseConfigurationTemplate
|
27
|
+
# the common database config data shared by all environments
|
28
|
+
attr_accessor :config_data
|
29
|
+
|
30
|
+
# an array containing the names of each database environment to be configured
|
31
|
+
attr_accessor :environments
|
32
|
+
|
33
|
+
# a string that will prefix the name of each database
|
34
|
+
attr_accessor :database_prefix
|
35
|
+
|
36
|
+
# a string that will suffix the name of each database, defaults to the
|
37
|
+
# hostname of the machine on which this code is running
|
38
|
+
attr_accessor :client_id
|
39
|
+
|
40
|
+
# Instantiates a new configuration template. If a +template_file+ is
|
41
|
+
# specified, it will be loaded as a YAML file and used to read in the
|
42
|
+
# configuration data for the template.
|
43
|
+
def initialize(template_file = nil)
|
44
|
+
@config_data = {}
|
45
|
+
if template_file
|
46
|
+
@config_data = self.class.read_template(template_file)
|
47
|
+
@client_id = @config_data.delete('client_id')
|
48
|
+
@database_prefix = @config_data.delete('database_prefix')
|
49
|
+
@environments = @config_data.delete('environments')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# returns a Hash containing the ActiveRecord configuration data for all
|
54
|
+
# environments
|
55
|
+
def configuration
|
56
|
+
environments.inject({}) do |config, env_name|
|
57
|
+
config[env_name] = @config_data.dup
|
58
|
+
config[env_name]['database'] = database_name(env_name)
|
59
|
+
config
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Writes the ActiveRecord configuration data (i.e. config/database.yml) to the
|
64
|
+
# specified file path
|
65
|
+
def render_to_file(path)
|
66
|
+
File.open(path, 'w') do |f|
|
67
|
+
YAML.dump(configuration, f)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def database_name(environment) #:nodoc:
|
72
|
+
"#{database_prefix}-#{environment}-#{client_id}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def client_id #:nodoc:
|
76
|
+
@client_id ||= Socket.gethostname.gsub(/\W/, '_')
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.read_template(template_file) #:nodoc:
|
80
|
+
YAML.load_file(template_file)
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
namespace :pipeline do
|
2
|
+
desc "Run commit stage build and tests"
|
3
|
+
task :commit => 'commit:default'
|
4
|
+
namespace :commit do
|
5
|
+
task :default => %w(configure build test)
|
6
|
+
task :configure
|
7
|
+
task :build
|
8
|
+
task :test
|
9
|
+
|
10
|
+
namespace :configure do
|
11
|
+
task :database do
|
12
|
+
require 'projectdx_pipeline/database_configuration_template'
|
13
|
+
dct = ProjectdxPipeline::DatabaseConfigurationTemplate.new('config/database.pipeline.yml')
|
14
|
+
dct.render_to_file('config/database.yml')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
namespace :build do
|
19
|
+
task :clone_reference_database do
|
20
|
+
config = YAML.load_file('config/database.yml')['development']
|
21
|
+
pg = PGconn.new(:host => config['host'], :port => config['port'],
|
22
|
+
:user => config['username'], :password => config['password'],
|
23
|
+
:dbname => 'template1')
|
24
|
+
pg.exec "DROP DATABASE IF EXISTS \"#{config['database']}\""
|
25
|
+
pg.exec "CREATE DATABASE \"#{config['database']}\" TEMPLATE \"#{config['reference_db']}\""
|
26
|
+
pg.close
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{projectdx_pipeline}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Renewable Funding"]
|
12
|
+
s.date = %q{2011-11-18}
|
13
|
+
s.description = %q{Common pipeline tasks and libraries to be used for all components of the ProjectDX platform}
|
14
|
+
s.email = %q{devteam@renewfund.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
".rvmrc",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"lib/projectdx_pipeline.rb",
|
30
|
+
"lib/projectdx_pipeline/database_configuration_template.rb",
|
31
|
+
"lib/projectdx_pipeline/railtie.rb",
|
32
|
+
"lib/tasks/projectdx_pipeline.rake",
|
33
|
+
"projectdx_pipeline.gemspec",
|
34
|
+
"spec/database_configuration_template_spec.rb",
|
35
|
+
"spec/spec_helper.rb"
|
36
|
+
]
|
37
|
+
s.homepage = %q{http://github.com/projectdx/projectdx_pipeline}
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = %q{1.3.7}
|
41
|
+
s.summary = %q{Rake tasks for ProjectDX deployment pipeline}
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
49
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
50
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
51
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
54
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
56
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
57
|
+
end
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
60
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
61
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
62
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'projectdx_pipeline/database_configuration_template'
|
3
|
+
|
4
|
+
describe ProjectdxPipeline::DatabaseConfigurationTemplate do
|
5
|
+
describe '#configuration' do
|
6
|
+
it 'returns an ActiveRecord configuration for each of the specified environments' do
|
7
|
+
template = ProjectdxPipeline::DatabaseConfigurationTemplate.new
|
8
|
+
template.database_prefix = 'awesomeapp'
|
9
|
+
template.client_id = 'thismachineshostname'
|
10
|
+
template.environments = %w(development test)
|
11
|
+
template.config_data['adapter'] = 'postgresql'
|
12
|
+
template.config_data['encoding'] = 'unicode'
|
13
|
+
template.config_data['pool'] = 5
|
14
|
+
template.config_data['min_messages'] = 'warning'
|
15
|
+
template.config_data['host'] = 'database.example.com'
|
16
|
+
template.config_data['username'] = 'chuckles'
|
17
|
+
template.config_data['password'] = 'stinkyface'
|
18
|
+
|
19
|
+
expected_data = {
|
20
|
+
'development' => {
|
21
|
+
'adapter' => 'postgresql',
|
22
|
+
'encoding' => 'unicode',
|
23
|
+
'pool' => 5,
|
24
|
+
'min_messages' => 'warning',
|
25
|
+
'host' => 'database.example.com',
|
26
|
+
'username' => 'chuckles',
|
27
|
+
'password' => 'stinkyface',
|
28
|
+
'database' => 'awesomeapp-development-thismachineshostname'
|
29
|
+
},
|
30
|
+
'test' => {
|
31
|
+
'adapter' => 'postgresql',
|
32
|
+
'encoding' => 'unicode',
|
33
|
+
'pool' => 5,
|
34
|
+
'min_messages' => 'warning',
|
35
|
+
'host' => 'database.example.com',
|
36
|
+
'username' => 'chuckles',
|
37
|
+
'password' => 'stinkyface',
|
38
|
+
'database' => 'awesomeapp-test-thismachineshostname'
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
template.configuration.should == expected_data
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#database_name' do
|
47
|
+
it 'returns the database name as {database_prefix}-{environment}-{client_hostname}' do
|
48
|
+
template = ProjectdxPipeline::DatabaseConfigurationTemplate.new
|
49
|
+
template.database_prefix = 'awesomeapp'
|
50
|
+
template.client_id = 'some_client'
|
51
|
+
|
52
|
+
template.database_name('terrarium').should == 'awesomeapp-terrarium-some_client'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '.new' do
|
57
|
+
it 'sets attributes from specified YAML file' do
|
58
|
+
data = {
|
59
|
+
'database_prefix' => 'awesomeapp',
|
60
|
+
'adapter' => 'postgresql',
|
61
|
+
'encoding' => 'unicode',
|
62
|
+
'pool' => 5,
|
63
|
+
'min_messages' => 'warning',
|
64
|
+
'host' => 'database.example.com',
|
65
|
+
'username' => 'chuckles',
|
66
|
+
'password' => 'stinkyface',
|
67
|
+
'environments' => %w(development test)
|
68
|
+
}
|
69
|
+
ProjectdxPipeline::DatabaseConfigurationTemplate.should_receive(:read_template) \
|
70
|
+
.with('/my/template/file.yml') \
|
71
|
+
.and_return(data)
|
72
|
+
|
73
|
+
template = ProjectdxPipeline::DatabaseConfigurationTemplate.new('/my/template/file.yml')
|
74
|
+
|
75
|
+
template.database_prefix.should == 'awesomeapp'
|
76
|
+
template.environments.should == %w(development test)
|
77
|
+
template.config_data['adapter'].should == 'postgresql'
|
78
|
+
template.config_data['encoding'].should == 'unicode'
|
79
|
+
template.config_data['pool'].should == 5
|
80
|
+
template.config_data['min_messages'].should == 'warning'
|
81
|
+
template.config_data['host'].should == 'database.example.com'
|
82
|
+
template.config_data['username'].should == 'chuckles'
|
83
|
+
template.config_data['password'].should == 'stinkyface'
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe '#client_id' do
|
88
|
+
it 'defaults to the hostname of the machine it is running on' do
|
89
|
+
Socket.stub!(:gethostname => 'foo.bar')
|
90
|
+
template = ProjectdxPipeline::DatabaseConfigurationTemplate.new
|
91
|
+
template.client_id.should == 'foo_bar'
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe '#render_to_file' do
|
96
|
+
it 'creates a YAML dump of the configuration at the specified path' do
|
97
|
+
file_io = stub
|
98
|
+
File.should_receive(:open).with('/destination/file.yml', 'w').and_yield(file_io)
|
99
|
+
YAML.should_receive(:dump).with('some data', file_io)
|
100
|
+
|
101
|
+
template = ProjectdxPipeline::DatabaseConfigurationTemplate.new
|
102
|
+
template.stub!(:configuration => 'some data')
|
103
|
+
template.render_to_file('/destination/file.yml')
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'projectdx_pipeline'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: projectdx_pipeline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
segments_generated: true
|
11
|
+
version: 0.0.1
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Renewable Funding
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-11-18 00:00:00 -08:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
23
|
+
prerelease: false
|
24
|
+
type: :development
|
25
|
+
name: rspec
|
26
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 3
|
32
|
+
segments:
|
33
|
+
- 2
|
34
|
+
- 3
|
35
|
+
- 0
|
36
|
+
segments_generated: true
|
37
|
+
version: 2.3.0
|
38
|
+
requirement: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
prerelease: false
|
41
|
+
type: :development
|
42
|
+
name: bundler
|
43
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 23
|
49
|
+
segments:
|
50
|
+
- 1
|
51
|
+
- 0
|
52
|
+
- 0
|
53
|
+
segments_generated: true
|
54
|
+
version: 1.0.0
|
55
|
+
requirement: *id002
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
prerelease: false
|
58
|
+
type: :development
|
59
|
+
name: jeweler
|
60
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 7
|
66
|
+
segments:
|
67
|
+
- 1
|
68
|
+
- 6
|
69
|
+
- 4
|
70
|
+
segments_generated: true
|
71
|
+
version: 1.6.4
|
72
|
+
requirement: *id003
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
prerelease: false
|
75
|
+
type: :development
|
76
|
+
name: rcov
|
77
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
segments_generated: true
|
86
|
+
version: "0"
|
87
|
+
requirement: *id004
|
88
|
+
description: Common pipeline tasks and libraries to be used for all components of the ProjectDX platform
|
89
|
+
email: devteam@renewfund.com
|
90
|
+
executables: []
|
91
|
+
|
92
|
+
extensions: []
|
93
|
+
|
94
|
+
extra_rdoc_files:
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.rdoc
|
97
|
+
files:
|
98
|
+
- .document
|
99
|
+
- .rspec
|
100
|
+
- .rvmrc
|
101
|
+
- Gemfile
|
102
|
+
- Gemfile.lock
|
103
|
+
- LICENSE.txt
|
104
|
+
- README.rdoc
|
105
|
+
- Rakefile
|
106
|
+
- VERSION
|
107
|
+
- lib/projectdx_pipeline.rb
|
108
|
+
- lib/projectdx_pipeline/database_configuration_template.rb
|
109
|
+
- lib/projectdx_pipeline/railtie.rb
|
110
|
+
- lib/tasks/projectdx_pipeline.rake
|
111
|
+
- projectdx_pipeline.gemspec
|
112
|
+
- spec/database_configuration_template_spec.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
has_rdoc: true
|
115
|
+
homepage: http://github.com/projectdx/projectdx_pipeline
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
segments_generated: true
|
132
|
+
version: "0"
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
segments_generated: true
|
142
|
+
version: "0"
|
143
|
+
requirements: []
|
144
|
+
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 1.3.7
|
147
|
+
signing_key:
|
148
|
+
specification_version: 3
|
149
|
+
summary: Rake tasks for ProjectDX deployment pipeline
|
150
|
+
test_files: []
|
151
|
+
|