csp_report 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +23 -0
  3. data/README.md +70 -20
  4. data/config/routes.rb +3 -1
  5. data/lib/csp_report/version.rb +1 -1
  6. data/lib/generators/csp_report/csp_declaration_generator.rb +1 -1
  7. data/lib/generators/csp_report/initializer_install_generator.rb +18 -0
  8. data/lib/generators/csp_report/install_generator.rb +41 -7
  9. data/lib/generators/csp_report/migration_generator.rb +15 -0
  10. data/lib/generators/csp_report/mount_generator.rb +17 -0
  11. data/lib/generators/templates/csp_report_initializer.erb +3 -0
  12. data/spec/api/csp_report_create_spec.rb +19 -0
  13. data/spec/controllers/home_controller_spec.rb +5 -0
  14. data/spec/dummy/app/assets/javascripts/home.js +2 -0
  15. data/spec/dummy/app/assets/stylesheets/home.css.scss +3 -0
  16. data/spec/dummy/app/controllers/home_controller.rb +5 -0
  17. data/spec/dummy/app/helpers/home_helper.rb +2 -0
  18. data/spec/dummy/app/views/home/index.html.haml +10 -0
  19. data/spec/dummy/config/routes.rb +2 -0
  20. data/spec/dummy/db/development.sqlite3 +0 -0
  21. data/spec/dummy/log/development.log +1101 -0
  22. data/spec/dummy/log/test.log +26944 -0
  23. data/spec/dummy/tmp/cache/assets/development/sass/3993bbee5479f52ce0cb34d1bfbe0a6755e8c605/home.css.scssc +0 -0
  24. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  25. data/spec/dummy/tmp/cache/assets/development/sprockets/1638f87db345b13872695759502b54fe +0 -0
  26. data/spec/dummy/tmp/cache/assets/development/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  27. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  28. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  29. data/spec/dummy/tmp/cache/assets/development/sprockets/73cf352579b646a784a2780873ee5ea8 +0 -0
  30. data/spec/dummy/tmp/cache/assets/development/sprockets/a9f028f7a492b5907ed80268be8f50f4 +0 -0
  31. data/spec/dummy/tmp/cache/assets/development/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  32. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  33. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  34. data/spec/dummy/tmp/cache/assets/development/sprockets/f1663d34d4b6003379113df98f1433a5 +0 -0
  35. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  36. data/spec/dummy/tmp/cache/assets/test/sass/3993bbee5479f52ce0cb34d1bfbe0a6755e8c605/home.css.scssc +0 -0
  37. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  38. data/spec/dummy/tmp/cache/assets/test/sprockets/1638f87db345b13872695759502b54fe +0 -0
  39. data/spec/dummy/tmp/cache/assets/test/sprockets/1c9faaf28d05409b88ad3113374d613c +0 -0
  40. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  41. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  42. data/spec/dummy/tmp/cache/assets/test/sprockets/b878faf942403e313a5b103e5d80488e +0 -0
  43. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  44. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  45. data/spec/dummy/tmp/cache/assets/test/sprockets/f1663d34d4b6003379113df98f1433a5 +0 -0
  46. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  47. data/spec/features/csp_report/csp_reports_report_by_ip_spec.rb +13 -0
  48. data/spec/generators/csp_report/initializer_install_generator_spec.rb +48 -0
  49. data/spec/generators/csp_report/mount_generator_spec.rb +45 -0
  50. data/spec/routing/csp_reports_routes_spec.rb +19 -0
  51. data/spec/spec_helper.rb +67 -48
  52. data/spec/support/api_helper.rb +14 -0
  53. metadata +138 -9
  54. data/spec/generators/csp_report/install_generators_spec.rb +0 -40
@@ -1,40 +0,0 @@
1
- require 'spec_helper'
2
- require 'genspec'
3
- require 'fileutils'
4
-
5
- # Can work if we simulate the app repo. need to find a way to have it use
6
- # the dummy repo
7
- module CspReport
8
- describe :"csp_report:install" do
9
- # The below does not work. Genspec creates a new uniquely named substructure
10
- # anyway, and therefore needs to create folder and files
11
- # GenSpec.root=File.expand_path("../../../dummy", __FILE__)
12
- # within_source_root do
13
- # FileUtils.mkdir_p "config"
14
- # FileUtils.touch "config/routes.rb"
15
- # FileUtils.touch "Rakefile"
16
- # FileUtils.touch "Gemfile"
17
- # File.open('Gemfile', 'w') do |f|
18
- # f.write "gem 'csp_report', path: '~/Documents/Prog/csp_report'"
19
- # end
20
- # # Tried to run bundle install... did not work. not sure we have a rails
21
- # # app in the temp location
22
- # end
23
-
24
- # context "with no arguments or options" do
25
- # # This actually tries to run the generator in a /tmp folder.
26
- # # thus the preparations above
27
- # # Not very practical
28
- # it "should generate successfully" do
29
- # subject.should generate
30
- # end
31
-
32
- # it "should mount the gem in the routes" do
33
- # # This checks that you call the inject_into_file with exactly this content.
34
- # # not very practical.
35
- # subject.should inject_into_file("config/routes.rb",
36
- # "\n mount CspReport::Engine, at: 'csp'")
37
- # end
38
- # end
39
- end
40
- end