acts_as_singleton 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.txt +2 -0
- data/Rakefile +2 -1
- data/lib/acts_as_singleton.rb +2 -2
- data/test/acts_as_singleton_test.rb +6 -0
- metadata +8 -6
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -11,6 +11,8 @@ It just makes sense to store mutable, site-wide, admin-level settings in the
|
|
11
11
|
database. Right? A key-value table may be more flexible, but maybe we don't
|
12
12
|
want to be flexible!
|
13
13
|
|
14
|
+
If you truly want that flexibility: http://github.com/stephencelis/kvc
|
15
|
+
|
14
16
|
|
15
17
|
== FEATURES/PROBLEMS
|
16
18
|
|
data/Rakefile
CHANGED
@@ -7,6 +7,7 @@ require "acts_as_singleton"
|
|
7
7
|
Hoe.new("acts_as_singleton", ActiveRecord::Singleton::VERSION) do |p|
|
8
8
|
p.developer("Stephen Celis", "stephen@stephencelis.com")
|
9
9
|
p.remote_rdoc_dir = ''
|
10
|
+
p.rubyforge_name = %q{actsassingleton}
|
10
11
|
end
|
11
12
|
|
12
13
|
require 'rake'
|
@@ -29,6 +30,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
29
30
|
rdoc.rdoc_dir = 'rdoc'
|
30
31
|
rdoc.title = 'acts_as_singleton'
|
31
32
|
rdoc.options << '--line-numbers' << '--inline-source'
|
32
|
-
rdoc.rdoc_files.include('README')
|
33
|
+
rdoc.rdoc_files.include('README.txt')
|
33
34
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
34
35
|
end
|
data/lib/acts_as_singleton.rb
CHANGED
@@ -17,11 +17,11 @@ module ActiveRecord
|
|
17
17
|
# clash with the <tt>ActiveRecord::Singleton::PRIVATE</tt> pattern, or
|
18
18
|
# define them after including the module.
|
19
19
|
module Singleton
|
20
|
-
VERSION = "0.0.
|
20
|
+
VERSION = "0.0.2"
|
21
21
|
|
22
22
|
# This pattern matches methods that should be made private because they
|
23
23
|
# should not be used in singleton classes.
|
24
|
-
PRIVATE = /^all(?:oc.*)?$|alloc|create|find|firs|mini|max|new|d_sco
|
24
|
+
PRIVATE = /^all(?:oc.*)?$|alloc|create|find|firs|mini|max|new|d_sco|^upd/
|
25
25
|
|
26
26
|
def self.included(model)
|
27
27
|
model.class_eval do
|
@@ -65,4 +65,10 @@ class ActsAsSingletonTest < ActiveSupport::TestCase
|
|
65
65
|
assert_no_match(/id: .+?,/, HomepageSettings.inspect)
|
66
66
|
assert_no_match(/id: .+?,/, HomepageSettings.instance.inspect)
|
67
67
|
end
|
68
|
+
|
69
|
+
test "should be mutable" do
|
70
|
+
assert_nothing_raised do
|
71
|
+
HomepageSettings.instance.update_attributes! :welcome_message => "OH HAI"
|
72
|
+
end
|
73
|
+
end
|
68
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_singleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Celis
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-13 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,9 +20,9 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
23
|
+
version: 1.12.1
|
24
24
|
version:
|
25
|
-
description: A lightweight singleton library for your Active Record models. It just makes sense to store mutable, site-wide, admin-level settings in the database. Right? A key-value table may be more flexible, but maybe we don't want to be flexible!
|
25
|
+
description: "A lightweight singleton library for your Active Record models. It just makes sense to store mutable, site-wide, admin-level settings in the database. Right? A key-value table may be more flexible, but maybe we don't want to be flexible! If you truly want that flexibility: http://github.com/stephencelis/kvc"
|
26
26
|
email:
|
27
27
|
- stephen@stephencelis.com
|
28
28
|
executables: []
|
@@ -43,6 +43,8 @@ files:
|
|
43
43
|
- test/acts_as_singleton_test.rb
|
44
44
|
has_rdoc: true
|
45
45
|
homepage: http://github.com/stephencelis/acts_as_singleton
|
46
|
+
licenses: []
|
47
|
+
|
46
48
|
post_install_message:
|
47
49
|
rdoc_options:
|
48
50
|
- --main
|
@@ -63,8 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
65
|
version:
|
64
66
|
requirements: []
|
65
67
|
|
66
|
-
rubyforge_project:
|
67
|
-
rubygems_version: 1.3.
|
68
|
+
rubyforge_project: actsassingleton
|
69
|
+
rubygems_version: 1.3.5
|
68
70
|
signing_key:
|
69
71
|
specification_version: 2
|
70
72
|
summary: A lightweight singleton library for your Active Record models
|