snip_snip 0.0.3 → 0.0.4

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: 69a715d7c418e729386a0c3beeb8894a99994b7e
4
- data.tar.gz: 9336758e8ff2c3b1e223f39e094efa92c75133b1
2
+ SHA256:
3
+ metadata.gz: 2ab20601d5e680676cb1586540ae9b188f750c0df3a517c938003b2707ceabf9
4
+ data.tar.gz: 02f339ff0f46d3268004effa8552c2b3bd02158473d2e9b7a7c7af9baf37caa0
5
5
  SHA512:
6
- metadata.gz: e2283f426b336f66f8773796da3222668c1186c317e416a51afe82db79b38ecc83d5b00dd99147a958d9ab4bc6188b854e455db46e551dfab6e282c070d9ba05
7
- data.tar.gz: 8c02415fe86e430a7b4f1ac540743fa75a75385e438814b6a6bfec0b2deda2f8a15805353d1716c9a45f723c915dc954839b31d85afc4608d910ba2ae6f60f06
6
+ metadata.gz: dd5b230d84091cd299d86bf1392d06eec979298af8181e4cc9b4b377d2d231bcf317a9b6273f5ceba366eb28f0064d8de854d2790fe799ba721e8070f8aa9e3f
7
+ data.tar.gz: 8523c5db2051eeb97a545472d63bda53c9dd2f225aaac8241587aa80f4a34d165f72b010b3b993af3fcf3c2958a1b46987cb065607bef34c4cc7fdc5ad600c5a
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-present Kevin Newton
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 CHANGED
@@ -1,15 +1,27 @@
1
1
  # SnipSnip
2
2
 
