glow 0.0.9 → 0.0.10
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.
- data/Gemfile.lock +6 -6
- data/lib/glow/filter.rb +7 -7
- data/lib/glow/version.rb +1 -1
- data/test/rails3/Gemfile +1 -0
- data/test/rails3/Gemfile.lock +68 -59
- data/test/rails3/spec/spec_helper.rb +1 -1
- data/test/rails31/Gemfile +1 -0
- data/test/rails31/Gemfile.lock +58 -49
- data/test/rails31/spec/spec_helper.rb +1 -1
- data/test/rails32/.gitignore +5 -0
- data/test/rails32/Gemfile +34 -0
- data/test/rails32/Gemfile.lock +161 -0
- data/test/rails32/Rakefile +7 -0
- data/test/rails32/app/assets/images/rails.png +0 -0
- data/test/rails32/app/assets/javascripts/application.js +10 -0
- data/test/rails32/app/assets/stylesheets/application.css +7 -0
- data/test/rails32/app/controllers/application_controller.rb +3 -0
- data/test/rails32/app/controllers/flash_controller.rb +18 -0
- data/test/rails32/app/views/flash/ajax.js.erb +1 -0
- data/test/rails32/app/views/flash/show.html.erb +13 -0
- data/test/rails32/app/views/layouts/application.html.erb +14 -0
- data/test/rails32/config.ru +4 -0
- data/test/rails32/config/application.rb +51 -0
- data/test/rails32/config/boot.rb +6 -0
- data/test/rails32/config/environment.rb +5 -0
- data/test/rails32/config/environments/development.rb +30 -0
- data/test/rails32/config/environments/production.rb +60 -0
- data/test/rails32/config/environments/test.rb +42 -0
- data/test/rails32/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails32/config/initializers/inflections.rb +10 -0
- data/test/rails32/config/initializers/mime_types.rb +5 -0
- data/test/rails32/config/initializers/secret_token.rb +7 -0
- data/test/rails32/config/initializers/session_store.rb +8 -0
- data/test/rails32/config/initializers/wrap_parameters.rb +10 -0
- data/test/rails32/config/locales/en.yml +5 -0
- data/test/rails32/config/routes.rb +6 -0
- data/test/rails32/log/.gitkeep +0 -0
- data/test/rails32/public/404.html +26 -0
- data/test/rails32/public/422.html +26 -0
- data/test/rails32/public/500.html +26 -0
- data/test/rails32/public/favicon.ico +0 -0
- data/test/rails32/public/robots.txt +5 -0
- data/test/rails32/script/rails +6 -0
- data/test/rails32/spec/controllers/.flash_controller_spec.rb.swn +0 -0
- data/test/rails32/spec/controllers/.flash_controller_spec.rb.swo +0 -0
- data/test/rails32/spec/controllers/flash_controller_spec.rb +33 -0
- data/test/rails32/spec/integration/flash_spec.rb +17 -0
- data/test/rails32/spec/spec_helper.rb +31 -0
- metadata +83 -5
@@ -0,0 +1,42 @@
|
|
1
|
+
Rails31::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
33
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
34
|
+
# like if you have constraints or database-specific column types
|
35
|
+
# config.active_record.schema_format = :sql
|
36
|
+
|
37
|
+
# Print deprecation notices to the stderr
|
38
|
+
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
|
41
|
+
config.assets.allow_debugging = true
|
42
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Rails31::Application.config.secret_token = '011674f911be1c903e62ab0017799eee12f628b81403e2aab25a7feda2f551dcc743fb37804a36ee4105e66c51b3adedd7eee0666287c6b6b01cd96a4b58881c'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Rails31::Application.config.session_store :cookie_store, key: '_rails31_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Rails31::Application.config.session_store :active_record_store
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
Binary file
|
Binary file
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'htmlentities'
|
4
|
+
|
5
|
+
ActionDispatch::Flash::FlashHash.class_eval do
|
6
|
+
def discard?(key); @used.include?(key); end
|
7
|
+
def keep?(key); !discard?(key); end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe FlashController do
|
11
|
+
it "should display flash message on redirect" do
|
12
|
+
post :redirect, type: :notice, message: 'Glow!'
|
13
|
+
|
14
|
+
flash[:notice].should be == 'Glow!'
|
15
|
+
flash.keep?(:notice).should be true
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should display flash message on xhr" do
|
19
|
+
xhr :get, :ajax, type: :notice, message: 'Glow!'
|
20
|
+
|
21
|
+
flash[:notice].should be == 'Glow!'
|
22
|
+
flash.discard?(:notice).should be true
|
23
|
+
|
24
|
+
@response.headers['X-Message-Type'].should be == 'notice'
|
25
|
+
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'Glow!'
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should handle unicode on xhr" do
|
29
|
+
xhr :get, :ajax, type: :notice, message: 'utf8: ✓'
|
30
|
+
@response.headers['X-Message-Type'].should be == 'notice'
|
31
|
+
HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'utf8: ✓'
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "the flash view" do
|
5
|
+
it "redirects" do
|
6
|
+
visit root_path
|
7
|
+
click_on 'redirect'
|
8
|
+
page.has_content?('utf8: ✓')
|
9
|
+
end
|
10
|
+
|
11
|
+
it "handles ajax" do
|
12
|
+
visit root_path
|
13
|
+
click_on 'ajax'
|
14
|
+
page.has_content?('ajax: ✓')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'capybara/rspec'
|
6
|
+
require 'capybara/rails'
|
7
|
+
|
8
|
+
Capybara.default_driver = :webkit
|
9
|
+
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
11
|
+
# in spec/support/ and its subdirectories.
|
12
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
# == Mock Framework
|
16
|
+
#
|
17
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
18
|
+
#
|
19
|
+
# config.mock_with :mocha
|
20
|
+
# config.mock_with :flexmock
|
21
|
+
# config.mock_with :rr
|
22
|
+
config.mock_with :rspec
|
23
|
+
|
24
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
25
|
+
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
26
|
+
|
27
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
28
|
+
# examples within a transaction, remove the following line or assign false
|
29
|
+
# instead of true.
|
30
|
+
#config.use_transactional_fixtures = true
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-08-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -155,6 +155,45 @@ files:
|
|
155
155
|
- test/rails31/spec/controllers/flash_controller_spec.rb
|
156
156
|
- test/rails31/spec/integration/flash_spec.rb
|
157
157
|
- test/rails31/spec/spec_helper.rb
|
158
|
+
- test/rails32/.gitignore
|
159
|
+
- test/rails32/Gemfile
|
160
|
+
- test/rails32/Gemfile.lock
|
161
|
+
- test/rails32/Rakefile
|
162
|
+
- test/rails32/app/assets/images/rails.png
|
163
|
+
- test/rails32/app/assets/javascripts/application.js
|
164
|
+
- test/rails32/app/assets/stylesheets/application.css
|
165
|
+
- test/rails32/app/controllers/application_controller.rb
|
166
|
+
- test/rails32/app/controllers/flash_controller.rb
|
167
|
+
- test/rails32/app/views/flash/ajax.js.erb
|
168
|
+
- test/rails32/app/views/flash/show.html.erb
|
169
|
+
- test/rails32/app/views/layouts/application.html.erb
|
170
|
+
- test/rails32/config.ru
|
171
|
+
- test/rails32/config/application.rb
|
172
|
+
- test/rails32/config/boot.rb
|
173
|
+
- test/rails32/config/environment.rb
|
174
|
+
- test/rails32/config/environments/development.rb
|
175
|
+
- test/rails32/config/environments/production.rb
|
176
|
+
- test/rails32/config/environments/test.rb
|
177
|
+
- test/rails32/config/initializers/backtrace_silencers.rb
|
178
|
+
- test/rails32/config/initializers/inflections.rb
|
179
|
+
- test/rails32/config/initializers/mime_types.rb
|
180
|
+
- test/rails32/config/initializers/secret_token.rb
|
181
|
+
- test/rails32/config/initializers/session_store.rb
|
182
|
+
- test/rails32/config/initializers/wrap_parameters.rb
|
183
|
+
- test/rails32/config/locales/en.yml
|
184
|
+
- test/rails32/config/routes.rb
|
185
|
+
- test/rails32/log/.gitkeep
|
186
|
+
- test/rails32/public/404.html
|
187
|
+
- test/rails32/public/422.html
|
188
|
+
- test/rails32/public/500.html
|
189
|
+
- test/rails32/public/favicon.ico
|
190
|
+
- test/rails32/public/robots.txt
|
191
|
+
- test/rails32/script/rails
|
192
|
+
- test/rails32/spec/controllers/.flash_controller_spec.rb.swn
|
193
|
+
- test/rails32/spec/controllers/.flash_controller_spec.rb.swo
|
194
|
+
- test/rails32/spec/controllers/flash_controller_spec.rb
|
195
|
+
- test/rails32/spec/integration/flash_spec.rb
|
196
|
+
- test/rails32/spec/spec_helper.rb
|
158
197
|
- vendor/assets/javascripts/glow.js
|
159
198
|
homepage: https://github.com/zweitag/glow
|
160
199
|
licenses: []
|
@@ -173,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
212
|
version: '0'
|
174
213
|
segments:
|
175
214
|
- 0
|
176
|
-
hash:
|
215
|
+
hash: 4248034504190271721
|
177
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
217
|
none: false
|
179
218
|
requirements:
|
@@ -182,10 +221,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
221
|
version: '0'
|
183
222
|
segments:
|
184
223
|
- 0
|
185
|
-
hash:
|
224
|
+
hash: 4248034504190271721
|
186
225
|
requirements: []
|
187
226
|
rubyforge_project:
|
188
|
-
rubygems_version: 1.8.
|
227
|
+
rubygems_version: 1.8.24
|
189
228
|
signing_key:
|
190
229
|
specification_version: 3
|
191
230
|
summary: Javascript Flash Hash handling for Rails.
|
@@ -268,3 +307,42 @@ test_files:
|
|
268
307
|
- test/rails31/spec/controllers/flash_controller_spec.rb
|
269
308
|
- test/rails31/spec/integration/flash_spec.rb
|
270
309
|
- test/rails31/spec/spec_helper.rb
|
310
|
+
- test/rails32/.gitignore
|
311
|
+
- test/rails32/Gemfile
|
312
|
+
- test/rails32/Gemfile.lock
|
313
|
+
- test/rails32/Rakefile
|
314
|
+
- test/rails32/app/assets/images/rails.png
|
315
|
+
- test/rails32/app/assets/javascripts/application.js
|
316
|
+
- test/rails32/app/assets/stylesheets/application.css
|
317
|
+
- test/rails32/app/controllers/application_controller.rb
|
318
|
+
- test/rails32/app/controllers/flash_controller.rb
|
319
|
+
- test/rails32/app/views/flash/ajax.js.erb
|
320
|
+
- test/rails32/app/views/flash/show.html.erb
|
321
|
+
- test/rails32/app/views/layouts/application.html.erb
|
322
|
+
- test/rails32/config.ru
|
323
|
+
- test/rails32/config/application.rb
|
324
|
+
- test/rails32/config/boot.rb
|
325
|
+
- test/rails32/config/environment.rb
|
326
|
+
- test/rails32/config/environments/development.rb
|
327
|
+
- test/rails32/config/environments/production.rb
|
328
|
+
- test/rails32/config/environments/test.rb
|
329
|
+
- test/rails32/config/initializers/backtrace_silencers.rb
|
330
|
+
- test/rails32/config/initializers/inflections.rb
|
331
|
+
- test/rails32/config/initializers/mime_types.rb
|
332
|
+
- test/rails32/config/initializers/secret_token.rb
|
333
|
+
- test/rails32/config/initializers/session_store.rb
|
334
|
+
- test/rails32/config/initializers/wrap_parameters.rb
|
335
|
+
- test/rails32/config/locales/en.yml
|
336
|
+
- test/rails32/config/routes.rb
|
337
|
+
- test/rails32/log/.gitkeep
|
338
|
+
- test/rails32/public/404.html
|
339
|
+
- test/rails32/public/422.html
|
340
|
+
- test/rails32/public/500.html
|
341
|
+
- test/rails32/public/favicon.ico
|
342
|
+
- test/rails32/public/robots.txt
|
343
|
+
- test/rails32/script/rails
|
344
|
+
- test/rails32/spec/controllers/.flash_controller_spec.rb.swn
|
345
|
+
- test/rails32/spec/controllers/.flash_controller_spec.rb.swo
|
346
|
+
- test/rails32/spec/controllers/flash_controller_spec.rb
|
347
|
+
- test/rails32/spec/integration/flash_spec.rb
|
348
|
+
- test/rails32/spec/spec_helper.rb
|