sniffed 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/main.yml +23 -0
- data/README.md +4 -4
- data/lib/sniffed/sniffer.rb +0 -4
- data/lib/sniffed/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0e48dfed1b8fda2e44c593ebe4a98ff44e8eaa8a1dfbaeb78144d83aab60606
|
4
|
+
data.tar.gz: e23175401380747803823fbf0141dd64abcb85b142efeebc8a2b59ab8687957d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 383aa862586c9111613e54d8751b39e8bdfa3d364a5d9732e634b56e4c227a67f587a99ab537cbcdf01188e1d0e66699ac3db7a37841c517b72bdeebe1484b58
|
7
|
+
data.tar.gz: 5c58f9faf3be9c6f04db2085063365775cca5fb08341ca590a94149da0f88f5d3c457da12e8b89452585b54bd230903690032b5a0c1291ad3d375c3fcc617ec2
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* joaopfernandesc
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Main
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- main
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
rspec:
|
11
|
+
name: RSpec
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Install Ruby and gems
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 2.6
|
19
|
+
bundler-cache: true
|
20
|
+
- name: Testing
|
21
|
+
run: |
|
22
|
+
bundle exec rspec
|
23
|
+
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
Depending on your logic, it may make sense. And one day, you suddenly wake up needing to use `saved_changes`, but then...:
|
16
16
|
```ruby
|
17
17
|
dog.saved_changes
|
18
|
-
# => { 'last_name' => ['
|
18
|
+
# => { 'last_name' => ['The Crazy', 'The Dog'] }
|
19
19
|
```
|
20
20
|
|
21
21
|
Yep, you've lost track of the `first_name` changes. Sad, isn't it? But wait! I have a solution
|
@@ -43,7 +43,7 @@ Or install it yourself as:
|
|
43
43
|
Just add `sniffed` to the model you want to keep track of those changes and then starting using like:
|
44
44
|
|
45
45
|
```ruby
|
46
|
-
dog.commited_changes
|
46
|
+
dog.commited_changes
|
47
47
|
# => { 'first_name' => ['Jujuba', 'Sif'], 'last_name' => ['The Crazy', 'The Dog'] }
|
48
48
|
```
|
49
49
|
|
@@ -61,7 +61,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
61
61
|
|
62
62
|
## Contributing
|
63
63
|
|
64
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sifthedog/sniffed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sifthedog/sniffed/blob/master/CODE_OF_CONDUCT.md).
|
65
65
|
|
66
66
|
## License
|
67
67
|
|
@@ -69,4 +69,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
69
69
|
|
70
70
|
## Code of Conduct
|
71
71
|
|
72
|
-
Everyone interacting in the Sniffed project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
72
|
+
Everyone interacting in the Sniffed project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sifthedog/sniffed/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/sniffed/sniffer.rb
CHANGED
@@ -25,13 +25,9 @@ module Sniffed
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def track_commited_changes
|
28
|
-
previous_changes.each_pair(&testing)
|
29
28
|
previous_changes.each_pair(&track_commited_change)
|
30
29
|
end
|
31
30
|
|
32
|
-
def testing
|
33
|
-
end
|
34
|
-
|
35
31
|
def track_commited_change
|
36
32
|
lambda do |(attribute, (previous_value, current_value))|
|
37
33
|
if @unfiltered_commited_changes.key?(attribute)
|
data/lib/sniffed/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sniffed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- João Fernandes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -108,6 +108,8 @@ executables: []
|
|
108
108
|
extensions: []
|
109
109
|
extra_rdoc_files: []
|
110
110
|
files:
|
111
|
+
- ".github/CODEOWNERS"
|
112
|
+
- ".github/workflows/main.yml"
|
111
113
|
- ".gitignore"
|
112
114
|
- ".rspec"
|
113
115
|
- ".rubocop.yml"
|
@@ -145,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
147
|
- !ruby/object:Gem::Version
|
146
148
|
version: '0'
|
147
149
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.0.3.1
|
149
151
|
signing_key:
|
150
152
|
specification_version: 4
|
151
153
|
summary: Keeps track of multiple changes made in a transaction.
|