quesadilla 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/Gemfile +1 -0
- data/Readme.markdown +2 -2
- data/lib/quesadilla/extractor/emoji.rb +5 -4
- data/lib/quesadilla/version.rb +1 -1
- data/quesadilla.gemspec +1 -1
- data/test/quesadilla/emoji_test.rb +7 -0
- data/test/test_helper.rb +3 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed61ae52a1a2028dc2c597566892392d46f6c5cf
|
4
|
+
data.tar.gz: 93d5608cbfc5479950dabd3de07586c9cb2d637b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d5da1d6ee46c094e3c9c31a51941e2eba26233a871a44ce8eaff784a4667ae46e67b8d70af68406e9a2a74a033767cbc07ee6e348902b37502e9c25d307b7b
|
7
|
+
data.tar.gz: 01cb80bc834f8e4282406f6adf575f5ad6a38ccd9f83e7055ee41b0a481ffbe58d8fda270149b447b34e1e6b2675d20edda8a4bbbbc5b4f2845e6cad3657dd2c
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/Gemfile
CHANGED
data/Readme.markdown
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Quesadilla
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/soffes/quesadilla.png?branch=master)](https://travis-ci.org/soffes/quesadilla) [![Coverage Status](https://coveralls.io/repos/soffes/quesadilla/badge.png?branch=master)](https://coveralls.io/r/soffes/quesadilla) [![Code Climate](https://codeclimate.com/github/soffes/quesadilla.png)](https://codeclimate.com/github/soffes/quesadilla) [![Dependency Status](https://gemnasium.com/soffes/quesadilla.png)](https://gemnasium.com/soffes/quesadilla) [![Gem Version](https://badge.fury.io/rb/quesadilla.png)](http://badge.fury.io/rb/quesadilla)
|
4
|
+
|
3
5
|
Entity-style text parsing. Quesadilla was extracted from [Cheddar](https://cheddarapp.com).
|
4
6
|
|
5
7
|
See the [Cheddar text guide](https://cheddarapp.com/text) for more information about how to type entities.
|
@@ -115,8 +117,6 @@ Assuming there is a user named `soffes` in your database, it would extract `@sof
|
|
115
117
|
|
116
118
|
Quesadilla is tested under 1.9.2, 1.9.3, 2.0.0, JRuby 1.7.2 (1.9 mode), and Rubinius 2.0.0 (1.9 mode).
|
117
119
|
|
118
|
-
[![Build Status](https://travis-ci.org/soffes/quesadilla.png?branch=master)](https://travis-ci.org/soffes/quesadilla)
|
119
|
-
|
120
120
|
|
121
121
|
## Contributing
|
122
122
|
|
@@ -27,11 +27,12 @@ module Quesadilla
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# Replace emojis
|
30
|
-
|
31
|
-
|
30
|
+
match = @original_text.match(EMOJI_COLON_REGEX)
|
31
|
+
match.captures.each do |match|
|
32
|
+
sym = match.downcase.to_sym
|
32
33
|
next unless NamedEmoji.emojis.keys.include?(sym)
|
33
|
-
@original_text.sub!(
|
34
|
-
end
|
34
|
+
@original_text.sub!(":#{sym}:", NamedEmoji.emojis[sym])
|
35
|
+
end if match && match.captures
|
35
36
|
|
36
37
|
# Unreplace codes
|
37
38
|
codes.each do |key, value|
|
data/lib/quesadilla/version.rb
CHANGED
data/quesadilla.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.required_ruby_version = '>= 1.9.2'
|
22
22
|
|
23
23
|
# Hashtag and autolink parsing
|
24
|
-
gem.add_dependency 'twitter-text', '~> 1.
|
24
|
+
gem.add_dependency 'twitter-text', '~> 1.6'
|
25
25
|
|
26
26
|
# Emoji detection
|
27
27
|
gem.add_dependency 'named_emoji', '~> 1.1.1'
|
@@ -106,5 +106,12 @@ module Quesadilla
|
|
106
106
|
# }
|
107
107
|
# assert_equal expected, extraction
|
108
108
|
end
|
109
|
+
|
110
|
+
def test_totally_invalid_emoji
|
111
|
+
bogus_text = 'Q14hMG4vA1RwLU3gQT9ENs7S.jpeg:Amazon:photo'
|
112
|
+
extraction = extract(bogus_text)
|
113
|
+
assert_equal bogus_text, extraction[:display_text]
|
114
|
+
assert_equal [], extraction[:entities]
|
115
|
+
end
|
109
116
|
end
|
110
117
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quesadilla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Soffes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twitter-text
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: named_emoji
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- .coveralls.yml
|
48
49
|
- .gitignore
|
49
50
|
- .travis.yml
|
50
51
|
- Contributing.markdown
|
@@ -93,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
version: '0'
|
94
95
|
requirements: []
|
95
96
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.0.
|
97
|
+
rubygems_version: 2.0.3
|
97
98
|
signing_key:
|
98
99
|
specification_version: 4
|
99
100
|
summary: Entity-style text parsing extracted from Cheddar
|