rack-jquery 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -2
- data/CHANGES.md +7 -0
- data/Gemfile +2 -0
- data/README.md +3 -3
- data/Rakefile +38 -0
- data/lib/rack/jquery/version.rb +3 -2
- data/rack-jquery.gemspec +2 -2
- data/spec/rack_jquery_spec.rb +6 -0
- data/spec/spec_helper.rb +1 -7
- metadata +6 -4
data/.travis.yml
CHANGED
data/CHANGES.md
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -16,7 +16,7 @@ I get tired of copy and pasting and downloading and moving… jQuery files and s
|
|
16
16
|
Have a look in the examples directory, but here's a snippet.
|
17
17
|
|
18
18
|
* Install it (see below)
|
19
|
-
*
|
19
|
+
* `require 'rack/jquery'`.
|
20
20
|
* Put this in the head of your layout (the example is Haml but you can use whatever you like)
|
21
21
|
|
22
22
|
<pre><code>
|
@@ -26,13 +26,13 @@ Have a look in the examples directory, but here's a snippet.
|
|
26
26
|
|
27
27
|
Now you have the script tags to Google's CDN in the head (you can also use Media Temple or Microsoft, see the docs).
|
28
28
|
|
29
|
-
It also adds in a bit of javascript that will load in a locally kept version of jQuery, just incase the CDN is unreachable. The script will use the "/js/jquery
|
29
|
+
It also adds in a bit of javascript that will load in a locally kept version of jQuery, just incase the CDN is unreachable. The script will use the "/js/jquery-1.9.1.min.js" path (or, instead of 1.9.1, whatever is in {Rack::JQuery::VERSION}). You can change the "/js" bit if you like (see the docs).
|
30
30
|
|
31
31
|
That was easy.
|
32
32
|
|
33
33
|
## Version numbers ##
|
34
34
|
|
35
|
-
This library uses [semver](http://semver.org/) to version the **library**. That means the library version is ***not*** an indicator of quality but a way to manage changes. The version of jQuery can be found in the lib/rack/jquery/version.rb file, or via the Rack::JQuery::JQUERY_VERSION constant.
|
35
|
+
This library uses [semver](http://semver.org/) to version the **library**. That means the library version is ***not*** an indicator of quality but a way to manage changes. The version of jQuery can be found in the lib/rack/jquery/version.rb file, or via the {Rack::JQuery::JQUERY_VERSION} constant.
|
36
36
|
|
37
37
|
## Installation
|
38
38
|
|
data/Rakefile
CHANGED
@@ -1 +1,39 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
|
4
|
+
desc "(Re-) generate documentation and place it in the docs/ dir. Open the index.html file in there to read it."
|
5
|
+
task :docs => [:"docs:environment", :"docs:yard"]
|
6
|
+
namespace :docs do
|
7
|
+
|
8
|
+
task :environment do
|
9
|
+
ENV["RACK_ENV"] = "documentation"
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'yard'
|
13
|
+
|
14
|
+
YARD::Rake::YardocTask.new :yard do |t|
|
15
|
+
t.files = ['lib/**/*.rb', 'app/*.rb', 'spec/**/*.rb']
|
16
|
+
t.options = ['-odocs/'] # optional
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
task :default => "spec"
|
22
|
+
|
23
|
+
task :spec => :"spec:run"
|
24
|
+
task :rspec => :spec
|
25
|
+
namespace :spec do
|
26
|
+
task :environment do
|
27
|
+
ENV["RACK_ENV"] = "test"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Run specs"
|
31
|
+
task :run, [:any_args] => :"spec:environment" do |t,args|
|
32
|
+
warn "Entering spec task."
|
33
|
+
any_args = args[:any_args] || ""
|
34
|
+
cmd = "bin/rspec #{any_args}"
|
35
|
+
warn cmd
|
36
|
+
system cmd
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/lib/rack/jquery/version.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module Rack
|
2
2
|
class JQuery
|
3
|
-
VERSION = "0.0
|
3
|
+
VERSION = "1.0.0"
|
4
4
|
JQUERY_VERSION = "1.9.1"
|
5
5
|
|
6
|
-
#
|
6
|
+
# This is the release date of the jQuery file, it makes an easy "Last-Modified" date for setting the headers around caching.
|
7
|
+
# @todo remember to change Last-Modified with each release!
|
7
8
|
JQUERY_VERSION_DATE = "Mon, 04 Feb 2013 00:00:00 GMT"
|
8
9
|
end
|
9
10
|
end
|
data/rack-jquery.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Rack::JQuery::VERSION
|
9
9
|
spec.authors = ["Iain Barnett"]
|
10
10
|
spec.email = ["iainspeed@gmail.com"]
|
11
|
-
spec.description = %q{jQuery CDN script tags and fallback in one neat package.}
|
11
|
+
spec.description = %q{jQuery CDN script tags and fallback in one neat package. Current version is for jQuery v#{Rack::JQuery::JQUERY_VERSION}}
|
12
12
|
spec.summary = %q{The description says it all.}
|
13
13
|
spec.homepage = "https://github.com/yb66/rack-jquery"
|
14
14
|
spec.license = "MIT"
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.2"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_dependency("rack")
|
24
24
|
end
|
data/spec/rack_jquery_spec.rb
CHANGED
@@ -27,6 +27,12 @@ end
|
|
27
27
|
|
28
28
|
describe "Inserting the CDN" do
|
29
29
|
include_context "All routes"
|
30
|
+
context "Check the examples run at all" do
|
31
|
+
before do
|
32
|
+
get "/"
|
33
|
+
end
|
34
|
+
it_should_behave_like "Any route"
|
35
|
+
end
|
30
36
|
context "Google CDN" do
|
31
37
|
before do
|
32
38
|
get "/google-cdn"
|
data/spec/spec_helper.rb
CHANGED
@@ -3,19 +3,13 @@
|
|
3
3
|
require 'rspec'
|
4
4
|
Spec_dir = File.expand_path( File.dirname __FILE__ )
|
5
5
|
|
6
|
-
unless Kernel.respond_to?(:require_relative)
|
7
|
-
module Kernel
|
8
|
-
def require_relative(path)
|
9
|
-
require File.join(File.dirname(caller[0]), path.to_str)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
6
|
|
14
7
|
# code coverage
|
15
8
|
require 'simplecov'
|
16
9
|
SimpleCov.start do
|
17
10
|
add_filter "/vendor/"
|
18
11
|
add_filter "/bin/"
|
12
|
+
add_filter "/spec/"
|
19
13
|
end
|
20
14
|
|
21
15
|
require "rack/test"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-jquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.2'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.2'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,8 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
description: jQuery CDN script tags and fallback in one neat package.
|
62
|
+
description: jQuery CDN script tags and fallback in one neat package. Current version
|
63
|
+
is for jQuery v#{Rack::JQuery::JQUERY_VERSION}
|
63
64
|
email:
|
64
65
|
- iainspeed@gmail.com
|
65
66
|
executables: []
|
@@ -68,6 +69,7 @@ extra_rdoc_files: []
|
|
68
69
|
files:
|
69
70
|
- .gitignore
|
70
71
|
- .travis.yml
|
72
|
+
- CHANGES.md
|
71
73
|
- Gemfile
|
72
74
|
- LICENCE.txt
|
73
75
|
- README.md
|