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.
Files changed (49) hide show
  1. data/Gemfile.lock +6 -6
  2. data/lib/glow/filter.rb +7 -7
  3. data/lib/glow/version.rb +1 -1
  4. data/test/rails3/Gemfile +1 -0
  5. data/test/rails3/Gemfile.lock +68 -59
  6. data/test/rails3/spec/spec_helper.rb +1 -1
  7. data/test/rails31/Gemfile +1 -0
  8. data/test/rails31/Gemfile.lock +58 -49
  9. data/test/rails31/spec/spec_helper.rb +1 -1
  10. data/test/rails32/.gitignore +5 -0
  11. data/test/rails32/Gemfile +34 -0
  12. data/test/rails32/Gemfile.lock +161 -0
  13. data/test/rails32/Rakefile +7 -0
  14. data/test/rails32/app/assets/images/rails.png +0 -0
  15. data/test/rails32/app/assets/javascripts/application.js +10 -0
  16. data/test/rails32/app/assets/stylesheets/application.css +7 -0
  17. data/test/rails32/app/controllers/application_controller.rb +3 -0
  18. data/test/rails32/app/controllers/flash_controller.rb +18 -0
  19. data/test/rails32/app/views/flash/ajax.js.erb +1 -0
  20. data/test/rails32/app/views/flash/show.html.erb +13 -0
  21. data/test/rails32/app/views/layouts/application.html.erb +14 -0
  22. data/test/rails32/config.ru +4 -0
  23. data/test/rails32/config/application.rb +51 -0
  24. data/test/rails32/config/boot.rb +6 -0
  25. data/test/rails32/config/environment.rb +5 -0
  26. data/test/rails32/config/environments/development.rb +30 -0
  27. data/test/rails32/config/environments/production.rb +60 -0
  28. data/test/rails32/config/environments/test.rb +42 -0
  29. data/test/rails32/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/rails32/config/initializers/inflections.rb +10 -0
  31. data/test/rails32/config/initializers/mime_types.rb +5 -0
  32. data/test/rails32/config/initializers/secret_token.rb +7 -0
  33. data/test/rails32/config/initializers/session_store.rb +8 -0
  34. data/test/rails32/config/initializers/wrap_parameters.rb +10 -0
  35. data/test/rails32/config/locales/en.yml +5 -0
  36. data/test/rails32/config/routes.rb +6 -0
  37. data/test/rails32/log/.gitkeep +0 -0
  38. data/test/rails32/public/404.html +26 -0
  39. data/test/rails32/public/422.html +26 -0
  40. data/test/rails32/public/500.html +26 -0
  41. data/test/rails32/public/favicon.ico +0 -0
  42. data/test/rails32/public/robots.txt +5 -0
  43. data/test/rails32/script/rails +6 -0
  44. data/test/rails32/spec/controllers/.flash_controller_spec.rb.swn +0 -0
  45. data/test/rails32/spec/controllers/.flash_controller_spec.rb.swo +0 -0
  46. data/test/rails32/spec/controllers/flash_controller_spec.rb +33 -0
  47. data/test/rails32/spec/integration/flash_spec.rb +17 -0
  48. data/test/rails32/spec/spec_helper.rb +31 -0
  49. metadata +83 -5
@@ -5,7 +5,7 @@ require 'rspec/rails'
5
5
  require 'capybara/rspec'
6
6
  require 'capybara/rails'
7
7
 
8
- Capybara.default_driver = :selenium
8
+ Capybara.default_driver = :webkit
9
9
 
10
10
  # Requires supporting ruby files with custom matchers and macros, etc,
11
11
  # in spec/support/ and its subdirectories.
