henko 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.gitignore +8 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +17 -0
  4. data/Gemfile.lock +163 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +3 -0
  7. data/Rakefile +27 -0
  8. data/app/assets/images/change_logger/.gitkeep +0 -0
  9. data/app/assets/javascripts/change_logger/application.js +15 -0
  10. data/app/assets/stylesheets/change_logger/application.css +13 -0
  11. data/app/controllers/henko/application_controller.rb +4 -0
  12. data/app/helpers/henko/application_helper.rb +4 -0
  13. data/app/models/henko/audit_log.rb +17 -0
  14. data/app/views/layouts/change_logger/application.html.erb +14 -0
  15. data/change_logger.gemspec +35 -0
  16. data/config/routes.rb +2 -0
  17. data/lib/henko.rb +11 -0
  18. data/lib/henko/active_record_extensions.rb +21 -0
  19. data/lib/henko/engine.rb +12 -0
  20. data/lib/henko/log_manager.rb +36 -0
  21. data/lib/henko/railtie.rb +9 -0
  22. data/lib/henko/version.rb +3 -0
  23. data/lib/tasks/change_logger_tasks.rake +5 -0
  24. data/script/rails +8 -0
  25. data/spec/dummy/README.rdoc +261 -0
  26. data/spec/dummy/Rakefile +7 -0
  27. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  28. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  29. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  30. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  31. data/spec/dummy/app/mailers/.gitkeep +0 -0
  32. data/spec/dummy/app/models/.gitkeep +0 -0
  33. data/spec/dummy/app/models/user.rb +3 -0
  34. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/spec/dummy/config.ru +4 -0
  36. data/spec/dummy/config/application.rb +66 -0
  37. data/spec/dummy/config/boot.rb +10 -0
  38. data/spec/dummy/config/database.yml +25 -0
  39. data/spec/dummy/config/environment.rb +5 -0
  40. data/spec/dummy/config/environments/development.rb +37 -0
  41. data/spec/dummy/config/environments/production.rb +67 -0
  42. data/spec/dummy/config/environments/test.rb +37 -0
  43. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/spec/dummy/config/initializers/inflections.rb +15 -0
  45. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  46. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  47. data/spec/dummy/config/initializers/session_store.rb +8 -0
  48. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  49. data/spec/dummy/config/locales/en.yml +5 -0
  50. data/spec/dummy/config/mongoid.yml +20 -0
  51. data/spec/dummy/config/routes.rb +3 -0
  52. data/spec/dummy/db/migrate/20120812192635_create_users.rb +11 -0
  53. data/spec/dummy/db/schema.rb +24 -0
  54. data/spec/dummy/lib/assets/.gitkeep +0 -0
  55. data/spec/dummy/log/.gitkeep +0 -0
  56. data/spec/dummy/public/404.html +26 -0
  57. data/spec/dummy/public/422.html +26 -0
  58. data/spec/dummy/public/500.html +25 -0
  59. data/spec/dummy/public/favicon.ico +0 -0
  60. data/spec/dummy/script/rails +6 -0
  61. data/spec/fabricators/change_logger_audit_log_fabricator.rb +2 -0
  62. data/spec/lib/henko/active_record_extensions_spec.rb +25 -0
  63. data/spec/lib/henko/log_manager_spec.rb +49 -0
  64. data/spec/models/change_logger/audit_log_spec.rb +12 -0
  65. data/spec/spec_helper.rb +65 -0
  66. metadata +365 -0
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Henko::AuditLog do
4
+ it "should create the log" do
5
+ log = Henko::AuditLog.create(action: 'destroy', action_url: '/something', user_id: 1, class_name: 'User', data: nil)
6
+ Henko::AuditLog.count.should == 1
7
+
8
+ log = Henko::AuditLog.first
9
+ log.user_id.should == "1"
10
+ log.action.should == "destroy"
11
+ end
12
+ end
@@ -0,0 +1,65 @@
1
+ ENV["RAILS_ENV"] ||= 'test'
2
+
3
+ require 'rubygems'
4
+ require 'spork'
5
+ require 'fabrication'
6
+ require 'faker'
7
+ require 'vcr'
8
+
9
+ #uncomment the following line to use spork with the debugger
10
+ #require 'spork/ext/ruby-debug'
11
+
12
+ Fabrication.configure do |config|
13
+ config.fabricator_path = 'spec/fabricators'
14
+ config.path_prefix = "."
15
+ end
16
+
17
+ Spork.prefork do
18
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
19
+ require File.expand_path("../../spec/dummy/config/environment", __FILE__)
20
+
21
+ require 'rspec/rails'
22
+ require 'rspec/autorun'
23
+
24
+ VCR.configure do |c|
25
+ c.cassette_library_dir = 'fixtures/vcr_cassettes'
26
+ c.hook_into :fakeweb
27
+ end
28
+
29
+ # Requires supporting ruby files with custom matchers and macros, etc,
30
+ # in spec/support/ and its subdirectories.
31
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
32
+
33
+ RSpec.configure do |config|
34
+ config.treat_symbols_as_metadata_keys_with_true_values = true
35
+
36
+ # ## Mock Framework
37
+ #
38
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
39
+ #
40
+ # config.mock_with :mocha
41
+ # config.mock_with :flexmock
42
+ # config.mock_with :rr
43
+
44
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
45
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
46
+
47
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
48
+ # examples within a transaction, remove the following line or assign false
49
+ # instead of true.
50
+ config.use_transactional_fixtures = true
51
+
52
+ # If true, the base class of anonymous controllers will be inferred
53
+ # automatically. This will be the default behavior in future versions of
54
+ # rspec-rails.
55
+ config.infer_base_class_for_anonymous_controllers = false
56
+
57
+ config.before(:each) do
58
+ Mongoid.purge!
59
+ end
60
+ end
61
+ end
62
+
63
+ Spork.each_run do
64
+
65
+ end
metadata ADDED
@@ -0,0 +1,365 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: henko
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Avi Tzurel
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.6
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.6
30
+ - !ruby/object:Gem::Dependency
31
+ name: mongoid
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '2.4'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bson_ext
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.5'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.5'
62
+ - !ruby/object:Gem::Dependency
63
+ name: sqlite3
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: fabrication
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rspec-rails
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: faker
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
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
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: simplecov
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: guard-spork
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: guard-rspec
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: mongoid-rspec
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: fakeweb
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ - !ruby/object:Gem::Dependency
207
+ name: vcr
208
+ requirement: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ description: Log your AR model changes into MongoDB
223
+ email:
224
+ - avi@kensodev.com
225
+ executables: []
226
+ extensions: []
227
+ extra_rdoc_files: []
228
+ files:
229
+ - .gitignore
230
+ - .rspec
231
+ - Gemfile
232
+ - Gemfile.lock
233
+ - MIT-LICENSE
234
+ - README.rdoc
235
+ - Rakefile
236
+ - app/assets/images/change_logger/.gitkeep
237
+ - app/assets/javascripts/change_logger/application.js
238
+ - app/assets/stylesheets/change_logger/application.css
239
+ - app/controllers/henko/application_controller.rb
240
+ - app/helpers/henko/application_helper.rb
241
+ - app/models/henko/audit_log.rb
242
+ - app/views/layouts/change_logger/application.html.erb
243
+ - change_logger.gemspec
244
+ - config/routes.rb
245
+ - lib/henko.rb
246
+ - lib/henko/active_record_extensions.rb
247
+ - lib/henko/engine.rb
248
+ - lib/henko/log_manager.rb
249
+ - lib/henko/railtie.rb
250
+ - lib/henko/version.rb
251
+ - lib/tasks/change_logger_tasks.rake
252
+ - script/rails
253
+ - spec/dummy/README.rdoc
254
+ - spec/dummy/Rakefile
255
+ - spec/dummy/app/assets/javascripts/application.js
256
+ - spec/dummy/app/assets/stylesheets/application.css
257
+ - spec/dummy/app/controllers/application_controller.rb
258
+ - spec/dummy/app/helpers/application_helper.rb
259
+ - spec/dummy/app/mailers/.gitkeep
260
+ - spec/dummy/app/models/.gitkeep
261
+ - spec/dummy/app/models/user.rb
262
+ - spec/dummy/app/views/layouts/application.html.erb
263
+ - spec/dummy/config.ru
264
+ - spec/dummy/config/application.rb
265
+ - spec/dummy/config/boot.rb
266
+ - spec/dummy/config/database.yml
267
+ - spec/dummy/config/environment.rb
268
+ - spec/dummy/config/environments/development.rb
269
+ - spec/dummy/config/environments/production.rb
270
+ - spec/dummy/config/environments/test.rb
271
+ - spec/dummy/config/initializers/backtrace_silencers.rb
272
+ - spec/dummy/config/initializers/inflections.rb
273
+ - spec/dummy/config/initializers/mime_types.rb
274
+ - spec/dummy/config/initializers/secret_token.rb
275
+ - spec/dummy/config/initializers/session_store.rb
276
+ - spec/dummy/config/initializers/wrap_parameters.rb
277
+ - spec/dummy/config/locales/en.yml
278
+ - spec/dummy/config/mongoid.yml
279
+ - spec/dummy/config/routes.rb
280
+ - spec/dummy/db/migrate/20120812192635_create_users.rb
281
+ - spec/dummy/db/schema.rb
282
+ - spec/dummy/lib/assets/.gitkeep
283
+ - spec/dummy/log/.gitkeep
284
+ - spec/dummy/public/404.html
285
+ - spec/dummy/public/422.html
286
+ - spec/dummy/public/500.html
287
+ - spec/dummy/public/favicon.ico
288
+ - spec/dummy/script/rails
289
+ - spec/fabricators/change_logger_audit_log_fabricator.rb
290
+ - spec/lib/henko/active_record_extensions_spec.rb
291
+ - spec/lib/henko/log_manager_spec.rb
292
+ - spec/models/change_logger/audit_log_spec.rb
293
+ - spec/spec_helper.rb
294
+ homepage: http://www.avi.io
295
+ licenses: []
296
+ post_install_message:
297
+ rdoc_options: []
298
+ require_paths:
299
+ - lib
300
+ required_ruby_version: !ruby/object:Gem::Requirement
301
+ none: false
302
+ requirements:
303
+ - - ! '>='
304
+ - !ruby/object:Gem::Version
305
+ version: '0'
306
+ segments:
307
+ - 0
308
+ hash: -4001270427597017019
309
+ required_rubygems_version: !ruby/object:Gem::Requirement
310
+ none: false
311
+ requirements:
312
+ - - ! '>='
313
+ - !ruby/object:Gem::Version
314
+ version: '0'
315
+ segments:
316
+ - 0
317
+ hash: -4001270427597017019
318
+ requirements: []
319
+ rubyforge_project:
320
+ rubygems_version: 1.8.24
321
+ signing_key:
322
+ specification_version: 3
323
+ summary: Log your AR model changes into MongoDB
324
+ test_files:
325
+ - spec/dummy/README.rdoc
326
+ - spec/dummy/Rakefile
327
+ - spec/dummy/app/assets/javascripts/application.js
328
+ - spec/dummy/app/assets/stylesheets/application.css
329
+ - spec/dummy/app/controllers/application_controller.rb
330
+ - spec/dummy/app/helpers/application_helper.rb
331
+ - spec/dummy/app/mailers/.gitkeep
332
+ - spec/dummy/app/models/.gitkeep
333
+ - spec/dummy/app/models/user.rb
334
+ - spec/dummy/app/views/layouts/application.html.erb
335
+ - spec/dummy/config.ru
336
+ - spec/dummy/config/application.rb
337
+ - spec/dummy/config/boot.rb
338
+ - spec/dummy/config/database.yml
339
+ - spec/dummy/config/environment.rb
340
+ - spec/dummy/config/environments/development.rb
341
+ - spec/dummy/config/environments/production.rb
342
+ - spec/dummy/config/environments/test.rb
343
+ - spec/dummy/config/initializers/backtrace_silencers.rb
344
+ - spec/dummy/config/initializers/inflections.rb
345
+ - spec/dummy/config/initializers/mime_types.rb
346
+ - spec/dummy/config/initializers/secret_token.rb
347
+ - spec/dummy/config/initializers/session_store.rb
348
+ - spec/dummy/config/initializers/wrap_parameters.rb
349
+ - spec/dummy/config/locales/en.yml
350
+ - spec/dummy/config/mongoid.yml
351
+ - spec/dummy/config/routes.rb
352
+ - spec/dummy/db/migrate/20120812192635_create_users.rb
353
+ - spec/dummy/db/schema.rb
354
+ - spec/dummy/lib/assets/.gitkeep
355
+ - spec/dummy/log/.gitkeep
356
+ - spec/dummy/public/404.html
357
+ - spec/dummy/public/422.html
358
+ - spec/dummy/public/500.html
359
+ - spec/dummy/public/favicon.ico
360
+ - spec/dummy/script/rails
361
+ - spec/fabricators/change_logger_audit_log_fabricator.rb
362
+ - spec/lib/henko/active_record_extensions_spec.rb
363
+ - spec/lib/henko/log_manager_spec.rb
364
+ - spec/models/change_logger/audit_log_spec.rb
365
+ - spec/spec_helper.rb