configvars_rails 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/Gemfile.lock +31 -31
- data/README.rdoc +1 -1
- data/Rakefile +1 -4
- data/VERSION +1 -1
- data/configvars_rails.gemspec +12 -33
- data/lib/configvars_rails/generators/all_generator.rb +4 -4
- data/lib/configvars_rails/model.rb +2 -2
- metadata +33 -79
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,43 +2,43 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
abstract (1.0.0)
|
5
|
-
actionmailer (3.0.
|
6
|
-
actionpack (= 3.0.
|
5
|
+
actionmailer (3.0.7)
|
6
|
+
actionpack (= 3.0.7)
|
7
7
|
mail (~> 2.2.15)
|
8
|
-
actionpack (3.0.
|
9
|
-
activemodel (= 3.0.
|
10
|
-
activesupport (= 3.0.
|
8
|
+
actionpack (3.0.7)
|
9
|
+
activemodel (= 3.0.7)
|
10
|
+
activesupport (= 3.0.7)
|
11
11
|
builder (~> 2.1.2)
|
12
12
|
erubis (~> 2.6.6)
|
13
|
-
i18n (~> 0.
|
13
|
+
i18n (~> 0.5.0)
|
14
14
|
rack (~> 1.2.1)
|
15
|
-
rack-mount (~> 0.6.
|
15
|
+
rack-mount (~> 0.6.14)
|
16
16
|
rack-test (~> 0.5.7)
|
17
17
|
tzinfo (~> 0.3.23)
|
18
|
-
activemodel (3.0.
|
19
|
-
activesupport (= 3.0.
|
18
|
+
activemodel (3.0.7)
|
19
|
+
activesupport (= 3.0.7)
|
20
20
|
builder (~> 2.1.2)
|
21
|
-
i18n (~> 0.
|
22
|
-
activerecord (3.0.
|
23
|
-
activemodel (= 3.0.
|
24
|
-
activesupport (= 3.0.
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.7)
|
23
|
+
activemodel (= 3.0.7)
|
24
|
+
activesupport (= 3.0.7)
|
25
25
|
arel (~> 2.0.2)
|
26
26
|
tzinfo (~> 0.3.23)
|
27
|
-
activeresource (3.0.
|
28
|
-
activemodel (= 3.0.
|
29
|
-
activesupport (= 3.0.
|
30
|
-
activesupport (3.0.
|
27
|
+
activeresource (3.0.7)
|
28
|
+
activemodel (= 3.0.7)
|
29
|
+
activesupport (= 3.0.7)
|
30
|
+
activesupport (3.0.7)
|
31
31
|
arel (2.0.9)
|
32
32
|
builder (2.1.2)
|
33
33
|
erubis (2.6.6)
|
34
34
|
abstract (>= 1.0.0)
|
35
35
|
git (1.2.5)
|
36
36
|
i18n (0.5.0)
|
37
|
-
jeweler (1.
|
37
|
+
jeweler (1.6.0)
|
38
38
|
bundler (~> 1.0.0)
|
39
39
|
git (>= 1.2.5)
|
40
40
|
rake
|
41
|
-
mail (2.2.
|
41
|
+
mail (2.2.19)
|
42
42
|
activesupport (>= 2.3.6)
|
43
43
|
i18n (>= 0.4.0)
|
44
44
|
mime-types (~> 1.16)
|
@@ -50,17 +50,17 @@ GEM
|
|
50
50
|
rack (>= 1.0.0)
|
51
51
|
rack-test (0.5.7)
|
52
52
|
rack (>= 1.0)
|
53
|
-
rails (3.0.
|
54
|
-
actionmailer (= 3.0.
|
55
|
-
actionpack (= 3.0.
|
56
|
-
activerecord (= 3.0.
|
57
|
-
activeresource (= 3.0.
|
58
|
-
activesupport (= 3.0.
|
53
|
+
rails (3.0.7)
|
54
|
+
actionmailer (= 3.0.7)
|
55
|
+
actionpack (= 3.0.7)
|
56
|
+
activerecord (= 3.0.7)
|
57
|
+
activeresource (= 3.0.7)
|
58
|
+
activesupport (= 3.0.7)
|
59
59
|
bundler (~> 1.0)
|
60
|
-
railties (= 3.0.
|
61
|
-
railties (3.0.
|
62
|
-
actionpack (= 3.0.
|
63
|
-
activesupport (= 3.0.
|
60
|
+
railties (= 3.0.7)
|
61
|
+
railties (3.0.7)
|
62
|
+
actionpack (= 3.0.7)
|
63
|
+
activesupport (= 3.0.7)
|
64
64
|
rake (>= 0.8.7)
|
65
65
|
thor (~> 0.14.4)
|
66
66
|
rake (0.8.7)
|
@@ -69,14 +69,14 @@ GEM
|
|
69
69
|
thor (0.14.6)
|
70
70
|
treetop (1.4.9)
|
71
71
|
polyglot (>= 0.3.1)
|
72
|
-
tzinfo (0.3.
|
72
|
+
tzinfo (0.3.27)
|
73
73
|
|
74
74
|
PLATFORMS
|
75
75
|
ruby
|
76
76
|
|
77
77
|
DEPENDENCIES
|
78
78
|
bundler (~> 1.0.0)
|
79
|
-
jeweler (~> 1.
|
79
|
+
jeweler (~> 1.6.0)
|
80
80
|
rails (>= 3.0.0)
|
81
81
|
rcov
|
82
82
|
sqlite3 (>= 1.3.3)
|
data/README.rdoc
CHANGED
@@ -13,7 +13,7 @@ different deployments.
|
|
13
13
|
== Installation
|
14
14
|
|
15
15
|
Scaffold the model, controller, and views.
|
16
|
-
rails g
|
16
|
+
rails g configvars:all
|
17
17
|
|
18
18
|
Note: the code inside the models and controllers is tucked away in the plug-in.
|
19
19
|
The scaffold model and controller is there as an point. You will be
|
data/Rakefile
CHANGED
@@ -20,10 +20,7 @@ Jeweler::Tasks.new do |gem|
|
|
20
20
|
configuration to change without source code modifications.}
|
21
21
|
gem.email = "victor@costan.us"
|
22
22
|
gem.authors = ["Victor Costan"]
|
23
|
-
#
|
24
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
25
|
-
gem.add_runtime_dependency "rails", ">= 3.0.0"
|
26
|
-
gem.add_development_dependency "sqlite3-ruby", ">= 1.3.0"
|
23
|
+
# Dependencies in Gemfile.
|
27
24
|
end
|
28
25
|
Jeweler::RubygemsDotOrgTasks.new
|
29
26
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/configvars_rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{configvars_rails}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{Victor Costan}]
|
12
|
+
s.date = %q{2011-05-15}
|
13
13
|
s.description = %q{This gem provides a model and simple controller for
|
14
14
|
storing global application configuration in a database. This allows the
|
15
15
|
configuration to change without source code modifications.}
|
@@ -61,54 +61,33 @@ Gem::Specification.new do |s|
|
|
61
61
|
"test/test_helper.rb"
|
62
62
|
]
|
63
63
|
s.homepage = %q{http://github.com/pwnall/configvars_rails}
|
64
|
-
s.licenses = [
|
65
|
-
s.require_paths = [
|
66
|
-
s.rubygems_version = %q{1.
|
64
|
+
s.licenses = [%q{MIT}]
|
65
|
+
s.require_paths = [%q{lib}]
|
66
|
+
s.rubygems_version = %q{1.8.2}
|
67
67
|
s.summary = %q{Global configuration variables for Rails 3 applications.}
|
68
|
-
s.test_files = [
|
69
|
-
"test/config_var_test.rb",
|
70
|
-
"test/config_vars_auth_api_test.rb",
|
71
|
-
"test/config_vars_controller_api_test.rb",
|
72
|
-
"test/descriptor_test.rb",
|
73
|
-
"test/helpers/application_controller.rb",
|
74
|
-
"test/helpers/auth_test_controller.rb",
|
75
|
-
"test/helpers/db_setup.rb",
|
76
|
-
"test/helpers/initializers.rb",
|
77
|
-
"test/helpers/rails.rb",
|
78
|
-
"test/helpers/routes.rb",
|
79
|
-
"test/helpers/view_helpers.rb",
|
80
|
-
"test/routes_test.rb",
|
81
|
-
"test/test_helper.rb"
|
82
|
-
]
|
83
68
|
|
84
69
|
if s.respond_to? :specification_version then
|
85
70
|
s.specification_version = 3
|
86
71
|
|
87
72
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
88
73
|
s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
|
89
|
-
s.add_runtime_dependency(%q<sqlite3>, [">= 1.3.3"])
|
90
74
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
91
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.
|
75
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
|
92
76
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
93
|
-
s.
|
94
|
-
s.add_development_dependency(%q<sqlite3-ruby>, [">= 1.3.0"])
|
77
|
+
s.add_development_dependency(%q<sqlite3>, [">= 1.3.3"])
|
95
78
|
else
|
96
79
|
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
97
|
-
s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
|
98
80
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
99
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
81
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
100
82
|
s.add_dependency(%q<rcov>, [">= 0"])
|
101
|
-
s.add_dependency(%q<
|
102
|
-
s.add_dependency(%q<sqlite3-ruby>, [">= 1.3.0"])
|
83
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
|
103
84
|
end
|
104
85
|
else
|
105
86
|
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
106
|
-
s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
|
107
87
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
108
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
88
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
109
89
|
s.add_dependency(%q<rcov>, [">= 0"])
|
110
|
-
s.add_dependency(%q<
|
111
|
-
s.add_dependency(%q<sqlite3-ruby>, [">= 1.3.0"])
|
90
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
|
112
91
|
end
|
113
92
|
end
|
114
93
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'rails'
|
2
2
|
|
3
3
|
# :nodoc: namespace
|
4
|
-
module
|
4
|
+
module Configvars
|
5
5
|
|
6
6
|
|
7
|
-
#
|
7
|
+
# rails g configvars:all
|
8
8
|
class AllGenerator < Rails::Generators::Base
|
9
9
|
source_root File.expand_path("../templates", __FILE__)
|
10
10
|
|
@@ -32,6 +32,6 @@ class AllGenerator < Rails::Generators::Base
|
|
32
32
|
File.join('config', 'initializers', 'config_vars.rb')
|
33
33
|
|
34
34
|
end
|
35
|
-
end # class
|
35
|
+
end # class Configvars::ConfigVarsGenerator
|
36
36
|
|
37
|
-
end # namespace
|
37
|
+
end # namespace Configvars
|
@@ -23,7 +23,7 @@ module ModelClassMethods
|
|
23
23
|
validates :name, :uniqueness => true, :length => 1..64, :presence => true
|
24
24
|
|
25
25
|
# The value of the configuration variable.
|
26
|
-
validates :value, :length =>
|
26
|
+
validates :value, :length => 0..1024, :exclusion => { :in => [nil] }
|
27
27
|
|
28
28
|
extend ModelMetaclassMethods
|
29
29
|
include ModelInstanceMethods
|
@@ -31,7 +31,7 @@ module ModelClassMethods
|
|
31
31
|
end # module ConfigvarsRails::Model::ModelClassMethods
|
32
32
|
|
33
33
|
|
34
|
-
# Included in the metaclass of models that call
|
34
|
+
# Included in the metaclass of models that call config_vars_model.
|
35
35
|
module ModelMetaclassMethods
|
36
36
|
# Access configuration flags by ConfigVar['flag_name'].
|
37
37
|
def [](name)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configvars_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Costan
|
@@ -15,12 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-05-15 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
22
|
none: false
|
25
23
|
requirements:
|
26
24
|
- - ">="
|
@@ -31,28 +29,12 @@ dependencies:
|
|
31
29
|
- 0
|
32
30
|
- 0
|
33
31
|
version: 3.0.0
|
34
|
-
version_requirements: *id001
|
35
|
-
name: rails
|
36
|
-
prerelease: false
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
32
|
type: :runtime
|
39
|
-
requirement:
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 29
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 3
|
48
|
-
- 3
|
49
|
-
version: 1.3.3
|
50
|
-
version_requirements: *id002
|
51
|
-
name: sqlite3
|
33
|
+
requirement: *id001
|
52
34
|
prerelease: false
|
35
|
+
name: rails
|
53
36
|
- !ruby/object:Gem::Dependency
|
54
|
-
|
55
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
56
38
|
none: false
|
57
39
|
requirements:
|
58
40
|
- - ~>
|
@@ -63,28 +45,28 @@ dependencies:
|
|
63
45
|
- 0
|
64
46
|
- 0
|
65
47
|
version: 1.0.0
|
66
|
-
|
67
|
-
|
48
|
+
type: :development
|
49
|
+
requirement: *id002
|
68
50
|
prerelease: false
|
51
|
+
name: bundler
|
69
52
|
- !ruby/object:Gem::Dependency
|
70
|
-
|
71
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
72
54
|
none: false
|
73
55
|
requirements:
|
74
56
|
- - ~>
|
75
57
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
58
|
+
hash: 15
|
77
59
|
segments:
|
78
60
|
- 1
|
79
|
-
-
|
80
|
-
-
|
81
|
-
version: 1.
|
82
|
-
|
83
|
-
|
61
|
+
- 6
|
62
|
+
- 0
|
63
|
+
version: 1.6.0
|
64
|
+
type: :development
|
65
|
+
requirement: *id003
|
84
66
|
prerelease: false
|
67
|
+
name: jeweler
|
85
68
|
- !ruby/object:Gem::Dependency
|
86
|
-
|
87
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
88
70
|
none: false
|
89
71
|
requirements:
|
90
72
|
- - ">="
|
@@ -93,41 +75,26 @@ dependencies:
|
|
93
75
|
segments:
|
94
76
|
- 0
|
95
77
|
version: "0"
|
96
|
-
|
97
|
-
|
98
|
-
prerelease: false
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
type: :runtime
|
101
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
|
-
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
hash: 7
|
107
|
-
segments:
|
108
|
-
- 3
|
109
|
-
- 0
|
110
|
-
- 0
|
111
|
-
version: 3.0.0
|
112
|
-
version_requirements: *id006
|
113
|
-
name: rails
|
78
|
+
type: :development
|
79
|
+
requirement: *id004
|
114
80
|
prerelease: false
|
81
|
+
name: rcov
|
115
82
|
- !ruby/object:Gem::Dependency
|
116
|
-
|
117
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
83
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
118
84
|
none: false
|
119
85
|
requirements:
|
120
86
|
- - ">="
|
121
87
|
- !ruby/object:Gem::Version
|
122
|
-
hash:
|
88
|
+
hash: 29
|
123
89
|
segments:
|
124
90
|
- 1
|
125
91
|
- 3
|
126
|
-
-
|
127
|
-
version: 1.3.
|
128
|
-
|
129
|
-
|
92
|
+
- 3
|
93
|
+
version: 1.3.3
|
94
|
+
type: :development
|
95
|
+
requirement: *id005
|
130
96
|
prerelease: false
|
97
|
+
name: sqlite3
|
131
98
|
description: |-
|
132
99
|
This gem provides a model and simple controller for
|
133
100
|
storing global application configuration in a database. This allows the
|
@@ -181,7 +148,6 @@ files:
|
|
181
148
|
- test/helpers/views/layouts/application.html.erb
|
182
149
|
- test/routes_test.rb
|
183
150
|
- test/test_helper.rb
|
184
|
-
has_rdoc: true
|
185
151
|
homepage: http://github.com/pwnall/configvars_rails
|
186
152
|
licenses:
|
187
153
|
- MIT
|
@@ -211,21 +177,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
177
|
requirements: []
|
212
178
|
|
213
179
|
rubyforge_project:
|
214
|
-
rubygems_version: 1.
|
180
|
+
rubygems_version: 1.8.2
|
215
181
|
signing_key:
|
216
182
|
specification_version: 3
|
217
183
|
summary: Global configuration variables for Rails 3 applications.
|
218
|
-
test_files:
|
219
|
-
|
220
|
-
- test/config_vars_auth_api_test.rb
|
221
|
-
- test/config_vars_controller_api_test.rb
|
222
|
-
- test/descriptor_test.rb
|
223
|
-
- test/helpers/application_controller.rb
|
224
|
-
- test/helpers/auth_test_controller.rb
|
225
|
-
- test/helpers/db_setup.rb
|
226
|
-
- test/helpers/initializers.rb
|
227
|
-
- test/helpers/rails.rb
|
228
|
-
- test/helpers/routes.rb
|
229
|
-
- test/helpers/view_helpers.rb
|
230
|
-
- test/routes_test.rb
|
231
|
-
- test/test_helper.rb
|
184
|
+
test_files: []
|
185
|
+
|