essay-paranoia 1.0.1

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
+ SHA1:
3
+ metadata.gz: 15ecb43813e8d87202bd30390fe05849d573689e
4
+ data.tar.gz: e4bce0808996f85d6dc4c942c32dcda387372940
5
+ SHA512:
6
+ metadata.gz: c1c1af52fc60964926c992828db527bffcee37b215e3b14c4705d0e63d34f21af016b6d655e5d25595cd26c35d77bdcd66d58837e36b5b77834c8e645d3a0370
7
+ data.tar.gz: ab1b2b996ddbc05d3ee1e1500b0b91a045a1a35c947e4107c9e8c3a1b16a4435839890e372fe8837b801c61c665495096e1ca359e6a99ebd2806489becc4f18a
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ source 'https://rubygems.org'
5
+
6
+ # Specify your gem's dependencies in essay-paranoia.gemspec
7
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Yaroslav Konoplov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ ```ruby
2
+ class Article < ActiveRecord::Base
3
+ acts_as_paranoid
4
+ end
5
+
6
+ Article.features.paranoid? # => true
7
+ Article.attribute_features[:deleted_at].paranoia_timestamp? # => true
8
+ ```
9
+
10
+ ## Gemfile
11
+ ```ruby
12
+ gem 'essay-paranoia', '~> 1.0'
13
+ ```
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'essay-paranoia'
6
+ s.version = '1.0.1'
7
+ s.authors = ['Yaroslav Konoplov']
8
+ s.email = ['eahome00@gmail.com']
9
+ s.summary = 'Essay writer for paranoia'
10
+ s.description = 'Essay writer for paranoia'
11
+ s.homepage = 'http://github.com/yivo/essay-paranoia'
12
+ s.license = 'MIT'
13
+ s.platform = Gem::Platform::RUBY
14
+
15
+ s.executables = `git ls-files -z -- bin/*`.split("\x0").map{ |f| File.basename(f) }
16
+ s.files = `git ls-files -z`.split("\x0")
17
+ s.test_files = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
18
+ s.require_paths = ['lib']
19
+
20
+ s.add_dependency 'paranoia', '>= 1.0', '< 3.0'
21
+ s.add_dependency 'essay', '~> 1.0'
22
+ end
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ require 'essay'
5
+
6
+ module Essay
7
+ class ModelFeatures
8
+ def paranoid?
9
+ model_class.respond_to?(:paranoia_column)
10
+ end
11
+
12
+ serialize do
13
+ { acts_as_paranoid: paranoid? }
14
+ end
15
+ end
16
+
17
+ class AttributeFeatures
18
+ def paranoia_timestamp?
19
+ model_class.try(:paranoia_column).try(:to_s) == attribute_name.to_s
20
+ end
21
+
22
+ serialize do
23
+ { is_paranoia_timestamp: paranoia_timestamp? }
24
+ end
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: essay-paranoia
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yaroslav Konoplov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: paranoia
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: essay
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ description: Essay writer for paranoia
48
+ email:
49
+ - eahome00@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - ".gitignore"
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - essay-paranoia.gemspec
59
+ - lib/essay-paranoia.rb
60
+ homepage: http://github.com/yivo/essay-paranoia
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.5.1
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Essay writer for paranoia
84
+ test_files: []