iceburn 0.0.1

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 (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +111 -0
  5. data/LICENSE.txt +29 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +67 -0
  8. data/Rakefile +18 -0
  9. data/config/initializers/generators.rb +3 -0
  10. data/iceburn.gemspec +25 -0
  11. data/lib/iceburn.rb +13 -0
  12. data/lib/iceburn/filters.rb +39 -0
  13. data/lib/iceburn/routes.rb +13 -0
  14. data/lib/iceburn/version.rb +3 -0
  15. data/lib/tasks/iceburn_tasks.rake +4 -0
  16. data/spec/dummy/README.rdoc +28 -0
  17. data/spec/dummy/Rakefile +6 -0
  18. data/spec/dummy/app/assets/images/.keep +0 -0
  19. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  20. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  22. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  23. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  24. data/spec/dummy/app/mailers/.keep +0 -0
  25. data/spec/dummy/app/models/.keep +0 -0
  26. data/spec/dummy/app/models/concerns/.keep +0 -0
  27. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/spec/dummy/bin/bundle +3 -0
  29. data/spec/dummy/bin/rails +4 -0
  30. data/spec/dummy/bin/rake +4 -0
  31. data/spec/dummy/config.ru +4 -0
  32. data/spec/dummy/config/application.rb +23 -0
  33. data/spec/dummy/config/boot.rb +5 -0
  34. data/spec/dummy/config/database.yml +85 -0
  35. data/spec/dummy/config/environment.rb +5 -0
  36. data/spec/dummy/config/environments/development.rb +37 -0
  37. data/spec/dummy/config/environments/production.rb +83 -0
  38. data/spec/dummy/config/environments/test.rb +39 -0
  39. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  41. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/spec/dummy/config/initializers/inflections.rb +16 -0
  43. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  44. data/spec/dummy/config/initializers/session_store.rb +3 -0
  45. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  46. data/spec/dummy/config/locales/en.yml +23 -0
  47. data/spec/dummy/config/routes.rb +7 -0
  48. data/spec/dummy/config/secrets.yml +22 -0
  49. data/spec/dummy/lib/assets/.keep +0 -0
  50. data/spec/dummy/log/.keep +0 -0
  51. data/spec/dummy/public/404.html +67 -0
  52. data/spec/dummy/public/422.html +67 -0
  53. data/spec/dummy/public/500.html +66 -0
  54. data/spec/dummy/public/favicon.ico +0 -0
  55. data/spec/iceburn/filters_spec.rb +34 -0
  56. data/spec/iceburn_spec.rb +7 -0
  57. data/spec/spec_helper.rb +17 -0
  58. metadata +198 -0
@@ -0,0 +1,7 @@
1
+ Rails.application.routes.draw do
2
+ extend Iceburn::Routes
3
+
4
+ namespace :iceburn do
5
+ resources :mocks, only: %w(index)
6
+ end
7
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: ae55fed26fef5b17cfb3897731faeebce781c5e5e5ce0bac402dc702e861c3129bbe1130d731a848166b61b69dd5e17a112a764da29cc23f8374e7342f1faa34
15
+
16
+ test:
17
+ secret_key_base: 971c787867d4b71fb7a0c1de5662fefd7a0658e0cee39bc50c383e70a43e4eb6ee19a313a8c8cfd921194e73a4255346a2cf6a33d1fdf10877da5f73ef7b324f
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
File without changes
File without changes
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+ require 'iceburn/filters'
3
+
4
+ module Iceburn
5
+ describe Filters, :type => :controller do
6
+ class MocksController < ActionController::Base
7
+ include Filters
8
+
9
+ def index
10
+ render json: { attr: 'value' }
11
+ end
12
+ end
13
+
14
+ before do
15
+ @controller = MocksController.new
16
+ end
17
+
18
+ it "stops html requests and returns a blank response" do
19
+ get :index
20
+
21
+ expect(response).to be_success
22
+ expect(response.header['Content-Type']).to match('text/html')
23
+ expect(response.body).to be_blank
24
+ end
25
+
26
+ it "passes on json requests" do
27
+ get :index, :format => :json
28
+
29
+ expect(response).to be_success
30
+ expect(response.header['Content-Type']).to match('application/json')
31
+ expect(response.body).to eq("{\"attr\":\"value\"}")
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Iceburn do
4
+ it "has a logger" do
5
+ expect(Iceburn.logger).to eq(Rails.logger)
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+ require 'rspec'
7
+ require 'rspec/rails'
8
+
9
+ Rails.backtrace_cleaner.remove_silencers!
10
+
11
+ # Load support files
12
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
+
14
+ # Load fixtures from the engine
15
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
16
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
17
+ end
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iceburn
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tom Scott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: HTTP request hijacker for ActionController and API-driven Rails apps
70
+ email:
71
+ - tubbo@psychedeli.ca
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - LICENSE.txt
80
+ - MIT-LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - config/initializers/generators.rb
84
+ - iceburn.gemspec
85
+ - lib/iceburn.rb
86
+ - lib/iceburn/filters.rb
87
+ - lib/iceburn/routes.rb
88
+ - lib/iceburn/version.rb
89
+ - lib/tasks/iceburn_tasks.rake
90
+ - spec/dummy/README.rdoc
91
+ - spec/dummy/Rakefile
92
+ - spec/dummy/app/assets/images/.keep
93
+ - spec/dummy/app/assets/javascripts/application.js
94
+ - spec/dummy/app/assets/stylesheets/application.css
95
+ - spec/dummy/app/controllers/application_controller.rb
96
+ - spec/dummy/app/controllers/concerns/.keep
97
+ - spec/dummy/app/helpers/application_helper.rb
98
+ - spec/dummy/app/mailers/.keep
99
+ - spec/dummy/app/models/.keep
100
+ - spec/dummy/app/models/concerns/.keep
101
+ - spec/dummy/app/views/layouts/application.html.erb
102
+ - spec/dummy/bin/bundle
103
+ - spec/dummy/bin/rails
104
+ - spec/dummy/bin/rake
105
+ - spec/dummy/config.ru
106
+ - spec/dummy/config/application.rb
107
+ - spec/dummy/config/boot.rb
108
+ - spec/dummy/config/database.yml
109
+ - spec/dummy/config/environment.rb
110
+ - spec/dummy/config/environments/development.rb
111
+ - spec/dummy/config/environments/production.rb
112
+ - spec/dummy/config/environments/test.rb
113
+ - spec/dummy/config/initializers/backtrace_silencers.rb
114
+ - spec/dummy/config/initializers/cookies_serializer.rb
115
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
116
+ - spec/dummy/config/initializers/inflections.rb
117
+ - spec/dummy/config/initializers/mime_types.rb
118
+ - spec/dummy/config/initializers/session_store.rb
119
+ - spec/dummy/config/initializers/wrap_parameters.rb
120
+ - spec/dummy/config/locales/en.yml
121
+ - spec/dummy/config/routes.rb
122
+ - spec/dummy/config/secrets.yml
123
+ - spec/dummy/lib/assets/.keep
124
+ - spec/dummy/log/.keep
125
+ - spec/dummy/public/404.html
126
+ - spec/dummy/public/422.html
127
+ - spec/dummy/public/500.html
128
+ - spec/dummy/public/favicon.ico
129
+ - spec/iceburn/filters_spec.rb
130
+ - spec/iceburn_spec.rb
131
+ - spec/spec_helper.rb
132
+ homepage: http://github.com/tubbo/iceburn
133
+ licenses:
134
+ - NCSA
135
+ metadata: {}
136
+ post_install_message:
137
+ rdoc_options: []
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ requirements: []
151
+ rubyforge_project:
152
+ rubygems_version: 2.0.3
153
+ signing_key:
154
+ specification_version: 4
155
+ summary: HTTP request hijacker for ActionController and API-driven Rails apps
156
+ test_files:
157
+ - spec/dummy/README.rdoc
158
+ - spec/dummy/Rakefile
159
+ - spec/dummy/app/assets/images/.keep
160
+ - spec/dummy/app/assets/javascripts/application.js
161
+ - spec/dummy/app/assets/stylesheets/application.css
162
+ - spec/dummy/app/controllers/application_controller.rb
163
+ - spec/dummy/app/controllers/concerns/.keep
164
+ - spec/dummy/app/helpers/application_helper.rb
165
+ - spec/dummy/app/mailers/.keep
166
+ - spec/dummy/app/models/.keep
167
+ - spec/dummy/app/models/concerns/.keep
168
+ - spec/dummy/app/views/layouts/application.html.erb
169
+ - spec/dummy/bin/bundle
170
+ - spec/dummy/bin/rails
171
+ - spec/dummy/bin/rake
172
+ - spec/dummy/config.ru
173
+ - spec/dummy/config/application.rb
174
+ - spec/dummy/config/boot.rb
175
+ - spec/dummy/config/database.yml
176
+ - spec/dummy/config/environment.rb
177
+ - spec/dummy/config/environments/development.rb
178
+ - spec/dummy/config/environments/production.rb
179
+ - spec/dummy/config/environments/test.rb
180
+ - spec/dummy/config/initializers/backtrace_silencers.rb
181
+ - spec/dummy/config/initializers/cookies_serializer.rb
182
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
183
+ - spec/dummy/config/initializers/inflections.rb
184
+ - spec/dummy/config/initializers/mime_types.rb
185
+ - spec/dummy/config/initializers/session_store.rb
186
+ - spec/dummy/config/initializers/wrap_parameters.rb
187
+ - spec/dummy/config/locales/en.yml
188
+ - spec/dummy/config/routes.rb
189
+ - spec/dummy/config/secrets.yml
190
+ - spec/dummy/lib/assets/.keep
191
+ - spec/dummy/log/.keep
192
+ - spec/dummy/public/404.html
193
+ - spec/dummy/public/422.html
194
+ - spec/dummy/public/500.html
195
+ - spec/dummy/public/favicon.ico
196
+ - spec/iceburn/filters_spec.rb
197
+ - spec/iceburn_spec.rb
198
+ - spec/spec_helper.rb