configvars_rails 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source "http://rubygems.org"
2
- gem "rails", ">= 3.1.0.rc4"
2
+ gem "rails", ">= 3.2.0.rc2"
3
3
 
4
4
  group :development do
5
5
  gem "bundler", "~> 1.0.0"
6
6
  gem "jeweler", "~> 1.6.0"
7
7
  gem "rcov", ">= 0"
8
- gem "sqlite3", ">= 1.3.3"
8
+ gem "sqlite3", ">= 1.3.5"
9
9
  end
data/Gemfile.lock CHANGED
@@ -1,91 +1,89 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (3.1.0.rc4)
5
- actionpack (= 3.1.0.rc4)
4
+ actionmailer (3.2.0.rc2)
5
+ actionpack (= 3.2.0.rc2)
6
6
  mail (~> 2.3.0)
7
- actionpack (3.1.0.rc4)
8
- activemodel (= 3.1.0.rc4)
9
- activesupport (= 3.1.0.rc4)
7
+ actionpack (3.2.0.rc2)
8
+ activemodel (= 3.2.0.rc2)
9
+ activesupport (= 3.2.0.rc2)
10
10
  builder (~> 3.0.0)
11
11
  erubis (~> 2.7.0)
12
- i18n (~> 0.6)
13
- rack (~> 1.3.0)
14
- rack-cache (~> 1.0.1)
15
- rack-mount (~> 0.8.1)
16
- rack-test (~> 0.6.0)
17
- sprockets (~> 2.0.0.beta.10)
18
- tzinfo (~> 0.3.27)
19
- activemodel (3.1.0.rc4)
20
- activesupport (= 3.1.0.rc4)
21
- bcrypt-ruby (~> 2.1.4)
12
+ journey (~> 1.0.0.rc1)
13
+ rack (~> 1.4.0)
14
+ rack-cache (~> 1.1)
15
+ rack-test (~> 0.6.1)
16
+ sprockets (~> 2.1.2)
17
+ activemodel (3.2.0.rc2)
18
+ activesupport (= 3.2.0.rc2)
22
19
  builder (~> 3.0.0)
20
+ activerecord (3.2.0.rc2)
21
+ activemodel (= 3.2.0.rc2)
22
+ activesupport (= 3.2.0.rc2)
23
+ arel (~> 3.0.0.rc1)
24
+ tzinfo (~> 0.3.29)
25
+ activeresource (3.2.0.rc2)
26
+ activemodel (= 3.2.0.rc2)
27
+ activesupport (= 3.2.0.rc2)
28
+ activesupport (3.2.0.rc2)
23
29
  i18n (~> 0.6)
24
- activerecord (3.1.0.rc4)
25
- activemodel (= 3.1.0.rc4)
26
- activesupport (= 3.1.0.rc4)
27
- arel (~> 2.1.1)
28
- tzinfo (~> 0.3.27)
29
- activeresource (3.1.0.rc4)
30
- activemodel (= 3.1.0.rc4)
31
- activesupport (= 3.1.0.rc4)
32
- activesupport (3.1.0.rc4)
33
30
  multi_json (~> 1.0)
34
- arel (2.1.3)
35
- bcrypt-ruby (2.1.4)
31
+ arel (3.0.0.rc1)
36
32
  builder (3.0.0)
37
33
  erubis (2.7.0)
38
34
  git (1.2.5)
39
- hike (1.1.0)
35
+ hike (1.2.1)
40
36
  i18n (0.6.0)
41
- jeweler (1.6.2)
37
+ jeweler (1.6.4)
42
38
  bundler (~> 1.0)
43
39
  git (>= 1.2.5)
44
40
  rake
41
+ journey (1.0.0.rc4)
42
+ json (1.6.4)
45
43
  mail (2.3.0)
46
44
  i18n (>= 0.4.0)
47
45
  mime-types (~> 1.16)
48
46
  treetop (~> 1.4.8)
