audits1984 0.1.3 → 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
2
  SHA256:
3
- metadata.gz: d5767616c2784090ee12b68487d23185f14b4f50f4df6a9508ee5a348ea8c028
4
- data.tar.gz: 05a4d8e505d0dde7d600e1b2a8388306a155e6a1fb8bb36e68c3b8811d35a63e
3
+ metadata.gz: 569bb7eda48cf95cd00f60dfd583079577a55e1d37ebeba7ab0d8559b6609685
4
+ data.tar.gz: 613d49b1312195a792e77578064c0e58cc19a98bc380be55d81e4bbece6fab1f
5
5
  SHA512:
6
- metadata.gz: ddeef7ee008c9bd3a27650892bc4c585f2614d63de7b46486a2ec97c9201a5544ae8b181575c21f87885dbd76737562db8cc543da4e04a3120b9588016642a7b
7
- data.tar.gz: 0a02a749677a67f90852095d8c66e99689a3e4feeaed0de2f8b30f543fd5e22b07a8695fd294b9d62184f21bd512c0ae14cffad1cc3a2ef9ec3dcb57beb2b96e
6
+ metadata.gz: 9992bf4db0efcfb963c95b4649fadb94212883c019221b5662951615e7d6535d40fde864f3c22ce61a70be08897719572803bdb9e8cdae0bc05d00fcc1c29397
7
+ data.tar.gz: 58565c4d4a3e4387a9722d77ecff98af9faa0575b2cc7185ed999a456be6cc1842f1241e7cb9ba0481596a7f8a956f7bb53fc38df72582538f0718359b8a27fc
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
- ![example workflow](https://github.com/basecamp/audits1984/actions/workflows/build.yml/badge.svg)
1
+ [![Build Status](https://github.com/basecamp/audits1984/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/basecamp/audits1984/actions?query=branch%3Amaster)
2
2
 
3
3
  # Audits1984
4
4
 
5
5
  A simple auditing tool for [`console1984`](https://github.com/basecamp/console1984).
6
6
 
7
-
8
-
9
7
  ## Installation
10
8
 
11
9
  Add it to your `Gemfile`:
@@ -16,7 +14,7 @@ gem 'audits1984'
16
14
 
17
15
  Create tables to store audits in the database:
18
16
 
19
- ```ruby
17
+ ```sh
20
18
  rails audits1984:install:migrations
21
19
  rails db:migrate
22
20
  ```
@@ -60,5 +58,5 @@ These config options are namespaced in `config.audits1984`:
60
58
  | Name | Description |
61
59
  | --------------------- | ------------------------------------------------------------ |
62
60
  | auditor_class | The name of the auditor class. By default it's `::User.` |
61
+ | auditor_name_attribute | The attribute on the auditor class that returns the auditor's name. By default it's `:name`. |
63
62
  | base_controller_class | The host application base class that will be the parent of `audit1984` controllers. By default it's `::ApplicationController`. |
64
-
data/Rakefile CHANGED
@@ -13,6 +13,7 @@ Rake::TestTask.new(:test) do |t|
13
13
  t.libs << 'test'
14
14
  t.pattern = 'test/**/*_test.rb'
15
15
  t.verbose = false
16
+ t.warning = false
16
17
  end
17
18
 
18
19
  task default: :test
@@ -2,6 +2,14 @@ require "rouge"
2
2
 
3
3
  module Audits1984
4
4
  module ApplicationHelper
5
+ def auditor_name_for(auditor)
6
+ if auditor == Audits1984::Current.auditor
7
+ "You"
8
+ else
9
+ auditor.public_send(Audits1984.auditor_name_attribute)
10
+ end
11
+ end
12
+
5
13
  def format_date(date)
6
14
  # <time datetime="2016-1-1">11:09 PM - 1 Jan 2016</time>
7
15
  date.strftime("%Y-%m-%d")
@@ -6,7 +6,7 @@
6
6
  <ul class="mb-6">
7
7
  <% session.audits.except(&:new_record?).each do |audit| %>
8
8
  <li> <%= audit.status.humanize %>
9
- by <%= audit.auditor == Audits1984::Current.auditor ? "You" : audit.auditor.name %>
9
+ by <%= auditor_name_for(audit.auditor) %>
10
10
  on <%= format_date_and_time(audit.created_at) %>
11
11
  </li>
12
12
  <% end %>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <%= csrf_meta_tags %>
10
10
 
11
- <%= javascript_include_tag "audits1984/application", data: { turbo_track: :reload } %>
11
+ <%= javascript_include_tag "audits1984/application", nonce: true, data: { turbo_track: :reload } %>
12
12
  <%= stylesheet_link_tag "audits1984/application", media: :all, data: { turbo_track: :reload } %>
13
13
  </head>
14
14
 
@@ -1,3 +1,3 @@
1
1
  module Audits1984
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.5'
3
3
  end
data/lib/audits1984.rb CHANGED
@@ -7,5 +7,6 @@ loader.setup
7
7
 
8
8
  module Audits1984
9
9
  mattr_accessor :auditor_class, default: "::User"
10
+ mattr_accessor :auditor_name_attribute, default: :name
10
11
  mattr_accessor :base_controller_class, default: "::ApplicationController"
11
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audits1984
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Manrubia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2023-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge
@@ -66,160 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 1.18.4
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 1.18.4
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-performance
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop-minitest
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-md
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-packaging
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rails
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: capybara
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: selenium-webdriver
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: puma
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: pg
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: mysql2
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
69
  description: Rails engine that implements a simple auditing tool for console1984 sessions
224
70
  email:
225
71
  - jorge.manrubia@gmail.com