restrict 0.0.8 → 0.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c64d62099175f3a9b75038ddb7194f9194b6a9f
4
- data.tar.gz: 062a5d223b9ca341d424eceabe63549306b26c40
3
+ metadata.gz: c93762926e3f4b9df38b5ef6a4727a2137722b91
4
+ data.tar.gz: 9e40544b25b8bcf811a4de23cfa5ed3c26fce8d4
5
5
  SHA512:
6
- metadata.gz: 7f20340ac055884a14dde1e86d3487493ed289bd483414918461402bf1f8563f55b1df07390b7ba0a4faa2bb689dcfc61fb2cfde03b82e96bea4ec01269e977f
7
- data.tar.gz: f4cb556ccee44018cb568512a7590a3383cc833340b4cb5cd96432447a817f7550118506436e3709acf1aacb55c3e3d6e2dd51011797c5a42deedf28c265ce68
6
+ metadata.gz: a5d3aebcad7634ed0e4f58b61feccbc2435499f5ba9dedfe38f9dbcc697f975d9b46abcf362e3cea32c78627c133a03744499903210533e03f066be903ebd72c
7
+ data.tar.gz: 48d33bb786b2bc5d62daa54d680bb373be4dfb8bcbbc9fff957e813b874c32da1157150898ad77ac03c9f6fe298236e3fee4a2bf36bb32082f86bf0f6298b1ce
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -1,7 +1,5 @@
1
1
  rvm:
2
- - 2.0.0
3
- - 2.1.0
4
- - 2.1.1
2
+ - 2.3.1
5
3
 
6
4
  script: 'bundle exec rake spec'
7
5
 
@@ -0,0 +1,5 @@
1
+ RSpec.shared_examples "restricts access to" do |action_name, unless_condition|
2
+ it "restricts #{action_name}#{unless_condition && " unless #{unless_condition}"}" do
3
+ expect(controller).to have_restriction_on(action_name).unless(unless_condition)
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Restrict
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -25,5 +25,4 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'simplecov'
26
26
  spec.add_development_dependency 'rake'
27
27
  spec.add_development_dependency 'byebug'
28
- spec.add_development_dependency 'codeclimate-test-reporter'
29
28
  end
@@ -17,6 +17,8 @@ describe Restrict::Rails::Controller do
17
17
  it 'builds and adds a conditional restriction' do
18
18
  expect(controller).to have_restriction_on(:show).unless(:access_allowed?)
19
19
  end
20
+
21
+ include_examples 'restricts access to', :show, :access_allowed?
20
22
  end
21
23
 
22
24
  describe '#included' do
@@ -1,6 +1,3 @@
1
- require 'codeclimate-test-reporter'
2
- CodeClimate::TestReporter.start
3
-
4
1
  require 'simplecov'
5
2
  require 'byebug'
6
3
 
@@ -13,6 +10,7 @@ SimpleCov.start 'gem'
13
10
 
14
11
  require 'restrict'
15
12
  require 'restrict/rspec/matcher'
13
+ require 'restrict/rspec/shared_example'
16
14
 
17
15
  RSpec.configure do |config|
18
16
  config.after do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restrict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-02 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: codeclimate-test-reporter
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  description: Simple access control dsl for controllers
112
98
  email:
113
99
  - johannes.opper@gmail.com
@@ -117,6 +103,7 @@ extra_rdoc_files: []
117
103
  files:
118
104
  - ".gitignore"
119
105
  - ".rspec"
106
+ - ".ruby-version"
120
107
  - ".travis.yml"
121
108
  - CHANGELOG.md
122
109
  - Gemfile
@@ -134,6 +121,7 @@ files:
134
121
  - lib/restrict/restriction.rb
135
122
  - lib/restrict/rspec/matcher.rb
136
123
  - lib/restrict/rspec/matcher_rspec2.rb
124
+ - lib/restrict/rspec/shared_example.rb
137
125
  - lib/restrict/version.rb
138
126
  - restrict.gemspec
139
127
  - spec/lib/restrict/configuration_spec.rb
@@ -163,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
151
  version: '0'
164
152
  requirements: []
165
153
  rubyforge_project:
166
- rubygems_version: 2.6.4
154
+ rubygems_version: 2.6.11
167
155
  signing_key:
168
156
  specification_version: 4
169
157
  summary: Simple access control dsl for controllers.
@@ -175,4 +163,3 @@ test_files:
175
163
  - spec/lib/restrict/rspec/matcher_spec.rb
176
164
  - spec/lib/restrict_spec.rb
177
165
  - spec/spec_helper.rb
178
- has_rdoc: