priit-sprockets-rails2 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +10 -0
  3. data/Rakefile +11 -0
  4. data/lib/sprockets-rails2.rb +5 -0
  5. data/lib/sprockets/rails2/asset_helpers.rb +14 -0
  6. data/lib/sprockets/rails2/asset_pipeline.rb +21 -0
  7. data/lib/sprockets/rails2/middleware.rb +18 -0
  8. data/lib/sprockets/rails2/version.rb +5 -0
  9. data/sprockets-rails2.gemspec +25 -0
  10. data/test/dummy/.gitignore +1 -0
  11. data/test/dummy/README +243 -0
  12. data/test/dummy/Rakefile +10 -0
  13. data/test/dummy/app/controllers/application_controller.rb +10 -0
  14. data/test/dummy/app/controllers/test_controller.rb +2 -0
  15. data/test/dummy/app/helpers/application_helper.rb +3 -0
  16. data/test/dummy/app/helpers/test_helper.rb +2 -0
  17. data/test/dummy/app/views/test/index.html.erb +15 -0
  18. data/test/dummy/config/boot.rb +114 -0
  19. data/test/dummy/config/environment.rb +43 -0
  20. data/test/dummy/config/environments/development.rb +17 -0
  21. data/test/dummy/config/environments/production.rb +28 -0
  22. data/test/dummy/config/environments/test.rb +28 -0
  23. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  24. data/test/dummy/config/initializers/cookie_verification_secret.rb +7 -0
  25. data/test/dummy/config/initializers/inflections.rb +10 -0
  26. data/test/dummy/config/initializers/mime_types.rb +5 -0
  27. data/test/dummy/config/initializers/new_rails_defaults.rb +21 -0
  28. data/test/dummy/config/initializers/session_store.rb +15 -0
  29. data/test/dummy/config/locales/en.yml +5 -0
  30. data/test/dummy/config/routes.rb +43 -0
  31. data/test/dummy/doc/README_FOR_APP +2 -0
  32. data/test/dummy/public/404.html +30 -0
  33. data/test/dummy/public/422.html +30 -0
  34. data/test/dummy/public/500.html +30 -0
  35. data/test/dummy/public/favicon.ico +0 -0
  36. data/test/dummy/public/images/rails.png +0 -0
  37. data/test/dummy/public/index.html +275 -0
  38. data/test/dummy/public/javascripts/application.js +4 -0
  39. data/test/dummy/public/javascripts/controls.js +963 -0
  40. data/test/dummy/public/javascripts/dragdrop.js +973 -0
  41. data/test/dummy/public/javascripts/effects.js +1128 -0
  42. data/test/dummy/public/javascripts/prototype.js +4320 -0
  43. data/test/dummy/public/robots.txt +5 -0
  44. data/test/dummy/public/stylesheets/test.css +3 -0
  45. data/test/dummy/script/about +4 -0
  46. data/test/dummy/script/console +3 -0
  47. data/test/dummy/script/dbconsole +3 -0
  48. data/test/dummy/script/destroy +3 -0
  49. data/test/dummy/script/generate +3 -0
  50. data/test/dummy/script/performance/benchmarker +3 -0
  51. data/test/dummy/script/performance/profiler +3 -0
  52. data/test/dummy/script/plugin +3 -0
  53. data/test/dummy/script/runner +3 -0
  54. data/test/dummy/script/server +3 -0
  55. data/test/sprockets_rails2_test.rb +37 -0
  56. data/test/test_helper.rb +9 -0
  57. metadata +143 -0
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,3 @@
1
+ body {
2
+ background-color: white;
3
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/server'
@@ -0,0 +1,37 @@
1
+ require File.join(File.dirname(__FILE__), "test_helper")
2
+
3
+ class SprocketRails2Test < ActionController::IntegrationTest
4
+ def test_add_rails_asset_pipeline
5
+ assert Rails.asset_pipeline.instance_of? Sprockets::Environment
6
+ end
7
+
8
+ def test_fingerprint_in_stylesheet_urls
9
+ get "/test"
10
+ assert response.body =~ /test-a2eac1b10320f24cdd178f53df2effdd.css/
11
+ end
12
+
13
+ def test_fingerprint_in_javascript_urls
14
+ get "/test"
15
+ assert response.body =~ /application-94d362ea70095a9c3b5181d17e793524.js/
16
+ end
17
+
18
+ def test_fingerprint_in_image_urls
19
+ get "/test"
20
+ assert response.body =~ /rails-9add994b9c64a94f1557f1241c433c67.png/
21
+ end
22
+
23
+ def test_respond_to_requests_under_assets
24
+ get "/assets/images/rails-9add994b9c64a94f1557f1241c433c67.png"
25
+ assert_response :success
26
+ end
27
+
28
+ def test_should_not_modify_url_for_non_existing_assets
29
+ get "/test"
30
+ assert response.body =~ %r{src="/images/non-existing-file.png"}
31
+ end
32
+
33
+ def test_respond_with_404_for_assets_with_invalid_fingerprint
34
+ get "/assets/images/rails-db31f719034fee4.png"
35
+ assert_response :missing
36
+ end
37
+ end
@@ -0,0 +1,9 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require 'bundler'
4
+ require 'minitest/autorun'
5
+ require 'minitest/spec'
6
+
7
+ ENV['RAILS_ENV'] = 'test'
8
+ require 'dummy/config/environment'
9
+ require 'test_help'
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: priit-sprockets-rails2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Andrew Willis
14
+ - Priit Tamboom
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2012-05-24 00:00:00 +03:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: sprockets
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 1
31
+ segments:
32
+ - 2
33
+ - 1
34
+ version: "2.1"
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: |-
38
+ The sprockets-rails2 gem allows Rails 2.3 apps to use the
39
+ same asset pipeline functionality introduced in Rails 3.1.
40
+ It does this by integrating the Sprockets gem into a Rails
41
+ 2.3 app
42
+ email:
43
+ - awillis@customink.com
44
+ - priit@gitlab.eu
45
+ executables: []
46
+
47
+ extensions: []
48
+
49
+ extra_rdoc_files: []
50
+
51
+ files:
52
+ - .gitignore
53
+ - Gemfile
54
+ - Rakefile
55
+ - lib/sprockets-rails2.rb
56
+ - lib/sprockets/rails2/asset_helpers.rb
57
+ - lib/sprockets/rails2/asset_pipeline.rb
58
+ - lib/sprockets/rails2/middleware.rb
59
+ - lib/sprockets/rails2/version.rb
60
+ - sprockets-rails2.gemspec
61
+ - test/dummy/.gitignore
62
+ - test/dummy/README
63
+ - test/dummy/Rakefile
64
+ - test/dummy/app/controllers/application_controller.rb
65
+ - test/dummy/app/controllers/test_controller.rb
66
+ - test/dummy/app/helpers/application_helper.rb
67
+ - test/dummy/app/helpers/test_helper.rb
68
+ - test/dummy/app/views/test/index.html.erb
69
+ - test/dummy/config/boot.rb
70
+ - test/dummy/config/environment.rb
71
+ - test/dummy/config/environments/development.rb
72
+ - test/dummy/config/environments/production.rb
73
+ - test/dummy/config/environments/test.rb
74
+ - test/dummy/config/initializers/backtrace_silencers.rb
75
+ - test/dummy/config/initializers/cookie_verification_secret.rb
76
+ - test/dummy/config/initializers/inflections.rb
77
+ - test/dummy/config/initializers/mime_types.rb
78
+ - test/dummy/config/initializers/new_rails_defaults.rb
79
+ - test/dummy/config/initializers/session_store.rb
80
+ - test/dummy/config/locales/en.yml
81
+ - test/dummy/config/routes.rb
82
+ - test/dummy/doc/README_FOR_APP
83
+ - test/dummy/public/404.html
84
+ - test/dummy/public/422.html
85
+ - test/dummy/public/500.html
86
+ - test/dummy/public/favicon.ico
87
+ - test/dummy/public/images/rails.png
88
+ - test/dummy/public/index.html
89
+ - test/dummy/public/javascripts/application.js
90
+ - test/dummy/public/javascripts/controls.js
91
+ - test/dummy/public/javascripts/dragdrop.js
92
+ - test/dummy/public/javascripts/effects.js
93
+ - test/dummy/public/javascripts/prototype.js
94
+ - test/dummy/public/robots.txt
95
+ - test/dummy/public/stylesheets/test.css
96
+ - test/dummy/script/about
97
+ - test/dummy/script/console
98
+ - test/dummy/script/dbconsole
99
+ - test/dummy/script/destroy
100
+ - test/dummy/script/generate
101
+ - test/dummy/script/performance/benchmarker
102
+ - test/dummy/script/performance/profiler
103
+ - test/dummy/script/plugin
104
+ - test/dummy/script/runner
105
+ - test/dummy/script/server
106
+ - test/sprockets_rails2_test.rb
107
+ - test/test_helper.rb
108
+ has_rdoc: true
109
+ homepage: ""
110
+ licenses: []
111
+
112
+ post_install_message:
113
+ rdoc_options: []
114
+
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ hash: 3
123
+ segments:
124
+ - 0
125
+ version: "0"
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ hash: 3
132
+ segments:
133
+ - 0
134
+ version: "0"
135
+ requirements: []
136
+
137
+ rubyforge_project: sprockets-rails2
138
+ rubygems_version: 1.3.9.5
139
+ signing_key:
140
+ specification_version: 3
141
+ summary: Provides asset pipeline functionality to Rails 2.3 apps
142
+ test_files: []
143
+