cinch-urbandict 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: ef763c1add5d934d58eee962cd4965e133f8595f
4
+ data.tar.gz: ea5050c3a10bee60f8f855efec9046a35aed0d2b
5
+ SHA512:
6
+ metadata.gz: 190b47a4636f039d7f20fbeaa680a073e6efa27cf2fef863ea380f3392da9f89c9feb065b72285dbffe8e9d70c08b9a7879b50056ea0a6792b9dc11d4ab08d8e
7
+ data.tar.gz: 4344651cf1f5f9e695554e3b8f85a0ff8a4a26b15755c6e6e99128db2c2b02692fda67ea84394d6f03b200469a647c1c2d382a37d3327e447fe4fe71cb8f5271
@@ -1,4 +1,23 @@
1
1
  language: ruby
2
+ env:
3
+ global:
4
+ - "JRUBY_OPTS=-Xcext.enabled=true"
2
5
  rvm:
3
- - 1.9.2
6
+ - 2.1.0
7
+ - 2.0.0
4
8
  - 1.9.3
9
+ - 1.9.2
10
+ - 1.8.7
11
+ - jruby-18mode
12
+ - jruby-19mode
13
+ - ruby-head
14
+ - jruby-head
15
+ - ree
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: 1.8.7
19
+ - rvm: ree
20
+ - rvm: jruby-18mode
21
+ - rvm: jruby-19mode
22
+ - rvm: jruby-head
23
+ fast_finish: true
@@ -18,12 +18,11 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ['lib']
20
20
 
21
- gem.add_development_dependency 'rake'
22
- gem.add_development_dependency 'rspec'
23
- gem.add_development_dependency 'coveralls'
24
- gem.add_development_dependency 'cinch-test'
25
-
26
- gem.add_dependency 'cinch', '~> 2.0.12'
27
- gem.add_dependency 'cinch-toolbox', '~> 1.1.0'
28
- gem.add_dependency 'cinch-cooldown', '~> 1.1.1'
21
+ gem.add_development_dependency 'rake', '~> 10'
22
+ gem.add_development_dependency 'rspec', '~> 3'
23
+ gem.add_development_dependency 'coveralls', '~> 0.7'
24
+ gem.add_development_dependency 'cinch-test', '~> 0.1', '>= 0.1.0'
25
+ gem.add_dependency 'cinch', '~> 2'
26
+ gem.add_dependency 'cinch-cooldown', '~> 1.1', '>= 1.1.1'
27
+ gem.add_dependency 'cinch-toolbox', '~> 1.1'
29
28
  end
@@ -3,52 +3,54 @@ require 'cinch'
3
3
  require 'cinch/cooldown'
4
4
  require 'cinch/toolbox'
5
5
 
6
- module Cinch::Plugins
7
- # Cinch plugin for getting UD defs.
8
- class UrbanDict
9
- include Cinch::Plugin
6
+ module Cinch
7
+ module Plugins
8
+ # Cinch plugin for getting UD defs.
9
+ class UrbanDict
10
+ include Cinch::Plugin
10
11
 
11
- enforce_cooldown
12
+ enforce_cooldown
12
13
 
13
- self.help = 'Use .ud <term> to see the Urban Dictionary definition.'
14
+ self.help = 'Use .ud <term> to see the Urban Dictionary definition.'
14
15
 
15
- match /ud (.*)/
16
+ match(/ud (.*)/)
16
17
 
17
- def execute(m, term)
18
- m.reply get_def(term), true
19
- end
18
+ def execute(m, term)
19
+ m.reply get_def(term), true
20
+ end
20
21
 
21
- private
22
+ private
22
23
 