3
- [![Build Status](https://travis-ci.org/kddeisz/snip_snip.svg?branch=master)](https://travis-ci.org/kddeisz/snip_snip)
4
- [![Coverage Status](https://coveralls.io/repos/github/kddeisz/snip_snip/badge.svg?branch=master)](https://coveralls.io/github/kddeisz/snip_snip?branch=master)
3
+ [![Build Status](https://github.com/kddnewton/snip_snip/workflows/Main/badge.svg)](https://github.com/kddnewton/snip_snip/actions)
4
+ [![Gem Version](https://img.shields.io/gem/v/snip_snip.svg)](https://rubygems.org/gems/snip_snip)
5
5
 
6
6
  SnipSnip tells you what you selected that you shouldn't have in a Rails controller action.
7
7
 
8
- ## Usage
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'snip_snip'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
9
19
 
10
- Add `SnipSnip` to your Gemfile:
20
+ Or install it yourself as:
11
21
 
12
- $ gem 'snip_snip', group: %i[test development]
22
+ $ gem install snip_snip
23
+
24
+ ## Usage
13
25
 
14
26
  Open `snip-snip.log`:
15
27
 
@@ -17,6 +29,10 @@ Open `snip-snip.log`:
17
29
 
18
30
  Hit a controller action and see the output.
19
31
 
32
+ ## Contributing
33
+
34
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kddnewton/snip_snip.
35
+
20
36
  ## License
21
37
 
22
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
38
+ The code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,17 +1,17 @@
1
- require 'bundler/setup'
1
+ # frozen_string_literal: true
2
+
3
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
4
+ load 'rails/tasks/engine.rake'
5
+ load 'rails/tasks/statistics.rake'
6
+
2
7
  require 'bundler/gem_tasks'
3
8
  require 'rake/testtask'
4
- require 'yard'
5
-
6
- YARD::Rake::YardocTask.new(:yard) do |t|
7
- t.stats_options = ['--list-undoc']
8
- end
9
9
 
10
10
  Rake::TestTask.new(:test) do |t|
11
11
  t.libs << 'lib'
12
12
  t.libs << 'test'
13
13
  t.pattern = 'test/**/*_test.rb'
14
- t.verbose = false
14
+ t.warning = nil
15
15
  end
16
16
 
17
17
  task default: :test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SnipSnip
2
4
  # Classes to filter out of the tracking when looking at which columns were
3
5
  # selected.
@@ -8,6 +10,7 @@ module SnipSnip
8
10
  @filtered = filtered
9
11
 
10
12
  return unless ActiveRecord.const_defined?(:InternalMetadata)
13
+
11
14
  @filtered << ActiveRecord::InternalMetadata
12
15
  end
13
16
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SnipSnip
2
4
  # Hooks into Rails to track when columns are selected but not necessary.
3
5
  class Railtie < Rails::Railtie
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SnipSnip
2
4
  # A list of records that were found during the course of the last request
3
5
  # on which we are tracking columns.
@@ -18,6 +20,7 @@ module SnipSnip
18
20
  # registry
19
21
  def each_record(&block)
20
22
  return to_enum(:each_record) unless block_given?
23
+
21
24
  records.each(&block)
22
25
  end
23
26
 
@@ -35,12 +38,13 @@ module SnipSnip
35
38
  # Delegate all missing methods to the singleton instance.
36
39
  def method_missing(method, *args, &block)
37
40
  return super unless respond_to_missing?(method)
41
+
38
42
  instance.public_send(method, *args, &block)
39
43
  end
40
44
 
41
45
  # Respond to all of the missing methods on the singleton instance.
42
- def respond_to_missing?(method)
43
- instance.respond_to?(method)
46
+ def respond_to_missing?(method, include_private = false)
47
+ instance.respond_to?(method) || super
44
48
  end
45
49
  end
46
50
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SnipSnip
2
4
  # Handles outputting unnecessarily selected columns to the logs.
3
5
  class Reporter
@@ -1,4 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SnipSnip
2
- # The current version of the gem.
3
- VERSION = '0.0.3'.freeze
4
+ VERSION = '0.0.4'
4
5
  end
data/lib/snip_snip.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
 
3
5
  require 'snip_snip/filter'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snip_snip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
- - Kevin Deisz
8
- autorequire:
7
+ - Kevin Newton
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2021-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,69 +25,97 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 5.0.0.beta
27
27
  - !ruby/object:Gem::Dependency
28
- name: rubocop
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: simplecov
42
+ name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '5.11'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '5.11'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sqlite3
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '13.0'
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: '0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: yard
70
+ name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.12'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.12'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.17'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.17'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.4'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0'
110
+ version: '1.4'
83
111
  description: Lets you know what you selected that you shouldn't have
84
112
  email:
85
- - kevin.deisz@gmail.com
113
+ - kddnewton@gmail.com
86
114
  executables: []
87
115
  extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
90
- - MIT-LICENSE
118
+ - LICENSE
91
119
  - README.md
92
120
  - Rakefile
93
121
  - lib/snip_snip.rb
@@ -96,11 +124,15 @@ files:
96
124
  - lib/snip_snip/registry.rb
97
125
  - lib/snip_snip/reporter.rb
98
126
  - lib/snip_snip/version.rb
99
- homepage: https://github.com/kddeisz/snip_snip
127
+ homepage: https://github.com/kddnewton/snip_snip
100
128
  licenses:
101
129
  - MIT
102
- metadata: {}
103
- post_install_message:
130
+ metadata:
131
+ bug_tracker_uri: https://github.com/kddnewton/snip_snip/issues
132
+ changelog_uri: https://github.com/kddnewton/snip_snip/blob/v0.0.4/CHANGELOG.md
133
+ source_code_uri: https://github.com/kddnewton/snip_snip
134
+ rubygems_mfa_required: 'true'
135
+ post_install_message:
104
136
  rdoc_options: []
105
137
  require_paths:
106
138
  - lib
@@ -115,9 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
147
  - !ruby/object:Gem::Version
116
148
  version: '0'
117
149
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.6.13
120
- signing_key:
150
+ rubygems_version: 3.2.3
151
+ signing_key:
121
152
  specification_version: 4
122
153
  summary: SnipSnip cuts the deadweight
123
154
  test_files: []
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2016 Kevin Deisz
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.