Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Small misprint in readme #1

Closed
wants to merge 3 commits into from

2 participants

@avakhov

No description provided.

@avakhov avakhov not rescue all exceptions
It prevents development
a33a14c
@randx
Owner

Thanks. But last commit make one test to fall. wont merge until all test passed

@randx
Owner

Btw i dont see reason to remove rescue block. It should not raise error but return bool

@avakhov

It was my first pull request, I don't plan to send you the last commit.

About deleting rescue block. I migrate one my project from cancan to six. Your solultion seems more delicious without superfluous magic. Code snippet: https://gist.github.com/1175760

What do you think about such using of your gem?

@randx
Owner

I'll accept pull request if you send it without last commit. I think for now rescue block is ok - allowed method should not raise any exception. I'm going to implement better validation & exception manage in future.

@randx
Owner

I ckecked out your gist - seems ok for me

@avakhov avakhov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 27, 2011
  1. @avakhov

    fix readme misprint

    avakhov authored
  2. @avakhov

    the same misprint

    avakhov authored
  3. @avakhov

    not rescue all exceptions

    avakhov authored
    It prevents development
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 4 deletions.
  1. +2 −2 README.markdown
  2. +0 −2  lib/six.rb
View
4 README.markdown
@@ -60,7 +60,7 @@ class BookRules
# you are free to write any conditions you need
if book.author?(author) && book.is_approved? # ....etc...
- rules << :publis_book
+ rules << :publish_book
end
rules # return array of abilities
@@ -168,7 +168,7 @@ abilities.allowed? ... # use rules from BookRules only -> more perfomance
```ruby
class BookRules
def self.allowed(author, book)
- [:read_book, :edit_book, :publis_book]
+ [:read_book, :edit_book, :publish_book]
end
end
View
2  lib/six.rb
@@ -93,8 +93,6 @@ def remove_pack!(name)
def valid_rules_object?(object)
object.respond_to?(:allowed) &&
object.send(:allowed, nil, nil).kind_of?(Array)
- rescue
- false
end
# Check if authorization class has pack with such name
Something went wrong with that request. Please try again.