tdiary-contrib 5.0.1 → 5.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45164104afb789350f27df675a67c5883a5c9c24
4
- data.tar.gz: 693b82c14081911639444d97110b253253fecc65
3
+ metadata.gz: df4146a150a383f7921897e986ff0f4290deff9e
4
+ data.tar.gz: 6f26f9bf9908f34579a6c21a36303ed74197105f
5
5
  SHA512:
6
- metadata.gz: da67a8625a789a06f07cdda68dbbb952cbae06be3ee3741caaeb6a43e4a69589359058d092b6caf8e5b42df73dbefef50fc8fb6e2f9d80fcccb27436721c754f
7
- data.tar.gz: 817c91cba026b251ecb6c10bda31c99297ebf5ea011092686630f749a78be3cc4d387b23c27ae8869167ffe06d689ff9f86822a105ea5f3fabce753652b81647
6
+ metadata.gz: a55826575cd0c91657388f0ea94614bb87e14d83dfe4cdd1ed0ba52664665a9c51fe62a35e8081e79851aab081d0ee697405b76a3bfb4c71584bf5a2ab8f189a
7
+ data.tar.gz: 33f849299b5e56e2f9ea699cc10607c3f72a16465850750e94d4aece07891ae15f0d7b3183d34bd67e695b00f81a2e9aab963052934a48051a5cd3eb25196cd5
@@ -7,7 +7,10 @@ GooglePlayのアプリ情報の表示及びリンクの生成を行います。
7
7
  ・market_botの導入
8
8
  GooglePlayのパーサとして、market_botを使用しています。
9
9
  通常は以下のコマンドで導入できます。
10
- #gem install market_bot
10
+ #gem install market_bot -v 1.0.4
11
+
12
+ Rack環境の場合、Gemfile.localに以下を記述し、bundle installを実行してください。
13
+ gem 'market_bot','=1.0.4'
11
14
 
12
15
  ・Pluginのインストール
13
16
  playstore.rbを適切な場所に配置してください。多言語用リソースは存在しません。
@@ -1,5 +1,5 @@
1
1
  module TDiary
2
2
  class Contrib
3
- VERSION = "5.0.1"
3
+ VERSION = "5.0.2"
4
4
  end
5
5
  end
data/plugin/playstore.rb CHANGED
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  require 'date'
20
20
 
21
- class PlayStore < MarketBot::Android::App
21
+ class PlayStore < MarketBot::Play::App
22
22
  def initialize(app_id,option={})
23
23
  super(app_id,option)
24
24
  end
@@ -30,7 +30,6 @@ class PlayStore < MarketBot::Android::App
30
30
  end
31
31
 
32
32
  def load(path)
33
- html = nil
34
33
  File.open(path,"rb"){ |f|
35
34
  begin
36
35
  html = Marshal.restore(f)
@@ -40,7 +39,7 @@ class PlayStore < MarketBot::Android::App
40
39
  }
41
40
  unless html.nil?
42
41
  result = PlayStore.parse(html)
43
- update_callback(result)
42
+ response_handler(html)
44
43
  end
45
44
  return html
46
45
  end
@@ -52,7 +51,8 @@ end
52
51
 
53
52
 
54
53
  def playstore_load_cache(app)
55
- path="#{@cache_path}/playstore/#{app.app_id}"
54
+ return nil
55
+ path="#{@cache_path}/playstore/#{app.package}"
56
56
  begin
57
57
  stat = File::Stat.new(path)
58
58
  rescue Errno::ENOENT
@@ -64,7 +64,7 @@ def playstore_load_cache(app)
64
64
  end
65
65
 
66
66
  def playstore_save_cache(app)
67
- path="#{@cache_path}/playstore/#{app.app_id}"
67
+ path="#{@cache_path}/playstore/#{app.package}"
68
68
  dir = File.dirname(path)
69
69
  Dir.mkdir(dir) unless File.directory?(dir)
70
70
 
@@ -76,7 +76,7 @@ def playstore_main(app_id)
76
76
  return :invalid
77
77
  end
78
78
 
79
- app = PlayStore.new(app_id)
79
+ app = PlayStore.new(app_id,lang:'ja')
80
80
  if playstore_load_cache(app).nil?
81
81
  begin
82
82
  app.update
@@ -87,7 +87,7 @@ def playstore_main(app_id)
87
87
  else
88
88
  save = false
89
89
  end
90
- if app.nil? || app.error
90
+ if app.nil?
91
91
  return :notfound
92
92
  else
93
93
  playstore_save_cache(app) if save
@@ -109,14 +109,14 @@ def playstore(app_id)
109
109
  else
110
110
  <<-HTML
111
111
  <div class="playstore-frame">
112
- <a href="#{app.market_url}">
113
- <img class="playstore-icon" src="#{app.banner_icon_url}" title="#{app.title}" >
112
+ <a href="#{app.store_url}">
113
+ <img class="playstore-icon" src="#{app.cover_image_url}" title="#{app.title}" >
114
114
  </a>
115
115
  <ul class="playstore-detail">
116
- <li><a href="#{app.market_url}">#{app.title}</a></li>
116
+ <li><a href="#{app.store_url}">#{app.title}</a></li>
117
117
  <li>カテゴリ:#{app.category}</li>
118
118
  <li>価格:#{app.price.eql?("0")?"無料":app.price}</li>
119
- <li><a href="#{app.market_url}">GooglePlayで詳細をみる</a></li>
119
+ <li><a href="#{app.store_url}">GooglePlayで詳細をみる</a></li>
120
120
  </ul>
121
121
  </div>
122
122
  HTML
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdiary-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tDiary contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-29 00:00:00.000000000 Z
11
+ date: 2016-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tdiary
@@ -503,7 +503,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
503
503
  version: '0'
504
504
  requirements: []
505
505
  rubyforge_project:
506
- rubygems_version: 2.6.4
506
+ rubygems_version: 2.5.1
507
507
  signing_key:
508
508
  specification_version: 4
509
509
  summary: tDiary contributions package