impressionist-cody 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/main.yml +25 -0
  3. data/.gitignore +17 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +27 -0
  6. data/.rubocop_todo.yml +660 -0
  7. data/CHANGELOG.rdoc +96 -0
  8. data/Gemfile +22 -0
  9. data/LICENSE.txt +20 -0
  10. data/README.md +265 -0
  11. data/Rakefile +20 -0
  12. data/UPGRADE_GUIDE.md +13 -0
  13. data/app/assets/config/manifest.js +3 -0
  14. data/app/controllers/impressionist_controller.rb +166 -0
  15. data/app/models/impression.rb +2 -0
  16. data/app/models/impressionist/bots.rb +1468 -0
  17. data/app/models/impressionist/impressionable.rb +62 -0
  18. data/impressionist.gemspec +30 -0
  19. data/lib/generators/active_record/impressionist_generator.rb +22 -0
  20. data/lib/generators/active_record/templates/create_impressions_table.rb.erb +32 -0
  21. data/lib/generators/impressionist_generator.rb +13 -0
  22. data/lib/generators/mongo_mapper/impressionist_generator.rb +8 -0
  23. data/lib/generators/mongoid/impressionist_generator.rb +8 -0
  24. data/lib/generators/templates/impression.rb.erb +8 -0
  25. data/lib/impressionist/bots.rb +21 -0
  26. data/lib/impressionist/controllers/mongoid/impressionist_controller.rb +10 -0
  27. data/lib/impressionist/counter_cache.rb +76 -0
  28. data/lib/impressionist/engine.rb +45 -0
  29. data/lib/impressionist/is_impressionable.rb +23 -0
  30. data/lib/impressionist/load.rb +11 -0
  31. data/lib/impressionist/models/active_record/impression.rb +14 -0
  32. data/lib/impressionist/models/active_record/impressionist/impressionable.rb +12 -0
  33. data/lib/impressionist/models/mongo_mapper/impression.rb +18 -0
  34. data/lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb +21 -0
  35. data/lib/impressionist/models/mongoid/impression.rb +26 -0
  36. data/lib/impressionist/models/mongoid/impressionist/impressionable.rb +28 -0
  37. data/lib/impressionist/rails_toggle.rb +26 -0
  38. data/lib/impressionist/setup_association.rb +53 -0
  39. data/lib/impressionist/update_counters.rb +77 -0
  40. data/lib/impressionist/version.rb +3 -0
  41. data/lib/impressionist.rb +12 -0
  42. data/logo.png +0 -0
  43. data/spec/controllers/articles_controller_spec.rb +113 -0
  44. data/spec/controllers/dummy_controller_spec.rb +13 -0
  45. data/spec/controllers/impressionist_uniqueness_spec.rb +463 -0
  46. data/spec/controllers/posts_controller_spec.rb +36 -0
  47. data/spec/controllers/widgets_controller_spec.rb +103 -0
  48. data/spec/counter_caching_spec.rb +49 -0
  49. data/spec/dummy/.ruby-version +1 -0
  50. data/spec/dummy/Rakefile +6 -0
  51. data/spec/dummy/app/assets/config/manifest.js +1 -0
  52. data/spec/dummy/app/assets/images/.keep +0 -0
  53. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  54. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  55. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  56. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  57. data/spec/dummy/app/controllers/articles_controller.rb +22 -0
  58. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  59. data/spec/dummy/app/controllers/dummy_controller.rb +6 -0
  60. data/spec/dummy/app/controllers/posts_controller.rb +23 -0
  61. data/spec/dummy/app/controllers/profiles_controller.rb +14 -0
  62. data/spec/dummy/app/controllers/widgets_controller.rb +12 -0
  63. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  64. data/spec/dummy/app/javascript/packs/application.js +15 -0
  65. data/spec/dummy/app/jobs/application_job.rb +7 -0
  66. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  67. data/spec/dummy/app/models/application_record.rb +3 -0
  68. data/spec/dummy/app/models/article.rb +3 -0
  69. data/spec/dummy/app/models/concerns/.keep +0 -0
  70. data/spec/dummy/app/models/dummy.rb +7 -0
  71. data/spec/dummy/app/models/post.rb +3 -0
  72. data/spec/dummy/app/models/profile.rb +6 -0
  73. data/spec/dummy/app/models/user.rb +3 -0
  74. data/spec/dummy/app/models/widget.rb +3 -0
  75. data/spec/dummy/app/views/articles/index.html.erb +1 -0
  76. data/spec/dummy/app/views/articles/show.html.erb +1 -0
  77. data/spec/dummy/app/views/dummy/index.html.erb +0 -0
  78. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  79. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  80. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  81. data/spec/dummy/app/views/posts/edit.html.erb +0 -0
  82. data/spec/dummy/app/views/posts/index.html.erb +0 -0
  83. data/spec/dummy/app/views/posts/show.html.erb +0 -0
  84. data/spec/dummy/app/views/profiles/show.html.erb +3 -0
  85. data/spec/dummy/app/views/widgets/index.html.erb +0 -0
  86. data/spec/dummy/app/views/widgets/new.html.erb +0 -0
  87. data/spec/dummy/app/views/widgets/show.html.erb +0 -0
  88. data/spec/dummy/bin/rails +4 -0
  89. data/spec/dummy/bin/rake +4 -0
  90. data/spec/dummy/bin/setup +33 -0
  91. data/spec/dummy/config/application.rb +20 -0
  92. data/spec/dummy/config/boot.rb +5 -0
  93. data/spec/dummy/config/cable.yml +10 -0
  94. data/spec/dummy/config/database.yml +25 -0
  95. data/spec/dummy/config/environment.rb +5 -0
  96. data/spec/dummy/config/environments/development.rb +62 -0
  97. data/spec/dummy/config/environments/production.rb +112 -0
  98. data/spec/dummy/config/environments/test.rb +49 -0
  99. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  100. data/spec/dummy/config/initializers/assets.rb +12 -0
  101. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  102. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  103. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  104. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  105. data/spec/dummy/config/initializers/impression.rb +8 -0
  106. data/spec/dummy/config/initializers/inflections.rb +16 -0
  107. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  108. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  109. data/spec/dummy/config/locales/en.yml +33 -0
  110. data/spec/dummy/config/puma.rb +38 -0
  111. data/spec/dummy/config/routes.rb +4 -0
  112. data/spec/dummy/config/spring.rb +6 -0
  113. data/spec/dummy/config/storage.yml +34 -0
  114. data/spec/dummy/config.ru +5 -0
  115. data/spec/dummy/config.ru2 +4 -0
  116. data/spec/dummy/db/development.sqlite3 +0 -0
  117. data/spec/dummy/db/migrate/20110201153144_create_articles.rb +13 -0
  118. data/spec/dummy/db/migrate/20110210205028_create_posts.rb +13 -0
  119. data/spec/dummy/db/migrate/20111127184039_create_widgets.rb +15 -0
  120. data/spec/dummy/db/migrate/20150207135825_create_profiles.rb +10 -0
  121. data/spec/dummy/db/migrate/20150207140310_create_friendly_id_slugs.rb +18 -0
  122. data/spec/dummy/db/migrate/20200720143817_create_impressions_table.rb +32 -0
  123. data/spec/dummy/db/schema.rb +77 -0
  124. data/spec/dummy/lib/assets/.keep +0 -0
  125. data/spec/dummy/log/.keep +0 -0
  126. data/spec/dummy/log/development.log +129 -0
  127. data/spec/dummy/public/404.html +67 -0
  128. data/spec/dummy/public/422.html +67 -0
  129. data/spec/dummy/public/500.html +66 -0
  130. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  131. data/spec/dummy/public/apple-touch-icon.png +0 -0
  132. data/spec/dummy/public/favicon.ico +0 -0
  133. data/spec/dummy/storage/.keep +0 -0
  134. data/spec/fixtures/articles.yml +3 -0
  135. data/spec/fixtures/impressions.yml +43 -0
  136. data/spec/fixtures/posts.yml +3 -0
  137. data/spec/fixtures/profiles.yml +4 -0
  138. data/spec/fixtures/widgets.yml +4 -0
  139. data/spec/initializers_spec.rb +21 -0
  140. data/spec/models/bots_spec.rb +25 -0
  141. data/spec/models/impression_spec.rb +66 -0
  142. data/spec/rails_generators/rails_generators_spec.rb +23 -0
  143. data/spec/rails_helper.rb +11 -0
  144. data/spec/rails_toggle_spec.rb +31 -0
  145. data/spec/setup_association_spec.rb +48 -0
  146. data/spec/spec_helper.rb +43 -0
  147. data/upgrade_migrations/version_0_3_0.rb +27 -0
  148. data/upgrade_migrations/version_0_4_0.rb +9 -0
  149. data/upgrade_migrations/version_1_5_2.rb +12 -0
  150. metadata +302 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1d3c6046729f36a0f5fadaf6d502415807fd44f0fabc78673bb30f893892433b
