emoji-js 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 082b2c00142f9b03c0166f803a5fdda60879bab2
4
- data.tar.gz: c84afeda810fbd6adb2fb0890dc8c331fc5a651b
3
+ metadata.gz: 85f90a9d2ad3e87627d14a50b630b0da336e9f58
4
+ data.tar.gz: de00761684cb8e038ec0963bec7ba8be50489ed4
5
5
  SHA512:
6
- metadata.gz: bd9ec20b2b46999d4c93260d8880d002c40bc97bf0316a6a90cf17320331d4db51c7c6767253a95467e2936261f181c3dad2bf834d165b2946b9f77c80654337
7
- data.tar.gz: bedb8a859a105a9c90806b818f1f89001f3b92268a78dc2e7b28f3949a00e8933ca3ad758350bb4e9d397fb49a06e3796a178ed3bf520f999bae6cccea1b64f2
6
+ metadata.gz: b89d64474c63c559a395a97a046557b89b48d120ecf909d193a3b0fbbf1f22d52a8b207934adfae1309dd213d95be536a214b507b488d0d486055c621b1a9f91
7
+ data.tar.gz: ed9e47472a9ab8499b2733163e8f79d31d43cab537fdb140034105ef9468c9af14d6bb26d0e32182f999c2404596c8b0a3df2cfb04827a01dada655304d9b790
data/Gemfile.lock CHANGED
@@ -3,8 +3,7 @@ PATH
3
3
  specs:
4
4
  emoji-js (0.1.0)
5
5
  coffee-script
6
- colorizer
7
- fileutils
6
+ colorize
8
7
  uglifier
9
8
 
10
9
  GEM
@@ -14,14 +13,11 @@ GEM
14
13
  coffee-script-source
15
14
  execjs
16
15
  coffee-script-source (1.7.0)
17
- colorizer (0.0.2)
18
- execjs (2.0.2)
19
- fileutils (0.7)
20
- rmagick (>= 2.13.1)
16
+ colorize (0.7.3)
17
+ execjs (2.2.1)
21
18
  json (1.8.1)
22
19
  rake (10.1.1)
23
- rmagick (2.13.2)
24
- uglifier (2.5.0)
20
+ uglifier (2.5.1)
25
21
  execjs (>= 0.3.0)
26
22
  json (>= 1.8.0)
27
23
 
data/README.md CHANGED
@@ -3,4 +3,22 @@
3
3
  Ever wanted to be able to write `:thumbsup:` and have :thumbsup: display on your blog? Me to. Let's make this happen...
4
4
 
5
5
  ## Getting Started
6
- 1. Download the JavaScript and CSS.
6
+ 1. Get the gem: `gem install emoji-js`
7
+ 2. Go to your project: `cd my-project`
8
+ 3. Generate the files: `emoji-js`
9
+ ```
10
+
11
+ Project path: (default: current directory)
12
+ Emoji graphics path: (default: "graphics/") [enter]
13
+ Your project's JavaScript directory: (default: "js/") [enter]
14
+ Emoji.JS successfully added to your project.
15
+ Now add: '<script src="/js/emoji.min.js"></script>' to the END of your HTML file.
16
+
17
+ ```
18
+ 4. Append `<script src="/js/emoji.min.js"></script>` to the __END__ of any HTML files that you want this added to.
19
+ 5. You're done! :tada:
20
+
21
+ ### Why do I have to call this script at the end?
22
+ In order to understand this question, one must first understand how Emoji.JS works. Emoji.JS works by scanning the existing webpage for emoji names wrapped in colons (e.g. `:dog:`), then replaces them with the corrosponding emoji image. This allows for two things. First, it allows for easy emoji integration. Second, it allows for cross-platform use of emoji. Because of this, if the script is not called at the end of the document, there will be nothing to scan. Thus, it is __imperitive__ that you call the script at the end of `<body>`
23
+
24
+ ... more docs to come!
data/emoji-js.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'emoji-js'
3
- s.version = '0.1.0'
3
+ s.version = '0.2.0'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "Emojify your website like GitHub and Campfire! :thumbsup:"
6
6
  s.description = s.summary
@@ -12,9 +12,8 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.add_runtime_dependency 'coffee-script'
14
14
  s.add_runtime_dependency 'colorize'
15
- s.add_runtime_dependency 'fileutils'
16
15
  s.add_runtime_dependency 'uglifier'
17
16
 
18
17
  s.add_development_dependency 'bundler'
19
18
  s.add_development_dependency 'rake'
20
- end
19
+ end
data/lib/emoji-js.rb CHANGED
@@ -19,7 +19,7 @@ module EmojiJS
19
19
  # get image path (we have to do it here because of coffeescript generation)
20
20
  print 'Emoji graphics path: (default: "graphics/") '
21
21
  @emoji_path = gets.chomp
22
- @emoji_path = "/graphics/" if @emoji_path.empty?
22
+ @emoji_path = "/graphics" if @emoji_path.empty?
23
23
 
24
24
  # coffee_grounds = modified coffescript
25
25
  @coffee_grounds = replace_in_file("#{@coffee_path}/emoji.coffee", %q{Emoji.image_path = "/graphics/" # customize to your liking}, "Emoji.image_path = \"#{@emoji_path}\"")
@@ -12,10 +12,11 @@ Emoji.image_path = "/graphics/" # customize to your liking
12
12
  Emoji.image_path = "#{Emoji.image_path}/" unless Emoji.image_path[Emoji.image_path - 1] == "/"
13
13
 
14
14
  # load emojis
15
- loadEmoji = () ->
16
- for emoji in Emoji.names
17
- do ->
18
- name = ":#{emoji}:"
19
- document.body.innerHTML = document.body.innerHTML.replace(name, "<img src='#{Emoji.image_path + Emoji.name_to_path[emoji]}' alt='#{name}' class='emoji' height='20' width='20' align='absmiddle'>")
15
+ loadEmoji = ->
16
+ for emoji in Emoji.names
17
+ do ->
18
+ name = ":#{emoji}:"
19
+ new_html = "<img src='#{Emoji.image_path + Emoji.name_to_path[emoji]}' alt='#{name}' class='emoji' height='20' width='20' align='absmiddle'>"
20
+ document.body.innerHTML = document.body.innerHTML.replace(name, new_html)
20
21
 
21
- window.onload = loadEmoji()
22
+ window.onload = loadEmoji()
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emoji-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Herrick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: fileutils
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: uglifier
57
43
  requirement: !ruby/object:Gem::Requirement