mistiq 0.0.922 → 0.0.923

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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/mistiq/base.rb +15 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzhjODk3NDRjM2I1ZjUwNmI4ZWQ2MjFmNGVlOTg5YTVkYTg3NDFkYQ==
4
+ MjI1NzI0N2EwMmFlMDc3NWYyYjc5OGM2ZDliMzBiZTc0NWNiYWU1OQ==
5
5
  data.tar.gz: !binary |-
6
- OWY1ZWE4MjYyYjA4Yzc4MmZiMDJkOGQ0NzQ5MGMwMjNlYTM1YjEzOA==
6
+ OTlhYzc5NWY4ZTc2NmI1ZmY4OGJlZmNmYmJiMTQ1NDUxMmU0NTQ0MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjRjMTBhYmQ1OTI0YjFhZGY0NWVmMjIyMzljNzFlM2ZmYTRhMGNkYmE5M2Ni
10
- OTg0ODNhYTdkN2Q0MzZhOTk5NjhiYmRjZjk3MGRhODc3MDA0ZjkwZWEzOTc4
11
- ZDllM2ZjMWY5MzE5OTJlY2FjZTU3Yzg5NWM3N2FkYWI0Zjc1YjY=
9
+ ZTY0NTgxMTJkMWNiZmNlZTQ4ZTMzYTIwN2ViMDcwN2Q0Nzg4MmQ3ZWUxZTQy
10
+ ZjhhYzQ4NDkyMmFjOTFhMDU4NzdiYjc0YTI3MTMzMDZkZDY3YWY3Y2U0ZWY0
11
+ Njk3OWExMDMwYjE1ZGU4ZDBjMjUwZGY5Njc5NDk3NGQzOGY1YmI=
12
12
  data.tar.gz: !binary |-
13
- MjlhMGRlZTg0ZmIyODA0MWIyYTVlNWJkNWM2ZGZkNTA3Yjc4YzU2ZjlmYzdk
14
- NDZlY2E4Zjg2YmZlYjhmOGI4MWVkNzQwM2JjMGE2YWE5MjFkZTNhYTcxYjhi
15
- NmYxODJiNTRkYmZlMDg4NjAwNTA4NTk5OTc0YjJkMjk5YWI1MGY=
13
+ MzZkZDFmYWIyMDJjNGE2YzY1ODBkZjMwMWJhYjdiMDU4ZmFmYTBmYTBhMTEx
14
+ ZmQ3MzU4ZDkxODUwNDhlNzRhZTYyZDk2YjM2ODE0NTk1ZjIyMDMyM2M0N2E0
15
+ YmM5MDAzNzc2OGU1NDAzYzMwOTU0MTUwMzY0MDM2MjU2ZTBlODI=
data/lib/mistiq/base.rb CHANGED
@@ -37,20 +37,30 @@ module Mistiq
37
37
  #only disable view if the current controller
38
38
  #and view are the ones that need to be disabled
39
39
  if(current_controller == pair_array[0] && current_action == pair_array[1])
40
- disable(pair_array[0],pair_array[1])
40
+ #if strip_links is true, then
41
+ #enable link removal
42
+ if pair_array[2]
43
+ disable(pair_array[0],pair_array[1])
44
+ else
45
+ disable_action(pair_array[0],pair_array[1])
46
+ end
41
47
  else
42
- remove_links(pair_array[0],pair_array[1])
48
+ #if strip_links is true, then
49
+ #enable link removal
50
+ if pair_array[2]
51
+ remove_links(pair_array[0],pair_array[1])
52
+ end
43
53
  end
44
54
  end
45
55
  }
46
56
  end
47
57
 
48
58
  #add a new rule to look out for
49
- def set_guard_rule(condition, consequence)
50
- pair = [condition,consequence]
59
+ def set_guard_rule(condition, consequence, strip_links=true)
60
+ pair = [condition,consequence,strip_links]
51
61
  @@rules["#{@@count+=1}"] = pair
52
62
 
53
- puts "New rule has been added: #{consequence}"
63
+ puts "New rule has been added: #{consequence}, strip links: #{strip_links}"
54
64
  end
55
65
 
56
66
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mistiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.922
4
+ version: 0.0.923
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Papancea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2013-11-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Dynamically restrict access to your Rails application
14
14
  email: alp2200@columbia.edu