oxforddictionaries 1.0.0 → 1.0.1

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: 2ed773a0967bb17aa08252f0c250fdc8a77f7dfb
4
- data.tar.gz: c646ff4320765303482091977b1c562b86d7599a
3
+ metadata.gz: 9d6f398d10537f80be81395b4aad03fb1b1f58d9
4
+ data.tar.gz: 54f779d2b379767d63bb42b3768a434278911e52
5
5
  SHA512:
6
- metadata.gz: d543bb45088fba158e1bfb42bd0c9f057bac78b05aaa139a06de1887cbdcd86575303b69bb3842ce723610a3773cfddc34bc932453a9400d5d9e8a6c3e723262
7
- data.tar.gz: 08c4196e332c23bec998312cc7f4da93c21e191b8b31a96e7fbf82fff692918a39c681d62491e048c77eee0fb3ec4baaf8842a1347c120534a2e44fca82b77d2
6
+ metadata.gz: cf8a92673b3ab9893e07d862785017b984fc43b10f463852b545dff1290b1963157f97705c7c9476350d16034f45e2faaeb4343f799e189f23e0e8c980352949
7
+ data.tar.gz: 7821848a03d61dfdd8698b675a4e95b1aeb4586bd0b9369904b934a8b1369bc80e770fabd17307dc18378acfb8bd60db77cc034799fb48940666a4af6c3ca138
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Michał Skóra
1
+ Copyright (c) 2014 Fractal Soft
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Oxforddictionaries
2
2
 
3
- TODO: Write a gem description
3
+ Simple parser to english words
4
4
 
5
5
  ## Installation
6
6
 
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
- require "bundler/gem_tasks"
2
-
1
+ require 'bundler/gem_tasks'
@@ -1,7 +1,2 @@
1
1
  require 'oxforddictionaries/version'
2
2
  require 'oxforddictionaries/parser'
3
-
4
- # Oxforddictionaries module
5
- module Oxforddictionaries
6
- # Your code goes here...
7
- end
@@ -8,11 +8,13 @@ module Oxforddictionaries
8
8
  attr_reader :word
9
9
 
10
10
  def initialize
11
- @word = ''
11
+ @word, @html, @page = '', '', nil
12
12
  end
13
13
 
14
14
  def exist?
15
- (regex =~ single_match) || (regex =~ plural_matches)
15
+ first = !(regex =~ single_match).nil?
16
+ second = !(regex =~ plural_matches).nil?
17
+ (first || second)
16
18
  end
17
19
 
18
20
  def word=(text)
@@ -38,8 +40,8 @@ module Oxforddictionaries
38
40
  end
39
41
 
40
42
  def single_match
41
- h1 = @page.search('h1').first
42
- h1 && h1.text
43
+ tag = @page.search('h1').first
44
+ tag && tag.text
43
45
  end
44
46
 
45
47
  def plural_matches
@@ -1,3 +1,4 @@
1
+ # Gem version
1
2
  module Oxforddictionaries
2
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
3
4
  end
@@ -6,22 +6,24 @@ require 'oxforddictionaries/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'oxforddictionaries'
8
8
  spec.version = Oxforddictionaries::VERSION
9
- spec.authors = ['Michał Skóra']
10
- spec.email = %w(mskora@fractalsoft.org)
9
+ spec.authors = [
10
+ 'Michał Skóra', 'Agnieszka Matysek', 'Alek Malaszkiewicz'
11
+ ]
12
+ spec.email = %w(info@fractalsoft.org)
11
13
  spec.summary = 'Oxford Dictionaries'
12
14
  spec.description = 'Simple parser to english words'
13
15
  spec.homepage = ''
14
16
  spec.license = 'MIT'
15
17
 
16
18
  spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(/^spec/)
19
21
  spec.require_paths = ['lib']
20
22
 
21
23
  spec.add_dependency 'nokogiri', '~> 1.6'
22
24
 
23
25
  spec.add_development_dependency 'bundler', '~> 1.6'
24
- spec.add_development_dependency 'rake', '~> 0'
26
+ spec.add_development_dependency 'rake', '>= 10.4'
25
27
  spec.add_development_dependency 'rspec', '~> 3.3'
26
28
  spec.add_development_dependency 'webmock', '~> 1.21'
27
29
  end
@@ -35,6 +35,21 @@ describe Oxforddictionaries::Parser do
35
35
  subject.word = 'fish'
36
36
  expect(subject).to be_exist
37
37
  end
38
+
39
+ it 'if word is home' do
40
+ subject.word = 'home'
41
+ expect(subject).to be_exist
42
+ end
43
+
44
+ it 'if word is dive' do
45
+ subject.word = 'dive'
46
+ expect(subject).to be_exist
47
+ end
48
+
49
+ it 'if word is doom' do
50
+ subject.word = 'doom'
51
+ expect(subject).to be_exist
52
+ end
38
53
  end
39
54
 
40
55
  context 'false' do
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxforddictionaries
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Skóra
8
+ - Agnieszka Matysek
9
+ - Alek Malaszkiewicz
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
13
+ date: 2015-06-30 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: nokogiri
@@ -42,16 +44,16 @@ dependencies:
42
44
  name: rake
43
45
  requirement: !ruby/object:Gem::Requirement
44
46
  requirements:
45
- - - "~>"
47
+ - - ">="
46
48
  - !ruby/object:Gem::Version
47
- version: '0'
49
+ version: '10.4'
48
50
  type: :development
49
51
  prerelease: false
50
52
  version_requirements: !ruby/object:Gem::Requirement
51
53
  requirements:
52
- - - "~>"
54
+ - - ">="
53
55
  - !ruby/object:Gem::Version
54
- version: '0'
56
+ version: '10.4'
55
57
  - !ruby/object:Gem::Dependency
56
58
  name: rspec
57
59
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +84,7 @@ dependencies:
82
84
  version: '1.21'
83
85
  description: Simple parser to english words
84
86
  email:
85
- - mskora@fractalsoft.org
87
+ - info@fractalsoft.org
86
88
  executables: []
87
89
  extensions: []
88
90
  extra_rdoc_files: []