dsboulder-acts_as_wrapped_class 1.0.3
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/History.txt +9 -0
- data/README.txt +63 -0
- metadata +55 -0
data/History.txt
ADDED
data/README.txt
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
ActsAsWrappedClass
|
|
2
|
+
by David Stevenson
|
|
3
|
+
http://elctech.com/blog
|
|
4
|
+
|
|
5
|
+
== DESCRIPTION:
|
|
6
|
+
|
|
7
|
+
ActsAsWrappedClass is designed to automatically generate a wrapper for an object that you don't want to be allowed to access certain methods in. This is useful in cases where you want to sandbox what users' code can and can't do, by providing them access to the wrapper classes rather than the original classes.
|
|
8
|
+
|
|
9
|
+
== FEATURES/PROBLEMS:
|
|
10
|
+
|
|
11
|
+
* Wrappers do not dispatch const_missing yet, so constants are not accessible yet.
|
|
12
|
+
|
|
13
|
+
== SYNOPSIS:
|
|
14
|
+
|
|
15
|
+
class Something
|
|
16
|
+
acts_as_wrapped_class :methods => [:safe_method]
|
|
17
|
+
# SomethingWrapper is now defined
|
|
18
|
+
|
|
19
|
+
def safe_method # allowed to access this method through SomethingWrapper
|
|
20
|
+
Something.new
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def unsafe_method # not allowed to access this method through SomethingWrapper
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
s = Something.new
|
|
28
|
+
wrapper = s.to_wrapper
|
|
29
|
+
wrapper.safe_method # returns a new SomethingWrapper
|
|
30
|
+
wrapper.unsafe_method # raises an exception
|
|
31
|
+
|
|
32
|
+
== REQUIREMENTS:
|
|
33
|
+
|
|
34
|
+
* none
|
|
35
|
+
|
|
36
|
+
== INSTALL:
|
|
37
|
+
|
|
38
|
+
* sudo gem install acts_as_wrapped_class
|
|
39
|
+
|
|
40
|
+
== LICENSE:
|
|
41
|
+
|
|
42
|
+
(The MIT License)
|
|
43
|
+
|
|
44
|
+
Copyright (c) 2007 David Stevenson
|
|
45
|
+
|
|
46
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
47
|
+
a copy of this software and associated documentation files (the
|
|
48
|
+
'Software'), to deal in the Software without restriction, including
|
|
49
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
50
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
51
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
52
|
+
the following conditions:
|
|
53
|
+
|
|
54
|
+
The above copyright notice and this permission notice shall be
|
|
55
|
+
included in all copies or substantial portions of the Software.
|
|
56
|
+
|
|
57
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
58
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
59
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
60
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
61
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
62
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
63
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
metadata
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: dsboulder-acts_as_wrapped_class
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.3
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- David Stevenson
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
|
|
12
|
+
date: 2009-04-04 00:00:00 -07:00
|
|
13
|
+
default_executable:
|
|
14
|
+
dependencies: []
|
|
15
|
+
|
|
16
|
+
description: ActsAsWrappedClass is a gem which easily creates proxy classes for use in the freaky-freaky-sandbox
|
|
17
|
+
email: david@flouri.sh
|
|
18
|
+
executables: []
|
|
19
|
+
|
|
20
|
+
extensions: []
|
|
21
|
+
|
|
22
|
+
extra_rdoc_files: []
|
|
23
|
+
|
|
24
|
+
files:
|
|
25
|
+
- README.txt
|
|
26
|
+
- History.txt
|
|
27
|
+
has_rdoc: true
|
|
28
|
+
homepage: http://github.com/dsboulder/acts_as_wrapped_cass
|
|
29
|
+
post_install_message:
|
|
30
|
+
rdoc_options:
|
|
31
|
+
- --inline-source
|
|
32
|
+
- --charset=UTF-8
|
|
33
|
+
require_paths:
|
|
34
|
+
- lib
|
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: "0"
|
|
40
|
+
version:
|
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: "0"
|
|
46
|
+
version:
|
|
47
|
+
requirements: []
|
|
48
|
+
|
|
49
|
+
rubyforge_project: acts_as_wrapped_class
|
|
50
|
+
rubygems_version: 1.2.0
|
|
51
|
+
signing_key:
|
|
52
|
+
specification_version: 2
|
|
53
|
+
summary: ""
|
|
54
|
+
test_files: []
|
|
55
|
+
|