sosowa 2.0 → 3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/README.md +0 -4
- data/lib/sosowa/version.rb +1 -1
- data/lib/sosowa.rb +4 -4
- data/sosowa.gemspec +2 -2
- data/spec/sosowa_spec.rb +12 -12
- metadata +6 -6
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,6 @@ samples/に各種サンプルが入っています。
|
|
8
8
|
## Requirements
|
9
9
|
|
10
10
|
* Ruby 1.9.x
|
11
|
-
* Nokogiri gem
|
12
11
|
|
13
12
|
## Installation
|
14
13
|
|
@@ -26,9 +25,6 @@ samples/に各種サンプルが入っています。
|
|
26
25
|
novel = Sosowa.get(:log => 156, :key => 1320873807)
|
27
26
|
puts novel.text
|
28
27
|
|
29
|
-
# "ナズーリン"がタイトルに含まれているSSの数を出力する
|
30
|
-
puts Sosowa.search("ナズーリン", :type => :title).size
|
31
|
-
|
32
28
|
## Contributing
|
33
29
|
|
34
30
|
1. Fork it
|
data/lib/sosowa/version.rb
CHANGED
data/lib/sosowa.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "megalopolis"
|
4
4
|
|
5
5
|
$LOAD_PATH.unshift(File.expand_path("../", __FILE__))
|
6
6
|
require "sosowa/version"
|
7
7
|
|
8
8
|
module Sosowa
|
9
|
-
BASE_URL = "http://coolier.sytes.net
|
9
|
+
BASE_URL = "http://coolier.sytes.net/sosowa/ssw_l/"
|
10
10
|
|
11
11
|
def self.get(args={})
|
12
12
|
args[:log] ||= 0
|
13
|
-
|
14
|
-
|
13
|
+
megalopolis = Megalopolis.new(BASE_URL)
|
14
|
+
megalopolis.get args
|
15
15
|
end
|
16
16
|
|
17
17
|
#def self.search(query, args={})
|
data/sosowa.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require File.expand_path('../lib/sosowa/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["
|
5
|
+
gem.authors = ["o_ame"]
|
6
6
|
gem.email = ["oame@oameya.com"]
|
7
7
|
gem.description = %q{Sosowa Parser for Ruby}
|
8
8
|
gem.summary = %q{Sosowa Parser for Ruby 1.9.x.}
|
@@ -14,5 +14,5 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "sosowa"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Sosowa::VERSION
|
17
|
-
gem.add_dependency "
|
17
|
+
gem.add_dependency "megalopolis"
|
18
18
|
end
|
data/spec/sosowa_spec.rb
CHANGED
@@ -8,35 +8,35 @@ describe Sosowa, "が #get, :log => 0 を呼ぶ時は" do
|
|
8
8
|
@log = Sosowa.get :log => 0
|
9
9
|
end
|
10
10
|
|
11
|
-
it "
|
12
|
-
@log.class.should ==
|
11
|
+
it "Megalopolis::Subjectを返すこと" do
|
12
|
+
@log.class.should == Megalopolis::Subject
|
13
13
|
end
|
14
14
|
|
15
|
-
it "最初が
|
16
|
-
@log.first.class.should ==
|
15
|
+
it "最初がMegalopolis::Indexであること" do
|
16
|
+
@log.first.class.should == Megalopolis::Index
|
17
17
|
end
|
18
18
|
|
19
19
|
it "最初のタイトルがStringであること" do
|
20
20
|
@log.first.title.class.should == String
|
21
21
|
end
|
22
22
|
|
23
|
-
it "#next_pageが
|
24
|
-
@log.next_page.class.should ==
|
23
|
+
it "#next_pageがMegalopolis::Subjectを返すこと" do
|
24
|
+
@log.next_page.class.should == Megalopolis::Subject
|
25
25
|
end
|
26
26
|
|
27
|
-
it "#prev_pageが
|
28
|
-
@log.prev_page.class.should ==
|
27
|
+
it "#prev_pageがMegalopolis::Subjectを返すこと" do
|
28
|
+
@log.prev_page.class.should == Megalopolis::Subject
|
29
29
|
end
|
30
30
|
|
31
31
|
it "#latest_logがFixnumを返すこと" do
|
32
32
|
@log.latest_log.class.should == Fixnum
|
33
33
|
end
|
34
34
|
|
35
|
-
it "最初を#fetchしたら
|
36
|
-
@log.first.fetch.class.should ==
|
35
|
+
it "最初を#fetchしたらMegalopolis::Novelを返すこと" do
|
36
|
+
@log.first.fetch.class.should == Megalopolis::Novel
|
37
37
|
end
|
38
38
|
|
39
|
-
it "最初を#fetchした
|
40
|
-
@log.first.fetch.title.class.should == String
|
39
|
+
it "最初を#fetchしたMegalopolis::Novel#entry#titleがStringなこと" do
|
40
|
+
@log.first.fetch.entry.title.class.should == String
|
41
41
|
end
|
42
42
|
end
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sosowa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '3.0'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
-
|
8
|
+
- o_ame
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: megalopolis
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
@@ -66,7 +66,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
version: '0'
|
67
67
|
segments:
|
68
68
|
- 0
|
69
|
-
hash:
|
69
|
+
hash: -2223355086656867454
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
71
|
none: false
|
72
72
|
requirements:
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
segments:
|
77
77
|
- 0
|
78
|
-
hash:
|
78
|
+
hash: -2223355086656867454
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
81
|
rubygems_version: 1.8.24
|