reallycare_utils 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,21 +28,13 @@ module ReallycareUtils
28
28
  end
29
29
 
30
30
  define_method "add_#{@@has_bitmask_field}" do |bitmask_const, save_it=false|
31
- this_bit = self.class.bitmask_value(bitmask_const)
32
- if self[@@has_bitmask_field]
33
- self[@@has_bitmask_field] = self[@@has_bitmask_field] + this_bit
34
- else
35
- self[@@has_bitmask_field] = this_bit
36
- end
31
+ self[@@has_bitmask_field] = self[@@has_bitmask_field] | self.class.bitmask_value(bitmask_const)
37
32
  self.save! if save_it
38
33
  end
39
34
 
40
35
  define_method "remove_#{@@has_bitmask_field}" do |bitmask_const, save_it=false|
41
- this_bit = self.class.bitmask_value(bitmask_const)
42
- if self[@@has_bitmask_field]
43
- self[@@has_bitmask_field] = self[@@has_bitmask_field] - this_bit
44
- self.save! if save_it
45
- end
36
+ self[@@has_bitmask_field] = self[@@has_bitmask_field] & ~(self.class.bitmask_value(bitmask_const))
37
+ self.save! if save_it
46
38
  end
47
39
 
48
40
  end
@@ -1,3 +1,3 @@
1
1
  module ReallycareUtils
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: reallycare_utils
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mark Chapman
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-03-26 23:00:00 +00:00
14
+ date: 2011-05-04 00:00:00 -04:00
15
15
  default_executable:
16
16
  dependencies: []
17
17
 
@@ -61,10 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements: []
62
62
 
63
63
  rubyforge_project: reallycare_utils
64
- rubygems_version: 1.6.1
64
+ rubygems_version: 1.6.0
65
65
  signing_key:
66
66
  specification_version: 3
67
67
  summary: Shared utilities for ReallyCare sites
68
- test_files:
69
- - spec/bitmask_spec.rb
70
- - spec/spec_helper.rb
68
+ test_files: []
69
+