taint_aliases 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e791bf14e51fbddef0ab93b1d78cec15e545e7d
4
- data.tar.gz: 1bc2f1a7a2fa6bb9774083a052c0fa2a9b687a28
3
+ metadata.gz: 9ecfd16d1f8bb65219c056887b16179f171a9774
4
+ data.tar.gz: 2a79ea671d047821d82c885ee906b76f72f3c17e
5
5
  SHA512:
6
- metadata.gz: 70ee561a9a991a6546de4449d1167f7020a387dc00a730e8bc01ebd840a5b3d354b5daeed4a28c449f494e18012c377d79061b736013e4ec48f84ff47e81660d
7
- data.tar.gz: 1e9bb5cd657594d565fbfce87fb16c9d9e1587dfa5ff45138cdffa58637d82b58332d3f65f288397a4e07f33bd33cef16307a8958d8ca950e133e0a38467374c
6
+ metadata.gz: 6abe8cd5d1f3e9a2748213c03bd617c1efd281c5dc2473b72249613b2906fbe0b73da240bdc03aa6a3274114b299e2d2a56f0aedbcfbc922b18fdfd608391383
7
+ data.tar.gz: 72c730e522208510a2e3109eed1aa7d7000ed540553cc2626b6223848335e78396122fb869efabceb135d8e065dad82cfeeb8f1d8b4fea0537160c97b4384f7d
data/README.md CHANGED
@@ -41,6 +41,39 @@ str.tainted?
41
41
  ```
42
42
  It's that easy!
43
43
 
44
+ `taint_aliases` currently supplies the following methods to taint your objects:
45
+
46
+ * `grundle`
47
+ * `fleshy_fun_bridge`
48
+ * `perineum`
49
+ * `gouch`
50
+ * `gooch`
51
+ * `grundel`
52
+
53
+ Thanks to [threeifbywhiskey](https://github.com/threeifbywhiskey), you can now use equivalent methods to untaint and check the taintedness of your objects, e.g.:
54
+
55
+ ```ruby
56
+
57
+ obj = Object.new
58
+ obj.grundle
59
+
60
+ obj.grundled?
61
+ => true
62
+
63
+ obj.unperineum
64
+
65
+ obj.fleshy_fun_bridged?
66
+ => false
67
+
68
+ ```
69
+
70
+ ## Contributors
71
+
72
+ * [Jason Lewis](https://github.com/canweriotnow)
73
+ * [Micah Gates](https://github.com/mgates)
74
+ * [Milt Reder](https://github.com/milt)
75
+ * [threeifbywhiskey](https://github.com/threeifbywhiskey)
76
+
44
77
  ## Contributing
45
78
 
46
79
  1. Fork it
@@ -54,5 +87,4 @@ It's that easy!
54
87
 
55
88
  Copyright © 2014 Jason Lewis, Micah Gates
56
89
 
57
-
58
90
  Distributed under the MIT License; see LICENSE.txt
data/lib/taint_aliases.rb CHANGED
@@ -5,7 +5,11 @@ module TaintAliases
5
5
  TAINT_ALIASES = %w[grundle fleshy_fun_bridge perineum gouch gooch grundel]
6
6
  def self.included(receiver)
7
7
  TAINT_ALIASES.each do |a|
8
+ suffix = 'aeiou'[a[-1]] ? 'd': 'ed'
9
+
8
10
  receiver.send(:alias_method, a, :taint)
11
+ receiver.send(:alias_method, "un" + a, :untaint)
12
+ receiver.send(:alias_method, a + suffix + "?", :tainted?)
9
13
  end
10
14
  end
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module TaintAliases
2
- VERSION = "0.0.3"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -10,10 +10,24 @@ module TaintAliasesSpec
10
10
  end
11
11
 
12
12
  TaintAliases::TAINT_ALIASES.each do |a|
13
+ suffix = 'aeiou'[a[-1]] ? 'd' : 'ed'
14
+ query = a + suffix + "?"
15
+
13
16
  it "should be tainted with #{a}" do
14
17
  @obj.public_send a
15
18
  @obj.should be_tainted
16
19
  end
20
+
21
+ it "should be untainted with un#{a}" do
22
+ @obj.public_send "un" + a
23
+ @obj.should_not be_tainted
24
+ end
25
+
26
+ it "should be queryable with #{query}" do
27
+ @obj.public_send(query).should be_false
28
+ @obj.public_send a
29
+ @obj.public_send(query).should be_true
30
+ end
17
31
  end
18
32
  end
19
33
 
@@ -31,10 +45,6 @@ module TaintAliasesSpec
31
45
  ary.should be_tainted
32
46
  end
33
47
  end
34
-
35
-
36
-
37
-
38
48
  end
39
49
 
40
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taint_aliases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lewis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-23 00:00:00.000000000 Z
12
+ date: 2014-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler