activeconfig 0.5.5

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.
@@ -0,0 +1,13 @@
1
+ #test_mode: false
2
+ secure_login: true
3
+ perform_caching: true
4
+ lazy: true
5
+
6
+ default: "yo!" # Test for #default override for .default notation
7
+
8
+ hash_1:
9
+ foo: "foo"
10
+ bar: "bar"
11
+ bok: "GB"
12
+ gb: "GB"
13
+
@@ -0,0 +1,15 @@
1
+ #test_mode: false
2
+ secure_login: true
3
+ perform_caching: true
4
+ lazy: true
5
+
6
+ default: "yo!" # Test for #default override for .default notation
7
+
8
+ hash_1:
9
+ foo: "foo"
10
+ bar: "bar"
11
+ bok: "US"
12
+ gb: ~
13
+
14
+
15
+
File without changes
@@ -0,0 +1,9 @@
1
+ test_mode: true
2
+
3
+
4
+ hash_1:
5
+ foo: "foo"
6
+ bar: "baz"
7
+ zzz: "zzz"
8
+
9
+
@@ -0,0 +1 @@
1
+ secure_login: false
@@ -0,0 +1,14 @@
1
+ #test_mode: false
2
+ secure_login: true
3
+ perform_caching: true
4
+ lazy: true
5
+
6
+ default: "yo!" # Test for #default override for .default notation
7
+
8
+ hash_1:
9
+ foo: "foo"
10
+ bar: "bar"
11
+ bok: "bok"
12
+
13
+
14
+ array_1: [ a, b, c, d ]
@@ -0,0 +1,14 @@
1
+ #test_mode: false
2
+ secure_login: true
3
+ perform_caching: true
4
+ lazy: true
5
+
6
+ default: "yo!" # Test for #default override for .default notation
7
+
8
+ hash_1:
9
+ foo: "foo"
10
+ bar: "bar"
11
+ bok: "bok"
12
+
13
+
14
+ array_1: [ a, b, c, d ]
@@ -0,0 +1,2 @@
1
+ default: "WIN" # Test for #default override for .default notation
2
+
@@ -0,0 +1,14 @@
1
+ #test_mode: false
2
+ secure_login: true
3
+ perform_caching: true
4
+ lazy: true
5
+
6
+ default: "yo!" # Test for #default override for .default notation
7
+
8
+ hash_1:
9
+ foo: "foo"
10
+ bar: "bar"
11
+ bok: "bok"
12
+
13
+
14
+ array_1: [ a, b, c, d ]
@@ -0,0 +1,2 @@
1
+ default: "WIN" # Test for #default override for .default notation
2
+
data/test/env_test.rb ADDED
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.expand_path("../../lib",__FILE__)
3
+
4
+ # TEST_CONFIG_BEGIN
5
+ # enabled: true
6
+ # TEST_CONFIG_END
7
+
8
+ # Test target dependencies
9
+
10
+ # Configure ActiveConfig to use our test config files.
11
+ ENV['RAILS_ENV']='development'
12
+
13
+ ENV['ACTIVE_CONFIG_PATH'] = File.expand_path(File.dirname(__FILE__) + "/active_config_test/")
14
+
15
+ # Test environment.
16
+ require 'rubygems'
17
+
18
+ # Test target
19
+ require 'active_config'
20
+
21
+ # Test dependencies
22
+ require 'test/unit'
23
+ require 'fileutils' # FileUtils.touch
24
+ require 'benchmark'
25
+
26
+ AC=ActiveConfig.new
27
+ AC.test.secure_login
28
+ ENV['RAILS_ENV']='production'
29
+ RAILS_ENV = ENV['RAILS_ENV']
30
+
31
+
32
+ class ActiveConfig::Test < Test::Unit::TestCase
33
+ def active_config
34
+ @active_config||= ActiveConfig.new :suffixes =>[
35
+ nil,
36
+ [:overlay, nil],
37
+ [:local],
38
+ [:overlay, [:local]],
39
+ :config,
40
+ [:overlay, :config],
41
+ :local_config,
42
+ [:overlay, :local_config],
43
+ :hostname,
44
+ [:overlay, :hostname],
45
+ [:hostname, :config_local],
46
+ [:overlay, [:hostname, :config_local]]
47
+ ]
48
+ end
49
+ def setup
50
+ super
51
+ begin
52
+ active_config._verbose = nil # default
53
+ active_config.reload(true)
54
+ active_config._reload_disabled = nil # default
55
+ active_config._reload_delay = nil # default
56
+ rescue => err
57
+ # NOTHING
58
+ end
59
+ end
60
+
61
+
62
+ def teardown
63
+ super
64
+ end
65
+
66
+
67
+ def test_cache_clearing
68
+ assert_equal true, AC.test.secure_login
69
+ AC._suffixes.rails_env=proc { |sym_table|return (RAILS_ENV if defined?(RAILS_ENV))||ENV['RAILS_ENV']}
70
+ assert_equal false, AC.test.secure_login
71
+ end
72
+
73
+
74
+ end # class
75
+
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeconfig
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.5
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jeremy Lawler
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rdoc
16
+ requirement: &5967980 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.12'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *5967980
25
+ - !ruby/object:Gem::Dependency
26
+ name: bundler
27
+ requirement: &5966480 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>'
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *5966480
36
+ - !ruby/object:Gem::Dependency
37
+ name: jeweler
38
+ requirement: &5964120 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 1.8.3
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *5964120
47
+ description: ! 'An extremely flexible configuration system.
48
+
49
+ s the ability for certain values to be "overridden" when conditions are met.
50
+
51
+ r example, you could have your production API keys only get read when the Rails.env
52
+ == "production"'
53
+ email: jeremylawler@gmail.com
54
+ executables:
55
+ - active_config
56
+ extensions: []
57
+ extra_rdoc_files: []
58
+ files:
59
+ - Gemfile
60
+ - Rakefile
61
+ - VERSION.yml
62
+ - activeconfig.gemspec
63
+ - bin/active_config
64
+ - lib/active_config.rb
65
+ - lib/active_config/hash_config.rb
66
+ - lib/active_config/hash_weave.rb
67
+ - lib/active_config/suffixes.rb
68
+ - pkg/activeconfig-0.1.4.gem
69
+ - pkg/activeconfig-0.2.0.gem
70
+ - pkg/activeconfig-0.3.0.gem
71
+ - pkg/activeconfig-0.4.0.gem
72
+ - pkg/activeconfig-0.4.1.gem
73
+ - pkg/activeconfig-0.5.0.gem
74
+ - pkg/activeconfig-0.5.1.gem
75
+ - test/active_config_collision_test.rb
76
+ - test/active_config_multi_test.rb
77
+ - test/active_config_test.rb
78
+ - test/active_config_test/global.yml
79
+ - test/active_config_test/test.yml
80
+ - test/active_config_test/test_GB.yml
81
+ - test/active_config_test/test_US.yml
82
+ - test/active_config_test/test_config.yml
83
+ - test/active_config_test/test_local.yml
84
+ - test/active_config_test/test_production.yml
85
+ - test/active_config_test_collision/patha/test.yml
86
+ - test/active_config_test_collision/pathb/test.yml
87
+ - test/active_config_test_collision/pathb/test_local.yml
88
+ - test/active_config_test_multi/patha/test.yml
89
+ - test/active_config_test_multi/pathb/test_local.yml
90
+ - test/env_test.rb
91
+ homepage: http://jlawler.github.com/activeconfig/
92
+ licenses: []
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ segments:
104
+ - 0
105
+ hash: 4164159844809069344
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 1.8.11
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: An extremely flexible configuration system
118
+ test_files: []