sosowa 0.5 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.5.1
2
+ * バグ修正
3
+
1
4
  ## 0.5
2
5
  * Sosowa::LogをArrayを継承したクラスに変更。Log.size等使えるようになりました
3
6
  * Sosowa::Log#latest_logを追加
data/lib/sosowa/parser.rb CHANGED
@@ -49,7 +49,6 @@ module Sosowa
49
49
  else
50
50
  title = tr.search(%{td[@class="title cell_title"] > a}).inner_html.to_s.toutf8.strip
51
51
  tags = tr.search(%{td[@class="title cell_title"] > a})[0].attributes["title"].value.split(" / ")
52
- #log = tr.search(%{td[@class="title cell_title"] > a})[0].attributes["href"].value.gsub(/log=(\d+)$/, '\1').to_i
53
52
  log = parse_absolute_log_number(page)
54
53
  key = tr.search(%{td[@class="title cell_title"] > a})[0].attributes["href"].value.gsub(/^.+key=(.+?)&.+$/, '\1').to_i
55
54
  author = tr.search(%{td[@class="cell_author"]}).inner_html.to_s.toutf8.strip
@@ -61,6 +60,7 @@ module Sosowa
61
60
  point = tr.search(%{td[@class="cell_point"]}).inner_html.to_s.toutf8.strip.to_i
62
61
  rate = tr.search(%{td[@class="cell_rate"]}).inner_html.to_s.toutf8.strip.to_f
63
62
  size = tr.search(%{td[@class="cell_size"]}).inner_html.to_s.toutf8.strip
63
+ url = tr.search(%{td[@class="title cell_title"] > a})[0].attributes["href"].value
64
64
  index = {
65
65
  :log => log,
66
66
  :key => key,
@@ -73,7 +73,8 @@ module Sosowa
73
73
  :point => point,
74
74
  :tags => tags,
75
75
  :rate => rate,
76
- :size => size
76
+ :size => size,
77
+ :url => URI.join(Sosowa::BASE_URL, "?mode=read&key=#{key}&log=#{log}").to_s
77
78
  }
78
79
  indexes << Index.new(index)
79
80
  end
data/lib/sosowa/scheme.rb CHANGED
@@ -114,7 +114,7 @@ module Sosowa
114
114
  end
115
115
 
116
116
  class Log < Array
117
- attr_reader :element
117
+ attr_accessor :element
118
118
  attr_reader :log
119
119
 
120
120
  def initialize(element, page, log=0)
@@ -1,3 +1,3 @@
1
1
  module Sosowa
2
- VERSION = "0.5"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sosowa
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-22 00:00:00.000000000Z
12
+ date: 2012-07-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
16
- requirement: &70250654256620 !ruby/object:Gem::Requirement
16
+ requirement: &70147252328280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70250654256620
24
+ version_requirements: *70147252328280
25
25
  description: Sosowa Parser for Ruby
26
26
  email:
27
27
  - oame@oameya.com