amberbit-config 1.0.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.rdoc +89 -0
- data/VERSION +1 -1
- data/lib/amberbit-config.rb +27 -3
- data/lib/amberbit-config/config.rb +60 -0
- data/lib/amberbit-config/engine.rb +12 -0
- data/lib/amberbit-config/errors.rb +4 -0
- data/lib/amberbit-config/hash_struct.rb +59 -0
- data/lib/amberbit-config/version.rb +3 -0
- data/lib/tasks/amberbit-config.rake +37 -0
- metadata +75 -127
- data/.gitignore +0 -1
- data/README +0 -68
- data/Rakefile +0 -36
- data/amberbit-config.gemspec +0 -122
- data/init.rb +0 -2
- data/install.rb +0 -1
- data/lib/amber_bit_app_config.rb +0 -74
- data/lib/hash_struct.rb +0 -9
- data/rails/init.rb +0 -2
- data/spec/library_spec.rb +0 -20
- data/spec/plugin_spec.rb +0 -31
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +0 -38
- data/spec/testapp/README +0 -243
- data/spec/testapp/Rakefile +0 -11
- data/spec/testapp/app/controllers/application_controller.rb +0 -10
- data/spec/testapp/app/helpers/application_helper.rb +0 -3
- data/spec/testapp/config/application/config.yml +0 -8
- data/spec/testapp/config/application/default.yml +0 -6
- data/spec/testapp/config/boot.rb +0 -110
- data/spec/testapp/config/environment.rb +0 -14
- data/spec/testapp/config/environments/development.rb +0 -17
- data/spec/testapp/config/environments/production.rb +0 -28
- data/spec/testapp/config/environments/test.rb +0 -28
- data/spec/testapp/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/testapp/config/initializers/inflections.rb +0 -10
- data/spec/testapp/config/initializers/mime_types.rb +0 -5
- data/spec/testapp/config/initializers/new_rails_defaults.rb +0 -19
- data/spec/testapp/config/initializers/session_store.rb +0 -15
- data/spec/testapp/config/locales/en.yml +0 -5
- data/spec/testapp/config/routes.rb +0 -43
- data/spec/testapp/db/test.sqlite3 +0 -0
- data/spec/testapp/doc/README_FOR_APP +0 -2
- data/spec/testapp/log/development.log +0 -0
- data/spec/testapp/log/production.log +0 -0
- data/spec/testapp/log/server.log +0 -0
- data/spec/testapp/log/test.log +0 -0
- data/spec/testapp/public/404.html +0 -30
- data/spec/testapp/public/422.html +0 -30
- data/spec/testapp/public/500.html +0 -30
- data/spec/testapp/public/favicon.ico +0 -0
- data/spec/testapp/public/images/rails.png +0 -0
- data/spec/testapp/public/index.html +0 -275
- data/spec/testapp/public/javascripts/application.js +0 -2
- data/spec/testapp/public/javascripts/controls.js +0 -963
- data/spec/testapp/public/javascripts/dragdrop.js +0 -973
- data/spec/testapp/public/javascripts/effects.js +0 -1128
- data/spec/testapp/public/javascripts/prototype.js +0 -4320
- data/spec/testapp/public/robots.txt +0 -5
- data/spec/testapp/script/about +0 -4
- data/spec/testapp/script/console +0 -3
- data/spec/testapp/script/dbconsole +0 -3
- data/spec/testapp/script/destroy +0 -3
- data/spec/testapp/script/generate +0 -3
- data/spec/testapp/script/performance/benchmarker +0 -3
- data/spec/testapp/script/performance/profiler +0 -3
- data/spec/testapp/script/plugin +0 -3
- data/spec/testapp/script/runner +0 -3
- data/spec/testapp/script/server +0 -3
- data/spec/testapp/test/performance/browsing_test.rb +0 -9
- data/spec/testapp/test/test_helper.rb +0 -38
- data/tasks/amberbit_app_config_tasks.rake +0 -79
- data/uninstall.rb +0 -1
data/spec/testapp/script/about
DELETED
data/spec/testapp/script/console
DELETED
data/spec/testapp/script/destroy
DELETED
data/spec/testapp/script/plugin
DELETED
data/spec/testapp/script/runner
DELETED
data/spec/testapp/script/server
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
3
|
-
require 'test_help'
|
4
|
-
|
5
|
-
class ActiveSupport::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
|
@@ -1,79 +0,0 @@
|
|
1
|
-
namespace :amberbit do
|
2
|
-
namespace :config do
|
3
|
-
desc "Creates config/application/default.yml and config/application/config.yml files"
|
4
|
-
task :setup do
|
5
|
-
if File.directory?(File.join(RAILS_ROOT, "config", "application"))
|
6
|
-
puts 'Directory config/application already exists, skipping.'
|
7
|
-
elsif !File.exists?(File.join(RAILS_ROOT, "config", "application"))
|
8
|
-
Dir.mkdir(File.join(RAILS_ROOT, "config", "application"))
|
9
|
-
puts "Directory config/application was created."
|
10
|
-
else
|
11
|
-
puts "AmberBit Config requires config/application to be a directory and it appears to be a regular file!"
|
12
|
-
puts "Cannot continue, stopping!"
|
13
|
-
exit -1
|
14
|
-
end
|
15
|
-
|
16
|
-
default_contents = {}
|
17
|
-
default_contents['default'] = <<BEGIN
|
18
|
-
# Store your application configuration defaults here. This file should be under
|
19
|
-
# version control. In case you need installation specific settings please copy
|
20
|
-
# config.template.yml to config.yml and ignore the latter with your version
|
21
|
-
# control system.
|
22
|
-
#
|
23
|
-
# Usage
|
24
|
-
# ------
|
25
|
-
#
|
26
|
-
# in this file:
|
27
|
-
# default:
|
28
|
-
# application_name: My Super App
|
29
|
-
#
|
30
|
-
# development:
|
31
|
-
# title_prefix: Development Mode
|
32
|
-
#
|
33
|
-
# in your code:
|
34
|
-
# This is <%= AppConfig['application_name'] %>
|
35
|
-
#
|
36
|
-
# or
|
37
|
-
#
|
38
|
-
# This is <%= AppConfig.application_name %>
|
39
|
-
#
|
40
|
-
default:
|
41
|
-
|
42
|
-
development:
|
43
|
-
|
44
|
-
test:
|
45
|
-
|
46
|
-
staging:
|
47
|
-
|
48
|
-
production:
|
49
|
-
|
50
|
-
BEGIN
|
51
|
-
|
52
|
-
default_contents['config.template'] = <<BEGIN
|
53
|
-
# See default.yml for usage.
|
54
|
-
default:
|
55
|
-
|
56
|
-
development:
|
57
|
-
|
58
|
-
test:
|
59
|
-
|
60
|
-
staging:
|
61
|
-
|
62
|
-
production:
|
63
|
-
|
64
|
-
BEGIN
|
65
|
-
|
66
|
-
|
67
|
-
%w(default config.template).each do |fn|
|
68
|
-
if File.exists?(File.join(RAILS_ROOT, "config", "application", "#{fn}.yml"))
|
69
|
-
puts "File config/application/#{fn}.yml already exists, skipping."
|
70
|
-
else
|
71
|
-
f = File.new(File.join(RAILS_ROOT, "config", "application", "#{fn}.yml"), "w+")
|
72
|
-
f.write(default_contents[fn])
|
73
|
-
f.close
|
74
|
-
puts "File config/application/#{fn}.yml was created."
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|