card 1.16.11 → 1.16.12

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: 87ac13203770cb0105dca6d10755c9f442425230
4
- data.tar.gz: 4f27287e05a9cb4ed93e0dd18a64585d47b9f044
3
+ metadata.gz: 8d1990615b92a108f5e31de742a36bd9e24775c3
4
+ data.tar.gz: 630821350bd6c6cf9292bca1ad6e8dc0ed0f0891
5
5
  SHA512:
6
- metadata.gz: 94d18bfbd1b5ffc9ae65f3cc503006571569b9a2b483bfe2b412b7d73d760e121d34dacd23e36bd21930e03145e943e9e29863f8fedbe96884d6b204e4ce5a0b
7
- data.tar.gz: 6d01d13ce7cd4e0c3e0a88414ee9f384e1ce9641189a54bcf0e032dae75f3decfb2371a7e3bba8e77a3546cb026bbdbc0a8998b5a48e53162e8b44eb7c6e3581
6
+ metadata.gz: 90603078c14e9931ae8ac6822da2afccd0a70bb6bd6578128beb0ee9ea55eddb45f31c1d766cd18cafe560c29f4793c1bd2d23b53f37255fa4fd7a204ad08485
7
+ data.tar.gz: 37c9f45c93cfa6f134085f599dd949cc3be996a19f4857b93e9146ea459961ae3098f7570c0c957aadc5f4c787933aea1d97e0d7b82f2eb09a8bd8d14e63f1f3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.16.11
1
+ 1.16.12
data/lib/card/cache.rb CHANGED
@@ -54,13 +54,11 @@ class Card
54
54
  end
55
55
 
56
56
  def generate_cache_id
57
- ((Time.now.to_f * 100).to_i).to_s +
58
- ('a'..'z').to_a[rand(26)] +
59
- ('a'..'z').to_a[rand(26)]
57
+ ((Time.now.to_f * 100).to_i).to_s + ('a'..'z').to_a[rand(26)] + ('a'..'z').to_a[rand(26)]
60
58
  end
61
59
 
62
60
  def reset_global
63
- cache_by_class.each do |_klass, cache|
61
+ cache_by_class.each do |klass, cache|
64
62
  cache.reset hard=true
65
63
  end
66
64
  Card::Codename.reset_cache
@@ -69,11 +67,9 @@ class Card
69
67
 
70
68
  def reset_local
71
69
  cache_by_class.each do |cc, cache|
72
- if Card::Cache === cache
70
+ if Card::Cache===cache
73
71
  cache.reset_local
74
- else
75
- warn "reset class #{cc}, #{cache.class} #{caller[0..8] * "\n"} ???"
76
- end
72
+ else warn "reset class #{cc}, #{cache.class} #{caller[0..8]*"\n"} ???" end
77
73
  end
78
74
  end
79
75
 
@@ -95,16 +91,20 @@ class Card
95
91
  private
96
92
 
97
93
  def prepopulate
98
- return unless @@prepopulating
99
- @@rule_cache ||= Card.rule_cache
100
- @@user_ids_cache ||= Card.user_ids_cache
101
- @@read_rule_cache ||= Card.read_rule_cache
102
- @@rule_keys_cache ||= Card.rule_keys_cache
103
- Card.cache.write_local 'RULES', @@rule_cache
104
- Card.cache.write_local 'READRULES', @@read_rule_cache
105
- Card.cache.write_local 'USER_IDS', @@user_ids_cache
106
- Card.cache.write_local 'RULE_KEYS', @@rule_keys_cache
94
+ if @@prepopulating
95
+ @@rule_cache ||= Card.rule_cache
96
+ @@read_rule_cache ||= Card.read_rule_cache
97
+ @@user_ids_cache ||= Card.user_ids_cache
98
+ @@rule_keys_cache ||= Card.rule_keys_cache
99
+ Card.cache.write_local 'RULES', @@rule_cache
100
+ Card.cache.write_local 'READRULES', @@read_rule_cache
101
+ Card.cache.write_local 'USER_IDS', @@user_ids_cache
102
+ Card.cache.write_local 'RULE_KEYS', @@rule_keys_cache
103
+ end
107
104
  end
105
+
106
+
107
+
108
108
  end
109
109
 
110
110
  attr_reader :prefix, :store, :klass
@@ -179,7 +179,7 @@ class Card
179
179
 
180
180
  def delete key
181
181
  @store.delete(@prefix + key) if @store
182
- delete_local key
182
+ @local.delete key
183
183
  end
184
184
 
185
185
  def delete_local key
@@ -67,4 +67,4 @@ event :store_subcards, after: :store do
67
67
  # eg. <user> creates <user+*account> creates <user+*account+*status>
68
68
  # <user> changes <user+*account+*status> in event activate_account
69
69
  Card.write_to_local_cache self
70
- end
70
+ end
@@ -28,10 +28,7 @@ event :validate_delete, before: :approve, on: :delete do
28
28
  errors.add :delete, "#{name} is is a system card. (#{codename})"
29
29
  end
30
30
 
31
- undeletable_all_rules_tags =
32
- %w{ default style layout create read update delete }
33
- # FIXME: HACK! should be configured in the rule
34
-
31
+ undeletable_all_rules_tags = %w{ default style layout create read update delete }
35
32
  if junction? && (l = left) && l.codename == 'all' &&
36
33
  undeletable_all_rules_tags.member?(right.codename)
37
34
  errors.add :delete, "#{name} is an indestructible rule"
@@ -21,8 +21,8 @@ format :html do
21
21
  args.merge!(
22
22
  title: 'Invite',
23
23
  buttons: button_tag('Send Invitation', situation: 'primary'),
24
- hidden: { success: '_self' }
25
24
  )
25
+ args[:hidden][:success] = '_self'
26
26
  end
27
27
 
28
28
  view :new do |args|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.11
4
+ version: 1.16.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-09 00:00:00.000000000 Z
14
+ date: 2015-11-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: smartname