environmentalist 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Manifest.txt +58 -0
- data/README.txt +43 -0
- data/Rakefile +32 -0
- data/bin/environmentalize +84 -0
- data/environmentalist.gemspec +35 -0
- data/lib/conf/postboot.rb +38 -0
- data/lib/environmentalist.rb +1 -0
- data/lib/environmentalist/version.rb +20 -0
- data/test/rails210/README +256 -0
- data/test/rails210/Rakefile +10 -0
- data/test/rails210/app/controllers/application.rb +15 -0
- data/test/rails210/app/helpers/application_helper.rb +3 -0
- data/test/rails210/config/boot.rb +109 -0
- data/test/rails210/config/database.yml +19 -0
- data/test/rails210/config/environment.rb +67 -0
- data/test/rails210/config/environments/development.rb +17 -0
- data/test/rails210/config/environments/production.rb +22 -0
- data/test/rails210/config/environments/test.rb +22 -0
- data/test/rails210/config/initializers/inflections.rb +10 -0
- data/test/rails210/config/initializers/mime_types.rb +5 -0
- data/test/rails210/config/initializers/new_rails_defaults.rb +15 -0
- data/test/rails210/config/routes.rb +41 -0
- data/test/rails210/doc/README_FOR_APP +2 -0
- data/test/rails210/log/development.log +0 -0
- data/test/rails210/log/production.log +0 -0
- data/test/rails210/log/server.log +0 -0
- data/test/rails210/log/test.log +0 -0
- data/test/rails210/public/404.html +30 -0
- data/test/rails210/public/422.html +30 -0
- data/test/rails210/public/500.html +30 -0
- data/test/rails210/public/dispatch.cgi +10 -0
- data/test/rails210/public/dispatch.fcgi +24 -0
- data/test/rails210/public/dispatch.rb +10 -0
- data/test/rails210/public/favicon.ico +0 -0
- data/test/rails210/public/images/rails.png +0 -0
- data/test/rails210/public/index.html +274 -0
- data/test/rails210/public/javascripts/application.js +2 -0
- data/test/rails210/public/javascripts/controls.js +963 -0
- data/test/rails210/public/javascripts/dragdrop.js +972 -0
- data/test/rails210/public/javascripts/effects.js +1120 -0
- data/test/rails210/public/javascripts/prototype.js +4225 -0
- data/test/rails210/public/robots.txt +5 -0
- data/test/rails210/script/about +3 -0
- data/test/rails210/script/console +3 -0
- data/test/rails210/script/dbconsole +3 -0
- data/test/rails210/script/destroy +3 -0
- data/test/rails210/script/generate +3 -0
- data/test/rails210/script/performance/benchmarker +3 -0
- data/test/rails210/script/performance/profiler +3 -0
- data/test/rails210/script/performance/request +3 -0
- data/test/rails210/script/plugin +3 -0
- data/test/rails210/script/process/inspector +3 -0
- data/test/rails210/script/process/reaper +3 -0
- data/test/rails210/script/process/spawner +3 -0
- data/test/rails210/script/runner +3 -0
- data/test/rails210/script/server +3 -0
- data/test/rails210/test/test_helper.rb +38 -0
- data/test/rails210test/test/test_helper.rb +38 -0
- data/test/rails_version_test.rb +38 -0
- metadata +124 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class Test::Unit::TestCase
|
6
|
+
# Transactional fixtures accelerate your tests by wrapping each test method
|
7
|
+
# in a transaction that's rolled back on completion. This ensures that the
|
8
|
+
# test database remains unchanged so your fixtures don't have to be reloaded
|
9
|
+
# between every test method. Fewer database queries means faster tests.
|
10
|
+
#
|
11
|
+
# Read Mike Clark's excellent walkthrough at
|
12
|
+
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
13
|
+
#
|
14
|
+
# Every Active Record database supports transactions except MyISAM tables
|
15
|
+
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
16
|
+
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
17
|
+
# is recommended.
|
18
|
+
#
|
19
|
+
# The only drawback to using transactional fixtures is when you actually
|
20
|
+
# need to test transactions. Since your test is bracketed by a transaction,
|
21
|
+
# any transactions started in your code will be automatically rolled back.
|
22
|
+
self.use_transactional_fixtures = true
|
23
|
+
|
24
|
+
# Instantiated fixtures are slow, but give you @david where otherwise you
|
25
|
+
# would need people(:david). If you don't want to migrate your existing
|
26
|
+
# test cases which use the @david style and don't mind the speed hit (each
|
27
|
+
# instantiated fixtures translates to a database query per test method),
|
28
|
+
# then set this back to true.
|
29
|
+
self.use_instantiated_fixtures = false
|
30
|
+
|
31
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
32
|
+
#
|
33
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
|
+
# -- they do not yet inherit this setting
|
35
|
+
fixtures :all
|
36
|
+
|
37
|
+
# Add more helper methods to be used by all tests here...
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class Test::Unit::TestCase
|
6
|
+
# Transactional fixtures accelerate your tests by wrapping each test method
|
7
|
+
# in a transaction that's rolled back on completion. This ensures that the
|
8
|
+
# test database remains unchanged so your fixtures don't have to be reloaded
|
9
|
+
# between every test method. Fewer database queries means faster tests.
|
10
|
+
#
|
11
|
+
# Read Mike Clark's excellent walkthrough at
|
12
|
+
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
13
|
+
#
|
14
|
+
# Every Active Record database supports transactions except MyISAM tables
|
15
|
+
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
16
|
+
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
17
|
+
# is recommended.
|
18
|
+
#
|
19
|
+
# The only drawback to using transactional fixtures is when you actually
|
20
|
+
# need to test transactions. Since your test is bracketed by a transaction,
|
21
|
+
# any transactions started in your code will be automatically rolled back.
|
22
|
+
self.use_transactional_fixtures = true
|
23
|
+
|
24
|
+
# Instantiated fixtures are slow, but give you @david where otherwise you
|
25
|
+
# would need people(:david). If you don't want to migrate your existing
|
26
|
+
# test cases which use the @david style and don't mind the speed hit (each
|
27
|
+
# instantiated fixtures translates to a database query per test method),
|
28
|
+
# then set this back to true.
|
29
|
+
self.use_instantiated_fixtures = false
|
30
|
+
|
31
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
32
|
+
#
|
33
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
|
+
# -- they do not yet inherit this setting
|
35
|
+
fixtures :all
|
36
|
+
|
37
|
+
# Add more helper methods to be used by all tests here...
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
class RailsVersionTest < Test::Unit::TestCase
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
def test_rails_two_one_zero
|
9
|
+
# Clean up an old run if necessary
|
10
|
+
rm_rf('rails210test')
|
11
|
+
|
12
|
+
cp_r('rails210', 'rails210test')
|
13
|
+
system("environmentalize rails210test")
|
14
|
+
|
15
|
+
config_root = File.join('rails210test', 'config')
|
16
|
+
|
17
|
+
assert File.exists?(File.join(config_root, 'postboot.rb'))
|
18
|
+
|
19
|
+
env_rb = File.open(File.join(config_root, 'environment.rb')).read
|
20
|
+
assert env_rb.include?("require File.join(File.dirname(__FILE__), 'postboot')")
|
21
|
+
|
22
|
+
%w(development test demo staging production).each do |env|
|
23
|
+
assert File.directory?(File.join(config_root, env))
|
24
|
+
end
|
25
|
+
|
26
|
+
%w(development test production).each do |env|
|
27
|
+
%w(database.yml environment.rb).each do |f|
|
28
|
+
assert File.exists?(File.join(config_root, env, f))
|
29
|
+
end
|
30
|
+
puts "Testing #{env}"
|
31
|
+
y = YAML.load_file(File.join(config_root, env, 'database.yml'))
|
32
|
+
assert_equal 1, y.keys.size
|
33
|
+
assert_equal env, y.keys.first
|
34
|
+
end
|
35
|
+
# ensure
|
36
|
+
# rm_rf('rails210test')
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: environmentalist
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Trupiano
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-09-12 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.7.0
|
24
|
+
version:
|
25
|
+
description: Provides an executable that converts a rails app's config structure. The basic idea is that environments themselves are now first-class citizens, allowing you to create several environments (e.g. staging, prodtest, demo, etc.) in a clean, organized fashion. Each environment is given its own folder where it can store its own set of configuration files (think mongrel configs, apache configs, etc.) without polluting the top-leve config/ direcotory.
|
26
|
+
email: jtrupiano@gmail.com
|
27
|
+
executables:
|
28
|
+
- environmentalize
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- test/rails210/public/robots.txt
|
36
|
+
files:
|
37
|
+
- History.txt
|
38
|
+
- Manifest.txt
|
39
|
+
- README.txt
|
40
|
+
- Rakefile
|
41
|
+
- bin/environmentalize
|
42
|
+
- environmentalist.gemspec
|
43
|
+
- lib/conf/postboot.rb
|
44
|
+
- lib/environmentalist.rb
|
45
|
+
- lib/environmentalist/version.rb
|
46
|
+
- test/rails210/README
|
47
|
+
- test/rails210/Rakefile
|
48
|
+
- test/rails210/app/controllers/application.rb
|
49
|
+
- test/rails210/app/helpers/application_helper.rb
|
50
|
+
- test/rails210/config/boot.rb
|
51
|
+
- test/rails210/config/database.yml
|
52
|
+
- test/rails210/config/environment.rb
|
53
|
+
- test/rails210/config/environments/development.rb
|
54
|
+
- test/rails210/config/environments/production.rb
|
55
|
+
- test/rails210/config/environments/test.rb
|
56
|
+
- test/rails210/config/initializers/inflections.rb
|
57
|
+
- test/rails210/config/initializers/mime_types.rb
|
58
|
+
- test/rails210/config/initializers/new_rails_defaults.rb
|
59
|
+
- test/rails210/config/routes.rb
|
60
|
+
- test/rails210/doc/README_FOR_APP
|
61
|
+
- test/rails210/log/development.log
|
62
|
+
- test/rails210/log/production.log
|
63
|
+
- test/rails210/log/server.log
|
64
|
+
- test/rails210/log/test.log
|
65
|
+
- test/rails210/public/404.html
|
66
|
+
- test/rails210/public/422.html
|
67
|
+
- test/rails210/public/500.html
|
68
|
+
- test/rails210/public/dispatch.cgi
|
69
|
+
- test/rails210/public/dispatch.fcgi
|
70
|
+
- test/rails210/public/dispatch.rb
|
71
|
+
- test/rails210/public/favicon.ico
|
72
|
+
- test/rails210/public/images/rails.png
|
73
|
+
- test/rails210/public/index.html
|
74
|
+
- test/rails210/public/javascripts/application.js
|
75
|
+
- test/rails210/public/javascripts/controls.js
|
76
|
+
- test/rails210/public/javascripts/dragdrop.js
|
77
|
+
- test/rails210/public/javascripts/effects.js
|
78
|
+
- test/rails210/public/javascripts/prototype.js
|
79
|
+
- test/rails210/public/robots.txt
|
80
|
+
- test/rails210/script/about
|
81
|
+
- test/rails210/script/console
|
82
|
+
- test/rails210/script/dbconsole
|
83
|
+
- test/rails210/script/destroy
|
84
|
+
- test/rails210/script/generate
|
85
|
+
- test/rails210/script/performance/benchmarker
|
86
|
+
- test/rails210/script/performance/profiler
|
87
|
+
- test/rails210/script/performance/request
|
88
|
+
- test/rails210/script/plugin
|
89
|
+
- test/rails210/script/process/inspector
|
90
|
+
- test/rails210/script/process/reaper
|
91
|
+
- test/rails210/script/process/spawner
|
92
|
+
- test/rails210/script/runner
|
93
|
+
- test/rails210/script/server
|
94
|
+
- test/rails_version_test.rb
|
95
|
+
has_rdoc: true
|
96
|
+
homepage: http://github.com/jtrupiano/environmentalist/tree/master
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options:
|
99
|
+
- --main
|
100
|
+
- README.txt
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: "0"
|
108
|
+
version:
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: "0"
|
114
|
+
version:
|
115
|
+
requirements: []
|
116
|
+
|
117
|
+
rubyforge_project: johntrupiano
|
118
|
+
rubygems_version: 1.2.0
|
119
|
+
signing_key:
|
120
|
+
specification_version: 2
|
121
|
+
summary: Provides an executable that converts a rails app's config structure. The basic idea is that environments themselves are now first-class citizens, allowing you to create several environments (e.g. staging, prodtest, demo, etc.) in a clean, organized fashion. Each environment is given its own folder where it can store its own set of configuration files (think mongrel configs, apache configs, etc.) without polluting the top-leve config/ direcotory.
|
122
|
+
test_files:
|
123
|
+
- test/rails210/test/test_helper.rb
|
124
|
+
- test/rails210test/test/test_helper.rb
|