ahoy_email 1.0.3 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -22
  3. data/LICENSE.txt +1 -1
  4. data/README.md +181 -135
  5. data/app/controllers/ahoy/messages_controller.rb +27 -45
  6. data/app/models/ahoy/click.rb +5 -0
  7. data/app/models/ahoy/message.rb +1 -1
  8. data/config/routes.rb +3 -0
  9. data/lib/ahoy_email.rb +34 -9
  10. data/lib/ahoy_email/database_subscriber.rb +42 -0
  11. data/lib/ahoy_email/engine.rb +3 -1
  12. data/lib/ahoy_email/mailer.rb +45 -17
  13. data/lib/ahoy_email/message_subscriber.rb +12 -0
  14. data/lib/ahoy_email/processor.rb +24 -43
  15. data/lib/ahoy_email/redis_subscriber.rb +79 -0
  16. data/lib/ahoy_email/tracker.rb +9 -3
  17. data/lib/ahoy_email/utils.rb +35 -0
  18. data/lib/ahoy_email/version.rb +1 -1
  19. data/lib/generators/ahoy/clicks/activerecord_generator.rb +20 -0
  20. data/lib/generators/ahoy/clicks/mongoid_generator.rb +15 -0
  21. data/lib/generators/ahoy/clicks/templates/migration.rb.tt +11 -0
  22. data/lib/generators/ahoy/clicks/templates/mongoid.rb.tt +8 -0
  23. data/lib/generators/ahoy/clicks_generator.rb +37 -0
  24. data/lib/generators/ahoy/messages/activerecord_generator.rb +40 -0
  25. data/lib/generators/ahoy/messages/mongoid_generator.rb +21 -0
  26. data/lib/generators/{ahoy_email/templates/install.rb.tt → ahoy/messages/templates/migration.rb.tt} +2 -2
  27. data/lib/generators/ahoy/messages/templates/model_encrypted.rb.tt +8 -0
  28. data/lib/generators/ahoy/messages/templates/mongoid.rb.tt +12 -0
  29. data/lib/generators/ahoy/messages/templates/mongoid_encrypted.rb.tt +16 -0
  30. data/lib/generators/ahoy/messages_generator.rb +39 -0
  31. metadata +29 -113
  32. data/lib/generators/ahoy_email/install_generator.rb +0 -35
@@ -1,35 +0,0 @@
1
- # taken from https://github.com/collectiveidea/audited/blob/master/lib/generators/audited/install_generator.rb
2
- require "rails/generators"
3
- require "rails/generators/migration"
4
- require "active_record"
5
- require "rails/generators/active_record"
6
-
7
- module AhoyEmail
8
- module Generators
9
- class InstallGenerator < Rails::Generators::Base
10
- include Rails::Generators::Migration
11
-
12
- source_root File.expand_path("../templates", __FILE__)
13
-
14
- # Implement the required interface for Rails::Generators::Migration.
15
- def self.next_migration_number(dirname) #:nodoc:
16
- next_migration_number = current_migration_number(dirname) + 1
17
- if ActiveRecord::Base.timestamped_migrations
18
- [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
19
- else
20
- "%.3d" % next_migration_number
21
- end
22
- end
23
-
24
- def copy_migration
25
- migration_template "install.rb", "db/migrate/create_ahoy_messages.rb", migration_version: migration_version
26
- end
27
-
28
- def migration_version
29
- if ActiveRecord::VERSION::MAJOR >= 5
30
- "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
31
- end
32
- end
33
- end
34
- end
35
- end