bitmask_attribute 1.0.2 → 1.0.3

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: 76ed99a443101270e21db0422f0b070f7ad281db
4
- data.tar.gz: 26f8ece67e57f3d935c3c2697eab86a87f6298f9
3
+ metadata.gz: 71a5a9d37f5e7f80765cd4b8a1f04e714c5de998
4
+ data.tar.gz: 6f59de9498c96accdfa7250f15a6332b081ca53a
5
5
  SHA512:
6
- metadata.gz: 598ed1eec15354a30c4bad937074359c0bbc8763ff06a6b5e263e8fb46353b7d67041f6312bde51d85369f31335f2c6fc5ef22abc96bc44524cca9d0cbc4b9e1
7
- data.tar.gz: ad5e1b39000e8b02dacedaf2de8c445e10a912766a6413b47da909fcada454d5889a7dcf8f83543094fc8ad29b7b70f5346f0fa641e70df8c41721218b4ac6ea
6
+ metadata.gz: f152855cffeed64641b44212aabad816c6b310e67f76faf9cb7298606ba1b078fbf5c25bdd7b172b90d44c9ea31b22353b9b6f4295951f333a4cb095bcf56848
7
+ data.tar.gz: 049e7b407b227ddee9ee25b0da40d62c2c575e351643857a2c0bc7b3439ead56affa6b96f210afa33ae0a76a3b1ee3a05e636f34cbc3bf8cf66cb39394351299
@@ -0,0 +1 @@
1
+ 2.3.1
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 1.0.3 (Feb 27, 2017)
4
+
5
+ * Update activesupport to version 5.0.1
6
+
7
+ ## 1.0.2 (Aug 30, 2016)
8
+
9
+ * Allow bit options to be set with their options names
10
+
11
+ ## 1.0.1 (Aug 24, 2016)
12
+
13
+ * Initial commit
data/README.md CHANGED
@@ -28,9 +28,11 @@ This attribute is expected to be an integer type.
28
28
  Class Foo
29
29
  include BitmaskAttribute::Concern
30
30
 
31
+ # Hash of options to bit values
32
+ OPTIONS_HASH = { option_1: 1, option_2: 2, option_3: 4, option_4: 8 }
31
33
  ...
32
34
 
33
- bitmask_attribute :actions
35
+ bitmask_attribute :actions, OPTIONS_HASH
34
36
  ```
35
37
 
36
38
  You now get the following methods at your disposal:
@@ -44,6 +46,14 @@ You now get the following methods at your disposal:
44
46
  `foo_instance.remove_action(1)`
45
47
  -> removes the input bit flag from the mask
46
48
 
49
+ `foo.option_1 = true`
50
+ or if using an active record model: `foo.update(option_1: true)`
51
+ -> adds the 1 bit to the bitmask attribute
52
+
53
+ `foo_option_1 = false`
54
+ or if using an active record model: `foo.update(option_1: false)`
55
+ -> removes the 1 bit from the bitmask attribute
56
+
47
57
  ## Contributing
48
58
 
49
59
  1. Fork it ( https://github.com/[my-github-username]/bitmask_attribute/fork )
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "rspec", "~> 3.0"
25
- spec.add_dependency "activesupport", "~> 4.2"
25
+ spec.add_dependency "activesupport", "~> 5.0"
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module BitmaskAttribute
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitmask_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Madeline Carson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-30 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '4.2'
61
+ version: '5.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '4.2'
68
+ version: '5.0'
69
69
  description: |-
70
70
  Bitmask attribute helper methods for Rails models. Gives model access to methods to
71
71
  check, add, and remove flags.
@@ -77,6 +77,8 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - ".gitignore"
79
79
  - ".rspec"
80
+ - ".ruby-version"
81
+ - CHANGELOG.md
80
82
  - Gemfile
81
83
  - LICENSE.txt
82
84
  - README.md
@@ -107,11 +109,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
109
  version: '0'
108
110
  requirements: []
109
111
  rubyforge_project:
110
- rubygems_version: 2.4.5
112
+ rubygems_version: 2.5.1
111
113
  signing_key:
112
114
  specification_version: 4
113
115
  summary: Bitmask attribute helper methods for Rails models.
114
116
  test_files:
115
117
  - spec/bitmask_attribute/concern_spec.rb
116
118
  - spec/spec_helper.rb
117
- has_rdoc: