vanity 3.0.2 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/linting.yml +28 -0
  3. data/.github/workflows/test.yml +3 -6
  4. data/.rubocop.yml +114 -0
  5. data/.rubocop_todo.yml +67 -0
  6. data/Appraisals +9 -31
  7. data/CHANGELOG +13 -0
  8. data/Gemfile +7 -3
  9. data/Gemfile.lock +32 -4
  10. data/README.md +4 -9
  11. data/Rakefile +25 -24
  12. data/bin/vanity +1 -1
  13. data/doc/configuring.textile +1 -0
  14. data/gemfiles/rails52.gemfile +6 -3
  15. data/gemfiles/rails52.gemfile.lock +34 -9
  16. data/gemfiles/rails60.gemfile +6 -3
  17. data/gemfiles/rails60.gemfile.lock +34 -9
  18. data/gemfiles/rails61.gemfile +6 -3
  19. data/gemfiles/rails61.gemfile.lock +34 -9
  20. data/lib/generators/vanity/migration_generator.rb +5 -7
  21. data/lib/vanity/adapters/abstract_adapter.rb +43 -45
  22. data/lib/vanity/adapters/active_record_adapter.rb +30 -30
  23. data/lib/vanity/adapters/mock_adapter.rb +14 -18
  24. data/lib/vanity/adapters/mongodb_adapter.rb +73 -69
  25. data/lib/vanity/adapters/redis_adapter.rb +19 -27
  26. data/lib/vanity/adapters.rb +1 -1
  27. data/lib/vanity/autoconnect.rb +6 -7
  28. data/lib/vanity/commands/list.rb +7 -7
  29. data/lib/vanity/commands/report.rb +18 -22
  30. data/lib/vanity/configuration.rb +23 -19
  31. data/lib/vanity/connection.rb +12 -14
  32. data/lib/vanity/experiment/ab_test.rb +95 -79
  33. data/lib/vanity/experiment/alternative.rb +3 -5
  34. data/lib/vanity/experiment/base.rb +24 -19
  35. data/lib/vanity/experiment/bayesian_bandit_score.rb +7 -13
  36. data/lib/vanity/experiment/definition.rb +6 -6
  37. data/lib/vanity/frameworks/rails.rb +39 -39
  38. data/lib/vanity/frameworks.rb +2 -2
  39. data/lib/vanity/helpers.rb +1 -1
  40. data/lib/vanity/metric/active_record.rb +21 -19
  41. data/lib/vanity/metric/base.rb +22 -23
  42. data/lib/vanity/metric/google_analytics.rb +6 -9
  43. data/lib/vanity/metric/remote.rb +3 -5
  44. data/lib/vanity/playground.rb +3 -6
  45. data/lib/vanity/vanity.rb +8 -12
  46. data/lib/vanity/version.rb +1 -1
  47. data/test/adapters/active_record_adapter_test.rb +1 -5
  48. data/test/adapters/mock_adapter_test.rb +0 -2
  49. data/test/adapters/mongodb_adapter_test.rb +1 -5
  50. data/test/adapters/redis_adapter_test.rb +2 -3
  51. data/test/adapters/shared_tests.rb +9 -12
  52. data/test/autoconnect_test.rb +3 -3
  53. data/test/cli_test.rb +0 -1
  54. data/test/configuration_test.rb +18 -34
  55. data/test/connection_test.rb +3 -3
  56. data/test/dummy/Rakefile +1 -1
  57. data/test/dummy/app/controllers/use_vanity_controller.rb +12 -8
  58. data/test/dummy/app/mailers/vanity_mailer.rb +3 -3
  59. data/test/dummy/config/application.rb +1 -1
  60. data/test/dummy/config/boot.rb +3 -3
  61. data/test/dummy/config/environment.rb +1 -1
  62. data/test/dummy/config/environments/development.rb +0 -1
  63. data/test/dummy/config/environments/test.rb +1 -1
  64. data/test/dummy/config/initializers/session_store.rb +1 -1
  65. data/test/dummy/config/initializers/vanity.rb +3 -0
  66. data/test/dummy/config/vanity.yml +7 -0
  67. data/test/dummy/config.ru +1 -1
  68. data/test/dummy/script/rails +2 -2
  69. data/test/experiment/ab_test.rb +188 -154
  70. data/test/experiment/base_test.rb +48 -32
  71. data/test/frameworks/rails/action_controller_test.rb +25 -25
  72. data/test/frameworks/rails/action_mailer_test.rb +2 -2
  73. data/test/frameworks/rails/action_view_test.rb +5 -6
  74. data/test/frameworks/rails/rails_test.rb +147 -181
  75. data/test/helper_test.rb +2 -2
  76. data/test/metric/active_record_test.rb +174 -212
  77. data/test/metric/base_test.rb +21 -46
  78. data/test/metric/google_analytics_test.rb +17 -25
  79. data/test/metric/remote_test.rb +7 -10
  80. data/test/playground_test.rb +7 -15
  81. data/test/templates_test.rb +16 -20
  82. data/test/test_helper.rb +28 -29
  83. data/test/vanity_test.rb +4 -10
  84. data/test/web/rails/dashboard_test.rb +21 -21
  85. data/vanity.gemspec +8 -7
  86. metadata +32 -30
  87. data/gemfiles/rails42.gemfile +0 -33
  88. data/gemfiles/rails42.gemfile.lock +0 -265
  89. data/gemfiles/rails42_protected_attributes.gemfile +0 -34
  90. data/gemfiles/rails42_protected_attributes.gemfile.lock +0 -264
  91. data/gemfiles/rails51.gemfile +0 -33
  92. data/gemfiles/rails51.gemfile.lock +0 -285
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
3
 
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
4
+ APP_PATH = File.expand_path('../config/application', __dir__)
5
+ require File.expand_path('../config/boot', __dir__)
6
6
  require 'rails/commands'