the_moderator 0.1.1 → 0.1.5

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: 55799be13b867400ecedb7640347f5f00ace2465
4
- data.tar.gz: 5db592b670f29749b6c2d405c94976cecf5c8bdb
2
+ SHA256:
3
+ metadata.gz: 1a98b30e2905b72202c7c07921f97b74c0f6330d237b25296d44cb3598927935
4
+ data.tar.gz: 17f489a1182ffb88de3637756e77b74238a1d72d39bada010323cce72af0c255
5
5
  SHA512:
6
- metadata.gz: 56fc8b648f6f02549c5037dd2481e680234c9c308f465c03321ade6c00298412940cc935c90f8c6dc24fda2b58ebe2784e85df249c410189c9e27c362fdf617e
7
- data.tar.gz: decc32e5617fdd3a1bd6266cc3eb97bc63c77800432b0549ecdc2db53b4c1433af18c54c0970781429fbf756670fd58d49461f08bd8ccf76dd6bd7aa71957c96
6
+ metadata.gz: ead49d4598d5521f4a5656f7dae06868ed5b9eb0decb5df1e07a43931f1af8659d326fe0e52e488d95616c4ed459839a3cc32a34f0eb286658b3e09ea8346fa4
7
+ data.tar.gz: 86c1d6c171fd2d49f58fb34df6909573e3ab7c0e954e11d87cba05011eff3797679aca961121e31d64ce0ee515a9722c00229d39d8ff37076b591c743bd364de
data/.gitignore CHANGED
@@ -16,4 +16,5 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ vendor/bundle
19
20
  *.s[a-w][a-z]
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 3.0.3
4
+ - 3.1.0
5
+ script: 'bundle exec rspec spec'
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # TheModerator
2
2
 
3
+ [![Build Status](https://travis-ci.org/gdott9/the_moderator.svg?branch=master)](https://travis-ci.org/gdott9/the_moderator)
4
+
3
5
  Moderate fields before their insertion in the database by serializing and saving them into a separate 'moderations' table.
4
6
 
5
7
  ## Installation
data/config.ru ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubygems"
4
+ require "bundler"
5
+
6
+ Bundler.require :default, :development
7
+
8
+ Combustion.initialize! :all
9
+ run Combustion::Application
@@ -16,7 +16,7 @@ module TheModerator
16
16
  def accept
17
17
  self.class.transaction do
18
18
  destroy
19
- moderatable.update_attributes(data)
19
+ moderatable.update(data)
20
20
  end
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module TheModerator
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.5"
3
3
  end
File without changes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.routes.draw do
2
- #
4
+ # Add your own routes here, or remove this file if you don't have need for it.
3
5
  end
@@ -0,0 +1,3 @@
1
+ test:
2
+ service: Disk
3
+ root: /home/guillaume/prog/pro/lafourmiimmo/the_moderator/tmp/storage
@@ -1,4 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ActiveRecord::Schema.define do
4
+ # Set up any tables you need to exist for your test suite that don't belong
5
+ # in migrations.
6
+
2
7
  create_table :categories, :force => true do |t|
3
8
  t.string :name
4
9
  t.timestamps
File without changes
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,6 @@ require 'the_moderator'
6
6
  Combustion.initialize! :active_record, :active_model
7
7
 
8
8
  RSpec.configure do |config|
9
- config.treat_symbols_as_metadata_keys_with_true_values = true
10
9
  config.run_all_when_everything_filtered = true
11
10
  config.filter_run :focus
12
11
 
@@ -6,7 +6,7 @@ describe TheModerator::Model do
6
6
  page = Page.new(name: 'Name', content: 'Content')
7
7
  page.moderate(:name)
8
8
 
9
- expect(page.moderations).to have(1).moderation
9
+ expect(page.moderations.size).to eq(1)
10
10
  expect(page.moderations.first.data[:attributes]).to include(name: 'Name')
11
11
  expect(page.name).to be_nil
12
12
  expect(page.content).to eq('Content')
@@ -14,14 +14,14 @@ describe TheModerator::Model do
14
14
 
15
15
  it 'moderates association fields' do
16
16
  category = Category.new(name: 'category')
17
- category.create_page
17
+ category.build_page
18
18
  category.save
19
19
 
20
20
  category.attributes = {page_attributes: {
21
21
  name: 'name', content: 'content', id: category.page.id}}
22
22
  category.moderate(page: :name)
23
23
 
24
- expect(category.moderations).to have(1).moderation
24
+ expect(category.moderations.size).to eq(1)
25
25
  expect(category.moderations.first.data[:attributes])
26
26
  .to include(page_attributes: {name: 'name', id: category.page.id})
27
27
  expect(category.page.name).to be_nil
@@ -35,7 +35,7 @@ describe TheModerator::Model do
35
35
  page.attributes = {links_attributes: [{id: link.id, name: 'link'}]}
36
36
  page.moderate(links: [:name])
37
37
 
38
- expect(page.moderations).to have(1).moderation
38
+ expect(page.moderations.size).to eq(1)
39
39
  expect(page.moderations.first.data[:attributes])
40
40
  .to include(links_attributes: {link.id => {name: 'link', id: link.id}})
41
41
  expect(link.name).to be_nil
@@ -47,8 +47,8 @@ describe TheModerator::Model do
47
47
  page = Page.new(name: 'Name', content: 'Content')
48
48
  page.moderate(:name)
49
49
 
50
- expect(page.moderated?(:name)).to be_true
51
- expect(page.moderated?(:content)).to be_false
50
+ expect(page.moderated?(:name)).to be true
51
+ expect(page.moderated?(:content)).to be false
52
52
  end
53
53
  end
54
54
  end
@@ -15,7 +15,7 @@ describe TheModerator::ModerationModel do
15
15
  subject.accept
16
16
 
17
17
  expect(subject.moderatable.name).to eq('Name')
18
- expect(subject.destroyed?).to be_true
18
+ expect(subject.destroyed?).to be true
19
19
  end
20
20
  end
21
21
 
@@ -25,7 +25,7 @@ describe TheModerator::ModerationModel do
25
25
  subject.discard
26
26
 
27
27
  expect(subject.moderatable.name).to be_nil
28
- expect(subject.destroyed?).to be_true
28
+ expect(subject.destroyed?).to be true
29
29
  end
30
30
  end
31
31
 
@@ -34,15 +34,15 @@ describe TheModerator::ModerationModel do
34
34
  expect(subject.moderatable.name).to be_nil
35
35
  preview = subject.preview
36
36
 
37
- expect(preview.frozen?).to be_true
37
+ expect(preview.frozen?).to be true
38
38
  expect(preview.name).to eq('Name')
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#include?' do
43
43
  it 'includes name' do
44
- expect(subject.include?(:name)).to be_true
45
- expect(subject.include?(:content)).to be_false
44
+ expect(subject.include?(:name)).to be true
45
+ expect(subject.include?(:content)).to be false
46
46
  end
47
47
  end
48
48
  end
@@ -18,14 +18,14 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "activemodel", ">= 3.2.0", "< 5.0"
22
- spec.add_dependency "activerecord", ">= 3.2.0", "< 5.0"
23
- spec.add_dependency "activesupport", ">= 3.2.0", "< 5.0"
21
+ spec.add_dependency "activemodel", ">= 3.2.0", "< 8"
22
+ spec.add_dependency "activerecord", ">= 3.2.0", "< 8"
23
+ spec.add_dependency "activesupport", ">= 3.2.0", "< 8"
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.3"
26
- spec.add_development_dependency "rake", "~> 10.3"
25
+ spec.add_development_dependency "bundler", "~> 2.2"
26
+ spec.add_development_dependency "rake", "~> 13.0"
27
27
 
28
- spec.add_development_dependency "rspec", "~> 2.14"
29
- spec.add_development_dependency "combustion", "~> 0.5"
28
+ spec.add_development_dependency "rspec", "~> 3.10"
29
+ spec.add_development_dependency "combustion", "~> 1.3"
30
30
  spec.add_development_dependency "sqlite3", "~> 1.3"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_moderator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume DOTT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.0'
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 3.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.0'
32
+ version: '8'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 3.2.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '5.0'
42
+ version: '8'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 3.2.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '5.0'
52
+ version: '8'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: activesupport
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: 3.2.0
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '5.0'
62
+ version: '8'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,63 +69,63 @@ dependencies:
69
69
  version: 3.2.0
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '5.0'
72
+ version: '8'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: bundler
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '1.3'
79
+ version: '2.2'
80
80
  type: :development
81
81
  prerelease: false
82
82
  version_requirements: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - "~>"
85
85
  - !ruby/object:Gem::Version
86
- version: '1.3'
86
+ version: '2.2'
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: rake
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - "~>"
92
92
  - !ruby/object:Gem::Version
93
- version: '10.3'
93
+ version: '13.0'
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '10.3'
100
+ version: '13.0'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: rspec
103
103
  requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - "~>"
106
106
  - !ruby/object:Gem::Version
107
- version: '2.14'
107
+ version: '3.10'
108
108
  type: :development
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - "~>"
113
113
  - !ruby/object:Gem::Version
114
- version: '2.14'
114
+ version: '3.10'
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: combustion
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - "~>"
120
120
  - !ruby/object:Gem::Version
121
- version: '0.5'
121
+ version: '1.3'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - "~>"
127
127
  - !ruby/object:Gem::Version
128
- version: '0.5'
128
+ version: '1.3'
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: sqlite3
131
131
  requirement: !ruby/object:Gem::Requirement
@@ -149,10 +149,12 @@ extra_rdoc_files: []
149
149
  files:
150
150
  - ".gitignore"
151
151
  - ".rspec"
152
+ - ".travis.yml"
152
153
  - Gemfile
153
154
  - LICENSE.txt
154
155
  - README.md
155
156
  - Rakefile
157
+ - config.ru
156
158
  - lib/generators/the_moderator/install/USAGE
157
159
  - lib/generators/the_moderator/install/install_generator.rb
158
160
  - lib/generators/the_moderator/install/templates/migration.rb
@@ -162,14 +164,17 @@ files:
162
164
  - lib/the_moderator/model.rb
163
165
  - lib/the_moderator/moderation_model.rb
164
166
  - lib/the_moderator/version.rb
167
+ - spec/internal/app/assets/config/manifest.js
165
168
  - spec/internal/app/models/category.rb
166
169
  - spec/internal/app/models/link.rb
167
170
  - spec/internal/app/models/moderation.rb
168
171
  - spec/internal/app/models/page.rb
169
172
  - spec/internal/config/database.yml
170
173
  - spec/internal/config/routes.rb
174
+ - spec/internal/config/storage.yml
171
175
  - spec/internal/db/schema.rb
172
176
  - spec/internal/log/.gitignore
177
+ - spec/internal/public/favicon.ico
173
178
  - spec/spec_helper.rb
174
179
  - spec/the_moderator/model_spec.rb
175
180
  - spec/the_moderator/moderation_model_spec.rb
@@ -178,7 +183,7 @@ homepage: https://github.com/gdott9/the_moderator
178
183
  licenses:
179
184
  - MIT
180
185
  metadata: {}
181
- post_install_message:
186
+ post_install_message:
182
187
  rdoc_options: []
183
188
  require_paths:
184
189
  - lib
@@ -193,21 +198,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
198
  - !ruby/object:Gem::Version
194
199
  version: '0'
195
200
  requirements: []
196
- rubyforge_project:
197
- rubygems_version: 2.2.2
198
- signing_key:
201
+ rubygems_version: 3.2.29
202
+ signing_key:
199
203
  specification_version: 4
200
204
  summary: Moderate fields before their insertion in the database by serializing and
201
205
  saving them into a separate 'moderations' table.
202
206
  test_files:
207
+ - spec/internal/app/assets/config/manifest.js
203
208
  - spec/internal/app/models/category.rb
204
209
  - spec/internal/app/models/link.rb
205
210
  - spec/internal/app/models/moderation.rb
206
211
  - spec/internal/app/models/page.rb
207
212
  - spec/internal/config/database.yml
208
213
  - spec/internal/config/routes.rb
214
+ - spec/internal/config/storage.yml
209
215
  - spec/internal/db/schema.rb
210
216
  - spec/internal/log/.gitignore
217
+ - spec/internal/public/favicon.ico
211
218
  - spec/spec_helper.rb
212
219
  - spec/the_moderator/model_spec.rb
213
220
  - spec/the_moderator/moderation_model_spec.rb