49
- mime-types (1.16)
50
- multi_json (1.0.3)
51
- polyglot (0.3.1)
52
- rack (1.3.0)
53
- rack-cache (1.0.2)
47
+ mime-types (1.17.2)
48
+ multi_json (1.0.4)
49
+ polyglot (0.3.3)
50
+ rack (1.4.0)
51
+ rack-cache (1.1)
54
52
  rack (>= 0.4)
55
- rack-mount (0.8.1)
56
- rack (>= 1.0.0)
57
53
  rack-ssl (1.3.2)
58
54
  rack
59
- rack-test (0.6.0)
55
+ rack-test (0.6.1)
60
56
  rack (>= 1.0)
61
- rails (3.1.0.rc4)
62
- actionmailer (= 3.1.0.rc4)
63
- actionpack (= 3.1.0.rc4)
64
- activerecord (= 3.1.0.rc4)
65
- activeresource (= 3.1.0.rc4)
66
- activesupport (= 3.1.0.rc4)
57
+ rails (3.2.0.rc2)
58
+ actionmailer (= 3.2.0.rc2)
59
+ actionpack (= 3.2.0.rc2)
60
+ activerecord (= 3.2.0.rc2)
61
+ activeresource (= 3.2.0.rc2)
62
+ activesupport (= 3.2.0.rc2)
67
63
  bundler (~> 1.0)
68
- railties (= 3.1.0.rc4)
69
- railties (3.1.0.rc4)
70
- actionpack (= 3.1.0.rc4)
71
- activesupport (= 3.1.0.rc4)
64
+ railties (= 3.2.0.rc2)
65
+ railties (3.2.0.rc2)
66
+ actionpack (= 3.2.0.rc2)
67
+ activesupport (= 3.2.0.rc2)
72
68
  rack-ssl (~> 1.3.2)
73
69
  rake (>= 0.8.7)
74
70
  rdoc (~> 3.4)
75
71
  thor (~> 0.14.6)
76
- rake (0.9.2)
77
- rcov (0.9.9)
78
- rdoc (3.8)
79
- sprockets (2.0.0.beta.10)
80
- hike (~> 1.0)
72
+ rake (0.9.2.2)
73
+ rcov (0.9.11)
74
+ rdoc (3.12)
75
+ json (~> 1.4)
76
+ sprockets (2.1.2)
77
+ hike (~> 1.2)
81
78
  rack (~> 1.0)
82
- tilt (!= 1.3.0, ~> 1.1)
83
- sqlite3 (1.3.3)
79
+ tilt (~> 1.1, != 1.3.0)
80
+ sqlite3 (1.3.5)
84
81
  thor (0.14.6)
85
- tilt (1.3.2)
86
- treetop (1.4.9)
82
+ tilt (1.3.3)
83
+ treetop (1.4.10)
84
+ polyglot
87
85
  polyglot (>= 0.3.1)
88
- tzinfo (0.3.29)
86
+ tzinfo (0.3.31)
89
87
 
90
88
  PLATFORMS
91
89
  ruby
@@ -93,6 +91,6 @@ PLATFORMS
93
91
  DEPENDENCIES
94
92
  bundler (~> 1.0.0)
95
93
  jeweler (~> 1.6.0)
96
- rails (>= 3.1.0.rc4)
94
+ rails (>= 3.2.0.rc2)
97
95
  rcov
98
- sqlite3 (>= 1.3.3)
96
+ sqlite3 (>= 1.3.5)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
@@ -4,16 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{configvars_rails}
8
- s.version = "0.5.1"
7
+ s.name = "configvars_rails"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Victor Costan}]
12
- s.date = %q{2011-07-19}
13
- s.description = %q{This gem provides a model and simple controller for
14
- storing global application configuration in a database. This allows the
15
- configuration to change without source code modifications.}
16
- s.email = %q{victor@costan.us}
11
+ s.authors = ["Victor Costan"]
12
+ s.date = "2012-01-07"
13
+ s.description = "This gem provides a model and simple controller for\n storing global application configuration in a database. This allows the\n configuration to change without source code modifications."
14
+ s.email = "victor@costan.us"
17
15
  s.extra_rdoc_files = [
18
16
  "LICENSE",
19
17
  "README.rdoc"
@@ -61,34 +59,34 @@ Gem::Specification.new do |s|
61
59
  "test/routes_test.rb",
62
60
  "test/test_helper.rb"
63
61
  ]
