pebbles-dajare 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
  require 'google_suggest'
2
+ require 'pebbles/dajare/version'
2
3
 
3
4
  module Pebbles
4
5
  module Dajare
5
- VERSION = '0.0.1'
6
6
 
7
7
  def generate_dajare(phrase, degree=2)
8
8
  components = phrase.scan(/./)
@@ -18,6 +18,14 @@ module Pebbles
18
18
  return dajares
19
19
  end
20
20
 
21
+ def dajarize(degree=2)
22
+ Pebbles::Dajare.generate_dajare(self.to_s, degree)
23
+ end
24
+
21
25
  module_function :generate_dajare
22
26
  end
23
27
  end
28
+
29
+ class String
30
+ include Pebbles::Dajare
31
+ end
@@ -0,0 +1,5 @@
1
+ module Pebbles
2
+ module Dajare
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "pebbles/dajare"
3
+ require "pebbles/dajare/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "pebbles-dajare"
@@ -7,8 +7,13 @@ describe Pebbles::Dajare do
7
7
  {'suggestion' => '益若つばさ'}
8
8
  ])
9
9
  end
10
-
11
- subject { Pebbles::Dajare.generate_dajare 'ありがとうございます' }
12
- its(:shift) { should == 'ありがとうござい益若つばさ' }
10
+ context ".generate_dajare" do
11
+ subject { Pebbles::Dajare.generate_dajare 'ありがとうございます' }
12
+ its(:shift) { should == 'ありがとうござい益若つばさ' }
13
+ end
14
+ context "String#dajarize" do
15
+ subject { 'ありがとうございます'.dajarize }
16
+ its(:shift) { should == 'ありがとうござい益若つばさ' }
17
+ end
13
18
 
14
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebbles-dajare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &692660 !ruby/object:Gem::Requirement
16
+ requirement: &3714120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *692660
24
+ version_requirements: *3714120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: google_suggest
27
- requirement: &692270 !ruby/object:Gem::Requirement
27
+ requirement: &3713870 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *692270
35
+ version_requirements: *3713870
36
36
  description: ''
37
37
  email:
38
38
  - satoryu.1981@gmail.com
@@ -47,6 +47,7 @@ files:
47
47
  - README.rdoc
48
48
  - Rakefile
49
49
  - lib/pebbles/dajare.rb
50
+ - lib/pebbles/dajare/version.rb
50
51
  - pebbles-dajare.gemspec
51
52
  - spec/pebbles/dajare_spec.rb
52
53
  - spec/spec_helper.rb