kant 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: 87d152de30258244f39885c12a98a2e6e2fa12e4
4
- data.tar.gz: 9a2941060fc43fde8785f8e6511318269e9bb678
2
+ SHA256:
3
+ metadata.gz: 68ec4aab07bd2a439486323f6786768abd9cc88d70f52c52123ee8a51106cdca
4
+ data.tar.gz: 562cda2f7eacf2dc4503c74affc2e93aae25589bd7c8556d0dac15f636b06cfb
5
5
  SHA512:
6
- metadata.gz: 23c41e1b08ed340947e26d0ab7109b0a62357cbca89e503ec759600c3fdb840adbf2ee646c766b80fadffad079edb572a0cc368fad449ef4707d9e0b95a7d0ec
7
- data.tar.gz: b03ea0e7bcf785dd6a2de1b1fee650bedadadb16b4441199082f2d036a051ebc4debcd4d54978568fd2d8cd9ff172494c8759720184b9c121621d89a1fa47b41
6
+ metadata.gz: 84c9056712e89db73be4428943c572dc4a778ec4c6415cb01b095d9cf981b92fe32cbd4920b6c15421bb3f0449bd5c4c56ac8606eba35845460ba5aae2927b44
7
+ data.tar.gz: aa16b2826f4defef93aa6a00c50fd65d7e806d973030cf38ca0b03e85ca56e726cf10eb3af21c68627d60f5e644502ccca86e6adb27b43081bc73c7ea220ae86
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - ruby-head
5
+ - 2.5
6
+ - 2.6
7
+ - 2.7
8
+ - 3.0
9
+ - 3.1
10
+ cache:
11
+ - bundler
12
+ - directories:
13
+ - /home/travis/.rvm/
14
+ script: bundle exec rspec -fd
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Kant v0.0.5
1
+ # Kant v0.0.6 [![Build Status](https://travis-ci.org/markprzepiora/kant.svg?branch=master)](https://app.travis-ci.com/github/markprzepiora/kant)
2
2
 
3
3
  Kant is a tiny authorization library for your Ruby (especially Rails and/or
4
4
  ActiveRecord) projects.
data/kant.gemspec CHANGED
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "bundler", ">= 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_development_dependency "rspec", "~> 3.1.0"
24
- spec.add_development_dependency "with_model", "~> 1.2.1"
25
- spec.add_development_dependency "sqlite3", "~> 1.3.10"
26
- spec.add_development_dependency "activerecord", ">= 3.2"
24
+ spec.add_development_dependency "with_model", "~> 2.1"
25
+ spec.add_development_dependency "sqlite3", ">= 1.4"
26
+ spec.add_development_dependency "activerecord", "~> 6.1"
27
27
  end
@@ -2,7 +2,7 @@ module Kant
2
2
  class AllAccess
3
3
  attr_reader :user
4
4
 
5
- def initialize(user)
5
+ def initialize(user = nil)
6
6
  @user = user
7
7
  end
8
8
 
data/lib/kant/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kant
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -193,7 +193,10 @@ describe Kant::PolicyAccess do
193
193
  # end
194
194
  # end
195
195
  todo_policy = Class.new do
196
- define_singleton_method(:readable_as_owner) do |todos, user, project:|
196
+ define_singleton_method(:readable_as_owner) do |todos, user, options = {}|
197
+ project = options[:project]
198
+ fail ArgumentError if !project
199
+
197
200
  if project.owner_id == user.id
198
201
  todos.where(project_id: project.id, completed: true)
199
202
  else
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Przepiora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
@@ -58,42 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2.1
61
+ version: '2.1'
62
62
  type: :development
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: 1.2.1
68
+ version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.3.10
75
+ version: '1.4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3.10
82
+ version: '1.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activerecord
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.2'
89
+ version: '6.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.2'
96
+ version: '6.1'
97
97
  description: Kant is a tiny authorization library for your Ruby (especially Rails
98
98
  and/or ActiveRecord) projects.
99
99
  email:
@@ -103,6 +103,7 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - ".gitignore"
106
+ - ".travis.yml"
106
107
  - Gemfile
107
108
  - LICENSE.txt
108
109
  - README.md
@@ -142,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.4.5.1
146
+ rubygems_version: 3.1.6
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: A tiny, non-magical authorization library