attr_masker 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.adoc +5 -0
- data/bin/console +14 -0
- data/bin/rake +18 -0
- data/bin/rspec +18 -0
- data/bin/rubocop +18 -0
- data/bin/setup +9 -0
- data/lib/attr_masker.rb +2 -0
- data/lib/attr_masker/version.rb +1 -1
- data/lib/tasks/db.rake +2 -0
- data/spec/dummy/app/models/non_persisted_model.rb +2 -0
- data/spec/unit/rake_task_spec.rb +14 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3d3045f0f336eb0d130431423de2ff87b179df1
|
4
|
+
data.tar.gz: 26153a076aeaccb2ea5a6bd31303fee820d02878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29d8df9cd78a25f87e1071abee8e90d7205a6b8adb300c195ae807af9fabdf1683f3f79d59e6ac6d3882aa3dc5f20431efcb267e64b0f51827248946a38e9cbc
|
7
|
+
data.tar.gz: 3206a778cb2fdad5b91ab0cf035678ed4454b1b1c743e6198145f65fb23528a0b3be0bf7f2038619e65412872e8f6b6251d55b8372ecdce209970cd9fd9af2e1
|
data/.gitignore
CHANGED
data/CHANGELOG.adoc
CHANGED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "rack/cleanser"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rake
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# rubocop:disable all
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
require "rubygems"
|
16
|
+
require "bundler/setup"
|
17
|
+
|
18
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# rubocop:disable all
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
require "rubygems"
|
16
|
+
require "bundler/setup"
|
17
|
+
|
18
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# rubocop:disable all
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
require "rubygems"
|
16
|
+
require "bundler/setup"
|
17
|
+
|
18
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/setup
ADDED
data/lib/attr_masker.rb
CHANGED
data/lib/attr_masker/version.rb
CHANGED
data/lib/tasks/db.rake
CHANGED
@@ -16,6 +16,8 @@ namespace :db do
|
|
16
16
|
# http://stackoverflow.com/questions/14163938/activerecordconnectionnotestablished-within-a-rake-task
|
17
17
|
#
|
18
18
|
task :mask => :environment do
|
19
|
+
Rails.application.eager_load!
|
20
|
+
|
19
21
|
performers = AttrMasker::Performer::Base.descendants.map(&:new)
|
20
22
|
performers.select!(&:dependencies_available?)
|
21
23
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# (c) 2017 Ribose Inc.
|
2
|
+
#
|
3
|
+
|
4
|
+
require "spec_helper"
|
5
|
+
|
6
|
+
RSpec.describe "db:mask", :suppress_progressbar do
|
7
|
+
subject { Rake::Task["db:mask"] }
|
8
|
+
|
9
|
+
it "loads all application's models eagerly" do
|
10
|
+
expect(Rails.application).to receive(:eager_load!)
|
11
|
+
subject.execute
|
12
|
+
expect(defined? NonPersistedModel).to be_truthy
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr_masker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -160,7 +160,12 @@ description: It is desired to mask certain attributes of certain models by modif
|
|
160
160
|
the database.
|
161
161
|
email:
|
162
162
|
- open.source@ribose.com
|
163
|
-
executables:
|
163
|
+
executables:
|
164
|
+
- console
|
165
|
+
- rake
|
166
|
+
- rspec
|
167
|
+
- rubocop
|
168
|
+
- setup
|
164
169
|
extensions: []
|
165
170
|
extra_rdoc_files: []
|
166
171
|
files:
|
@@ -176,6 +181,11 @@ files:
|
|
176
181
|
- README.adoc
|
177
182
|
- Rakefile
|
178
183
|
- attr_masker.gemspec
|
184
|
+
- bin/console
|
185
|
+
- bin/rake
|
186
|
+
- bin/rspec
|
187
|
+
- bin/rubocop
|
188
|
+
- bin/setup
|
179
189
|
- config.ru
|
180
190
|
- gemfiles/Rails-4.0.gemfile
|
181
191
|
- gemfiles/Rails-4.1.gemfile
|
@@ -194,6 +204,7 @@ files:
|
|
194
204
|
- lib/attr_masker/railtie.rb
|
195
205
|
- lib/attr_masker/version.rb
|
196
206
|
- lib/tasks/db.rake
|
207
|
+
- spec/dummy/app/models/non_persisted_model.rb
|
197
208
|
- spec/dummy/config/database.yml
|
198
209
|
- spec/dummy/config/mongoid.yml
|
199
210
|
- spec/dummy/config/routes.rb
|
@@ -213,6 +224,7 @@ files:
|
|
213
224
|
- spec/unit/maskers/replacing_spec.rb
|
214
225
|
- spec/unit/maskers/simple_spec.rb
|
215
226
|
- spec/unit/model_spec.rb
|
227
|
+
- spec/unit/rake_task_spec.rb
|
216
228
|
homepage: https://github.com/riboseinc/attr_masker
|
217
229
|
licenses:
|
218
230
|
- MIT
|
@@ -238,6 +250,7 @@ signing_key:
|
|
238
250
|
specification_version: 4
|
239
251
|
summary: Masking attributes
|
240
252
|
test_files:
|
253
|
+
- spec/dummy/app/models/non_persisted_model.rb
|
241
254
|
- spec/dummy/config/database.yml
|
242
255
|
- spec/dummy/config/mongoid.yml
|
243
256
|
- spec/dummy/config/routes.rb
|
@@ -257,3 +270,4 @@ test_files:
|
|
257
270
|
- spec/unit/maskers/replacing_spec.rb
|
258
271
|
- spec/unit/maskers/simple_spec.rb
|
259
272
|
- spec/unit/model_spec.rb
|
273
|
+
- spec/unit/rake_task_spec.rb
|