emoticons_helper 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -3
- data/VERSION +1 -1
- data/emoticons_helper.gemspec +18 -3
- data/lib/generators/smile_generator.rb +12 -4
- data/lib/generators/templates/smilies.css +18 -0
- data/lib/generators/templates/smilies/angry.gif +0 -0
- data/lib/generators/templates/smilies/bigsmile.gif +0 -0
- data/lib/generators/templates/smilies/cool.gif +0 -0
- data/lib/generators/templates/smilies/dull.gif +0 -0
- data/lib/generators/templates/smilies/evilgrin.gif +0 -0
- data/lib/generators/templates/smilies/no.gif +0 -0
- data/lib/generators/templates/smilies/rofl.gif +0 -0
- data/lib/generators/templates/smilies/sadsmile.gif +0 -0
- data/lib/generators/templates/smilies/sleepy.gif +0 -0
- data/lib/generators/templates/smilies/smile.gif +0 -0
- data/lib/generators/templates/{smilies-sprite.png → smilies/smilies-sprite.png} +0 -0
- data/lib/generators/templates/smilies/tongueout.gif +0 -0
- data/lib/generators/templates/smilies/wink.gif +0 -0
- data/lib/generators/templates/smilies/wondering.gif +0 -0
- data/lib/generators/templates/smilies/worried.gif +0 -0
- data/lib/generators/templates/smilies/yes.gif +0 -0
- metadata +19 -4
data/README.rdoc
CHANGED
@@ -4,17 +4,21 @@ How to use
|
|
4
4
|
|
5
5
|
Include the gem in the Gemfile
|
6
6
|
|
7
|
-
gem "emoticons_helper"
|
7
|
+
gem "emoticons_helper"
|
8
8
|
|
9
9
|
Run bundle install
|
10
10
|
|
11
11
|
Run the generator
|
12
12
|
|
13
|
-
rails generate smile
|
13
|
+
rails generate smile
|
14
14
|
|
15
15
|
Now in your view file use the method replace_smilies
|
16
16
|
|
17
|
-
<%= replace_smilies(text) %>
|
17
|
+
<%= replace_smilies(text) %>
|
18
|
+
|
19
|
+
For animated smilies pass true option while method call
|
20
|
+
|
21
|
+
<%= replace_smilies(text, true) %>
|
18
22
|
|
19
23
|
== Contributing to emoticons_helper
|
20
24
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
0.2.1
|
data/emoticons_helper.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{emoticons_helper}
|
8
|
-
s.version = "0.1
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["gravindra"]
|
12
|
-
s.date = %q{2013-04-
|
12
|
+
s.date = %q{2013-04-13}
|
13
13
|
s.description = %q{Gives face to your text.}
|
14
14
|
s.email = %q{ravighare26@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -27,9 +27,24 @@ Gem::Specification.new do |s|
|
|
27
27
|
"emoticons_helper.gemspec",
|
28
28
|
"lib/emoticons_helper.rb",
|
29
29
|
"lib/generators/smile_generator.rb",
|
30
|
-
"lib/generators/templates/smilies-sprite.png",
|
31
30
|
"lib/generators/templates/smilies.css",
|
32
31
|
"lib/generators/templates/smilies.yml",
|
32
|
+
"lib/generators/templates/smilies/angry.gif",
|
33
|
+
"lib/generators/templates/smilies/bigsmile.gif",
|
34
|
+
"lib/generators/templates/smilies/cool.gif",
|
35
|
+
"lib/generators/templates/smilies/dull.gif",
|
36
|
+
"lib/generators/templates/smilies/evilgrin.gif",
|
37
|
+
"lib/generators/templates/smilies/no.gif",
|
38
|
+
"lib/generators/templates/smilies/rofl.gif",
|
39
|
+
"lib/generators/templates/smilies/sadsmile.gif",
|
40
|
+
"lib/generators/templates/smilies/sleepy.gif",
|
41
|
+
"lib/generators/templates/smilies/smile.gif",
|
42
|
+
"lib/generators/templates/smilies/smilies-sprite.png",
|
43
|
+
"lib/generators/templates/smilies/tongueout.gif",
|
44
|
+
"lib/generators/templates/smilies/wink.gif",
|
45
|
+
"lib/generators/templates/smilies/wondering.gif",
|
46
|
+
"lib/generators/templates/smilies/worried.gif",
|
47
|
+
"lib/generators/templates/smilies/yes.gif",
|
33
48
|
"test/helper.rb",
|
34
49
|
"test/test_emoticons_helper.rb"
|
35
50
|
]
|
@@ -4,10 +4,14 @@ class SmileGenerator < Rails::Generators::Base
|
|
4
4
|
def create_initializer_file
|
5
5
|
str = %!#This file loads simileys
|
6
6
|
module SmileyHelpers
|
7
|
-
def replace_smilies(str)
|
7
|
+
def replace_smilies(str, animate=false)
|
8
8
|
smilies = YAML.load_file("\#{Rails.root}/config/smilies.yml")
|
9
9
|
smilies.each_pair do |k, v|
|
10
|
-
|
10
|
+
if animate
|
11
|
+
new_str = "<span class=\'smilies animate"+k+"\'> </span>"
|
12
|
+
else
|
13
|
+
new_str = "<span class=\'smilies "+k+"\'> </span>"
|
14
|
+
end
|
11
15
|
v.each{|val| str = str.gsub(val, new_str)}
|
12
16
|
end
|
13
17
|
str.html_safe
|
@@ -19,10 +23,14 @@ ActionView::Base.send :include, SmileyHelpers
|
|
19
23
|
copy_file "smilies.yml", "#{Rails.root}/config/smilies.yml"
|
20
24
|
|
21
25
|
if Dir.exists?("#{Rails.root}/app/assets/")
|
22
|
-
|
26
|
+
FileUtils.mkpath("#{Rails.root}/app/assets/images/smilies")
|
27
|
+
files = Dir.glob("#{File.expand_path('../templates/smilies', __FILE__)}/*")
|
28
|
+
FileUtils.cp_r files, "#{Rails.root}/app/assets/images/smilies/"
|
23
29
|
copy_file "smilies.css", "#{Rails.root}/app/assets/stylesheets/smilies.css"
|
24
30
|
else
|
25
|
-
|
31
|
+
FileUtils.mkpath("#{Rails.root}/public/images/smilies")
|
32
|
+
files = Dir.glob("#{File.expand_path('../templates/smilies', __FILE__)}/*")
|
33
|
+
FileUtils.cp_r files, "#{Rails.root}/public/images/smilies/"
|
26
34
|
copy_file "smilies.css", "#{Rails.root}/public/stylesheets/smilies.css"
|
27
35
|
end
|
28
36
|
|
@@ -14,3 +14,21 @@
|
|
14
14
|
.like{background:url(smilies-sprite.png) 0 -104px;}
|
15
15
|
.dislike{background:url(smilies-sprite.png) -20px -104px;}
|
16
16
|
.rofl{background:url(smilies-sprite.png) -60px -40px;}
|
17
|
+
|
18
|
+
/* Animated Smilies*/
|
19
|
+
|
20
|
+
.animatesmile{background:url(smilies/smile.gif) no-repeat 0 0;}
|
21
|
+
.animatelaugh{background:url(smilies/bigsmile.gif) 0 0;}
|
22
|
+
.animatetongue{background:url(smilies/tongueout.gif) 0 0;}
|
23
|
+
.animatesmart{background:url(smilies/cool.gif) 0 0;}
|
24
|
+
.animatesad{background:url(smilies/sadsmile.gif) 0 0;}
|
25
|
+
.animatewink{background:url(smilies/wink.gif) 0 0;}
|
26
|
+
.animateangry{background:url(smilies/angry.gif) 0 0;}
|
27
|
+
.animatelouds{background:url(smilies/bigsmile.gif) 0 0;}
|
28
|
+
.animateevil{background:url(smilies/evilgrin.gif) 0 0;}
|
29
|
+
.animateskeptical{background:url(smilies/worried.gif) 0 0;}
|
30
|
+
.animateconfused{background:url(smilies/wondering.gif) 0 0;}
|
31
|
+
.animatesleeping{background:url(smilies/sleepy.gif) 0 0;}
|
32
|
+
.animatelike{background:url(smilies/yes.gif) 0 0;}
|
33
|
+
.animatedislike{background:url(smilies/no.gif) 0 0;}
|
34
|
+
.animaterofl{background:url(smilies/rofl.gif) 0 0;}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 2
|
7
8
|
- 1
|
8
|
-
|
9
|
-
version: 0.1.3
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- gravindra
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2013-04-
|
17
|
+
date: 2013-04-13 00:00:00 +05:30
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -88,9 +88,24 @@ files:
|
|
88
88
|
- emoticons_helper.gemspec
|
89
89
|
- lib/emoticons_helper.rb
|
90
90
|
- lib/generators/smile_generator.rb
|
91
|
-
- lib/generators/templates/smilies-sprite.png
|
92
91
|
- lib/generators/templates/smilies.css
|
93
92
|
- lib/generators/templates/smilies.yml
|
93
|
+
- lib/generators/templates/smilies/angry.gif
|
94
|
+
- lib/generators/templates/smilies/bigsmile.gif
|
95
|
+
- lib/generators/templates/smilies/cool.gif
|
96
|
+
- lib/generators/templates/smilies/dull.gif
|
97
|
+
- lib/generators/templates/smilies/evilgrin.gif
|
98
|
+
- lib/generators/templates/smilies/no.gif
|
99
|
+
- lib/generators/templates/smilies/rofl.gif
|
100
|
+
- lib/generators/templates/smilies/sadsmile.gif
|
101
|
+
- lib/generators/templates/smilies/sleepy.gif
|
102
|
+
- lib/generators/templates/smilies/smile.gif
|
103
|
+
- lib/generators/templates/smilies/smilies-sprite.png
|
104
|
+
- lib/generators/templates/smilies/tongueout.gif
|
105
|
+
- lib/generators/templates/smilies/wink.gif
|
106
|
+
- lib/generators/templates/smilies/wondering.gif
|
107
|
+
- lib/generators/templates/smilies/worried.gif
|
108
|
+
- lib/generators/templates/smilies/yes.gif
|
94
109
|
- test/helper.rb
|
95
110
|
- test/test_emoticons_helper.rb
|
96
111
|
has_rdoc: true
|