jtrupiano-environmentalist 0.2.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.
Files changed (61) hide show
  1. data/History.txt +4 -0
  2. data/LICENSE +22 -0
  3. data/README.textile +22 -0
  4. data/Rakefile +22 -0
  5. data/VERSION.yml +4 -0
  6. data/bin/environmentalize +90 -0
  7. data/lib/conf/postboot.rb +27 -0
  8. data/lib/conf/preinitializer.rb +20 -0
  9. data/lib/environmentalist.rb +1 -0
  10. data/lib/environmentalist/version.rb +20 -0
  11. data/test/rails210/README +256 -0
  12. data/test/rails210/Rakefile +10 -0
  13. data/test/rails210/app/controllers/application.rb +15 -0
  14. data/test/rails210/app/helpers/application_helper.rb +3 -0
  15. data/test/rails210/config/boot.rb +109 -0
  16. data/test/rails210/config/database.yml +19 -0
  17. data/test/rails210/config/environment.rb +67 -0
  18. data/test/rails210/config/environments/development.rb +17 -0
  19. data/test/rails210/config/environments/production.rb +22 -0
  20. data/test/rails210/config/environments/test.rb +22 -0
  21. data/test/rails210/config/initializers/inflections.rb +10 -0
  22. data/test/rails210/config/initializers/mime_types.rb +5 -0
  23. data/test/rails210/config/initializers/new_rails_defaults.rb +15 -0
  24. data/test/rails210/config/routes.rb +41 -0
  25. data/test/rails210/doc/README_FOR_APP +2 -0
  26. data/test/rails210/log/development.log +0 -0
  27. data/test/rails210/log/production.log +0 -0
  28. data/test/rails210/log/server.log +0 -0
  29. data/test/rails210/log/test.log +0 -0
  30. data/test/rails210/public/404.html +30 -0
  31. data/test/rails210/public/422.html +30 -0
  32. data/test/rails210/public/500.html +30 -0
  33. data/test/rails210/public/dispatch.cgi +10 -0
  34. data/test/rails210/public/dispatch.fcgi +24 -0
  35. data/test/rails210/public/dispatch.rb +10 -0
  36. data/test/rails210/public/favicon.ico +0 -0
  37. data/test/rails210/public/images/rails.png +0 -0
  38. data/test/rails210/public/index.html +274 -0
  39. data/test/rails210/public/javascripts/application.js +2 -0
  40. data/test/rails210/public/javascripts/controls.js +963 -0
  41. data/test/rails210/public/javascripts/dragdrop.js +972 -0
  42. data/test/rails210/public/javascripts/effects.js +1120 -0
  43. data/test/rails210/public/javascripts/prototype.js +4225 -0
  44. data/test/rails210/public/robots.txt +5 -0
  45. data/test/rails210/script/about +3 -0
  46. data/test/rails210/script/console +3 -0
  47. data/test/rails210/script/dbconsole +3 -0
  48. data/test/rails210/script/destroy +3 -0
  49. data/test/rails210/script/generate +3 -0
  50. data/test/rails210/script/performance/benchmarker +3 -0
  51. data/test/rails210/script/performance/profiler +3 -0
  52. data/test/rails210/script/performance/request +3 -0
  53. data/test/rails210/script/plugin +3 -0
  54. data/test/rails210/script/process/inspector +3 -0
  55. data/test/rails210/script/process/reaper +3 -0
  56. data/test/rails210/script/process/spawner +3 -0
  57. data/test/rails210/script/runner +3 -0
  58. data/test/rails210/script/server +3 -0
  59. data/test/rails210/test/test_helper.rb +38 -0
  60. data/test/rails_version_test.rb +38 -0
  61. metadata +241 -0
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/request'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/inspector'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/reaper'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spawner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -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,241 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jtrupiano-environmentalist
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - John Trupiano
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-02 00:00:00 -08:00
13
+ default_executable: environmentalize
14
+ dependencies: []
15
+
16
+ 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/ directory.
17
+ email: jtrupiano@gmail.com
18
+ executables:
19
+ - environmentalize
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - History.txt
26
+ - LICENSE
27
+ - Rakefile
28
+ - README.textile
29
+ - VERSION.yml
30
+ - bin/environmentalize
31
+ - lib/conf
32
+ - lib/conf/postboot.rb
33
+ - lib/conf/preinitializer.rb
34
+ - lib/environmentalist
35
+ - lib/environmentalist/version.rb
36
+ - lib/environmentalist.rb
37
+ - test/rails210
38
+ - test/rails210/app
39
+ - test/rails210/app/controllers
40
+ - test/rails210/app/controllers/application.rb
41
+ - test/rails210/app/helpers
42
+ - test/rails210/app/helpers/application_helper.rb
43
+ - test/rails210/app/models
44
+ - test/rails210/app/views
45
+ - test/rails210/app/views/layouts
46
+ - test/rails210/config
47
+ - test/rails210/config/boot.rb
48
+ - test/rails210/config/database.yml
49
+ - test/rails210/config/environment.rb
50
+ - test/rails210/config/environments
51
+ - test/rails210/config/environments/development.rb
52
+ - test/rails210/config/environments/production.rb
53
+ - test/rails210/config/environments/test.rb
54
+ - test/rails210/config/initializers
55
+ - test/rails210/config/initializers/inflections.rb
56
+ - test/rails210/config/initializers/mime_types.rb
57
+ - test/rails210/config/initializers/new_rails_defaults.rb
58
+ - test/rails210/config/routes.rb
59
+ - test/rails210/db
60
+ - test/rails210/doc
61
+ - test/rails210/doc/README_FOR_APP
62
+ - test/rails210/lib
63
+ - test/rails210/lib/tasks
64
+ - test/rails210/log
65
+ - test/rails210/log/development.log
66
+ - test/rails210/log/production.log
67
+ - test/rails210/log/server.log
68
+ - test/rails210/log/test.log
69
+ - test/rails210/public
70
+ - test/rails210/public/404.html
71
+ - test/rails210/public/422.html
72
+ - test/rails210/public/500.html
73
+ - test/rails210/public/dispatch.cgi
74
+ - test/rails210/public/dispatch.fcgi
75
+ - test/rails210/public/dispatch.rb
76
+ - test/rails210/public/favicon.ico
77
+ - test/rails210/public/images
78
+ - test/rails210/public/images/rails.png
79
+ - test/rails210/public/index.html
80
+ - test/rails210/public/javascripts
81
+ - test/rails210/public/javascripts/application.js
82
+ - test/rails210/public/javascripts/controls.js
83
+ - test/rails210/public/javascripts/dragdrop.js
84
+ - test/rails210/public/javascripts/effects.js
85
+ - test/rails210/public/javascripts/prototype.js
86
+ - test/rails210/public/robots.txt
87
+ - test/rails210/public/stylesheets
88
+ - test/rails210/Rakefile
89
+ - test/rails210/README
90
+ - test/rails210/script
91
+ - test/rails210/script/about
92
+ - test/rails210/script/console
93
+ - test/rails210/script/dbconsole
94
+ - test/rails210/script/destroy
95
+ - test/rails210/script/generate
96
+ - test/rails210/script/performance
97
+ - test/rails210/script/performance/benchmarker
98
+ - test/rails210/script/performance/profiler
99
+ - test/rails210/script/performance/request
100
+ - test/rails210/script/plugin
101
+ - test/rails210/script/process
102
+ - test/rails210/script/process/inspector
103
+ - test/rails210/script/process/reaper
104
+ - test/rails210/script/process/spawner
105
+ - test/rails210/script/runner
106
+ - test/rails210/script/server
107
+ - test/rails210/test
108
+ - test/rails210/test/fixtures
109
+ - test/rails210/test/functional
110
+ - test/rails210/test/integration
111
+ - test/rails210/test/test_helper.rb
112
+ - test/rails210/test/unit
113
+ - test/rails210/tmp
114
+ - test/rails210/tmp/cache
115
+ - test/rails210/tmp/pids
116
+ - test/rails210/tmp/sessions
117
+ - test/rails210/tmp/sockets
118
+ - test/rails210/vendor
119
+ - test/rails210/vendor/plugins
120
+ - test/rails210test
121
+ - test/rails210test/app
122
+ - test/rails210test/app/controllers
123
+ - test/rails210test/app/controllers/application.rb
124
+ - test/rails210test/app/helpers
125
+ - test/rails210test/app/helpers/application_helper.rb
126
+ - test/rails210test/app/models
127
+ - test/rails210test/app/views
128
+ - test/rails210test/app/views/layouts
129
+ - test/rails210test/config
130
+ - test/rails210test/config/boot.rb
131
+ - test/rails210test/config/demo
132
+ - test/rails210test/config/demo/environment.rb
133
+ - test/rails210test/config/development
134
+ - test/rails210test/config/development/database.yml
135
+ - test/rails210test/config/development/environment.rb
136
+ - test/rails210test/config/environment.rb
137
+ - test/rails210test/config/initializers
138
+ - test/rails210test/config/initializers/inflections.rb
139
+ - test/rails210test/config/initializers/mime_types.rb
140
+ - test/rails210test/config/initializers/new_rails_defaults.rb
141
+ - test/rails210test/config/postboot.rb
142
+ - test/rails210test/config/production
143
+ - test/rails210test/config/production/database.yml
144
+ - test/rails210test/config/production/environment.rb
145
+ - test/rails210test/config/routes.rb
146
+ - test/rails210test/config/staging
147
+ - test/rails210test/config/staging/environment.rb
148
+ - test/rails210test/config/test
149
+ - test/rails210test/config/test/database.yml
150
+ - test/rails210test/config/test/environment.rb
151
+ - test/rails210test/db
152
+ - test/rails210test/doc
153
+ - test/rails210test/doc/README_FOR_APP
154
+ - test/rails210test/lib
155
+ - test/rails210test/lib/tasks
156
+ - test/rails210test/log
157
+ - test/rails210test/log/development.log
158
+ - test/rails210test/log/production.log
159
+ - test/rails210test/log/server.log
160
+ - test/rails210test/log/test.log
161
+ - test/rails210test/public
162
+ - test/rails210test/public/404.html
163
+ - test/rails210test/public/422.html
164
+ - test/rails210test/public/500.html
165
+ - test/rails210test/public/dispatch.cgi
166
+ - test/rails210test/public/dispatch.fcgi
167
+ - test/rails210test/public/dispatch.rb
168
+ - test/rails210test/public/favicon.ico
169
+ - test/rails210test/public/images
170
+ - test/rails210test/public/images/rails.png
171
+ - test/rails210test/public/index.html
172
+ - test/rails210test/public/javascripts
173
+ - test/rails210test/public/javascripts/application.js
174
+ - test/rails210test/public/javascripts/controls.js
175
+ - test/rails210test/public/javascripts/dragdrop.js
176
+ - test/rails210test/public/javascripts/effects.js
177
+ - test/rails210test/public/javascripts/prototype.js
178
+ - test/rails210test/public/robots.txt
179
+ - test/rails210test/public/stylesheets
180
+ - test/rails210test/Rakefile
181
+ - test/rails210test/README
182
+ - test/rails210test/script
183
+ - test/rails210test/script/about
184
+ - test/rails210test/script/console
185
+ - test/rails210test/script/dbconsole
186
+ - test/rails210test/script/destroy
187
+ - test/rails210test/script/generate
188
+ - test/rails210test/script/performance
189
+ - test/rails210test/script/performance/benchmarker
190
+ - test/rails210test/script/performance/profiler
191
+ - test/rails210test/script/performance/request
192
+ - test/rails210test/script/plugin
193
+ - test/rails210test/script/process
194
+ - test/rails210test/script/process/inspector
195
+ - test/rails210test/script/process/reaper
196
+ - test/rails210test/script/process/spawner
197
+ - test/rails210test/script/runner
198
+ - test/rails210test/script/server
199
+ - test/rails210test/test
200
+ - test/rails210test/test/fixtures
201
+ - test/rails210test/test/functional
202
+ - test/rails210test/test/integration
203
+ - test/rails210test/test/test_helper.rb
204
+ - test/rails210test/test/unit
205
+ - test/rails210test/tmp
206
+ - test/rails210test/tmp/cache
207
+ - test/rails210test/tmp/pids
208
+ - test/rails210test/tmp/sessions
209
+ - test/rails210test/tmp/sockets
210
+ - test/rails210test/vendor
211
+ - test/rails210test/vendor/plugins
212
+ - test/rails_version_test.rb
213
+ has_rdoc: true
214
+ homepage: http://github.com/jtrupiano/environmentalist
215
+ post_install_message:
216
+ rdoc_options:
217
+ - --inline-source
218
+ - --charset=UTF-8
219
+ require_paths:
220
+ - lib
221
+ required_ruby_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: "0"
226
+ version:
227
+ required_rubygems_version: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - ">="
230
+ - !ruby/object:Gem::Version
231
+ version: "0"
232
+ version:
233
+ requirements: []
234
+
235
+ rubyforge_project:
236
+ rubygems_version: 1.2.0
237
+ signing_key:
238
+ specification_version: 2
239
+ 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/ directory.
240
+ test_files: []
241
+