lite-regulations 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6fb0af891daafb5d1225d4a5c5f0b5d08ac8b0bb9b0faa750dfc46c3238d5054
4
+ data.tar.gz: 99b9963b02ccb39b541fd48c62068c5bdf925293835897fb066f9341d30e3b31
5
+ SHA512:
6
+ metadata.gz: a02aad5930c31afa80dff4997bf722be622f8188722043171a2115fd2ae0549b804bbb3ce5ef3297453578620ce1c1c73499cea902e4bc1c71e0d86bd3778cb1
7
+ data.tar.gz: 7609e2b1b4260fd966c115402cd465e9c922a950c7bf510a0789ac662a3501dfff614d931b6f4281385e7b001e06d8e8cd6e199c719d1642c45562bb4adfc943
data/.fasterer.yml ADDED
@@ -0,0 +1,19 @@
1
+ speedups:
2
+ block_vs_symbol_to_proc: true
3
+ each_with_index_vs_while: false
4
+ fetch_with_argument_vs_block: true
5
+ for_loop_vs_each: true
6
+ getter_vs_attr_reader: true
7
+ gsub_vs_tr: true
8
+ hash_merge_bang_vs_hash_brackets: true
9
+ keys_each_vs_each_key: true
10
+ map_flatten_vs_flat_map: true
11
+ module_eval: true
12
+ proc_call_vs_yield: true
13
+ rescue_vs_respond_to: true
14
+ reverse_each_vs_reverse_each: true
15
+ select_first_vs_detect: true
16
+ select_last_vs_reverse_detect: true
17
+ setter_vs_attr_writer: true
18
+ shuffle_first_vs_sample: true
19
+ sort_vs_sort_by: true
data/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --backtrace
2
+ --color
3
+ --format progress
4
+ --order random
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+ AllCops:
5
+ TargetRubyVersion: 2.6
6
+ DisplayCopNames: true
7
+ DisplayStyleGuide: true
8
+ LineLength:
9
+ Max: 100
10
+ Layout/EmptyLinesAroundBlockBody:
11
+ Exclude:
12
+ - 'spec/**/**/*'
13
+ Layout/EmptyLinesAroundClassBody:
14
+ EnforcedStyle: empty_lines_except_namespace
15
+ Layout/EmptyLinesAroundModuleBody:
16
+ EnforcedStyle: empty_lines_except_namespace
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'spec/**/**/*'
20
+ - '*.gemspec'
21
+ Style/Documentation:
22
+ Enabled: false
23
+ Style/ExpandPathArguments:
24
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,24 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.5
6
+ - 2.6
7
+ - ruby-head
8
+ matrix:
9
+ fast_finish: true
10
+ allow_failures:
11
+ - rvm: ruby-head
12
+ before_install:
13
+ - gem update --system
14
+ - gem install bundler
15
+ install:
16
+ - bundle install --jobs=3 --retry=3
17
+ script:
18
+ - bundle exec rspec
19
+ - bundle exec rubocop
20
+ - bundle exec fasterer
21
+ notifications:
22
+ email: false
23
+ slack:
24
+ secure: Jn7h124NhPPnz7fH5YuqBcHxNBnzUvahtV5bjidZWQXYIBK1qAreJOOMEYrLu3Jupv3AW76aQvEvgxRg0ijYy0DCH6XEsET2rBWgcbRLU4geFgNwgXE0GE70X1ar7uY8yUDnNbaznFCDAYtUE+Gs/88U22rSxjIq9cjNtZweswDWML2VVpGjNF65aufLyVOU6IL/Hn700yblfBPKltoJwAjLTj7haUhRWB7yKeWenzsRcKlTmdY7A8mFQ1XTYsYsIG/wnakwi3sjSGRGtbpc9Q9CoLVmhWpOzzJkOu5XmY1ny4cNrEMP8levN/0GiqyEp1j9RBzVYuoZRg55DOa28hE2dzwORaSC1+KQgdQBfVATSmNBy8/QPCpPdACy92iZLi9KmATiRYE4My4Ksm6Dti+lZMiraiIDH4P1e2e0G0iFseOqy3YcR9JEfJoJsT4Nem4twOeevpTUZ+hJ0nPkwDu1EFDXIw9xf0C6nY/zkP8yspqrrmDVR1xDwHBN9APVbNgwK97yqjl8cSwOAQqn4uONhJKWqW+nfMs5+a942bP/z7xj6DdrhTv5fqqjU0ghNB+Yrysj4wvBkI+nlqVD+y4ZhsVCPrmQPwSrpfkct6CON2rP64GSitX/wGI+4TP6UY2Fi0UIpNdKs/FW5DpKibq/JKgpb53eRvoG8TnhXBI=
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.0.0] - 2019-07-18
10
+ ### Added
11
+ - Initial project version
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at j.gomez@drexed.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in lite-regulations.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,137 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lite-regulations (1.0.0)
5
+ activerecord
6
+ activesupport
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.2.3)
12
+ actionview (= 5.2.3)
13
+ activesupport (= 5.2.3)
14
+ rack (~> 2.0)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.2.3)
19
+ activesupport (= 5.2.3)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activemodel (5.2.3)
25
+ activesupport (= 5.2.3)
26
+ activerecord (5.2.3)
27
+ activemodel (= 5.2.3)
28
+ activesupport (= 5.2.3)
29
+ arel (>= 9.0)
30
+ activesupport (5.2.3)
31
+ concurrent-ruby (~> 1.0, >= 1.0.2)
32
+ i18n (>= 0.7, < 2)
33
+ minitest (~> 5.1)
34
+ tzinfo (~> 1.1)
35
+ arel (9.0.0)
36
+ ast (2.4.0)
37
+ builder (3.2.3)
38
+ colorize (0.8.1)
39
+ concurrent-ruby (1.1.5)
40
+ crass (1.0.4)
41
+ database_cleaner (1.7.0)
42
+ diff-lcs (1.3)
43
+ erubi (1.8.0)
44
+ fasterer (0.5.1)
45
+ colorize (~> 0.7)
46
+ ruby_parser (>= 3.13.0)
47
+ i18n (1.6.0)
48
+ concurrent-ruby (~> 1.0)
49
+ jaro_winkler (1.5.3)
50
+ loofah (2.2.3)
51
+ crass (~> 1.0.2)
52
+ nokogiri (>= 1.5.9)
53
+ method_source (0.9.2)
54
+ mini_portile2 (2.4.0)
55
+ minitest (5.11.3)
56
+ nokogiri (1.10.3)
57
+ mini_portile2 (~> 2.4.0)
58
+ parallel (1.17.0)
59
+ parser (2.6.3.0)
60
+ ast (~> 2.4.0)
61
+ rack (2.0.7)
62
+ rack-test (1.1.0)
63
+ rack (>= 1.0, < 3)
64
+ rails-dom-testing (2.0.3)
65
+ activesupport (>= 4.2.0)
66
+ nokogiri (>= 1.6)
67
+ rails-html-sanitizer (1.0.4)
68
+ loofah (~> 2.2, >= 2.2.2)
69
+ railties (5.2.3)
70
+ actionpack (= 5.2.3)
71
+ activesupport (= 5.2.3)
72
+ method_source
73
+ rake (>= 0.8.7)
74
+ thor (>= 0.19.0, < 2.0)
75
+ rainbow (3.0.0)
76
+ rake (12.3.2)
77
+ rspec (3.8.0)
78
+ rspec-core (~> 3.8.0)
79
+ rspec-expectations (~> 3.8.0)
80
+ rspec-mocks (~> 3.8.0)
81
+ rspec-core (3.8.2)
82
+ rspec-support (~> 3.8.0)
83
+ rspec-expectations (3.8.4)
84
+ diff-lcs (>= 1.2.0, < 2.0)
85
+ rspec-support (~> 3.8.0)
86
+ rspec-mocks (3.8.1)
87
+ diff-lcs (>= 1.2.0, < 2.0)
88
+ rspec-support (~> 3.8.0)
89
+ rspec-rails (3.8.2)
90
+ actionpack (>= 3.0)
91
+ activesupport (>= 3.0)
92
+ railties (>= 3.0)
93
+ rspec-core (~> 3.8.0)
94
+ rspec-expectations (~> 3.8.0)
95
+ rspec-mocks (~> 3.8.0)
96
+ rspec-support (~> 3.8.0)
97
+ rspec-support (3.8.2)
98
+ rubocop (0.72.0)
99
+ jaro_winkler (~> 1.5.1)
100
+ parallel (~> 1.10)
101
+ parser (>= 2.6)
102
+ rainbow (>= 2.2.2, < 4.0)
103
+ ruby-progressbar (~> 1.7)
104
+ unicode-display_width (>= 1.4.0, < 1.7)
105
+ rubocop-performance (1.4.0)
106
+ rubocop (>= 0.71.0)
107
+ rubocop-rspec (1.33.0)
108
+ rubocop (>= 0.60.0)
109
+ ruby-progressbar (1.10.1)
110
+ ruby_parser (3.13.1)
111
+ sexp_processor (~> 4.9)
112
+ sexp_processor (4.12.1)
113
+ sqlite3 (1.4.1)
114
+ thor (0.20.3)
115
+ thread_safe (0.3.6)
116
+ tzinfo (1.2.5)
117
+ thread_safe (~> 0.1)
118
+ unicode-display_width (1.6.0)
119
+
120
+ PLATFORMS
121
+ ruby
122
+
123
+ DEPENDENCIES
124
+ bundler
125
+ database_cleaner
126
+ fasterer
127
+ lite-regulations!
128
+ rake
129
+ rspec
130
+ rspec-rails
131
+ rubocop
132
+ rubocop-performance
133
+ rubocop-rspec
134
+ sqlite3
135
+
136
+ BUNDLED WITH
137
+ 2.0.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Juan Gomez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Lite::Regulations
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/lite-regulations.svg)](http://badge.fury.io/rb/lite-regulations)
4
+ [![Build Status](https://travis-ci.org/drexed/lite-regulations.svg?branch=master)](https://travis-ci.org/drexed/lite-regulations)
5
+
6
+ Lite::Regulations is a collection of mixins to control the state of a database record.
7
+
8
+ **NOTE:** If you are coming from `ActiveRegulation`, please read the [port](#port) section.
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'lite-regulations'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install lite-regulations
25
+
26
+ ## Table of Contents
27
+
28
+ * [Regulators](#regulators)
29
+ * [Port](#port)
30
+
31
+ ## Regulators
32
+
33
+ * [Activation](https://github.com/drexed/lite-regulations/blob/master/docs/ACTIVATION.md)
34
+ * [Containment](https://github.com/drexed/lite-regulations/blob/master/docs/CONTAINMENT.md)
35
+ * [Expiration](https://github.com/drexed/lite-regulations/blob/master/docs/EXPIRATION.md)
36
+ * [Quarantine](https://github.com/drexed/lite-regulations/blob/master/docs/QUARANTINE.md)
37
+ * [Suspension](https://github.com/drexed/lite-regulations/blob/master/docs/SUSPENSION.md)
38
+ * [Visibility](https://github.com/drexed/lite-regulations/blob/master/docs/VISIBILITY.md)
39
+
40
+ ## Port
41
+
42
+ `Lite::Regulations` is a compatible port of [ActiveRegulation](https://github.com/drexed/active_regulation).
43
+
44
+ ## Development
45
+
46
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
47
+
48
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
49
+
50
+ ## Contributing
51
+
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lite-regulations. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
53
+
54
+ ## License
55
+
56
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
57
+
58
+ ## Code of Conduct
59
+
60
+ Everyone interacting in the Lite::Regulations project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lite-regulations/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-leap-day
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'lite/regulations'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)