@@ -0,0 +1,5 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/
5
+ .sass-cache/
@@ -0,0 +1,34 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 3.2.0'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+
9
+
10
+ # Gems used only for assets and not required
11
+ # in production environments by default.
12
+ group :assets do
13
+ gem 'sass-rails', " ~> 3.2.0"
14
+ gem 'coffee-rails', "~> 3.2.0"
15
+ gem 'uglifier'
16
+ end
17
+
18
+ gem 'glow', path: '../..'
19
+
20
+ gem 'jquery-rails'
21
+ gem 'rspec-rails'
22
+ gem 'capybara'
23
+ gem 'htmlentities'
24
+ gem 'capybara-webkit'
25
+
26
+ # Use unicorn as the web server
27
+ # gem 'unicorn'
28
+
29
+ # Deploy with Capistrano
30
+ # gem 'capistrano'
31
+
32
+ # To use debugger
33
+ # gem 'ruby-debug19', :require => 'ruby-debug'
34
+
@@ -0,0 +1,161 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ glow (0.0.10)
5
+ jquery-rails
6
+ rails (>= 3.0.0, < 4.0.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.8)
12
+ actionpack (= 3.2.8)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.8)
15
+ activemodel (= 3.2.8)
16
+ activesupport (= 3.2.8)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.1.3)
24
+ activemodel (3.2.8)
25
+ activesupport (= 3.2.8)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.8)
28
+ activemodel (= 3.2.8)
29
+ activesupport (= 3.2.8)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.8)
33
+ activemodel (= 3.2.8)
34
+ activesupport (= 3.2.8)
35
+ activesupport (3.2.8)
36
+ i18n (~> 0.6)
37
+ multi_json (~> 1.0)
38
+ addressable (2.3.2)
39
+ arel (3.0.2)
40
+ builder (3.0.0)
41
+ capybara (1.1.2)
42
+ mime-types (>= 1.16)
43
+ nokogiri (>= 1.3.3)
44
+ rack (>= 1.0.0)
45
+ rack-test (>= 0.5.4)
46
+ selenium-webdriver (~> 2.0)
47
+ xpath (~> 0.1.4)
48
+ capybara-webkit (0.12.1)
49
+ capybara (>= 1.0.0, < 1.2)
50
+ json
51
+ childprocess (0.3.5)
52
+ ffi (~> 1.0, >= 1.0.6)
53
+ coffee-rails (3.2.2)
54
+ coffee-script (>= 2.2.0)
55
+ railties (~> 3.2.0)
56
+ coffee-script (2.2.0)
57
+ coffee-script-source
58
+ execjs
59
+ coffee-script-source (1.3.3)
60
+ diff-lcs (1.1.3)
61
+ erubis (2.7.0)
62
+ execjs (1.4.0)
63
+ multi_json (~> 1.0)
64
+ ffi (1.1.5)
65
+ hike (1.2.1)
66
+ htmlentities (4.3.1)
67
+ i18n (0.6.0)
68
+ journey (1.0.4)
69
+ jquery-rails (2.0.2)
70
+ railties (>= 3.2.0, < 5.0)
71
+ thor (~> 0.14)
72
+ json (1.7.4)
73
+ libwebsocket (0.1.5)
74
+ addressable
75
+ mail (2.4.4)
76
+ i18n (>= 0.4.0)
77
+ mime-types (~> 1.16)
78
+ treetop (~> 1.4.8)
79
+ mime-types (1.19)
80
+ multi_json (1.3.6)
81
+ nokogiri (1.5.5)
82
+ polyglot (0.3.3)
83
+ rack (1.4.1)
84
+ rack-cache (1.2)
85
+ rack (>= 0.4)
86
+ rack-ssl (1.3.2)
87
+ rack
88
+ rack-test (0.6.1)
89
+ rack (>= 1.0)
90
+ rails (3.2.8)
91
+ actionmailer (= 3.2.8)
92
+ actionpack (= 3.2.8)
93
+ activerecord (= 3.2.8)
94
+ activeresource (= 3.2.8)
95
+ activesupport (= 3.2.8)
96
+ bundler (~> 1.0)
97
+ railties (= 3.2.8)
98
+ railties (3.2.8)
99
+ actionpack (= 3.2.8)
100
+ activesupport (= 3.2.8)
101
+ rack-ssl (~> 1.3.2)
102
+ rake (>= 0.8.7)
103
+ rdoc (~> 3.4)
104
+ thor (>= 0.14.6, < 2.0)
105
+ rake (0.9.2.2)
106
+ rdoc (3.12)
107
+ json (~> 1.4)
108
+ rspec (2.11.0)
109
+ rspec-core (~> 2.11.0)
110
+ rspec-expectations (~> 2.11.0)
111
+ rspec-mocks (~> 2.11.0)
112
+ rspec-core (2.11.1)
113
+ rspec-expectations (2.11.2)
114
+ diff-lcs (~> 1.1.3)
115
+ rspec-mocks (2.11.2)
116
+ rspec-rails (2.11.0)
117
+ actionpack (>= 3.0)
118
+ activesupport (>= 3.0)
119
+ railties (>= 3.0)
120
+ rspec (~> 2.11.0)
121
+ rubyzip (0.9.9)
122
+ sass (3.2.0)
123
+ sass-rails (3.2.5)
124
+ railties (~> 3.2.0)
125
+ sass (>= 3.1.10)
126
+ tilt (~> 1.3)
127
+ selenium-webdriver (2.25.0)
128
+ childprocess (>= 0.2.5)
129
+ libwebsocket (~> 0.1.3)
130
+ multi_json (~> 1.0)
131
+ rubyzip
132
+ sprockets (2.1.3)
133
+ hike (~> 1.2)
134
+ rack (~> 1.0)
135
+ tilt (~> 1.1, != 1.3.0)
136
+ thor (0.16.0)
137
+ tilt (1.3.3)
138
+ treetop (1.4.10)
139
+ polyglot
140
+ polyglot (>= 0.3.1)
141
+ tzinfo (0.3.33)
142
+ uglifier (1.2.7)
143
+ execjs (>= 0.3.0)
144
+ multi_json (~> 1.3)
145
+ xpath (0.1.4)
146
+ nokogiri (~> 1.3)
147
+
148
+ PLATFORMS
149
+ ruby
150
+
151
+ DEPENDENCIES
152
+ capybara
153
+ capybara-webkit
154
+ coffee-rails (~> 3.2.0)
155
+ glow!
156
+ htmlentities
157
+ jquery-rails
158
+ rails (~> 3.2.0)
159
+ rspec-rails
160
+ sass-rails (~> 3.2.0)
161
+ uglifier
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Rails31::Application.load_tasks
@@ -0,0 +1,10 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require glow
10
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,18 @@
1
+ class FlashController < ApplicationController
2
+ def show
3
+ # show.html.erb
4
+ end
5
+
6
+ def redirect
7
+ flash[params[:type].to_sym] = params[:message]
8
+ redirect_to action: 'show'
9
+ end
10
+
11
+ def ajax
12
+ respond_to do |wants|
13
+ wants.js {
14
+ flash[params[:type].to_sym] = params[:message]
15
+ }
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ console.log('ajax response');
@@ -0,0 +1,13 @@
1
+ <script type="application/javascript">
2
+ // Flash handling
3
+ $(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').html(flash.message); });
4
+ </script>
5
+
6
+ <p id="flash"><%= flash.map { |type, message| message }.join %></p>
7
+ <p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓ ' %></p>
8
+ <p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓ '}, remote: true %></p>
9
+ <p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
10
+
11
+ <script type="application/javascript">
12
+ $('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery utf8: ✓', format: :js %>'); return false;});
13
+ </script>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Rails31</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails31::Application
@@ -0,0 +1,51 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "action_controller/railtie"
4
+ require "action_mailer/railtie"
5
+ require "active_resource/railtie"
6
+ require "sprockets/railtie"
7
+
8
+ if defined?(Bundler)
9
+ # If you precompile assets before deploying to production, use this line
10
+ Bundler.require *Rails.groups(:assets => %w(development test))
11
+ # If you want your assets lazily compiled in production, use this line
12
+ # Bundler.require(:default, :assets, Rails.env)
13
+ end
14
+
15
+ module Rails31
16
+ class Application < Rails::Application
17
+ # Settings in config/environments/* take precedence over those specified here.
18
+ # Application configuration should go into files in config/initializers
19
+ # -- all .rb files in that directory are automatically loaded.
20
+
21
+ # Custom directories with classes and modules you want to be autoloadable.
22
+ # config.autoload_paths += %W(#{config.root}/extras)
23
+
24
+ # Only load the plugins named here, in the order given (default is alphabetical).
25
+ # :all can be used as a placeholder for all plugins not explicitly named.
26
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
27
+
28
+ # Activate observers that should always be running.
29
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
30
+
31
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
32
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
33
+ # config.time_zone = 'Central Time (US & Canada)'
34
+
35
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
36
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
37
+ # config.i18n.default_locale = :de
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+
45
+ # Enable the asset pipeline
46
+ config.assets.enabled = true
47
+
48
+ # Version of your assets, change this if you want to expire all your assets
49
+ config.assets.version = '1.0'
50
+ end
51
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Rails31::Application.initialize!
@@ -0,0 +1,30 @@
1
+ Rails31::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -0,0 +1,60 @@
1
+ Rails31::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ end