rack-emoji 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cd6ba7624c28c76c2421b67806726c1b8da963e
4
- data.tar.gz: f6992a6ed9f6c72c76bd2d19d6b07ce1d4402742
3
+ metadata.gz: 05b8bd4ab5df13cc62059b07ecbaa985e566eb6c
4
+ data.tar.gz: 1384b00f4eb76c0ac002d93f90f083d35c265b32
5
5
  SHA512:
6
- metadata.gz: 1730a047f80c1dd3a50ddeaf1518a10602f3fed2e5ec40a80db76f380fd32829cfc3befe04adacbc2c7b982f3533bdb5c59209c1c24bffc4ef910f3508cb8c9d
7
- data.tar.gz: ebcba38c5e3155b1ed08dea9488ca2e53b31c0fc917b5625ee7780bd81c9b7c38852ed6fa593349db74220db0eef89d9f41b04732b2c201779f3220bd570f2be
6
+ metadata.gz: 2bb0106b1ab5afce50593d6e4b8962d67fc28789d9cd73b28b63b5a665fab29366aa05d5108de33de35e56a50a9b486f5a56c21a414510ca398bf8a97426b389
7
+ data.tar.gz: 9118e3f29da757407f7983227696b49149c4385d5667d9d2ad7460c195b77d8800c5539c03c635f6abe7426fad77d56cd66365c4463ed9fad56c0f1ce611829b
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
 
19
19
  example/sinatra/public/
20
+ example/rack/public/
data/README.md CHANGED
@@ -6,38 +6,44 @@ Quickly and easily use emoji with rack based application
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'rack-emoji'
9
+ ``` ruby
10
+ gem 'rack-emoji'
11
+ ```
10
12
 
11
13
  And then execute:
12
14
 
13
- $ bundle
15
+ ``` bash
16
+ $ bundle
17
+ ```
14
18
 
15
19
  Or install it yourself as:
16
20
 
17
- $ gem install rack-emoji
21
+ ```
22
+ $ gem install rack-emoji
23
+ ```
18
24
 
19
25
  ## Usage
20
26
 
21
27
  To get started, need a copy of emoji images.
22
28
  Edit your Rakefile:
23
29
 
24
- ```
30
+ ``` ruby
25
31
  # Rakefile
26
32
  load 'tasks/emoji.rake'
27
33
  ```
28
34
 
29
- ```
35
+ ``` bash
30
36
  $ rake emoji # copied to your public directory
31
37
  ```
32
38
 
33
39
  Edit your rack application file as follows:
34
40
 
35
- ```
41
+ ``` ruby
36
42
  require 'rack/emoji'
37
43
 
38
44
  use Rack::Emoji, :width => 50, :height => 50
39
45
 
40
- ...
46
+ # ...
41
47
 
42
48
  run app
43
49
  ```
@@ -49,21 +55,11 @@ Just use emoji name.
49
55
  :dog:
50
56
  ```
51
57
 
58
+ Please see the example directory :dog:
59
+
52
60
  ## Options
53
61
 
54
62
  - dir (for emoji image directory)
55
63
  - width
56
64
  - height
57
65
  - style
58
-
59
- ## Contributing
60
-
61
- 1. Fork it ( http://github.com/stny/rack-emoji/fork )
62
- 2. Create your feature branch (`git checkout -b my-new-feature`)
63
- 3. Commit your changes (`git commit -am 'Add some feature'`)
64
- 4. Push to the branch (`git push origin my-new-feature`)
65
- 5. Create new Pull Request
66
-
67
- ## Acknowledgment
68
-
69
- [github/gemoji](https://github.com/github/gemoji)
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rake'
4
+ gem 'rack'
5
+ gem 'rack-emoji'
@@ -0,0 +1 @@
1
+ load 'tasks/emoji.rake'
@@ -0,0 +1,23 @@
1
+ require 'rack/emoji'
2
+
3
+ class Example
4
+ HTML = <<-EOS
5
+ <!doctype html>
6
+ <html>
7
+ <head></head>
8
+ <body><p>:dog:</p></body>
9
+ </html>
10
+ EOS
11
+
12
+ def self.call(env)
13
+ [ 200,
14
+ {"Content-Type" => "text/html"},
15
+ [HTML]
16
+ ]
17
+ end
18
+ end
19
+
20
+ use Rack::Static, :urls => ["/images"], :root => "public"
21
+ use Rack::Emoji
22
+
23
+ run Example
@@ -19,7 +19,7 @@ module Rack
19
19
 
20
20
  if headers["Content-Type"] && headers["Content-Type"].include?("text/html")
21
21
  new_response = emojify(response)
22
- headers['Content-Length'] = new_response.length.to_s
22
+ headers['Content-Length'] = new_response.bytesize.to_s
23
23
  [status, headers, [new_response]]
24
24
  else
25
25
  [status, headers, response]
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Emoji
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-emoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SATO Naoya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-31 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -50,6 +50,9 @@ files:
50
50
  - LICENSE.txt
51
51
  - README.md
52
52
  - Rakefile
53
+ - example/rack/Gemfile
54
+ - example/rack/Rakefile
55
+ - example/rack/config.ru
53
56
  - example/sinatra/Rakefile
54
57
  - example/sinatra/app.rb
55
58
  - lib/rack/emoji.rb
@@ -76,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
79
  version: '0'
77
80
  requirements: []
78
81
  rubyforge_project:
79
- rubygems_version: 2.2.1
82
+ rubygems_version: 2.4.5
80
83
  signing_key:
81
84
  specification_version: 4
82
85
  summary: Rack middleware for emoji