4
+ data.tar.gz: 38de6c112f5622bbf0081dc5a5231cd3e20c66792dc4dbe5037e89f7b4b38dd5
5
+ SHA512:
6
+ metadata.gz: 6255edac1732aaf0070328b88482173a67474d59c577831c57aa24f0e8237e9963c942c1a3097ea8b4a10ca92f50f3aa0ea40d6db3e1ce464457036e197dcb86
7
+ data.tar.gz: 508f523bc47f7aa58aa0491f0413e6a513dc4f1c5030ed3a6a5ccefa592d223e41d2f849b210a528ad3ea254118c3b05f5981d522b8ee817fb3157b24accb75c
@@ -0,0 +1,25 @@
1
+ name: Main
2
+ on: [push]
3
+ jobs:
4
+ Build-And-Run-Tests:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ ruby: ['3.0.3', '2.7.5']
9
+ env:
10
+ RAILS_ENV: test
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: ${{ matrix.ruby }}
16
+ - name: setup app
17
+ run: |
18
+ bundle
19
+ cd spec/dummy
20
+ bundle exec rails g impressionist -f
21
+ bundle exec rake db:create db:migrate RAILS_ENV=test
22
+ - name: Lint
23
+ run: bundle exec rubocop
24
+ - name: Run Tests
25
+ run: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *~
2
+ /coverage
3
+ /pkg
4
+ /rdoc
5
+ /test_app/db/schema.rb
6
+ /test_app/db/migrate/*_create_impressions_table.rb
7
+ /test_app/doc
8
+ /test_app/test
9
+ /test_app/vendor
10
+ Gemfile.lock
11
+ gemfiles/*.lock
12
+ .DS_Store
13
+ *.swo
14
+ .vscode/
15
+ spec/dummy/tmp
16
+ spec/dummy/db/test.sqlite3*
17
+ spec/dummy/log/*
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,27 @@
1
+ AllCops:
2
+ Exclude:
3
+ - "spec/dummy/**/*"
4
+ SuggestExtensions: false
5
+
6
+ inherit_from: .rubocop_todo.yml
7
+
8
+ require:
9
+ - rubocop-rspec
10
+ - rubocop-rails
11
+
12
+ Layout/SpaceAroundMethodCallOperator:
13
+ Enabled: true
14
+ Lint/RaiseException:
15
+ Enabled: True
16
+ Lint/StructNewOverride:
17
+ Enabled: True
18
+ Style/ExponentialNotation:
19
+ Enabled: True
20
+ Style/HashEachMethods:
21
+ Enabled: True
22
+ Style/HashTransformKeys:
23
+ Enabled: True
24
+ Style/HashTransformValues:
25
+ Enabled: True
26
+ RSpec/FilePath:
27
+ Enabled: False