lorempixum 0.0.1
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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/lib/lorempixum/version.rb +3 -0
- data/lib/lorempixum.rb +35 -0
- data/lorempixum.gemspec +21 -0
- metadata +60 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/lib/lorempixum.rb
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module ActionView
|
|
2
|
+
module Helpers
|
|
3
|
+
module AssetTagHelper
|
|
4
|
+
def placeholder_image_tag(options = {})
|
|
5
|
+
source = "http://lorempixum.com"
|
|
6
|
+
options[:alt] = "lorempixum" unless options.has_key?(:alt)
|
|
7
|
+
|
|
8
|
+
# grey
|
|
9
|
+
if options.has_key?(:grey)
|
|
10
|
+
source += "/g" if options[:grey]
|
|
11
|
+
options.delete(:grey)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# width
|
|
15
|
+
width = options.has_key?(:width) ? options[:width] : 100
|
|
16
|
+
source += "/#{width}"
|
|
17
|
+
|
|
18
|
+
# height
|
|
19
|
+
height = options.has_key?(:height) ? options[:height] : 100
|
|
20
|
+
source += "/#{height}"
|
|
21
|
+
|
|
22
|
+
# category
|
|
23
|
+
if options.has_key?(:category)
|
|
24
|
+
source += "/#{options.delete(:category)}"
|
|
25
|
+
|
|
26
|
+
# number
|
|
27
|
+
source += "/#{options.delete(:number)}" if options.has_key?(:number)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
image_tag(source, options)
|
|
31
|
+
end
|
|
32
|
+
alias_method :lorempixum_image_tag, :placeholder_image_tag
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lorempixum.gemspec
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "lorempixum/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "lorempixum"
|
|
7
|
+
s.version = Lorempixum::VERSION
|
|
8
|
+
s.platform = Gem::Platform::RUBY
|
|
9
|
+
s.authors = ["Daniel Spangenberg"]
|
|
10
|
+
s.email = ["daniel.spangenberg@parcydo.com"]
|
|
11
|
+
s.homepage = "http://neonlex.github.com"
|
|
12
|
+
s.summary = %q{With these gem you can easily have nice placeholder images in your app.}
|
|
13
|
+
s.description = %q{This gem generates image urls for placeholder images.}
|
|
14
|
+
|
|
15
|
+
s.rubyforge_project = "lorempixum"
|
|
16
|
+
|
|
17
|
+
s.files = `git ls-files`.split("\n")
|
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
|
+
s.require_paths = ["lib"]
|
|
21
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: lorempixum
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
prerelease:
|
|
5
|
+
version: 0.0.1
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Daniel Spangenberg
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
|
|
13
|
+
date: 2011-04-14 00:00:00 Z
|
|
14
|
+
dependencies: []
|
|
15
|
+
|
|
16
|
+
description: This gem generates image urls for placeholder images.
|
|
17
|
+
email:
|
|
18
|
+
- daniel.spangenberg@parcydo.com
|
|
19
|
+
executables: []
|
|
20
|
+
|
|
21
|
+
extensions: []
|
|
22
|
+
|
|
23
|
+
extra_rdoc_files: []
|
|
24
|
+
|
|
25
|
+
files:
|
|
26
|
+
- .gitignore
|
|
27
|
+
- Gemfile
|
|
28
|
+
- Rakefile
|
|
29
|
+
- lib/lorempixum.rb
|
|
30
|
+
- lib/lorempixum/version.rb
|
|
31
|
+
- lorempixum.gemspec
|
|
32
|
+
homepage: http://neonlex.github.com
|
|
33
|
+
licenses: []
|
|
34
|
+
|
|
35
|
+
post_install_message:
|
|
36
|
+
rdoc_options: []
|
|
37
|
+
|
|
38
|
+
require_paths:
|
|
39
|
+
- lib
|
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: "0"
|
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
|
+
none: false
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: "0"
|
|
52
|
+
requirements: []
|
|
53
|
+
|
|
54
|
+
rubyforge_project: lorempixum
|
|
55
|
+
rubygems_version: 1.7.2
|
|
56
|
+
signing_key:
|
|
57
|
+
specification_version: 3
|
|
58
|
+
summary: With these gem you can easily have nice placeholder images in your app.
|
|
59
|
+
test_files: []
|
|
60
|
+
|