jquery-rails-google-cdn 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +45 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +14 -0
  5. data/LICENSE +22 -0
  6. data/README.md +78 -0
  7. data/Rakefile +2 -0
  8. data/demoapp/.bundle/config +4 -0
  9. data/demoapp/.gitignore +58 -0
  10. data/demoapp/.ruby-version +1 -0
  11. data/demoapp/Gemfile +46 -0
  12. data/demoapp/Gemfile.lock +125 -0
  13. data/demoapp/README.rdoc +28 -0
  14. data/demoapp/Rakefile +6 -0
  15. data/demoapp/app/assets/javascripts/application.js +14 -0
  16. data/demoapp/app/assets/javascripts/home.js.coffee +3 -0
  17. data/demoapp/app/assets/stylesheets/application.css +13 -0
  18. data/demoapp/app/assets/stylesheets/home.css.scss +3 -0
  19. data/demoapp/app/controllers/application_controller.rb +5 -0
  20. data/demoapp/app/controllers/concerns/.keep +0 -0
  21. data/demoapp/app/controllers/home_controller.rb +4 -0
  22. data/demoapp/app/helpers/application_helper.rb +2 -0
  23. data/demoapp/app/helpers/home_helper.rb +2 -0
  24. data/demoapp/app/mailers/.keep +0 -0
  25. data/demoapp/app/models/.keep +0 -0
  26. data/demoapp/app/models/concerns/.keep +0 -0
  27. data/demoapp/app/views/home/index.html.erb +1 -0
  28. data/demoapp/app/views/layouts/application.html.erb +16 -0
  29. data/demoapp/bin/bundle +3 -0
  30. data/demoapp/bin/rails +4 -0
  31. data/demoapp/bin/rake +4 -0
  32. data/demoapp/config.ru +4 -0
  33. data/demoapp/config/application.rb +33 -0
  34. data/demoapp/config/boot.rb +4 -0
  35. data/demoapp/config/database.yml +25 -0
  36. data/demoapp/config/environment.rb +5 -0
  37. data/demoapp/config/environments/development.rb +29 -0
  38. data/demoapp/config/environments/production.rb +80 -0
  39. data/demoapp/config/environments/test.rb +36 -0
  40. data/demoapp/config/initializers/backtrace_silencers.rb +7 -0
  41. data/demoapp/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/demoapp/config/initializers/inflections.rb +16 -0
  43. data/demoapp/config/initializers/mime_types.rb +5 -0
  44. data/demoapp/config/initializers/secret_token.rb +12 -0
  45. data/demoapp/config/initializers/session_store.rb +3 -0
  46. data/demoapp/config/initializers/wrap_parameters.rb +14 -0
  47. data/demoapp/config/locales/en.yml +23 -0
  48. data/demoapp/config/routes.rb +52 -0
  49. data/demoapp/db/schema.rb +16 -0
  50. data/demoapp/db/seeds.rb +7 -0
  51. data/demoapp/lib/assets/.keep +0 -0
  52. data/demoapp/lib/tasks/.keep +0 -0
  53. data/demoapp/log/.keep +0 -0
  54. data/demoapp/public/404.html +58 -0
  55. data/demoapp/public/422.html +58 -0
  56. data/demoapp/public/500.html +57 -0
  57. data/demoapp/public/favicon.ico +0 -0
  58. data/demoapp/public/robots.txt +5 -0
  59. data/demoapp/vendor/assets/javascripts/.keep +0 -0
  60. data/demoapp/vendor/assets/javascripts/jquery/jquery.min.js +6 -0
  61. data/demoapp/vendor/assets/stylesheets/.keep +0 -0
  62. data/jquery_rails_google_cdn.gemspec +18 -0
  63. data/lib/jquery_rails_google_cdn.rb +2 -0
  64. data/lib/jquery_rails_google_cdn/railtie.rb +11 -0
  65. data/lib/jquery_rails_google_cdn/view_helpers.rb +14 -0
  66. metadata +66 -3
  67. data/lib/jquery-rails-google-cdn.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdae152578eadc1a402bac7455f3d81a4fa15ba7
4
- data.tar.gz: adcc466594ce94723b42abdac84653fcf3b079a7
3
+ metadata.gz: b00f6a89abbc1e4926c81eec49076044b543801e
4
+ data.tar.gz: 6a015fb2e595e0d96d05626aef1a68b1d94a4b1d
5
5
  SHA512:
