cinch-wikipedia 1.0.4 → 1.0.5

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
- !binary "U0hBMQ==":
3
- metadata.gz: 305cbd144f78bb303fc80ea0799cb7f99bf3e617
4
- data.tar.gz: c459148d6bf723416685399c1bb81ef55ff9353d
2
+ SHA1:
3
+ metadata.gz: e264758e04d18e105a34ab48d3ac37c6c4dab2d0
4
+ data.tar.gz: 084ee4d008d3df1a1917d888c5dc1bf943e92ccb
5
5
  SHA512:
6
- metadata.gz: d67acf315089000afc197817fc3f721244be777ce70ce680940b342c8d235bb571b293ac4429c16cb9bb59293166f3907fe7b98b41ed63680a39032124e1e504
7
- data.tar.gz: d7610b6e57932623fd3798ed99ee9a1f86ca07d5335a8cb7dcf88e31fcecf84fb4b246bad31e4e556f63ca42dded00985e90e5c7283c81f9a8c910d7ad5245d2
6
+ metadata.gz: 0e32393546b41efba6cce1f4b9fc8a455893a5f354dd3b81a93e2f7161277dc07e9476b30728825b513c9eac1749a3ef398487690a23f97cb7c3777ee8ef7031
7
+ data.tar.gz: 856e629a1ad7ecfc9a7a49919e0505ea3a8bab51c37d456ceedabf9305c33632f53b44167c17b749ad97c31f0691431a9db9c3b17d2ff60d54b45ec064926a45
@@ -1,13 +1,21 @@
1
+ addons:
2
+ code_climate:
3
+ repo_token: 2be14078568687e04a23810df8b2d8b5f11347f586f720c90b74d79aed27bb6a
1
4
  language: ruby
5
+ before_install:
6
+ - gem update --system
7
+ - gem update bundler
2
8
  env:
3
9
  global:
4
10
  - "JRUBY_OPTS=-Xcext.enabled=true"
5
11
  rvm:
6
- - 2.1.0
7
- - 2.0.0
8
- - 1.9.3
9
- - 1.9.2
10
12
  - 1.8.7
13
+ - 1.9.2
14
+ - 1.9.3
15
+ - 2.0.0
16
+ - 2.1.0
17
+ - 2.2.0
18
+ - 2.3.0
11
19
  - jruby-18mode
12
20
  - jruby-19mode
13
21
  - ruby-head
@@ -16,8 +24,11 @@ rvm:
16
24
  matrix:
17
25
  allow_failures:
18
26
  - rvm: 1.8.7
27
+ - rvm: 1.9.2
28
+ - rvm: 1.9.3
19
29
  - rvm: ree
20
30
  - rvm: jruby-18mode
21
31
  - rvm: jruby-19mode
22
32
  - rvm: jruby-head
33
+ - rvm: ruby-head
23
34
  fast_finish: true
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/cinch-wikipedia.png)](http://badge.fury.io/rb/cinch-wikipedia)
4
4
  [![Dependency Status](https://gemnasium.com/bhaberer/cinch-wikipedia.png)](https://gemnasium.com/bhaberer/cinch-wikipedia)
5
5
  [![Build Status](https://travis-ci.org/bhaberer/cinch-wikipedia.png?branch=master)](https://travis-ci.org/bhaberer/cinch-wikipedia)
6
- [![Coverage Status](https://coveralls.io/repos/bhaberer/cinch-wikipedia/badge.png?branch=master)](https://coveralls.io/r/bhaberer/cinch-wikipedia?branch=master)
6
+ [![Test Coverage](https://codeclimate.com/github/bhaberer/cinch-wikipedia/badges/coverage.svg)](https://codeclimate.com/github/bhaberer/cinch-wikipedia/coverage)
7
7
  [![Code Climate](https://codeclimate.com/github/bhaberer/cinch-wikipedia.png)](https://codeclimate.com/github/bhaberer/cinch-wikipedia)
8
8
 
9
9
  Cinch plugin to query wikipedia.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new
5
5
 
6
- task :default => :spec
7
- task :test => :spec
6
+ task default: :spec
7
+ task test: :spec
@@ -8,21 +8,23 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Cinch::Plugins::Wikipedia::VERSION
9
9
  gem.authors = ['Brian Haberer']
10
10
  gem.email = ['bhaberer@gmail.com']
11
- gem.description = %q{Cinch plugin that fetches a truncated blurb from the head of a wikipedia page.}
12
- gem.summary = %q{Cinch Wikipedia Plugin}
11
+ gem.description = 'Cinch plugin that fetches a truncated blurb from the '\
12
+ 'head of a wikipedia page.'
13
+ gem.summary = 'Cinch Wikipedia Plugin'
13
14
  gem.homepage = 'https://github.com/bhaberer/cinch-wikipedia'
14
15
  gem.license = 'MIT'
15
16
 
16
- gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
18
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
20
  gem.require_paths = ['lib']
20
21
 
21
22
  gem.add_development_dependency 'rake', '~> 10'
22
23
  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'
24
+ gem.add_development_dependency 'cinch-test', '~> 0.1', '>= 0.1.1'
25
+ gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
26
+
25
27
  gem.add_dependency 'cinch', '~> 2'
26
- gem.add_dependency 'cinch-cooldown', '~> 1.1', '>= 1.1.1'
27
- gem.add_dependency 'cinch-toolbox', '~> 1.1'
28
+ gem.add_dependency 'cinch-cooldown', '~> 1.1', '>= 1.1.7'
29
+ gem.add_dependency 'cinch-toolbox', '~> 1.1', '>= 1.1.6'
28
30
  end
@@ -1,3 +1,2 @@
1
- # -*- coding: utf-8 -*-
2
1
  require 'cinch/plugins/wikipedia/version'
3
2
  require 'cinch/plugins/wikipedia'
@@ -41,14 +41,14 @@ module Cinch
41
41
  def get_def(term, url)
42
42
  cats = Cinch::Toolbox.get_html_element(url, '#mw-normal-catlinks')
43
43
  if cats && cats.include?('Disambiguation')
44
- wiki_text = "'#{term} is too vague and lead to a disambiguation page."
44
+ return "'#{term} is too vague and lead to a disambiguation page."
45
45
  else
46
- wiki_text = Cinch::Toolbox.get_html_element(url, '#mw-content-text p')
47
- if wiki_text.nil? || wiki_text.include?('Help:Searching')
46
+ wiki_text = Cinch::Toolbox.get_html_element(url, '#mw-content-text/p')
47
+ if wiki_text.nil?
48
48
  return not_found(url)
49
49
  end
50
+ return wiki_text
50
51
  end
51
- wiki_text
52
52
  end
53
53
 
54
54
  def not_found(url)
@@ -3,7 +3,7 @@ module Cinch
3
3
  module Plugins
4
4
  # Versioning information
5
5
  class Wikipedia
6
- VERSION = '1.0.4'
6
+ VERSION = '1.0.5'
7
7
  end
8
8
  end
9
9
  end
@@ -10,7 +10,7 @@ describe Cinch::Plugins::Wikipedia do
10
10
  # normal queries
11
11
  it 'should return a definition of a term' do
12
12
  expect(get_replies(make_message(@bot, '!wiki computer')).first.text)
13
- .to include("A computer is a general purpose device")
13
+ .to include('A computer is a general purpose device')
14
14
  end
15
15
 
16
16
  it 'should return a definition of a term for each version of cmd' do
@@ -37,8 +37,8 @@ describe Cinch::Plugins::Wikipedia do
37
37
  end
38
38
 
39
39
  it 'should provide suggestions if one is listed on the page' do
40
- expect(get_replies(make_message(@bot, '!wiki smegama')).first.text)
41
- .to include("I couldn't find anything for that search, did you mean 'smegma'?")
40
+ expect(get_replies(make_message(@bot, '!wiki cliinton')).first.text)
41
+ .to include("I couldn't find anything for that search, did you mean 'clinton'?")
42
42
  end
43
43
 
44
44
  # disambiguation
@@ -1,11 +1,5 @@
1
- require 'coveralls'
2
- require 'simplecov'
3
-
4
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
- SimpleCov::Formatter::HTMLFormatter,
6
- Coveralls::SimpleCov::Formatter
7
- ]
8
- SimpleCov.start
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
9
3
 
10
4
  require 'cinch-wikipedia'
11
5
  require 'cinch/test'
metadata CHANGED
@@ -1,125 +1,131 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-wikipedia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Haberer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-04 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: coveralls
42
+ name: cinch-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ - - ">="
46
49
  - !ruby/object:Gem::Version
47
- version: '0.7'
50
+ version: 0.1.1
48
51
  type: :development
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
- - - ~>
55
+ - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: '0.7'
57
+ version: '0.1'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 0.1.1
55
61
  - !ruby/object:Gem::Dependency
56
- name: cinch-test
62
+ name: codeclimate-test-reporter
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ~>
65
+ - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '0.1'
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
64
- version: 0.1.0
67
+ version: '0.4'
65
68
  type: :development
66
69
  prerelease: false
67
70
  version_requirements: !ruby/object:Gem::Requirement
68
71
  requirements:
69
- - - ~>
70
- - !ruby/object:Gem::Version
71
- version: '0.1'
72
- - - ! '>='
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 0.1.0
74
+ version: '0.4'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: cinch
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: cinch-cooldown
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ~>
93
+ - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: '1.1'
96
- - - ! '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
- version: 1.1.1
98
+ version: 1.1.7
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ~>
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
105
  version: '1.1'
106
- - - ! '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
- version: 1.1.1
108
+ version: 1.1.7
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: cinch-toolbox
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ~>
113
+ - - "~>"
114
114
  - !ruby/object:Gem::Version
115
115
  version: '1.1'
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 1.1.6
116
119
  type: :runtime
117
120
  prerelease: false
118
121
  version_requirements: !ruby/object:Gem::Requirement
119
122
  requirements:
120
- - - ~>
123
+ - - "~>"
121
124
  - !ruby/object:Gem::Version
122
125
  version: '1.1'
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 1.1.6
123
129
  description: Cinch plugin that fetches a truncated blurb from the head of a wikipedia
124
130
  page.
125
131
  email:
@@ -128,8 +134,8 @@ executables: []
128
134
  extensions: []
129
135
  extra_rdoc_files: []
130
136
  files:
131
- - .gitignore
132
- - .travis.yml
137
+ - ".gitignore"
138
+ - ".travis.yml"
133
139
  - Gemfile
134
140
  - LICENSE.txt
135
141
  - README.md
@@ -150,17 +156,17 @@ require_paths:
150
156
  - lib
151
157
  required_ruby_version: !ruby/object:Gem::Requirement
152
158
  requirements:
153
- - - ! '>='
159
+ - - ">="
154
160
  - !ruby/object:Gem::Version
155
161
  version: '0'
156
162
  required_rubygems_version: !ruby/object:Gem::Requirement
157
163
  requirements:
158
- - - ! '>='
164
+ - - ">="
159
165
  - !ruby/object:Gem::Version
160
166
  version: '0'
161
167
  requirements: []
162
168
  rubyforge_project:
163
- rubygems_version: 2.2.2
169
+ rubygems_version: 2.4.8
164
170
  signing_key:
165
171
  specification_version: 4
166
172
  summary: Cinch Wikipedia Plugin