csp_report 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a67c65f19301c31abe8d13421b4b2240a0fcb220
4
- data.tar.gz: 295a52305a61819d25f33d5b5eedf1285492edb5
3
+ metadata.gz: 438b12fe66495e47c46a9950948fd74f8bdc18fa
4
+ data.tar.gz: a6b5bf930f89cd10b4d5cf25d974b83c9bd19091
5
5
  SHA512:
6
- metadata.gz: aaedf37ca2ff7c003b877a9c6457baa40664eb73706fc51bd31950bb1cb1d6edfe980d68f5f44c2f4ec71e1dcba979f58e19be7beefacc958cd16dcdd7269ec0
7
- data.tar.gz: 254d79e625d31a44766e336dc6dfa3734d329b20846aaaabd3244bcd071f6aa70c7ea519895370f6fa41a70d9c755c25f1ce9b71465bebc2f7b5241195e14892
6
+ metadata.gz: efca6558189f2bf33beff60a2f8765ce797d7914a742a8108a400b65d64eba615bc206105a562651eab92f5c3074514a68697a980402388db83bc979340219b6
7
+ data.tar.gz: 29c49b95580f86c5c338e2d8e85ca33905f34ef4679e4ccdcaaca8aa27381c0a9e73792081638d54fe71044d69ab0d491bfc5cb3ae8207f24623e04f0f19f1bf
data/README.md CHANGED
@@ -45,24 +45,18 @@ Install
45
45
 
46
46
  Don't forget to run `bundle install` afterwards
47
47
 
48
- 2. Retrieve the db migration files from the gem and install them
48
+ 2. Run the generator
49
49
 
50
50
  ```shell
51
- rake csp_report:install:migrations
52
- rake db:migrate
51
+ rails generate csp_report:install
53
52
  ```
54
53
 
55
- 3. In your *config/routes.rb*, you need to import the csp routes, like so
54
+ It retrieve the db migration files from the gem and install them
55
+ It mounts the gem routes in the application
56
56
 
57
- ```ruby
58
- mount CspReport::Engine, at: 'csp'
59
- ```
60
-
61
- where the *at* parameter acts as a url encapsulation for the gem routes. For
62
- example, with the above lines, you would create a */csp/csp_reports* set of
63
- routes in your application
57
+ *Don't forget to run the `rake db:migrate` command*
64
58
 
65
- 4. You need to configure a CSP on your server response, with the *report_uri*
59
+ 3. You need to configure a CSP on your server response, with the *report_uri*
66
60
  parameters pointing to the configured REST resource above. Following the setup
67
61
  above, one solution is to find this in your application_controller.rb file:
68
62
 
@@ -78,7 +72,7 @@ above, one solution is to find this in your application_controller.rb file:
78
72
  end
79
73
  ```
80
74
 
81
- 5. You're all set. Accessing *application_root_url*/csp/csp_reports will display
75
+ 4. You're all set. Accessing *application_root_url*/csp/csp_reports will display
82
76
  a list of all the CSP violation that were reported.
83
77
 
84
78
  Trying it out
@@ -1,3 +1,4 @@
1
1
  module CspReport
2
- VERSION = "0.1.1".freeze
2
+ #TODO - gbataille: Permanent todo to bump the version for new releases
3
+ VERSION = "0.1.2".freeze
3
4
  end
@@ -0,0 +1,14 @@
1
+ module CspReport
2
+ class InstallGenerator < Rails::Generators::Base
3
+ desc "Adds route to the csp_report resource"
4
+ def setup_route
5
+ route "mount CspReport::Engine, at: 'csp'"
6
+ end
7
+
8
+ desc "Retrieves the migration files from the gem"
9
+ def setup_migration
10
+ rake "csp_report:install:migrations"
11
+ puts "\n Don't forget to run 'rake db:migrate'\n"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ class Setup < Thor
2
+ desc "install", "Performs all the steps necessary to install CspReport"
3
+ def install
4
+ puts "install task"
5
+ end
6
+ end
@@ -2,3 +2,63 @@
2
2
   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
3
   (0.2ms) SELECT version FROM "schema_migrations"
4
4
   (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
5
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
6
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
7
+  (0.2ms) SELECT version FROM "schema_migrations"
8
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
9
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
10
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
11
+  (0.3ms) SELECT version FROM "schema_migrations"
12
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
13
+  (8.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
14
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
15
+  (0.2ms) SELECT version FROM "schema_migrations"
16
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
17
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19
+  (0.2ms) SELECT version FROM "schema_migrations"
20
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
21
+  (8.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
22
+  (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
23
+  (0.2ms) SELECT version FROM "schema_migrations"
24
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
25
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
26
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
27
+  (0.2ms) SELECT version FROM "schema_migrations"
28
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
29
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
30
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
31
+  (0.2ms) SELECT version FROM "schema_migrations"
32
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
33
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
34
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
35
+  (0.2ms) SELECT version FROM "schema_migrations"
36
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
37
+  (8.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
38
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
39
+  (0.2ms) SELECT version FROM "schema_migrations"
40
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
41
+  (9.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
42
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
43
+  (0.3ms) SELECT version FROM "schema_migrations"
44
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
45
+  (9.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
46
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
+  (0.3ms) SELECT version FROM "schema_migrations"
48
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
49
+  (9.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
50
+  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
51
+  (0.3ms) SELECT version FROM "schema_migrations"
52
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
53
+  (8.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
54
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
55
+  (0.3ms) SELECT version FROM "schema_migrations"
56
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
57
+  (2.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
58
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
59
+  (0.3ms) SELECT version FROM "schema_migrations"
60
+  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
61
+  (9.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
62
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
63
+  (0.3ms) SELECT version FROM "schema_migrations"
64
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+ require 'rails/generators/base'
3
+ require 'generators/csp_report/install_generator'
4
+
5
+ module CspReport
6
+ describe "InstallGenerator" do
7
+ # puts $:
8
+ pending "add some tests here"
9
+ end
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csp_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Bataille
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-30 00:00:00.000000000 Z
11
+ date: 2013-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -143,7 +143,9 @@ files:
143
143
  - lib/csp_report/engine.rb
144
144
  - lib/csp_report/version.rb
145
145
  - lib/csp_report.rb
146
+ - lib/generators/csp_report/install_generator.rb
146
147
  - lib/tasks/csp_report_tasks.rake
148
+ - lib/tasks/install.thor
147
149
  - MIT-LICENSE
148
150
  - Rakefile
149
151
  - README.md
@@ -185,6 +187,7 @@ files:
185
187
  - spec/dummy/Rakefile
186
188
  - spec/dummy/README.rdoc
187
189
  - spec/factories/csp_report_csp_reports.rb
190
+ - spec/generators/csp_report/install_generators_spec.rb
188
191
  - spec/models/csp_report/csp_report_spec.rb
189
192
  - spec/spec_helper.rb
190
193
  homepage: http://www.github.com/gbataille/csp_report
@@ -250,5 +253,6 @@ test_files:
250
253
  - spec/dummy/Rakefile
251
254
  - spec/dummy/README.rdoc
252
255
  - spec/factories/csp_report_csp_reports.rb
256
+ - spec/generators/csp_report/install_generators_spec.rb
253
257
  - spec/models/csp_report/csp_report_spec.rb
254
258
  - spec/spec_helper.rb