64
- s.homepage = %q{http://github.com/pwnall/configvars_rails}
65
- s.licenses = [%q{MIT}]
66
- s.require_paths = [%q{lib}]
67
- s.rubygems_version = %q{1.8.5}
68
- s.summary = %q{Global configuration variables for Rails 3 applications.}
62
+ s.homepage = "http://github.com/pwnall/configvars_rails"
63
+ s.licenses = ["MIT"]
64
+ s.require_paths = ["lib"]
65
+ s.rubygems_version = "1.8.15"
66
+ s.summary = "Global configuration variables for Rails 3 applications."
69
67
 
70
68
  if s.respond_to? :specification_version then
71
69
  s.specification_version = 3
72
70
 
73
71
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
74
- s.add_runtime_dependency(%q<rails>, [">= 3.1.0.rc4"])
72
+ s.add_runtime_dependency(%q<rails>, [">= 3.2.0.rc2"])
75
73
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
76
74
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
77
75
  s.add_development_dependency(%q<rcov>, [">= 0"])
78
- s.add_development_dependency(%q<sqlite3>, [">= 1.3.3"])
76
+ s.add_development_dependency(%q<sqlite3>, [">= 1.3.5"])
79
77
  else
80
- s.add_dependency(%q<rails>, [">= 3.1.0.rc4"])
78
+ s.add_dependency(%q<rails>, [">= 3.2.0.rc2"])
81
79
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
82
80
  s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
83
81
  s.add_dependency(%q<rcov>, [">= 0"])
84
- s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
82
+ s.add_dependency(%q<sqlite3>, [">= 1.3.5"])
85
83
  end
86
84
  else
87
- s.add_dependency(%q<rails>, [">= 3.1.0.rc4"])
85
+ s.add_dependency(%q<rails>, [">= 3.2.0.rc2"])
88
86
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
89
87
  s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
90
88
  s.add_dependency(%q<rcov>, [">= 0"])
91
- s.add_dependency(%q<sqlite3>, [">= 1.3.3"])
89
+ s.add_dependency(%q<sqlite3>, [">= 1.3.5"])
92
90
  end
93
91
  end
94
92
 
@@ -14,75 +14,72 @@ module Controller
14
14
  layout 'config_vars'
15
15
  end
16
16
 
17
- # Included in controllers that include ConfivarsRails::Controller.
18
- module InstanceMethods
19
- # GET /config_vars
20
- def index
21
- @config_vars = ConfigVar.order(:name).all
22
-
23
- defined_names = ConfigvarsRails.variable_names
24
- default_names = defined_names - @config_vars.map { |var| var.name.to_sym }
25
- @default_vars = default_names.map { |name|
26
- [name.to_s, ConfigvarsRails.variable_descriptor(name)]
27
- }.sort
28
-
29
- respond_to do |format|
30
- format.html # index.html.erb
31
- end
32
- end
33
-
34
- # GET /config_vars/http_user
35
- def show
36
- edit
37
- render :text => @config_var.value
17
+ # GET /config_vars
18
+ def index
19
+ @config_vars = ConfigVar.order(:name).all
20
+
21
+ defined_names = ConfigvarsRails.variable_names
22
+ default_names = defined_names - @config_vars.map { |var| var.name.to_sym }
23
+ @default_vars = default_names.map { |name|
24
+ [name.to_s, ConfigvarsRails.variable_descriptor(name)]
25
+ }.sort
26
+
27
+ respond_to do |format|
28
+ format.html # index.html.erb
38
29
  end
39
-
40
- # GET /config_vars/http_user/edit
41
- def edit
42
- @config_var = ConfigVar.where(:name => params[:name]).first
43
- unless @config_var
44
- @config_var = ConfigVar.new :name => params[:name]
45
- if descriptor = ConfigvarsRails.variable_descriptor(params[:name])
46
- @config_var.value = descriptor.default_value
47
- end
48
- end
30
+ end
31
+
32
+ # GET /config_vars/http_user
33
+ def show
34
+ edit
35
+ render :text => @config_var.value
36
+ end
37
+
38
+ # GET /config_vars/http_user/edit
39
+ def edit
40
+ @config_var = ConfigVar.where(:name => params[:name]).first
41
+ unless @config_var
42
+ @config_var = ConfigVar.new :name => params[:name]
43
+ if descriptor = ConfigvarsRails.variable_descriptor(params[:name])
44
+ @config_var.value = descriptor.default_value
45
+ end
46
+ end
47
+ end
48
+
49
+ # PUT /config_vars/http_user
50
+ def update
51
+ @config_var = ConfigVar.where(:name => params[:name]).first
52
+ unless @config_var
53
+ @config_var = ConfigVar.new params[:config_var]
54
+ @config_var.name = params[:name]
49
55
  end
50
-
51
- # PUT /config_vars/http_user
52
- def update
53
- @config_var = ConfigVar.where(:name => params[:name]).first
54
- unless @config_var
55
- @config_var = ConfigVar.new params[:config_var]
56
- @config_var.name = params[:name]
56
+
57
+ respond_to do |format|
58
+ success = if @config_var.new_record?
59
+ @config_var.save
60
+ else
61
+ @config_var.update_attributes(params[:config_var])
57
62
  end
58
-
59
- respond_to do |format|
60
- success = if @config_var.new_record?
61
- @config_var.save
62
- else
63
- @config_var.update_attributes(params[:config_var])
64
- end
65
- if success
66
- format.html do
67
- redirect_to config_vars_url,
68
- :notice => 'Configuration variable was successfully updated.'
69
- end
70
- else
71
- format.html { render :action => :edit }
63
+ if success
64
+ format.html do
65
+ redirect_to config_vars_url,
66
+ :notice => 'Configuration variable was successfully updated.'
72
67
  end
68
+ else
69
+ format.html { render :action => :edit }
73
70
  end
74
71
  end
75
-
76
- # DELETE /config_vars/http_user
77
- def destroy
78
- @config_var = ConfigVar.where(:name => params[:name]).first
79
- @config_var.destroy
80
-
81
- respond_to do |format|
82
- format.html { redirect_to(config_vars_url) }
83
- end
72
+ end
73
+
74
+ # DELETE /config_vars/http_user
75
+ def destroy
76
+ @config_var = ConfigVar.where(:name => params[:name]).first
77
+ @config_var.destroy
78
+
79
+ respond_to do |format|
80
+ format.html { redirect_to(config_vars_url) }
84
81
  end
85
- end # module ConfigvarsRails::Controller::InstanceMethods
82
+ end
86
83
 
87
84
  end # module ConfigvarsRails::Controller
88
85
 
@@ -40,18 +40,15 @@ module Model
40
40
  end # module ConfigvarsRails::Model::ClassMethods
41
41
 
42
42
 
43
- # Included in models that include ConfigVarsRails::Model.
44
- module InstanceMethods
45
- # The descriptor for this variable, or nil if no descriptor was defined.
46
- def descriptor
47
- ConfigvarsRails.variable_descriptor name
48
- end
49
-
50
- # Use name instead of ID on all URLs.
51
- def to_param
52
- name
53
- end
54
- end # module ConfigvarsRails::Model::InstanceMethods
43
+ # The descriptor for this variable, or nil if no descriptor was defined.
44
+ def descriptor
45
+ ConfigvarsRails.variable_descriptor name
46
+ end
47
+
48
+ # Use name instead of ID on all URLs.
49
+ def to_param
50
+ name
51
+ end
55
52
 
56
53
  end # namespace ConfigvarsRails::Model
57
54
 
metadata CHANGED
@@ -1,115 +1,81 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: configvars_rails
3
- version: !ruby/object:Gem::Version
4
- hash: 9
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Victor Costan
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-07-19 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-01-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &14079700 !ruby/object:Gem::Requirement
22
17
  none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 15424109
27
- segments:
28
- - 3
29
- - 1
30
- - 0
31
- - rc
32
- - 4
33
- version: 3.1.0.rc4
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0.rc2
34
22
  type: :runtime
35
- requirement: *id001
36
23
  prerelease: false
37
- name: rails
38
- - !ruby/object:Gem::Dependency
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *14079700
25
+ - !ruby/object:Gem::Dependency
26
+ name: bundler
27
+ requirement: &14069860 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 23
45
- segments:
46
- - 1
47
- - 0
48
- - 0
31
+ - !ruby/object:Gem::Version
49
32
  version: 1.0.0
50
33
  type: :development
51
- requirement: *id002
52
34
  prerelease: false
53
- name: bundler
54
- - !ruby/object:Gem::Dependency
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *14069860
36
+ - !ruby/object:Gem::Dependency
37
+ name: jeweler
38
+ requirement: &14068420 !ruby/object:Gem::Requirement
56
39
  none: false
57
- requirements:
40
+ requirements:
58
41
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 15
61
- segments:
62
- - 1
63
- - 6
64
- - 0
42
+ - !ruby/object:Gem::Version
65
43
  version: 1.6.0
66
44
  type: :development
67
- requirement: *id003
68
45
  prerelease: false
69
- name: jeweler
70
- - !ruby/object:Gem::Dependency
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *14068420
47
+ - !ruby/object:Gem::Dependency
48
+ name: rcov
49
+ requirement: &14066980 !ruby/object:Gem::Requirement
72
50
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
80
55
  type: :development
81
- requirement: *id004
82
56
  prerelease: false
83
- name: rcov
84
- - !ruby/object:Gem::Dependency
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *14066980
58
+ - !ruby/object:Gem::Dependency
59
+ name: sqlite3
60
+ requirement: &14066120 !ruby/object:Gem::Requirement
86
61
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 29
91
- segments:
92
- - 1
93
- - 3
94
- - 3
95
- version: 1.3.3
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: 1.3.5
96
66
  type: :development
97
- requirement: *id005
98
67
  prerelease: false
99
- name: sqlite3
100
- description: |-
101
- This gem provides a model and simple controller for
102
- storing global application configuration in a database. This allows the
103
- configuration to change without source code modifications.
68
+ version_requirements: *14066120
69
+ description: ! "This gem provides a model and simple controller for\n storing global
70
+ application configuration in a database. This allows the\n configuration to change
71
+ without source code modifications."
104
72
  email: victor@costan.us
105
73
  executables: []
106
-
107
74
  extensions: []
108
-
109
- extra_rdoc_files:
75
+ extra_rdoc_files:
110
76
  - LICENSE
111
77
  - README.rdoc
112
- files:
78
+ files:
113
79
  - .project
114
80
  - Gemfile
115
81
  - Gemfile.lock
@@ -152,37 +118,31 @@ files:
152
118
  - test/routes_test.rb
153
119
  - test/test_helper.rb
154
120
  homepage: http://github.com/pwnall/configvars_rails
155
- licenses:
121
+ licenses:
156
122
  - MIT
157
123
  post_install_message:
158
124
  rdoc_options: []
159
-
160
- require_paths:
125
+ require_paths:
161
126
  - lib
162
- required_ruby_version: !ruby/object:Gem::Requirement
127
+ required_ruby_version: !ruby/object:Gem::Requirement
163
128
  none: false
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- hash: 3
168
- segments:
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ segments:
169
134
  - 0
170
- version: "0"
171
- required_rubygems_version: !ruby/object:Gem::Requirement
135
+ hash: -2926765151334171930
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
137
  none: false
173
- requirements:
174
- - - ">="
175
- - !ruby/object:Gem::Version
176
- hash: 3
177
- segments:
178
- - 0
179
- version: "0"
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
180
142
  requirements: []
181
-
182
143
  rubyforge_project:
183
- rubygems_version: 1.8.5
144
+ rubygems_version: 1.8.15
184
145
  signing_key:
185
146
  specification_version: 3
186
147
  summary: Global configuration variables for Rails 3 applications.
187
148
  test_files: []
188
-