asset_tags 0.1.0

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.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ = AssetTags - Use additional view asset tags.
2
+
3
+ This is a ActionView::Helpers::AssetTagHelper module extension that adds support for some additional view tags.
4
+
5
+ == Installation (Rails 3 ready)
6
+
7
+ Add this line to your Gemfile
8
+
9
+ gem 'asset_tags'
10
+
11
+ == Examples
12
+
13
+ = link_tag :rel => "stylesheet", :type => "text/css", :media => "screen", :href => "/css/style2.css"
14
+ = favicon_tag :path => 'favicon.ico'
15
+ = imgsrc_tag :path => 'facebook_logo.png'
@@ -0,0 +1,23 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+
5
+ desc 'Default: run unit tests.'
6
+ task :default => :test
7
+
8
+ desc 'Test the asset_tags plugin.'
9
+ Rake::TestTask.new(:test) do |t|
10
+ t.libs << 'lib'
11
+ t.libs << 'test'
12
+ t.pattern = 'test/**/*_test.rb'
13
+ t.verbose = true
14
+ end
15
+
16
+ desc 'Generate documentation for the asset_tags plugin.'
17
+ Rake::RDocTask.new(:rdoc) do |rdoc|
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.title = 'AssetTags'
20
+ rdoc.options << '--line-numbers' << '--inline-source'
21
+ rdoc.rdoc_files.include('README')
22
+ rdoc.rdoc_files.include('lib/**/*.rb')
23
+ end
@@ -0,0 +1,8 @@
1
+ #
2
+ # Load dependencies
3
+ #
4
+ %w( asset_tags/asset_helper
5
+ asset_tags/version
6
+ ).each do |lib|
7
+ require File.join(File.dirname(__FILE__), lib)
8
+ end
@@ -0,0 +1,26 @@
1
+ module ActionView
2
+ module Helpers
3
+ module AssetTagHelper
4
+
5
+ def link_tag(url_options = {}, tag_options = {})
6
+ href = url_options.is_a?(Hash) ? url_for(url_options.merge(:only_path => false)) : url_options
7
+ tag(
8
+ "link",
9
+ "rel" => tag_options[:rel] || nil,
10
+ "type" => tag_options[:type] || nil,
11
+ "title" => tag_options[:title] || nil,
12
+ "href" => compute_public_path(href, "", "")
13
+ )
14
+ end
15
+
16
+ def favicon_tag(path)
17
+ link_tag(path, :rel => "shortcut icon", :type => "image/x-icon")
18
+ end
19
+
20
+ def imgsrc_tag(path)
21
+ link_tag(path, :rel => "image_src")
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,9 @@
1
+ module AssetTags
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class AssetTagsTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'active_support'
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asset_tags
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Kristijan Sedlak
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-11-10 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: This is a ActionView::Helpers::AssetTagHelper module extension that adds support for some additional view tags.
23
+ email: xpepermint@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - README.rdoc
30
+ - MIT-LICENSE
31
+ files:
32
+ - Rakefile
33
+ - lib/asset_tags/asset_helper.rb
34
+ - lib/asset_tags/version.rb
35
+ - lib/asset_tags.rb
36
+ - test/asset_tags_test.rb
37
+ - test/test_helper.rb
38
+ - README.rdoc
39
+ - MIT-LICENSE
40
+ has_rdoc: true
41
+ homepage: http://github.com/xpepermint/asset_tags
42
+ licenses: []
43
+
44
+ post_install_message:
45
+ rdoc_options:
46
+ - --main
47
+ - README.rdoc
48
+ - --charset=UTF-8
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ requirements: []
70
+
71
+ rubyforge_project:
72
+ rubygems_version: 1.3.7
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: AssetTags - Use additional view asset tags.
76
+ test_files: []
77
+