amberbit-config 1.0.1
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/MIT-LICENSE +20 -0
- data/README +59 -0
- data/Rakefile +36 -0
- data/VERSION +1 -0
- data/amberbit-config.gemspec +120 -0
- data/init.rb +2 -0
- data/install.rb +1 -0
- data/lib/amber_bit_app_config.rb +74 -0
- data/lib/amberbit-config.rb +3 -0
- data/lib/hash_struct.rb +9 -0
- data/spec/library_spec.rb +20 -0
- data/spec/plugin_spec.rb +31 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/testapp/README +243 -0
- data/spec/testapp/Rakefile +11 -0
- data/spec/testapp/app/controllers/application_controller.rb +10 -0
- data/spec/testapp/app/helpers/application_helper.rb +3 -0
- data/spec/testapp/config/application/config.yml +8 -0
- data/spec/testapp/config/application/default.yml +6 -0
- data/spec/testapp/config/boot.rb +110 -0
- data/spec/testapp/config/environment.rb +14 -0
- data/spec/testapp/config/environments/development.rb +17 -0
- data/spec/testapp/config/environments/production.rb +28 -0
- data/spec/testapp/config/environments/test.rb +28 -0
- data/spec/testapp/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/testapp/config/initializers/inflections.rb +10 -0
- data/spec/testapp/config/initializers/mime_types.rb +5 -0
- data/spec/testapp/config/initializers/new_rails_defaults.rb +19 -0
- data/spec/testapp/config/initializers/session_store.rb +15 -0
- data/spec/testapp/config/locales/en.yml +5 -0
- data/spec/testapp/config/routes.rb +43 -0
- data/spec/testapp/db/test.sqlite3 +0 -0
- data/spec/testapp/doc/README_FOR_APP +2 -0
- 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 +30 -0
- data/spec/testapp/public/422.html +30 -0
- data/spec/testapp/public/500.html +30 -0
- data/spec/testapp/public/favicon.ico +0 -0
- data/spec/testapp/public/images/rails.png +0 -0
- data/spec/testapp/public/index.html +275 -0
- data/spec/testapp/public/javascripts/application.js +2 -0
- data/spec/testapp/public/javascripts/controls.js +963 -0
- data/spec/testapp/public/javascripts/dragdrop.js +973 -0
- data/spec/testapp/public/javascripts/effects.js +1128 -0
- data/spec/testapp/public/javascripts/prototype.js +4320 -0
- data/spec/testapp/public/robots.txt +5 -0
- data/spec/testapp/script/about +4 -0
- data/spec/testapp/script/console +3 -0
- data/spec/testapp/script/dbconsole +3 -0
- data/spec/testapp/script/destroy +3 -0
- data/spec/testapp/script/generate +3 -0
- data/spec/testapp/script/performance/benchmarker +3 -0
- data/spec/testapp/script/performance/profiler +3 -0
- data/spec/testapp/script/plugin +3 -0
- data/spec/testapp/script/runner +3 -0
- data/spec/testapp/script/server +3 -0
- data/spec/testapp/test/performance/browsing_test.rb +9 -0
- data/spec/testapp/test/test_helper.rb +38 -0
- data/tasks/amberbit_app_config_tasks.rake +79 -0
- data/uninstall.rb +1 -0
- metadata +148 -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 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
|
@@ -0,0 +1,79 @@
|
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Uninstall hook code here
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: amberbit-config
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Wojciech Piekutowski
|
14
|
+
- Hubert Lepicki
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-08-22 00:00:00 +02:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description: Reads YAML files with configuration. Allows you to specify default configuration file you can store in repository and overwrite it with custom configuration file for each application instance and environment.
|
24
|
+
email: hubert.lepicki@amberbit.com
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files:
|
30
|
+
- README
|
31
|
+
files:
|
32
|
+
- MIT-LICENSE
|
33
|
+
- README
|
34
|
+
- Rakefile
|
35
|
+
- VERSION
|
36
|
+
- amberbit-config.gemspec
|
37
|
+
- init.rb
|
38
|
+
- install.rb
|
39
|
+
- lib/amber_bit_app_config.rb
|
40
|
+
- lib/amberbit-config.rb
|
41
|
+
- lib/hash_struct.rb
|
42
|
+
- spec/library_spec.rb
|
43
|
+
- spec/plugin_spec.rb
|
44
|
+
- spec/spec.opts
|
45
|
+
- spec/spec_helper.rb
|
46
|
+
- spec/testapp/README
|
47
|
+
- spec/testapp/Rakefile
|
48
|
+
- spec/testapp/app/controllers/application_controller.rb
|
49
|
+
- spec/testapp/app/helpers/application_helper.rb
|
50
|
+
- spec/testapp/config/application/config.yml
|
51
|
+
- spec/testapp/config/application/default.yml
|
52
|
+
- spec/testapp/config/boot.rb
|
53
|
+
- spec/testapp/config/environment.rb
|
54
|
+
- spec/testapp/config/environments/development.rb
|
55
|
+
- spec/testapp/config/environments/production.rb
|
56
|
+
- spec/testapp/config/environments/test.rb
|
57
|
+
- spec/testapp/config/initializers/backtrace_silencers.rb
|
58
|
+
- spec/testapp/config/initializers/inflections.rb
|
59
|
+
- spec/testapp/config/initializers/mime_types.rb
|
60
|
+
- spec/testapp/config/initializers/new_rails_defaults.rb
|
61
|
+
- spec/testapp/config/initializers/session_store.rb
|
62
|
+
- spec/testapp/config/locales/en.yml
|
63
|
+
- spec/testapp/config/routes.rb
|
64
|
+
- spec/testapp/db/test.sqlite3
|
65
|
+
- spec/testapp/doc/README_FOR_APP
|
66
|
+
- spec/testapp/log/development.log
|
67
|
+
- spec/testapp/log/production.log
|
68
|
+
- spec/testapp/log/server.log
|
69
|
+
- spec/testapp/log/test.log
|
70
|
+
- spec/testapp/public/404.html
|
71
|
+
- spec/testapp/public/422.html
|
72
|
+
- spec/testapp/public/500.html
|
73
|
+
- spec/testapp/public/favicon.ico
|
74
|
+
- spec/testapp/public/images/rails.png
|
75
|
+
- spec/testapp/public/index.html
|
76
|
+
- spec/testapp/public/javascripts/application.js
|
77
|
+
- spec/testapp/public/javascripts/controls.js
|
78
|
+
- spec/testapp/public/javascripts/dragdrop.js
|
79
|
+
- spec/testapp/public/javascripts/effects.js
|
80
|
+
- spec/testapp/public/javascripts/prototype.js
|
81
|
+
- spec/testapp/public/robots.txt
|
82
|
+
- spec/testapp/script/about
|
83
|
+
- spec/testapp/script/console
|
84
|
+
- spec/testapp/script/dbconsole
|
85
|
+
- spec/testapp/script/destroy
|
86
|
+
- spec/testapp/script/generate
|
87
|
+
- spec/testapp/script/performance/benchmarker
|
88
|
+
- spec/testapp/script/performance/profiler
|
89
|
+
- spec/testapp/script/plugin
|
90
|
+
- spec/testapp/script/runner
|
91
|
+
- spec/testapp/script/server
|
92
|
+
- spec/testapp/test/performance/browsing_test.rb
|
93
|
+
- spec/testapp/test/test_helper.rb
|
94
|
+
- tasks/amberbit_app_config_tasks.rake
|
95
|
+
- uninstall.rb
|
96
|
+
has_rdoc: true
|
97
|
+
homepage: http://github.com/amberbit/amberbit-config
|
98
|
+
licenses: []
|
99
|
+
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options:
|
102
|
+
- --charset=UTF-8
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
version: "0"
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
requirements: []
|
124
|
+
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 1.3.7
|
127
|
+
signing_key:
|
128
|
+
specification_version: 3
|
129
|
+
summary: Yet Another AppConfig for Rails but not only
|
130
|
+
test_files:
|
131
|
+
- spec/testapp/config/boot.rb
|
132
|
+
- spec/testapp/config/environment.rb
|
133
|
+
- spec/testapp/config/environments/development.rb
|
134
|
+
- spec/testapp/config/environments/production.rb
|
135
|
+
- spec/testapp/config/environments/test.rb
|
136
|
+
- spec/testapp/config/initializers/backtrace_silencers.rb
|
137
|
+
- spec/testapp/config/initializers/mime_types.rb
|
138
|
+
- spec/testapp/config/initializers/new_rails_defaults.rb
|
139
|
+
- spec/testapp/config/initializers/session_store.rb
|
140
|
+
- spec/testapp/config/initializers/inflections.rb
|
141
|
+
- spec/testapp/config/routes.rb
|
142
|
+
- spec/testapp/test/test_helper.rb
|
143
|
+
- spec/testapp/test/performance/browsing_test.rb
|
144
|
+
- spec/testapp/app/controllers/application_controller.rb
|
145
|
+
- spec/testapp/app/helpers/application_helper.rb
|
146
|
+
- spec/library_spec.rb
|
147
|
+
- spec/plugin_spec.rb
|
148
|
+
- spec/spec_helper.rb
|