ryodo 0.2.2 → 0.2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f46d8b24a8bd695cfc6f4841d3825be3a4cb417c
4
+ data.tar.gz: da363e80c452085a77d24b04bb06a70762477965
5
+ SHA512:
6
+ metadata.gz: 761feba4fc480e250399ad83cc43497d843e6549b7edf42c374a3920b1d7b21446ea82ea203300b0a63c17ede36d2c86cc32ae6c48dbd749ef337fa2b19c3928
7
+ data.tar.gz: 8e87dda60e727d9e6bb0d001d14444e01854ff54399ed34eb70acf5239a5caf9ba57dd17dd5552402123eb21329c1420d0dc2cf13bc13022b9e0f818bdb4277a
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ *.so
4
+ .bundle
5
+ .config
6
+ coverage
7
+ InstalledFiles
8
+ lib/bundler/man
9
+ pkg
10
+ rdoc
11
+ spec/reports
12
+ test/tmp
13
+ test/version_tmp
14
+ tmp
15
+
16
+ # YARD artifacts
17
+ .yardoc
18
+ _yardoc
19
+ doc/
data/.travis.yml CHANGED
@@ -1,16 +1,12 @@
1
+ language: ruby
2
+
1
3
  rvm:
4
+ - 2.0.0
2
5
  - 1.9.3
3
6
  - 1.9.2
4
7
  - jruby-19mode
5
- - rbx-19mode
6
- - ruby-head
7
- - jruby-head
8
8
 
9
9
  branches:
10
10
  only:
11
11
  - develop
12
12
  - master
13
-
14
- notifications:
15
- email:
16
- - chris@dinarrr.com
data/Gemfile CHANGED
@@ -1,12 +1,2 @@
1
- source :rubygems
2
-
3
- group :development do
4
- gem "rake"
5
- gem "bundler"
6
- gem "jeweler"
7
- gem "rspec"
8
- gem "fakeweb"
9
-
10
- gem "pry"
11
- gem "pry-doc"
12
- end
1
+ source "https://rubygems.org"
2
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,46 +1,42 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ryodo (0.2.4.1)
5
+
1
6
  GEM
2
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
3
8
  specs:
4
- coderay (1.0.6)
9
+ coderay (1.0.8)
5
10
  diff-lcs (1.1.3)
6
11
  fakeweb (1.3.0)
7
- git (1.2.5)
8
- jeweler (1.8.3)
9
- bundler (~> 1.0)
10
- git (>= 1.2.5)
11
- rake
12
- rdoc
13
- json (1.7.3)
14
- method_source (0.7.1)
15
- pry (0.9.9.6)
12
+ method_source (0.8.1)
13
+ pry (0.9.11.4)
16
14
  coderay (~> 1.0.5)
17
- method_source (~> 0.7.1)
18
- slop (>= 2.4.4, < 3)
19
- pry-doc (0.4.2)
20
- pry (>= 0.9.0)
15
+ method_source (~> 0.8)
16
+ slop (~> 3.4)
17
+ pry-doc (0.4.4)
18
+ pry (>= 0.9.9.6)
21
19
  yard (~> 0.8.1)
22
- rake (0.9.2.2)
23
- rdoc (3.12)
24
- json (~> 1.4)
25
- rspec (2.10.0)
26
- rspec-core (~> 2.10.0)
27
- rspec-expectations (~> 2.10.0)
28
- rspec-mocks (~> 2.10.0)
29
- rspec-core (2.10.1)
30
- rspec-expectations (2.10.0)
20
+ rake (10.0.3)
21
+ rspec (2.12.0)
22
+ rspec-core (~> 2.12.0)
23
+ rspec-expectations (~> 2.12.0)
24
+ rspec-mocks (~> 2.12.0)
25
+ rspec-core (2.12.2)
26
+ rspec-expectations (2.12.1)
31
27
  diff-lcs (~> 1.1.3)
32
- rspec-mocks (2.10.1)
33
- slop (2.4.4)
34
- yard (0.8.1)
28
+ rspec-mocks (2.12.2)
29
+ slop (3.4.3)
30
+ yard (0.8.3)
35
31
 
36
32
  PLATFORMS
37
33
  ruby
38
34
 
39
35
  DEPENDENCIES
40
- bundler
36
+ bundler (~> 1.3)
41
37
  fakeweb
42
- jeweler
43
38
  pry
44
39
  pry-doc
45
40
  rake
46
41
  rspec
42
+ ryodo!
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Christoph Grabo
1
+ Copyright (c) 2012-2013 Christoph Grabo
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  **ryōdo【領土】 りょうど — A domain name parser using public suffix list**
4
4
 
5
- ----
5
+ Do you ever wanted to know if `suspicious.domain.name.blerp` is really a valid domain?
6
6
 
7
- This is a pure Ruby implementation of the [regdomr](https://github.com/asaaki/regdomr) gem, but with slightly different API.
7
+ Do you ever wanted to know what is the domain portion of `others.guy.awesome.domain.co.jp`?
8
8
 
9
- Without the Cext backend it should be also easily usable with Ruby implemenations like JRuby.
10
-
11
- **Works only with Ruby 1.9.x!** (I dropped all support for 1.8.x)
9
+ Then you should try `ryodo` and get the answers!
12
10
 
11
+ Notice: This gem **does not** check DNS records to verify if a name was taken and registered, this is not its purpose.
12
+ I am a big fan of the UNIX philosophy: *»Write programs that do one thing and do it well.«*
13
13
 
14
14
 
15
15
  ## Usage
@@ -53,14 +53,14 @@ ryodo("my.awesome.domain.co.jp")
53
53
  ```
54
54
 
55
55
 
56
- ### Quick check (.valid_domain?)
56
+ ### Quick check (.domain_valid?)
57
57
 
58
58
  ```ruby
59
59
  Ryodo.domain_valid?("my.awesome.domain.co.jp") #=> true
60
60
  Ryodo.domain_valid?("co.jp") #=> false
61
61
 
62
62
  # aliases
63
- Ryodo.domain_valid?("my.awesome.domain.co.jp")
63
+ Ryodo.valid_domain?("my.awesome.domain.co.jp")
64
64
  Ryodo.valid?("my.awesome.domain.co.jp")
65
65
  Ryodo?("my.awesome.domain.co.jp")
66
66
  ryodo?("my.awesome.domain.co.jp")
@@ -90,7 +90,7 @@ gem "ryodo", :require => ["ryodo", "ryodo/ext/string"]
90
90
  ### UTF-8 junkie?
91
91
 
92
92
  ```ruby
93
- # encoding: utf-8
93
+ # coding: utf-8
94
94
  require "ryodo/convenience/utf8"
95
95
 
96
96
  ryōdo("my.awesome.domain.co.jp")
@@ -223,6 +223,6 @@ Lot of specs missing, this first version of second approach was developed in pla
223
223
 
224
224
  ## License
225
225
 
226
- MIT/X11 — see `LICENSE.txt`
226
+ MIT/X11 — see [`LICENSE`](./LICENSE)
227
227
 
228
- (c) 2012 Christoph Grabo
228
+ (c) 2012—2013 Christoph Grabo
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # coding: utf-8
2
2
 
3
3
  require "rubygems"
4
4
  require "bundler"
@@ -10,22 +10,9 @@ rescue Bundler::BundlerError => e
10
10
  exit e.status_code
11
11
  end
12
12
  require "rake"
13
- require "jeweler"
14
13
  require "rspec"
15
14
  require "rspec/core/rake_task"
16
15
 
17
- Jeweler::Tasks.new do |gem|
18
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
19
- gem.name = "ryodo"
20
- gem.homepage = "http://github.com/asaaki/ryodo"
21
- gem.license = "MIT"
22
- gem.summary = %Q{ryōdo【領土】 りょうど — A domain name parser using public suffix list}
23
- gem.description = %Q{ryōdo【領土】 りょうど — A domain name parser gem using public suffix list (provided by publicsuffix.org/mozilla)}
24
- gem.email = "chris@dinarrr.com"
25
- gem.authors = ["Christoph Grabo"]
26
- # dependencies defined in Gemfile
27
- end
28
- Jeweler::RubygemsDotOrgTasks.new
29
16
 
30
17
  desc "Starts IRB with gem loaded"
31
18
  task :irb do
@@ -37,17 +24,48 @@ task :pry do
37
24
  sh "pry -I lib -r ryodo --no-pager"
38
25
  end
39
26
 
27
+
40
28
  desc "Run all specs"
41
29
  task RSpec::Core::RakeTask.new(:spec) do |t|
42
30
  t.pattern = 'spec/**/*_spec.rb'
43
31
  t.verbose = false
44
32
  end
45
33
 
34
+
46
35
  desc "Fetch and save public suffix data (task for updates)"
47
36
  task :fetch_data do
37
+ $: << "lib"
48
38
  require "ryodo"
49
39
  require "ryodo/suffix_list_fetcher"
50
40
  Ryodo::SuffixListFetcher.fetch_and_save!
51
41
  end
52
42
 
43
+
44
+ namespace :gem do
45
+ $: << "lib"
46
+ require "ryodo/version"
47
+
48
+ task :tag do
49
+ system "git tag -f v#{Ryodo::VERSION} && git push --tags -f"
50
+ end
51
+
52
+ task :build do
53
+ system "rm *.gem"
54
+ system "gem build ryodo.gemspec"
55
+ end
56
+
57
+ task :push => "gem:build" do
58
+ system "gem push ryodo-#{Ryodo::VERSION}.gem"
59
+ end
60
+
61
+ task :clean do
62
+ system "rm *.gem"
63
+ end
64
+
65
+ desc "Publish gem to rubygems.org"
66
+ task :publish => ["gem:tag","gem:push","gem:clean"]
67
+
68
+ end
69
+
70
+
53
71
  task :default => :spec
data/checks/matching.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
2
+ # coding: utf-8
3
3
  $: << "lib"
4
4
  require "ryodo"
5
5
 
@@ -89,4 +89,4 @@ checkPublicSuffix('test.ak.us', 'test.ak.us')
89
89
  checkPublicSuffix('www.test.ak.us', 'test.ak.us')
90
90
  checkPublicSuffix('k12.ak.us', 'NULL')
91
91
  checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us')
92
- checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us')
92
+ checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us')