pebbles-dajare 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
- SHA1:
3
- metadata.gz: 7a97c562df8f3fd2747182b3b88377f8dce62721
4
- data.tar.gz: 495dae493577a5cef74ce24248455887d5562e95
2
+ SHA256:
3
+ metadata.gz: 12e8fc82c52036f195326c07da4f93a6d41da81a2e5e1356b013c80739f39923
4
+ data.tar.gz: f4d4f775a1cae7373ce05fe99a00c9e42af6d0658fb53a1171a4c1fd65dfc8c3
5
5
  SHA512:
6
- metadata.gz: f0502d3a8d13170b269c2867e748ebab91060edbe252ac182b38cc4b4599899d2139d6d4a6e2811916ee123e1107ba147726b2d6fc2b58d0c676e5acdad7aac5
7
- data.tar.gz: 7ebeccdb47c80334eb22f6010cbd1189c1aa747e7befcacbe54ee6bca7eaae82e1ba3053745580455f50926e75ceea7380a4385ac14e5593c8aadd41674876f2
6
+ metadata.gz: c4c33118fa2ea27d4540e0f3b49eb66c9ab8d37ff24d3efac963243827d082ef137ecb108d832a70efc1cb271e1a566115e24dbe2e1e2ca847ea0043301c9a0d
7
+ data.tar.gz: 78358441cba72a732ec3fe24d17a61e7e28e8aa85c17f21a6764d91309ee60dfe62d911e1105784435d4c6346769903fcb030aec0e09b64bbeed5597ed0fe150
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.1.9
5
4
  - 2.2.5
6
5
  - 2.3.1
6
+ - 2.4.3
7
+ - 2.5.0
7
8
  - ruby-head
8
9
 
9
10
  cache: bundler
data/Gemfile CHANGED
@@ -1,11 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'google_suggest'
4
-
5
- group :development, :test do
6
- gem 'rake'
7
- gem 'rspec', '~> 2.8.0'
8
- end
9
-
10
3
  # Specify your gem's dependencies in pebbles-dajare.gemspec
11
4
  gemspec
@@ -1,13 +1,11 @@
1
1
  require 'google_suggest'
2
- require 'pebbles/dajare/version'
3
2
 
4
3
  module Pebbles
5
4
  module Dajare
6
-
7
5
  def generate_dajare(phrase, degree: 2, region: 'jp')
8
6
  components = phrase.scan(/./)
9
7
 
10
- prefix = components[0..-(degree+1)].join
8
+ prefix = components[0..-(degree + 1)].join
11
9
  src_dajare = components[-degree..-1].join
12
10
 
13
11
  results = GoogleSuggest.suggest_for(src_dajare, region: region)
@@ -15,11 +13,12 @@ module Pebbles
15
13
  dajares = results.map do |result|
16
14
  prefix + result.split(' ').shift
17
15
  end
18
- return dajares
16
+
17
+ dajares
19
18
  end
20
19
 
21
20
  def dajarize(degree: 2, region: 'jp')
22
- Pebbles::Dajare.generate_dajare(self.to_s, degree: degree, region: region)
21
+ Pebbles::Dajare.generate_dajare(to_s, degree: degree, region: region)
23
22
  end
24
23
 
25
24
  module_function :generate_dajare
@@ -1,5 +1,5 @@
1
1
  module Pebbles
2
2
  module Dajare
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
@@ -1,26 +1,25 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "pebbles/dajare/version"
1
+ $LOAD_PATH.push File.expand_path(File.join(__dir__, 'lib'))
2
+ require 'pebbles/dajare/version'
4
3
 
5
4
  Gem::Specification.new do |s|
6
- s.name = "pebbles-dajare"
5
+ s.name = 'pebbles-dajare'
7
6
  s.version = Pebbles::Dajare::VERSION
8
- s.authors = ["Tatsuya Sato"]
9
- s.email = ["satoryu.1981@gmail.com"]
10
- s.homepage = "http://github.com/satoryu/pebbles-dajare"
11
- s.summary = %q{a gem to generate dajare}
7
+ s.authors = ['Tatsuya Sato']
8
+ s.email = ['satoryu.1981@gmail.com']
9
+ s.homepage = 'https://github.com/satoryu/pebbles-dajare'
10
+ s.summary = 'a gem to generate dajare'
12
11
  s.description = <<-DESC
13
12
  DESC
14
13
 
