roleup 0.0.2 → 0.1.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: b2ea91510f467ad94058d25b9ba42988fb9a1d43
4
- data.tar.gz: 00c2b340f808dccea230dc656d76376802aa9d97
3
+ metadata.gz: 63b885b52339e6ce02adf525f8aa38357c264e74
4
+ data.tar.gz: 942bf4261de0d5c678ba77f3b6c372154772d2a3
5
5
  SHA512:
6
- metadata.gz: e04258f420a95b321cd28b73133dd2e1028af8f70865e5259dae026b7afc1e1e0be5fac4f9f6ad535b9e81c904fbb909f6418ef81ce7f70c12ae54d99515c5fa
7
- data.tar.gz: 5a42fcc56e8525b78727aa7fec30f48369dc719bda85a19f42e3ae487452011547209077e77bc5c94fb81ccabff689bb33274b6713570e60441f33c6118ee53c
6
+ metadata.gz: c3e23e86e3e8685bca7f3a70efa7c54aa7405f686df75ed46119baa81c880e03dcc2029c8435f1f7673772891adbaca3f6c70702611b35cca06bb37f33b1c962
7
+ data.tar.gz: 1b6c743b65b409c48e7ad2088d40e2d92e3b554cd0951b62d802fb9392af84b852f6220ba4bd5dc285e518ce1ffb8eba385764d73f659330e9d36a88ed7d26ea
@@ -4,7 +4,7 @@ module Roleup
4
4
  @roles ||= List.new
5
5
  end
6
6
 
7
- def set_roles(*roles)
7
+ def roles=(*roles)
8
8
  @roles = List.new(*roles)
9
9
  end
10
10
 
data/lib/roleup/list.rb CHANGED
@@ -7,7 +7,7 @@ module Roleup
7
7
  def_delegators :inner_list, :each, :length, :size
8
8
 
9
9
  def initialize(*values)
10
- @inner_list = values.map { |value| standardize(value) }.uniq.sort
10
+ @inner_list = values.flatten.map { |value| standardize(value) }.uniq.sort
11
11
  end
12
12
 
13
13
  def include?(value)
@@ -1,3 +1,3 @@
1
1
  module Roleup
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -9,10 +9,10 @@ module Roleup
9
9
  end
10
10
 
11
11
  @obj_with_roles = class_with_roles.new
12
- @obj_with_roles.set_roles :admin, :editor
12
+ @obj_with_roles.roles = :admin, :editor
13
13
  end
14
14
 
15
- test "set_roles" do
15
+ test "assign roles" do
16
16
  assert @obj_with_roles.roles.to_a == [:admin, :editor]
17
17
  end
18
18
 
data/test/list_test.rb CHANGED
@@ -28,6 +28,7 @@ module Roleup
28
28
  end
29
29
 
30
30
  test "delete" do
31
+ assert @roles.include?(:admin)
31
32
  @roles.delete :admin
32
33
  assert !@roles.include?(:admin)
33
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roleup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins