js_include 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Manifest +3 -0
  2. data/Rakefile +15 -0
  3. data/js_include.gemspec +32 -0
  4. data/lib/js_include.rb +19 -0
  5. metadata +85 -0
data/Manifest ADDED
@@ -0,0 +1,3 @@
1
+ Rakefile
2
+ lib/js_include.rb
3
+ Manifest
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('js_include', '0.9.4') do |p|
6
+ p.description = "A Rails extension to ensure single inclusion of JS"
7
+ p.url = "https://github.com/jwhitehorn/js_include"
8
+ p.author = "Jason Whitehorn"
9
+ p.email = "jason.whitehorn@gmail.com"
10
+ p.runtime_dependencies = ["addressable"]
11
+ p.ignore_pattern = ["tmp/*", "script/*"]
12
+ p.development_dependencies = []
13
+ end
14
+
15
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{js_include}
5
+ s.version = "0.9.4"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = [%q{Jason Whitehorn}]
9
+ s.date = %q{2011-08-16}
10
+ s.description = %q{A Rails extension to ensure single inclusion of JS}
11
+ s.email = %q{jason.whitehorn@gmail.com}
12
+ s.extra_rdoc_files = [%q{lib/js_include.rb}]
13
+ s.files = [%q{Rakefile}, %q{lib/js_include.rb}, %q{Manifest}, %q{js_include.gemspec}]
14
+ s.homepage = %q{https://github.com/jwhitehorn/js_include}
15
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Js_include}]
16
+ s.require_paths = [%q{lib}]
17
+ s.rubyforge_project = %q{js_include}
18
+ s.rubygems_version = %q{1.8.7}
19
+ s.summary = %q{A Rails extension to ensure single inclusion of JS}
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<addressable>, [">= 0"])
26
+ else
27
+ s.add_dependency(%q<addressable>, [">= 0"])
28
+ end
29
+ else
30
+ s.add_dependency(%q<addressable>, [">= 0"])
31
+ end
32
+ end
data/lib/js_include.rb ADDED
@@ -0,0 +1,19 @@
1
+ module JsInclude
2
+ module ViewHelpers
3
+
4
+ def js_include resource
5
+ @included_js_files ||= []
6
+ unless @included_js_files.include? resource
7
+ @included_js_files << resource
8
+ javascript_include_tag resource
9
+ end
10
+ end
11
+
12
+ end
13
+
14
+ class Railtie < Rails::Railtie
15
+ initializer "js_include.view_helpers" do
16
+ ActionView::Base.send :include, ViewHelpers
17
+ end
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: js_include
3
+ version: !ruby/object:Gem::Version
4
+ hash: 51
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 4
10
+ version: 0.9.4
11
+ platform: ruby
12
+ authors:
13
+ - Jason Whitehorn
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-08-16 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: addressable
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: A Rails extension to ensure single inclusion of JS
35
+ email: jason.whitehorn@gmail.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files:
41
+ - lib/js_include.rb
42
+ files:
43
+ - Rakefile
44
+ - lib/js_include.rb
45
+ - Manifest
46
+ - js_include.gemspec
47
+ homepage: https://github.com/jwhitehorn/js_include
48
+ licenses: []
49
+
50
+ post_install_message:
51
+ rdoc_options:
52
+ - --line-numbers
53
+ - --inline-source
54
+ - --title
55
+ - Js_include
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 11
73
+ segments:
74
+ - 1
75
+ - 2
76
+ version: "1.2"
77
+ requirements: []
78
+
79
+ rubyforge_project: js_include
80
+ rubygems_version: 1.8.7
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: A Rails extension to ensure single inclusion of JS
84
+ test_files: []
85
+