File tree 5 files changed +18
-13
lines changed
5 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,5 @@ source "https://rubygems.org"
3
3
4
4
git_source ( :github ) { |repo_name | "https://github.com/#{ repo_name } " }
5
5
6
- gem 'docbase'
7
6
gem 'esa'
8
7
gem 'pry'
Original file line number Diff line number Diff line change 2
2
remote: https://rubygems.org/
3
3
specs:
4
4
coderay (1.1.2 )
5
- docbase (0.1.2 )
6
- faraday (~> 0.9.2 )
7
- faraday_middleware (~> 0.10.0 )
8
- esa (1.13.0 )
5
+ esa (1.13.1 )
9
6
faraday (~> 0.9 )
10
7
faraday_middleware
11
8
mime-types (~> 2.6 )
12
9
multi_xml (~> 0.5.5 )
13
- faraday (0.9.2 )
10
+ faraday (0.13.1 )
14
11
multipart-post (>= 1.2 , < 3 )
15
- faraday_middleware (0.10.1 )
12
+ faraday_middleware (0.12.2 )
16
13
faraday (>= 0.7.4 , < 1.0 )
17
14
method_source (0.9.0 )
18
15
mime-types (2.99.3 )
@@ -26,7 +23,6 @@ PLATFORMS
26
23
ruby
27
24
28
25
DEPENDENCIES
29
- docbase
30
26
esa
31
27
pry
32
28
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ DocBaseからesa.ioへのインポートスクリプトのサンプルです
13
13
14
14
## スクリプトの用意
15
15
16
+ ※ スクリプトの作成・動作確認はRuby2.4.1で行っております
17
+
16
18
```
17
19
$ git clone https://github.com/fukayatsu/d2e.git
18
20
$ bundle install
@@ -26,6 +28,8 @@ $ cp config.sample.yml config.yml
26
28
- ` config.yml ` にAPIトークンや設定を記述します
27
29
- ` users.yml ` にdocbase上のユーザー名とesa上のユーザー名の紐付けを記述します
28
30
- 必要に応じてimporter.rbの内容を変更します。
31
+ - docbase上のデータをesa上のデータに変更する部分を主に調整していただくと良さそうです。
32
+ - => https://github.com/fukayatsu/d2e/blob/master/lib/converter.rb
29
33
30
34
## スクリプトの動作確認(Dry Run)
31
35
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ def post_params(content)
29
29
end
30
30
31
31
def comments_params ( comment_content )
32
+ # NOTE: DocBaseのJSONエクスポート機能にコメントが暗号化されたまま出力される不備があり、
33
+ # 問い合わせた結果修正待ちの状態
32
34
body_md = <<~EOT
33
35
created_at: #{ comment_content [ 'created_at' ] }
34
36
user_id: #{ comment_content [ 'user_id' ] }
@@ -39,7 +41,7 @@ def comments_params(comment_content)
39
41
40
42
{
41
43
body_md : body_md ,
42
- # user: screen_name_for([comment)content[ 'user']['name'] ])
44
+ user : screen_name_for ( comment_content [ 'user' ] [ 'name' ] )
43
45
}
44
46
end
45
47
end
Original file line number Diff line number Diff line change @@ -36,10 +36,14 @@ def import(dry_run: true, start_index: 0)
36
36
exit 1
37
37
end
38
38
39
- post_number = response . body [ 'number' ]
40
- params [ :comments ] . each do |comment_param |
41
- client . create_comment ( post_number , comment_param )
42
- end
39
+ # NOTE: DocBaseのJSONエクスポート機能にコメントが暗号化されたまま出力される不備があり、
40
+ # 問い合わせた結果修正待ちの状態
41
+ # このままインポート処理をしても読めないコメントがつくので、一旦コメントアウト
42
+
43
+ # post_number = response.body['number']
44
+ # params[:comments].each do |comment_param|
45
+ # client.create_comment(post_number, comment_param)
46
+ # end
43
47
end
44
48
end
45
49
You can’t perform that action at this time.
0 commit comments