slashjoin 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/slashjoin/uri.rb CHANGED
@@ -6,7 +6,7 @@ module Slashjoin
6
6
 
7
7
  module URI
8
8
  def / (other)
9
- self.join(other)
9
+ ::URI.join(self,other)
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Slashjoin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,14 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ $: << File.expand_path(File.dirname(__FILE__))
4
+ require 'spec_helper'
5
+
6
+ describe StringWidth::Tanasinn do
7
+ module StringWidth
8
+ module Tanasinn
9
+ context RE_AMB_AS_SINGLE_2 do
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ $: << File.expand_path(File.dirname(__FILE__))
4
+ require 'spec_helper'
5
+ require 'slashjoin/nopatching'
6
+
7
+ describe Slashjoin do
8
+
9
+ end
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ $: << File.expand_path(File.dirname(__FILE__))
4
+ require 'spec_helper'
5
+ require 'slashjoin'
6
+
7
+ describe Slashjoin do
8
+ context String do
9
+ it "join to URI path name" do
10
+ base = "https://github.com/"
11
+ user = "zonuexe/"
12
+ project = "ruby-slashjoin"
13
+ user_uri = base / user
14
+ user_uri.should == URI.parse("https://github.com/zonuexe/")
15
+ proj_uri = user_uri / project
16
+ proj_uri.should == URI.parse("https://github.com/zonuexe/ruby-slashjoin")
17
+ end
18
+ it "join to UNIX like path name" do
19
+ home = "/home"
20
+ megurine_home = (home / "megurine")
21
+ megurine_home.should == "/home/megurine"
22
+ megurine_home.class.should == String
23
+ end
24
+ end
25
+ context Pathname do
26
+ it "join to" do
27
+ home = Pathname.new("/home")
28
+ megurine_home = (home / "megurine")
29
+ megurine_home.should == Pathname.new("/home/megurine")
30
+ megurine_home.class.should == Pathname
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,4 @@
1
+ $: << File.expand_path(File.join(File.dirname(__FILE__), '..','lib'))
2
+
3
+ require 'rspec'
4
+
@@ -0,0 +1,66 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ $: << File.expand_path(File.dirname(__FILE__))
4
+ require 'spec_helper'
5
+
6
+ describe StringWidth::Tanasinn do
7
+ before(:all){ include StringWidth::Tanasinn }
8
+ describe "As single" do
9
+ context "Ascii" do
10
+ it "large A" do
11
+ StringWidth::Tanasinn::wcwidth_amb_as_single("A").should == 1
12
+ end
13
+ it "large Z" do
14
+ StringWidth::Tanasinn::wcwidth_amb_as_single("Z").should == 1
15
+ end
16
+ end
17
+ context "Japanese" do
18
+ it "Hiragana NU" do
19
+ StringWidth::Tanasinn::wcwidth_amb_as_single("ぬ").should == 2
20
+ end
21
+ it "Hiragana RU" do
22
+ StringWidth::Tanasinn::wcwidth_amb_as_single("る").should == 2
23
+ end
24
+ it "Hiragana PO" do
25
+ StringWidth::Tanasinn::wcwidth_amb_as_single("ぽ").should == 2
26
+ end
27
+ it "Half Katakana GA" do
28
+ ->{
29
+ StringWidth::Tanasinn::wcwidth_amb_as_single("ガ")
30
+ }.should raise_error ArgumentError
31
+ end
32
+ it "Half Katakana Small TSU" do
33
+ StringWidth::Tanasinn::wcwidth_amb_as_single("ッ").should == 1
34
+ end
35
+ end
36
+ end
37
+ describe "As double" do
38
+ context "Ascii" do
39
+ it "large A" do
40
+ StringWidth::Tanasinn::wcwidth_amb_as_double("A").should == 1
41
+ end
42
+ it "large Z" do
43
+ StringWidth::Tanasinn::wcwidth_amb_as_double("Z").should == 1
44
+ end
45
+ end
46
+ context "Japanese" do
47
+ it "Hiragana NU" do
48
+ StringWidth::Tanasinn::wcwidth_amb_as_double("ぬ").should == 2
49
+ end
50
+ it "Hiragana RU" do
51
+ StringWidth::Tanasinn::wcwidth_amb_as_double("る").should == 2
52
+ end
53
+ it "Hiragana PO" do
54
+ StringWidth::Tanasinn::wcwidth_amb_as_double("ぽ").should == 2
55
+ end
56
+ it "Half Katakana GA" do
57
+ ->{
58
+ StringWidth::Tanasinn::wcwidth_amb_as_double("ガ")
59
+ }.should raise_error ArgumentError
60
+ end
61
+ it "Half Katakana Small TSU" do
62
+ StringWidth::Tanasinn::wcwidth_amb_as_double("ッ").should == 1
63
+ end
64
+ end
65
+ end
66
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slashjoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-29 00:00:00.000000000 Z
12
+ date: 2012-11-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: add String#/ method, do {file|URI} path join
15
15
  email:
@@ -32,6 +32,11 @@ files:
32
32
  - lib/slashjoin/use_pathname.rb
33
33
  - lib/slashjoin/version.rb
34
34
  - slashjoin.gemspec
35
+ - spec/regexp_spec.rb
36
+ - spec/slashjoin_nopatching.rb
37
+ - spec/slashjoin_spec.rb
38
+ - spec/spec_helper.rb
39
+ - spec/wcwidth_spec.rb
35
40
  homepage: ''
36
41
  licenses: []
37
42
  post_install_message:
@@ -56,5 +61,10 @@ rubygems_version: 1.8.24
56
61
  signing_key:
57
62
  specification_version: 3
58
63
  summary: atode kaku.
59
- test_files: []
64
+ test_files:
65
+ - spec/regexp_spec.rb
66
+ - spec/slashjoin_nopatching.rb
67
+ - spec/slashjoin_spec.rb
68
+ - spec/spec_helper.rb
69
+ - spec/wcwidth_spec.rb
60
70
  has_rdoc: