mona 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/Gemfile +1 -6
- data/README.md +3 -0
- data/VERSION +1 -1
- data/lib/mona/response.rb +2 -1
- data/mona.gemspec +9 -6
- data/spec/board_spec.rb +3 -3
- data/spec/response_spec.rb +3 -3
- data/spec/thread_spec.rb +2 -1
- metadata +23 -7
- data/Gemfile.lock +0 -32
- data/README.rdoc +0 -19
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,14 +1,9 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
2
|
|
6
|
-
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
3
|
+
gem 'rake'
|
8
4
|
gem 'httpclient'
|
9
5
|
group :development do
|
10
6
|
gem "rspec"
|
11
7
|
gem "bundler"
|
12
8
|
gem "jeweler"
|
13
|
-
# gem "rcov", ">= 0"
|
14
9
|
end
|
data/README.md
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/mona/response.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
require 'time'
|
2
3
|
|
3
4
|
class Mona::Response
|
4
5
|
attr_accessor :name, :trip, :written_at, :body
|
@@ -12,7 +13,7 @@ class Mona::Response
|
|
12
13
|
def parse_line(line)
|
13
14
|
name, _, time_str, body, _ = line.to_s.split(/<>/)
|
14
15
|
name, trip = parse_name(name)
|
15
|
-
time = Time.parse(time_str)
|
16
|
+
time = Time.parse(time_str + " +09:00")
|
16
17
|
body = body.strip.split(' <br> ').join("\n")
|
17
18
|
Mona::Response.new(name: name, trip: trip, written_at: time, body: body)
|
18
19
|
end
|
data/mona.gemspec
CHANGED
@@ -5,24 +5,24 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mona"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["masarakki"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-03-06"
|
13
13
|
s.description = "talk to 2ch library"
|
14
14
|
s.email = "masaki@hisme.net"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
-
"README.
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
|
+
".travis.yml",
|
22
23
|
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
24
|
"LICENSE.txt",
|
25
|
-
"README.
|
25
|
+
"README.md",
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
28
|
"lib/mona.rb",
|
@@ -43,24 +43,27 @@ Gem::Specification.new do |s|
|
|
43
43
|
s.homepage = "http://github.com/masarakki/mona"
|
44
44
|
s.licenses = ["MIT"]
|
45
45
|
s.require_paths = ["lib"]
|
46
|
-
s.rubygems_version = "1.8.
|
46
|
+
s.rubygems_version = "1.8.25"
|
47
47
|
s.summary = "talk 2ch"
|
48
48
|
|
49
49
|
if s.respond_to? :specification_version then
|
50
50
|
s.specification_version = 3
|
51
51
|
|
52
52
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
53
54
|
s.add_runtime_dependency(%q<httpclient>, [">= 0"])
|
54
55
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
55
56
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
56
57
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
57
58
|
else
|
59
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
58
60
|
s.add_dependency(%q<httpclient>, [">= 0"])
|
59
61
|
s.add_dependency(%q<rspec>, [">= 0"])
|
60
62
|
s.add_dependency(%q<bundler>, [">= 0"])
|
61
63
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
62
64
|
end
|
63
65
|
else
|
66
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
64
67
|
s.add_dependency(%q<httpclient>, [">= 0"])
|
65
68
|
s.add_dependency(%q<rspec>, [">= 0"])
|
66
69
|
s.add_dependency(%q<bundler>, [">= 0"])
|
data/spec/board_spec.rb
CHANGED
@@ -9,8 +9,8 @@ describe Mona::Board do
|
|
9
9
|
before do
|
10
10
|
Mona::Board.any_instance.stub(:connect) { test_subject }
|
11
11
|
end
|
12
|
-
|
13
|
-
subject {
|
12
|
+
let(:board) { Mona::Board.new('localhost', 'board_001') }
|
13
|
+
subject { board }
|
14
14
|
its(:dat_url) { should eq("http://localhost/board_001/subject.txt") }
|
15
15
|
describe :threads do
|
16
16
|
subject { Mona::Board.new('localhost', 'board_001').threads }
|
@@ -18,7 +18,7 @@ describe Mona::Board do
|
|
18
18
|
its('first.title') { should eq'【東京】岩手の食材をテーマにした居酒屋が復興目指して急遽オープン' }
|
19
19
|
its('first.id') { should eq 1317477718 }
|
20
20
|
its('first.res_num') { should eq 49 }
|
21
|
-
its('first.board') { should
|
21
|
+
its('first.board.board') { should == board.board }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
data/spec/response_spec.rb
CHANGED
@@ -11,7 +11,8 @@ describe Mona::Response do
|
|
11
11
|
describe :ClassMethod do
|
12
12
|
describe :parse_name do
|
13
13
|
context :with_trip do
|
14
|
-
|
14
|
+
before { @response = Mona::Response.parse_name('天使 </b>◆uL5esZLBSE <b>') }
|
15
|
+
subject { @response }
|
15
16
|
its(:first) { should == '天使' }
|
16
17
|
its(:last) { should == 'uL5esZLBSE' }
|
17
18
|
end
|
@@ -28,8 +29,7 @@ describe Mona::Response do
|
|
28
29
|
|
29
30
|
its(:name) { should == '天使' }
|
30
31
|
its(:trip) { should == 'uL5esZLBSE' }
|
31
|
-
its("written_at.to_i") { should ==
|
32
|
-
its("written_at.zone") { should == "JST" }
|
32
|
+
its("written_at.to_i") { should == 1309526026 }
|
33
33
|
its(:body) { should == "Rubyバカにしてる子ってさ
|
34
34
|
変数に$ついてる言語触ってるって事だよね
|
35
35
|
|
data/spec/thread_spec.rb
CHANGED
@@ -40,7 +40,8 @@ describe Mona::Thread do
|
|
40
40
|
|
41
41
|
describe :from_url do
|
42
42
|
context "with valid url: http://news2.2ch.net/test/read.cgi/newsplus/1000000000/" do
|
43
|
-
|
43
|
+
before { @thread = Mona::Thread.from_url "http://news2.2ch.net/test/read.cgi/newsplus/1000000000/" }
|
44
|
+
subject { @thread }
|
44
45
|
its("board.host") { should == "news2.2ch.net" }
|
45
46
|
its("board.board") { should == "newsplus" }
|
46
47
|
its(:id) { should == 1000000000 }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mona
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: httpclient
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,14 +97,14 @@ executables: []
|
|
81
97
|
extensions: []
|
82
98
|
extra_rdoc_files:
|
83
99
|
- LICENSE.txt
|
84
|
-
- README.
|
100
|
+
- README.md
|
85
101
|
files:
|
86
102
|
- .document
|
87
103
|
- .rspec
|
104
|
+
- .travis.yml
|
88
105
|
- Gemfile
|
89
|
-
- Gemfile.lock
|
90
106
|
- LICENSE.txt
|
91
|
-
- README.
|
107
|
+
- README.md
|
92
108
|
- Rakefile
|
93
109
|
- VERSION
|
94
110
|
- lib/mona.rb
|
@@ -120,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
136
|
version: '0'
|
121
137
|
segments:
|
122
138
|
- 0
|
123
|
-
hash:
|
139
|
+
hash: -1907804862958835511
|
124
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
141
|
none: false
|
126
142
|
requirements:
|
@@ -129,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
145
|
version: '0'
|
130
146
|
requirements: []
|
131
147
|
rubyforge_project:
|
132
|
-
rubygems_version: 1.8.
|
148
|
+
rubygems_version: 1.8.25
|
133
149
|
signing_key:
|
134
150
|
specification_version: 3
|
135
151
|
summary: talk 2ch
|
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
diff-lcs (1.1.3)
|
5
|
-
git (1.2.5)
|
6
|
-
httpclient (2.2.4)
|
7
|
-
jeweler (1.8.3)
|
8
|
-
bundler (~> 1.0)
|
9
|
-
git (>= 1.2.5)
|
10
|
-
rake
|
11
|
-
rdoc
|
12
|
-
json (1.6.5)
|
13
|
-
rake (0.9.2.2)
|
14
|
-
rdoc (3.12)
|
15
|
-
json (~> 1.4)
|
16
|
-
rspec (2.9.0)
|
17
|
-
rspec-core (~> 2.9.0)
|
18
|
-
rspec-expectations (~> 2.9.0)
|
19
|
-
rspec-mocks (~> 2.9.0)
|
20
|
-
rspec-core (2.9.0)
|
21
|
-
rspec-expectations (2.9.0)
|
22
|
-
diff-lcs (~> 1.1.3)
|
23
|
-
rspec-mocks (2.9.0)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
bundler
|
30
|
-
httpclient
|
31
|
-
jeweler
|
32
|
-
rspec
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= mona
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to mona
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
-
* Fork the project
|
10
|
-
* Start a feature/bugfix branch
|
11
|
-
* Commit and push until you are happy with your contribution
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2011 Yamada Masaki. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|