placehold_it 0.0.1 → 0.0.2
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/README.markdown +31 -0
- data/lib/placehold_it.rb +6 -6
- data/lib/placehold_it/version.rb +1 -1
- data/test/dummy/log/test.log +3 -0
- metadata +4 -4
- data/README.rdoc +0 -3
data/README.markdown
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# PlaceholdIt
|
|
2
|
+
Rails helpers for easy image placeholders from [Placehold.It](http://placehold.it).
|
|
3
|
+
|
|
4
|
+
## Examples
|
|
5
|
+
### Generating a URL
|
|
6
|
+
````ruby
|
|
7
|
+
#(1) Default Arguments
|
|
8
|
+
placeholder_image_url
|
|
9
|
+
#(2) 350x350 image
|
|
10
|
+
placeholder_image_url 350
|
|
11
|
+
#(3) 350x450 image, with a red (#FF0000) background
|
|
12
|
+
placeholder_image_url "350x450", :bg => "FF0000"
|
|
13
|
+
#(4) 350x350 image with a black (#000) background and dark grey (#666) text
|
|
14
|
+
placeholder_image_url "350x350", :bg => "000", :fg => "666"
|
|
15
|
+
#(5) 350x350 image with text "Args in any order", a black (#000) background and dark grey (#666) text
|
|
16
|
+
placeholder_image_url "350x350", :text => "Args in any order", :bg => "000", :fg => "666"
|
|
17
|
+
#(6) 500x50 image with text "Jackdaws love my big sphinx of quartz."
|
|
18
|
+
placeholder_image_url "500x50", :text => "Jackdaws love my big sphinx of quartz."
|
|
19
|
+
````
|
|
20
|
+
|
|
21
|
+
### Inserting a tag
|
|
22
|
+
it's much the same as the ```placeholder_image_url``` method, except that you can add some html options
|
|
23
|
+
````ruby
|
|
24
|
+
#Default Arguments
|
|
25
|
+
placeholder_image_tag "300x450", #size
|
|
26
|
+
{ :class => "my_image_class", :id => "special_img"}, # html element options
|
|
27
|
+
:text => "This is a test" # followed by the options described above for placeholder_image_url
|
|
28
|
+
````
|
|
29
|
+
|
|
30
|
+
## Thanks
|
|
31
|
+
Credit goes to [Brent Spore](http://brentspore.com/) for making [Placehold.It](http://placehold.it) and keeping it free, and to [Zeke Sikelianos](https://github.com/zeke) for writing the [little piece of code](https://gist.github.com/473254) that inspired this gem.
|
data/lib/placehold_it.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module PlaceholdIt
|
|
2
|
-
end
|
|
3
|
-
|
|
4
1
|
require "placehold_it/engine"
|
|
5
|
-
|
|
2
|
+
require "placehold_it/common"
|
|
6
3
|
require "placehold_it/view_extensions"
|
|
7
4
|
require "placehold_it/controller_extensions"
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
module PlaceholdIt
|
|
7
|
+
ActionView::Base.send :include, PlaceholdIt::ViewExtensions
|
|
8
|
+
ActionController::Base.send :include, PlaceholdIt::ControllerExtensions
|
|
9
|
+
ActiveModel::Naming.send :include, PlaceholdIt::Common
|
|
10
|
+
end
|
data/lib/placehold_it/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
|
@@ -5,3 +5,6 @@ Connecting to database specified by database.yml
|
|
|
5
5
|
Connecting to database specified by database.yml
|
|
6
6
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
|
7
7
|
[1m[35m (0.0ms)[0m rollback transaction
|
|
8
|
+
Connecting to database specified by database.yml
|
|
9
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: placehold_it
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -44,7 +44,7 @@ files:
|
|
|
44
44
|
- lib/tasks/placehold_it_tasks.rake
|
|
45
45
|
- MIT-LICENSE
|
|
46
46
|
- Rakefile
|
|
47
|
-
- README.
|
|
47
|
+
- README.markdown
|
|
48
48
|
- test/dummy/app/assets/javascripts/application.js
|
|
49
49
|
- test/dummy/app/assets/stylesheets/application.css
|
|
50
50
|
- test/dummy/app/controllers/application_controller.rb
|
|
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
91
91
|
version: '0'
|
|
92
92
|
segments:
|
|
93
93
|
- 0
|
|
94
|
-
hash:
|
|
94
|
+
hash: 197301390186736492
|
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
none: false
|
|
97
97
|
requirements:
|
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
100
|
version: '0'
|
|
101
101
|
segments:
|
|
102
102
|
- 0
|
|
103
|
-
hash:
|
|
103
|
+
hash: 197301390186736492
|
|
104
104
|
requirements: []
|
|
105
105
|
rubyforge_project:
|
|
106
106
|
rubygems_version: 1.8.24
|
data/README.rdoc
DELETED