15
- s.rubyforge_project = "pebbles-dajare"
16
- s.required_ruby_version = '>= 2.1'
14
+ s.rubyforge_project = 'pebbles-dajare'
15
+ s.required_ruby_version = '>= 2.2'
17
16
 
18
17
  s.files = `git ls-files`.split("\n")
19
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.require_paths = ["lib"]
19
+ s.require_paths = ['lib']
22
20
 
23
21
  # specify any dependencies here; for example:
24
- s.add_development_dependency "rspec", '>= 2'
25
- s.add_runtime_dependency "google_suggest", '~> 1.0.0'
22
+ s.add_runtime_dependency 'google_suggest', '~> 1.0.0'
23
+ s.add_development_dependency 'rake', '~> 11.2.2'
24
+ s.add_development_dependency 'rspec', '~> 3.5.0'
26
25
  end
@@ -5,7 +5,7 @@ describe Pebbles::Dajare do
5
5
  let(:keyword) { 'ます' }
6
6
 
7
7
  before do
8
- GoogleSuggest.stub(:suggest_for).with(keyword, options).and_return([
8
+ allow(GoogleSuggest).to receive(:suggest_for).with(keyword, options).and_return([
9
9
  '舛添要一'
10
10
  ])
11
11
  end
@@ -13,27 +13,27 @@ describe Pebbles::Dajare do
13
13
  describe ".generate_dajare" do
14
14
  subject { Pebbles::Dajare.generate_dajare 'ありがとうございます' }
15
15
 
16
- its(:shift) { should == 'ありがとうござい舛添要一' }
16
+ it { is_expected.to match_array(%w[ありがとうござい舛添要一]) }
17
17
 
18
18
  context 'Giving degree option' do
19
19
  let(:keyword) { 'います' }
20
20
 
21
21
  subject { Pebbles::Dajare.generate_dajare('ありがとうございます', degree: 3) }
22
22
 
23
- its(:shift) { should == 'ありがとうござ舛添要一' }
23
+ it { is_expected.to match_array(%w[ありがとうござ舛添要一]) }
24
24
  end
25
25
  context 'Giving region option' do
26
26
  let(:options) { { region: 'us' } }
27
27
 
28
28
  subject { Pebbles::Dajare.generate_dajare('ありがとうございます', region: 'us') }
29
29
 
30
- its(:shift) { should == 'ありがとうござい舛添要一' }
30
+ it { is_expected.to match_array(%w[ありがとうござい舛添要一]) }
31
31
  end
32
32
  end
33
33
 
34
34
  describe "String#dajarize" do
35
35
  subject { 'ありがとうございます'.dajarize }
36
36
 
37
- its(:shift) { should == 'ありがとうござい舛添要一' }
37
+ it { is_expected.to match_array(%w[ありがとうござい舛添要一]) }
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,43 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebbles-dajare
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
  - Tatsuya Sato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rspec
14
+ name: google_suggest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
18
25
  - !ruby/object:Gem::Version
19
- version: '2'
26
+ version: 1.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 11.2.2
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '2'
40
+ version: 11.2.2
27
41
  - !ruby/object:Gem::Dependency
28
- name: google_suggest
42
+ name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 1.0.0
34
- type: :runtime
47
+ version: 3.5.0
48
+ type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 1.0.0
54
+ version: 3.5.0
41
55
  description: ''
42
56
  email:
43
57
  - satoryu.1981@gmail.com
@@ -56,7 +70,7 @@ files:
56
70
  - pebbles-dajare.gemspec
57
71
  - spec/pebbles/dajare_spec.rb
58
72
  - spec/spec_helper.rb
59
- homepage: http://github.com/satoryu/pebbles-dajare
73
+ homepage: https://github.com/satoryu/pebbles-dajare
60
74
  licenses: []
61
75
  metadata: {}
62
76
  post_install_message:
@@ -67,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
81
  requirements:
68
82
  - - ">="
69
83
  - !ruby/object:Gem::Version
70
- version: '2.1'
84
+ version: '2.2'
71
85
  required_rubygems_version: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -75,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
89
  version: '0'
76
90
  requirements: []
77
91
  rubyforge_project: pebbles-dajare
78
- rubygems_version: 2.4.5.1
92
+ rubygems_version: 2.7.3
79
93
  signing_key:
80
94
  specification_version: 4
81
95
  summary: a gem to generate dajare