6
- metadata.gz: 364d7a6629881fee74a85f026a477fecd2c83ed4855d78dcfb03ff937380e4ae0ca19b76a97b94b1f1fb98a5e4e7362adf3e8015a7423bcfcb114e2be79009b0
7
- data.tar.gz: 8edf1d222f9639808f019d1e52d7068f02365bd61780e3a48e7c99cb97da2fa995509474a6e1f3dd39ed6e048ec60146c99ea2ef42cc06fc3fbec8e57ee28d78
6
+ metadata.gz: 10724b74795d0c27b49db3cbdd7cef50e8809e8322f25b4d6eb018fc0c5e866ebf65e1567891ef5ea33c4546587054b3e578fb4dc8aa00b7540c4013d4e15f62
7
+ data.tar.gz: a884d2a059f43f0036399f070f02c4797c434507414a98a3bb16a2a8a37d77fdca9c72570b7e340de58185b96e5200b88e2e2c797acae0288d175f3b7a9b9334
@@ -0,0 +1,45 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # APPLICATION #
8
+ ###################
9
+ *.com
10
+ *.class
11
+ *.dll
12
+ *.exe
13
+ *.o
14
+ *.so
15
+
16
+ # Packages #
17
+ ############
18
+ # it's better to unpack these files and commit the raw source
19
+ # git has its own built in compression methods
20
+ *.7z
21
+ *.dmg
22
+ *.gz
23
+ *.iso
24
+ *.jar
25
+ *.rar
26
+ *.tar
27
+ *.zip
28
+
29
+ # Logs and databases #
30
+ ######################
31
+ *.log
32
+ *.sql
33
+ *.sqlite
34
+
35
+ # OS generated files #
36
+ ######################
37
+ *.DS_Store
38
+ .DS_Store?
39
+ ._*
40
+ .Spotlight-V100
41
+ .Trashes
42
+ Icon?
43
+ ehthumbs.db
44
+ Thumbs.db
45
+
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,14 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jquery-rails-google-cdn (0.0.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+
10
+ PLATFORMS
11
+ ruby
12
+
13
+ DEPENDENCIES
14
+ jquery-rails-google-cdn!
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Kenn Ejima
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,78 @@
1
+ I have to give credit to the authors of the gems I combined and modified to make this a reality:
2
+ [jquery-rails](https://github.com/styx/jquery-ui-rails-cdn) and [jquery-ui-rails-cdn](https://github.com/styx/jquery-ui-rails-cdn). This gem will utilize [jquery-rails](https://github.com/rails/jquery-rails) however, it will serve your jquery files from the google cdn, if possible, than fall back to your local copies if neccessary.
3
+
4
+ Serving jQuery from a publicly available [CDN](http://en.wikipedia.org/wiki/Content_Delivery_Network) has clear benefits:
5
+
6
+ * **Speed**: Users will be able to download jQuery from the closest physical location.
7
+ * **Caching**: CDN is used so widely that potentially your users may not need to download jQuery at all.
8
+ * **Parallelism**: Browsers have a limitation on how many connections can be made to a single host. Using a CDN for jQuery offloads a big one.
9
+
10
+ =============
11
+
12
+ ### Features
13
+
14
+ This gem offers the following features:
15
+
16
+ * Supports Google CDN
17
+ * jQuery version is set in your application.rb file
18
+ * Automatically fallback to local jquery min files stored in your vendor directory:
19
+ * You're on a development environment, so that you can work offline.
20
+ * The CDN is down or unreachable.
21
+
22
+ On top of that, if you're using asset pipeline, you may have noticed that the major chunks of the code in combined `application.js` is jQuery. Implications of externalizing jQuery from `application.js` are:
23
+
24
+ * Updating your JS code won't evict the entire cache in browsers.
25
+ * Cached jQuery in the client browsers will survive deployments.
26
+ * Your code changes more often than jQuery upgrades, right?
27
+ * `rake assets:precompile` will run faster and use less memory.
28
+
29
+ =============
30
+
31
+ ### Installation
32
+
33
+ If you're using the asset pipeline with Rails 3.1+,
34
+
35
+ - Start by removing `//= require jquery` from your `application.js` file.
36
+
37
+ If you're using the asset pipeline with Rails 4+,
38
+
39
+ - Create the jQuery vendor directory: `mkdir vendor/assets/javascripts/jquery`
40
+ - Download the version of jquery you want to use from the [google cdn](https://developers.google.com/speed/libraries/devguide#jquery) and save the file to this directory. The file should look something like `jquery.min.js`.
41
+ - Verify you have the jquery-rails gem enabled as well as the new gem:
42
+
43
+ ```ruby
44
+ gem 'jquery-rails'
45
+ gem 'jquery-rails-google-cdn'
46
+ ```
47
+
48
+ - Add these lines to your application.rb file to set the version of jQuery you are using and to make sure the asset pipeline makes it available:
49
+
50
+ ```ruby
51
+ config.assets.precompile += ["jquery.min.js"]
52
+ config.jquery_version = "2.0.2"
53
+ ```
54
+
55
+ - Finally add this section to your layouts file.
56
+
57
+ ```html
58
+ <%= jquery_include_tag Rails.application.config.jquery_version %>
59
+ <%= javascript_include_tag "application" %>
60
+ ```
61
+
62
+ It will generate the following across all modes production, testing, and development:
63
+
64
+ ```html
65
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
66
+ <script>
67
+ //<![CDATA[
68
+ window.jQuery || document.write(unescape('%3Cscript src="/assets/jquery.min.js">%3C/script>'))
69
+ //]]>
70
+ </script>
71
+ ```
72
+
73
+ =============
74
+
75
+ ###Changelog
76
+
77
+ * v0.0.2: Changed up initial workflow, forking even further from the previous authors
78
+ * v0.0.1: Initial release
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,4 @@
1
+ ---
2
+ BUNDLE_PATH: .bundle
3
+ BUNDLE_BIN: .bundle/binstubs
4
+ BUNDLE_DISABLE_SHARED_GEMS: '1'
@@ -0,0 +1,58 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore specific config files
8
+ .bundle/*
9
+ !.bundle/config
10
+ .chef
11
+ .vagrant
12
+
13
+ # Ignore the default SQLite database.
14
+ /db/*.sqlite3
15
+
16
+ # Ignore all logfiles and tempfiles.
17
+ /log/*.log
18
+ /tmp
19
+
20
+ # APPLICATION #
21
+ ###################
22
+ *.com
23
+ *.class
24
+ *.dll
25
+ *.exe
26
+ *.o
27
+ *.so
28
+
29
+ # Packages #
30
+ ############
31
+ # it's better to unpack these files and commit the raw source
32
+ # git has its own built in compression methods
33
+ *.7z
34
+ *.dmg
35
+ *.gz
36
+ *.iso
37
+ *.jar
38
+ *.rar
39
+ *.tar
40
+ *.zip
41
+
42
+ # Logs and databases #
43
+ ######################
44
+ *.log
45
+ *.sql
46
+ *.sqlite
47
+
48
+ # OS generated files #
49
+ ######################
50
+ *.DS_Store
51
+ .DS_Store?
52
+ ._*
53
+ .Spotlight-V100
54
+ .Trashes
55
+ Icon?
56
+ ehthumbs.db
57
+ Thumbs.db
58
+
@@ -0,0 +1 @@
1
+ 2.0.0-p0
@@ -0,0 +1,46 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0.rc1'
5
+
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+
9
+ # Use SCSS for stylesheets
10
+ gem 'sass-rails', '~> 4.0.0.rc1'
11
+
12
+ # Use Uglifier as compressor for JavaScript assets
13
+ gem 'uglifier', '>= 1.3.0'
14
+
15
+ # Use CoffeeScript for .js.coffee assets and views
16
+ gem 'coffee-rails', '~> 4.0.0'
17
+
18
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
19
+ # gem 'therubyracer', platforms: :ruby
20
+
21
+ # Use jquery as the JavaScript library
22
+ gem 'jquery-rails'
23
+ gem 'jquery-rails-google-cdn', path: '/Users/chrishough/NoConformity/Code/Public/RubyGems/jquery_rails_google_cdn', require: 'jquery_rails_google_cdn'
24
+
25
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
26
+ gem 'turbolinks'
27
+
28
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
29
+ gem 'jbuilder', '~> 1.0.1'
30
+
31
+ group :doc do
32
+ # bundle exec rake doc:rails generates the API under doc/api.
33
+ gem 'sdoc', require: false
34
+ end
35
+
36
+ # Use ActiveModel has_secure_password
37
+ # gem 'bcrypt-ruby', '~> 3.0.0'
38
+
39
+ # Use unicorn as the app server
40
+ # gem 'unicorn'
41
+
42
+ # Use Capistrano for deployment
43
+ # gem 'capistrano', group: :development
44
+
45
+ # Use debugger
46
+ # gem 'debugger', group: [:development, :test]
@@ -0,0 +1,125 @@
1
+ PATH
2
+ remote: /Users/chrishough/NoConformity/Code/Public/RubyGems/jquery_rails_google_cdn
3
+ specs:
4
+ jquery-rails-google-cdn (0.0.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actionmailer (4.0.0.rc1)
10
+ actionpack (= 4.0.0.rc1)
11
+ mail (~> 2.5.3)
12
+ actionpack (4.0.0.rc1)
13
+ activesupport (= 4.0.0.rc1)
14
+ builder (~> 3.1.0)
15
+ erubis (~> 2.7.0)
16
+ rack (~> 1.5.2)
17
+ rack-test (~> 0.6.2)
18
+ activemodel (4.0.0.rc1)
19
+ activesupport (= 4.0.0.rc1)
20
+ builder (~> 3.1.0)
21
+ activerecord (4.0.0.rc1)
22
+ activemodel (= 4.0.0.rc1)
23
+ activerecord-deprecated_finders (~> 1.0.2)
24
+ activesupport (= 4.0.0.rc1)
25
+ arel (~> 4.0.0)
26
+ activerecord-deprecated_finders (1.0.3)
27
+ activesupport (4.0.0.rc1)
28
+ i18n (~> 0.6, >= 0.6.4)
29
+ minitest (~> 4.2)
30
+ multi_json (~> 1.3)
31
+ thread_safe (~> 0.1)
32
+ tzinfo (~> 0.3.37)
33
+ arel (4.0.0)
34
+ atomic (1.1.9)
35
+ builder (3.1.4)
36
+ coffee-rails (4.0.0)
37
+ coffee-script (>= 2.2.0)
38
+ railties (>= 4.0.0.beta, < 5.0)
39
+ coffee-script (2.2.0)
40
+ coffee-script-source
41
+ execjs
42
+ coffee-script-source (1.6.2)
43
+ erubis (2.7.0)
44
+ execjs (1.4.0)
45
+ multi_json (~> 1.0)
46
+ hike (1.2.3)
47
+ i18n (0.6.4)
48
+ jbuilder (1.0.2)
49
+ activesupport (>= 3.0.0)
50
+ jquery-rails (3.0.1)
51
+ railties (>= 3.0, < 5.0)
52
+ thor (>= 0.14, < 2.0)
53
+ json (1.8.0)
54
+ mail (2.5.4)
55
+ mime-types (~> 1.16)
56
+ treetop (~> 1.4.8)
57
+ mime-types (1.23)
58
+ minitest (4.7.4)
59
+ multi_json (1.7.6)
60
+ polyglot (0.3.3)
61
+ rack (1.5.2)
62
+ rack-test (0.6.2)
63
+ rack (>= 1.0)
64
+ rails (4.0.0.rc1)
65
+ actionmailer (= 4.0.0.rc1)
66
+ actionpack (= 4.0.0.rc1)
67
+ activerecord (= 4.0.0.rc1)
68
+ activesupport (= 4.0.0.rc1)
69
+ bundler (>= 1.3.0, < 2.0)
70
+ railties (= 4.0.0.rc1)
71
+ sprockets-rails (~> 2.0.0.rc4)
72
+ railties (4.0.0.rc1)
73
+ actionpack (= 4.0.0.rc1)
74
+ activesupport (= 4.0.0.rc1)
75
+ rake (>= 0.8.7)
76
+ thor (>= 0.18.1, < 2.0)
77
+ rake (10.0.4)
78
+ rdoc (3.12.2)
79
+ json (~> 1.4)
80
+ sass (3.2.9)
81
+ sass-rails (4.0.0.rc2)
82
+ railties (>= 4.0.0.beta, < 5.0)
83
+ sass (>= 3.1.10)
84
+ sprockets-rails (~> 2.0.0)
85
+ sdoc (0.3.20)
86
+ json (>= 1.1.3)
87
+ rdoc (~> 3.10)
88
+ sprockets (2.10.0)
89
+ hike (~> 1.2)
90
+ multi_json (~> 1.0)
91
+ rack (~> 1.0)
92
+ tilt (~> 1.1, != 1.3.0)
93
+ sprockets-rails (2.0.0)
94
+ actionpack (>= 3.0)
95
+ activesupport (>= 3.0)
96
+ sprockets (~> 2.8)
97
+ sqlite3 (1.3.7)
98
+ thor (0.18.1)
99
+ thread_safe (0.1.0)
100
+ atomic
101
+ tilt (1.4.1)
102
+ treetop (1.4.14)
103
+ polyglot
104
+ polyglot (>= 0.3.1)
105
+ turbolinks (1.2.0)
106
+ coffee-rails
107
+ tzinfo (0.3.37)
108
+ uglifier (2.1.1)
109
+ execjs (>= 0.3.0)
110
+ multi_json (~> 1.0, >= 1.0.2)
111
+
112
+ PLATFORMS
113
+ ruby
114
+
115
+ DEPENDENCIES
116
+ coffee-rails (~> 4.0.0)
117
+ jbuilder (~> 1.0.1)
118
+ jquery-rails
119
+ jquery-rails-google-cdn!
120
+ rails (= 4.0.0.rc1)
121
+ sass-rails (~> 4.0.0.rc1)
122
+ sdoc
123
+ sqlite3
124
+ turbolinks
125
+ uglifier (>= 1.3.0)
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.