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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70dc2e9472fde307002d6826fc06e0d2d316e00b
4
- data.tar.gz: f8ef3bceef62a578e65a846b03cdb4d3348d71ee
3
+ metadata.gz: ed61ae52a1a2028dc2c597566892392d46f6c5cf
4
+ data.tar.gz: 93d5608cbfc5479950dabd3de07586c9cb2d637b
5
5
  SHA512:
6
- metadata.gz: a325502695825843f55530bc6b61e72b9428103b45a5d75a1a1b098e84b5bdf525a9d330ddc09db60baafa41dd11f912d85dc74f2001eafe01fe6378c8020640
7
- data.tar.gz: e9fafa4a7fd9d679e192286beaa837dd9ec9d2c1de64beeebdcada523a3bcf6d5a20135c8f7d50fa1bb72d41eb02abc487d7bb2def1d9d9baeebebb733caa9ca
6
+ metadata.gz: 51d5da1d6ee46c094e3c9c31a51941e2eba26233a871a44ce8eaff784a4667ae46e67b8d70af68406e9a2a74a033767cbc07ee6e348902b37502e9c25d307b7b
7
+ data.tar.gz: 01cb80bc834f8e4282406f6adf575f5ad6a38ccd9f83e7055ee41b0a481ffbe58d8fda270149b447b34e1e6b2675d20edda8a4bbbbc5b4f2845e6cad3657dd2c
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/Gemfile CHANGED
@@ -16,4 +16,5 @@ group :test do
16
16
  gem 'minitest'
17
17
  gem 'minitest-wscolor'
18
18
  gem 'simplecov', require: false
19
+ gem 'coveralls', require: false
19
20
  end
@@ -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
- while match = @original_text.match(EMOJI_COLON_REGEX)
31
- sym = match[1].downcase.to_sym
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!(match[0], NamedEmoji.emojis[sym])
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|
@@ -1,4 +1,4 @@
1
1
  module Quesadilla
2
2
  # Version of the Quesadilla gem
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
@@ -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.5.0'
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
@@ -2,6 +2,9 @@ require 'rubygems'
2
2
  require 'bundler'
3
3
  Bundler.require :test
4
4
 
5
+ require 'coveralls'
6
+ Coveralls.wear!
7
+
5
8
  require 'simplecov'
6
9
  SimpleCov.start
7
10
 
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.2
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-03-04 00:00:00.000000000 Z
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.5.0
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.5.0
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.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