cando 0.2.3 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/cando.gemspec +3 -3
- data/lib/cando.rb +2 -2
- data/spec/spec_helper.rb +13 -4
- metadata +4 -4
    
        data/Rakefile
    CHANGED
    
    | @@ -16,7 +16,7 @@ require 'jeweler' | |
| 16 16 | 
             
            Jeweler::Tasks.new do |gem|
         | 
| 17 17 | 
             
              # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
         | 
| 18 18 | 
             
              gem.name = "cando"
         | 
| 19 | 
            -
              gem.homepage = "http://github.com/ | 
| 19 | 
            +
              gem.homepage = "http://github.com/soundcloud/cando"
         | 
| 20 20 | 
             
              gem.license = "MIT"
         | 
| 21 21 | 
             
              gem.summary = %Q{Simple roles helper}
         | 
| 22 22 | 
             
              gem.description = %Q{CanDo is a small gem to implement a simple user access system based on users, roles & capabilites, where:
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.2. | 
| 1 | 
            +
            0.2.6
         | 
    
        data/cando.gemspec
    CHANGED
    
    | @@ -5,11 +5,11 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = "cando"
         | 
| 8 | 
            -
              s.version = "0.2. | 
| 8 | 
            +
              s.version = "0.2.6"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["Daniel Bornkessel"]
         | 
| 12 | 
            -
              s.date = "2014- | 
| 12 | 
            +
              s.date = "2014-06-02"
         | 
| 13 13 | 
             
              s.description = "CanDo is a small gem to implement a simple user access system based on users, roles & capabilites, where:\n\n    each user can have 0, 1 or many roles\n    each role can have 0, 1 or many capabilites\n\nUsers have capabilities by getting roles assigned (role == collection of capabilities). Within the code, the can helper method can be used to test whether a user has a certain capability or not (see below for a working code example)."
         | 
| 14 14 | 
             
              s.email = "daniel@soundcloud.com"
         | 
| 15 15 | 
             
              s.extra_rdoc_files = [
         | 
| @@ -36,7 +36,7 @@ Gem::Specification.new do |s| | |
| 36 36 | 
             
                "spec/cando_spec.rb",
         | 
| 37 37 | 
             
                "spec/spec_helper.rb"
         | 
| 38 38 | 
             
              ]
         | 
| 39 | 
            -
              s.homepage = "http://github.com/ | 
| 39 | 
            +
              s.homepage = "http://github.com/soundcloud/cando"
         | 
| 40 40 | 
             
              s.licenses = ["MIT"]
         | 
| 41 41 | 
             
              s.require_paths = ["lib"]
         | 
| 42 42 | 
             
              s.rubygems_version = "1.8.23"
         | 
    
        data/lib/cando.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            require 'sequel' | 
| 1 | 
            +
            require 'sequel'
         | 
| 2 2 |  | 
| 3 3 | 
             
            if File.basename($0) == "rake"    # we are in a rake call: export our rake stuff
         | 
| 4 4 | 
             
              require 'rake'
         | 
| @@ -94,7 +94,7 @@ module CanDo | |
| 94 94 | 
             
                  @db
         | 
| 95 95 | 
             
                rescue => e
         | 
| 96 96 | 
             
                  raise ConfigConnectionError.new(<<-EOF
         | 
| 97 | 
            -
            Error connecting to database. Be sure to pass in a  | 
| 97 | 
            +
            Error connecting to database. Be sure to pass in a database config like 'mysql://cando_user:cando_passwd@localhost/cando':
         | 
| 98 98 | 
             
            #{e.message}
         | 
| 99 99 | 
             
            EOF
         | 
| 100 100 | 
             
                  )
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -25,7 +25,8 @@ require 'cando' | |
| 25 25 | 
             
            # in ./support/ and its subdirectories.
         | 
| 26 26 | 
             
            Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
         | 
| 27 27 |  | 
| 28 | 
            -
            ENV['CANDO_TEST_DB']  | 
| 28 | 
            +
            db_connection_string = ENV['CANDO_TEST_DB'] || 'mysql://cando_user:cando_passwd@localhost/cando'
         | 
| 29 | 
            +
             | 
| 29 30 |  | 
| 30 31 | 
             
            RSpec.configure do |config|
         | 
| 31 32 | 
             
              Sequel.extension :migration
         | 
| @@ -34,9 +35,17 @@ RSpec.configure do |config| | |
| 34 35 |  | 
| 35 36 | 
             
              config.before(:suite) do
         | 
| 36 37 | 
             
                db = CanDo.init do
         | 
| 37 | 
            -
                   | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 38 | 
            +
                  begin
         | 
| 39 | 
            +
                    db = connect db_connection_string
         | 
| 40 | 
            +
                    db.drop_table(*db.tables)
         | 
| 41 | 
            +
                    migration.apply(db, :up)
         | 
| 42 | 
            +
                  rescue => e
         | 
| 43 | 
            +
                    message = e.message
         | 
| 44 | 
            +
                    unless ENV['CANDO_TEST_DB']
         | 
| 45 | 
            +
                      message = "\n\nUsed db config was: '#{db_connection_string}'; overwrite by setting the env var $CANDO_TEST_DB\n" + message
         | 
| 46 | 
            +
                    end
         | 
| 47 | 
            +
                    raise message
         | 
| 48 | 
            +
                  end
         | 
| 40 49 | 
             
                end
         | 
| 41 50 | 
             
              end
         | 
| 42 51 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cando
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.6
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2014- | 
| 12 | 
            +
            date: 2014-06-02 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: sequel
         | 
| @@ -154,7 +154,7 @@ files: | |
| 154 154 | 
             
            - lib/tasks/cando.rake
         | 
| 155 155 | 
             
            - spec/cando_spec.rb
         | 
| 156 156 | 
             
            - spec/spec_helper.rb
         | 
| 157 | 
            -
            homepage: http://github.com/ | 
| 157 | 
            +
            homepage: http://github.com/soundcloud/cando
         | 
| 158 158 | 
             
            licenses:
         | 
| 159 159 | 
             
            - MIT
         | 
| 160 160 | 
             
            post_install_message: 
         | 
| @@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 169 169 | 
             
                  version: '0'
         | 
| 170 170 | 
             
                  segments:
         | 
| 171 171 | 
             
                  - 0
         | 
| 172 | 
            -
                  hash:  | 
| 172 | 
            +
                  hash: 683573766701050136
         | 
| 173 173 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 174 174 | 
             
              none: false
         | 
| 175 175 | 
             
              requirements:
         |