23
- def get_def(term)
24
- # URI Encode
25
- term = URI.escape(term, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
24
+ def get_def(term)
25
+ # URI Encode
26
+ term = URI.escape(term, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
26
27
 
27
- # Check if it's not defined.
28
- if Cinch::Toolbox.get_html_element(ud_url(term), '#not_defined_yet')
29
- return "Urban Dictionary ∴ #{term}: No definition available."
30
- end
28
+ # Check if it's not defined.
29
+ if Cinch::Toolbox.get_html_element(ud_url(term), '#not_defined_yet')
30
+ return "Urban Dictionary ∴ #{term}: No definition available."
31
+ end
31
32
 
32
- # Get the def
33
- ud_def(term)
34
- end
33
+ # Get the def
34
+ ud_def(term)
35
+ end
35
36
 
36
- def ud_def(term)
37
- # Grab the element
38
- result = Cinch::Toolbox.get_html_element(ud_url(term), '.meaning')
37
+ def ud_def(term)
38
+ # Grab the element
39
+ result = Cinch::Toolbox.get_html_element(ud_url(term), '.meaning')
39
40
 
40
- result.gsub!(/[\n\r]/, ' - ')
41
+ result.gsub!(/[\n\r]/, ' - ')
41
42
 
42
- # Make sure it's not terribly long
43
- result = Cinch::Toolbox.truncate(result, 250)
44
- url = Cinch::Toolbox.shorten(ud_url(term))
43
+ # Make sure it's not terribly long
44
+ result = Cinch::Toolbox.truncate(result, 250)
45
+ url = Cinch::Toolbox.shorten(ud_url(term))
45
46
 
46
- debug result
47
- "Urban Dictionary ∴ #{term}: #{result} [#{url}]"
48
- end
47
+ debug result
48
+ "Urban Dictionary ∴ #{term}: #{result} [#{url}]"
49
+ end
49
50
 
50
- def ud_url(term)
51
- "http://www.urbandictionary.com/define.php?term=#{term}"
51
+ def ud_url(term)
52
+ "http://www.urbandictionary.com/define.php?term=#{term}"
53
+ end
52
54
  end
53
55
  end
54
56
  end
@@ -3,7 +3,7 @@ module Cinch
3
3
  module Plugins
4
4
  # Versioning Info
5
5
  class UrbanDict
6
- VERSION = '1.0.3'
6
+ VERSION = '1.0.4'
7
7
  end
8
8
  end
9
9
  end
@@ -9,24 +9,25 @@ describe Cinch::Plugins::UrbanDict do
9
9
  end
10
10
 
11
11
  it 'should allow users to search for words' do
12
- get_replies(make_message(@bot, '!ud dork')).first.text.
13
- should match('Someone who has odd interests')
12
+ msg = get_replies(make_message(@bot, '!ud dork')).first
13
+ expect(msg.text).to match('Someone who has odd interests')
14
14
  end
15
15
 
16
16
  it 'should not return nil for valid searches' do
17
- get_replies(make_message(@bot, '!ud dork')).first.text.
18
- should_not be_nil
17
+ msg = get_replies(make_message(@bot, '!ud dork')).first
18
+ expect(msg.text).to_not be_nil
19
19
  end
20
20
 
21
21
  it 'should return an error for invalid searches' do
22
- get_replies(make_message(@bot, '!ud 7zJ6t8rT8p384My')).first.text.
23
- should == "test: Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available."
22
+ msg = get_replies(make_message(@bot, '!ud 7zJ6t8rT8p384My')).first
23
+ expect(msg.text)
24
+ .to match('test: Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available.')
24
25
  end
25
26
 
26
27
  it 'should not return multiple lines for a definition with breaks' do
27
28
  response = get_replies(make_message(@bot, '!ud dong')).first.text
28
- response.should_not match("<br")
29
- response.should_not match("\r")
30
- response.should_not match("\n")
29
+ expect(response).to_not match('<br')
30
+ expect(response).to_not match('\r')
31
+ expect(response).to_not match('\n')
31
32
  end
32
33
  end
metadata CHANGED
@@ -1,128 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-urbandict
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
5
- prerelease:
4
+ version: 1.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brian Haberer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2014-08-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '10'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: '10'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: '0'
33
+ version: '3'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: '0'
40
+ version: '3'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: coveralls
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ~>
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: '0.7'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ~>
60
53
  - !ruby/object:Gem::Version
61
- version: '0'
54
+ version: '0.7'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: cinch-test
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
67
62
  - - ! '>='
68
63
  - !ruby/object:Gem::Version
69
- version: '0'
64
+ version: 0.1.0
70
65
  type: :development
71
66
  prerelease: false
72
67
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
68
  requirements:
69
+ - - ~>
70
+ - !ruby/object:Gem::Version
71
+ version: '0.1'
75
72
  - - ! '>='
76
73
  - !ruby/object:Gem::Version
77
- version: '0'
74
+ version: 0.1.0
78
75
  - !ruby/object:Gem::Dependency
79
76
  name: cinch
80
77
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
78
  requirements:
83
79
  - - ~>
84
80
  - !ruby/object:Gem::Version
85
- version: 2.0.12
81
+ version: '2'
86
82
  type: :runtime
87
83
  prerelease: false
88
84
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
85
  requirements:
91
86
  - - ~>
92
87
  - !ruby/object:Gem::Version
93
- version: 2.0.12
88
+ version: '2'
94
89
  - !ruby/object:Gem::Dependency
95
- name: cinch-toolbox
90
+ name: cinch-cooldown
96
91
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
92
  requirements:
99
93
  - - ~>
100
94
  - !ruby/object:Gem::Version
101
- version: 1.1.0
95
+ version: '1.1'
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: 1.1.1
102
99
  type: :runtime
103
100
  prerelease: false
104
101
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
102
  requirements:
107
103
  - - ~>
108
104
  - !ruby/object:Gem::Version
109
- version: 1.1.0
105
+ version: '1.1'
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: 1.1.1
110
109
  - !ruby/object:Gem::Dependency
111
- name: cinch-cooldown
110
+ name: cinch-toolbox
112
111
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
112
  requirements:
115
113
  - - ~>
116
114
  - !ruby/object:Gem::Version
117
- version: 1.1.1
115
+ version: '1.1'
118
116
  type: :runtime
119
117
  prerelease: false
120
118
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
119
  requirements:
123
120
  - - ~>
124
121
  - !ruby/object:Gem::Version
125
- version: 1.1.1
122
+ version: '1.1'
126
123
  description: Cinch Plugin to fetch definition data from Urban Dictionary
127
124
  email:
128
125
  - bhaberer@gmail.com
@@ -145,29 +142,27 @@ files:
145
142
  homepage: https://github.com/bhaberer/cinch-urbandict
146
143
  licenses:
147
144
  - MIT
145
+ metadata: {}
148
146
  post_install_message:
149
147
  rdoc_options: []
150
148
  require_paths:
151
149
  - lib
152
150
  required_ruby_version: !ruby/object:Gem::Requirement
153
- none: false
154
151
  requirements:
155
152
  - - ! '>='
156
153
  - !ruby/object:Gem::Version
157
154
  version: '0'
158
155
  required_rubygems_version: !ruby/object:Gem::Requirement
159
- none: false
160
156
  requirements:
161
157
  - - ! '>='
162
158
  - !ruby/object:Gem::Version
163
159
  version: '0'
164
160
  requirements: []
165
161
  rubyforge_project:
166
- rubygems_version: 1.8.25
162
+ rubygems_version: 2.2.2
167
163
  signing_key:
168
- specification_version: 3
164
+ specification_version: 4
169
165
  summary: Cinch Plugin for Urban Dictionary
170
166
  test_files:
171
167
  - spec/cinch-urbandict_spec.rb
172
168
  - spec/spec_helper.rb
173
- has_rdoc: