moorage-xml_protected 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.textile +2 -0
- data/Rakefile +1 -1
- data/lib/xml_protected.rb +4 -2
- metadata +2 -2
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 [name of plugin creator]
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
CHANGED
@@ -11,6 +11,7 @@ An ActiveRecord Model:
|
|
11
11
|
|
12
12
|
<pre>
|
13
13
|
class Model < ActiveRecord::Base
|
14
|
+
include XmlProtected # Required because it's a gemmefied plugin
|
14
15
|
xml_protected :attr1, :attr2, :attr3
|
15
16
|
end
|
16
17
|
</pre>
|
@@ -24,6 +25,7 @@ h3. In Conjunction with <code>attr_protected</code>
|
|
24
25
|
|
25
26
|
<pre>
|
26
27
|
class Model < ActiveRecord::Base
|
28
|
+
include XmlProtected # Required because it's a gemmefied plugin
|
27
29
|
attr_protected :attr1, :attr2, :attr3
|
28
30
|
xml_protected :attr1, :attr2, :attr3
|
29
31
|
end
|
data/Rakefile
CHANGED
data/lib/xml_protected.rb
CHANGED
@@ -26,8 +26,10 @@ module XmlProtected
|
|
26
26
|
|
27
27
|
module InstanceMethods
|
28
28
|
def to_xml(options = {})
|
29
|
-
|
30
|
-
|
29
|
+
xml_protected_to_xml(
|
30
|
+
options.merge(
|
31
|
+
:except => self.class.protected_xml_attributes + (options[:except] || [])
|
32
|
+
))
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moorage-xml_protected
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ThriveSmart, LLC
|
@@ -13,7 +13,7 @@ date: 2008-10-01 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description: Keeps specified attributes of a model out of to_xml. Do so by aliasing to_xml, and automatically sending in the correct :excludes to the original to_xml method.
|
16
|
+
description: Keeps specified attributes of a model out of to_xml. Do so by aliasing to_xml, and automatically sending in the correct :excludes to the original to_xml method, e.g. :excludes => [:attr1, :attr2, ...]
|
17
17
|
email: developers@thrivesmart.com
|
18
18
|
executables: []
|
19
19
|
|