qiita_org 0.1.17 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a463880ab35d7cad18535215cd98fa1dfc34e25828d4dfe4a253278f7d0d3c30
4
- data.tar.gz: ccb99abcbdf89214c3e0fd600da6c1e3541b64f3576f481469a50928d62a995d
3
+ metadata.gz: e459de3b9e3d74b23c5c2942f2ee94aa98c462fb78576376a5873fd3259530f3
4
+ data.tar.gz: 06270f5b069a681b6f250c45edc662bd9d0c804c4b309d6b403f0c8688398470
5
5
  SHA512:
6
- metadata.gz: cb48fcced4575c6925f603a26bf4ed958d4719a3aaea774ee48d10532e71003a8f13ee737f7fb15ebbe2eaf5cc14036a6fbff94515d022f71820d213d67fa4e1
7
- data.tar.gz: 4d52108691f2c691e70fa31fa549a35df62106538d19845b48f732cbbde512069f5dc611b62b1c71a9b95ce697d935a76f07ba1d4028ff0fd009eb25baee1504
6
+ metadata.gz: 20958f4bbd4da7c62eb40c820a36d9e21ee01da766313bae57a687fa79a691e1c299976e66a1dc62f2c6716d013f63ca41b1d062a67fa6798d0dd1ebb6e28fc9
7
+ data.tar.gz: fb22b876db34b3ce2740864fbd8a20bd6cf3815eb49d727ca430f515074f6339ac43e208b8635081113ec7052cf196fcb74554b8d6285d22487d46ed2b96c2bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qiita_org (0.1.16)
4
+ qiita_org (0.1.20)
5
5
  colorize
6
6
  command_line (> 2.0.0)
7
7
  fileutils
@@ -11,6 +11,7 @@ require "qiita_org/get_template"
11
11
  require "qiita_org/check_pc_os"
12
12
  require "qiita_org/get_file_path"
13
13
  require "qiita_org/show_file_and_url"
14
+ require "qiita_org/decide_option"
14
15
  #require "qiita_org/qiita_org_thor"
15
16
 
16
17
  module QiitaOrg
@@ -38,7 +39,7 @@ module QiitaOrg
38
39
 
39
40
  p ["in qiita_org.rb", argv]
40
41
  p file = argv[0] || "README.org"
41
- p mode = argv[1] || "private"
42
+ p mode = argv[1] || DecideOption.new(file).decide_option()
42
43
  qiita = QiitaPost.new(file, mode, os)
43
44
  begin
44
45
  qiita.select_option(mode)
@@ -84,7 +85,7 @@ module QiitaOrg
84
85
  config.run
85
86
  end
86
87
 
87
- desc "get [qiita/teams] [記事のID]", "get qiita report"
88
+ desc "get [qiita/teams] [ITEM_ID]", "get qiita report"
88
89
 
89
90
  def get(*argv)
90
91
  p mode = argv[0] || "qiita"
@@ -0,0 +1,22 @@
1
+ class DecideOption
2
+ def initialize(src)
3
+ @src = src
4
+ end
5
+
6
+ def decide_option()
7
+ lines = File.readlines(@src)
8
+
9
+ lines.each do |line|
10
+ if line.match(/\#\+qiita_(.+): (.+)/)
11
+ option = line.match(/\#\+qiita_(.+): (.+)/)[1]
12
+ return option
13
+ end
14
+ end
15
+ option = "private"
16
+ return option
17
+ end
18
+ end
19
+
20
+ if __FILE__ == $0
21
+ DecideOption.new("test.org").decide_option()
22
+ end
@@ -40,11 +40,18 @@ class QiitaGet
40
40
  headers = { "Authorization" => "Bearer #{@access_token}",
41
41
  "Content-Type" => "application/json" }
42
42
 
43
- response = URI.open(
44
- "#{uri}",
45
- "Authorization" => "#{headers["Authorization"]}",
46
- )
47
- @items = JSON.parse(response.read)
43
+ begin
44
+ response = URI.open(
45
+ "#{uri}",
46
+ "Authorization" => "#{headers["Authorization"]}",
47
+ )
48
+ #raise "NOT FOUND: # {@get_id} report".red
49
+ rescue => e
50
+ puts "#{$!}".red
51
+ exit
52
+ else
53
+ @items = JSON.parse(response.read)
54
+ end
48
55
  end
49
56
 
50
57
  # select report
@@ -121,6 +128,7 @@ EOS
121
128
  # see massage and delete id.md
122
129
  def puts_massage_and_delete_md()
123
130
  puts "created #{@id}.org".green
131
+ puts "URL: #{@items["url"]}"
124
132
  system "rm -f #{@id}.md"
125
133
  end
126
134
 
@@ -165,6 +165,8 @@ class QiitaPost
165
165
  open_qiita()
166
166
 
167
167
  add_qiita_id_on_org()
168
+
169
+ system "rm #{@src.gsub(".org", ".md")}"
168
170
  end
169
171
  end
170
172
 
@@ -1,3 +1,3 @@
1
1
  module QiitaOrg
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.22"
3
3
  end
@@ -0,0 +1,15 @@
1
+ #+qiita_teams: bd41ced53b4b18701453
2
+ #+OPTIONS: ^:{}
3
+ #+STARTUP: indent nolineimages
4
+ #+TITLE: test
5
+ #+AUTHOR: Kenta Yamamoto
6
+ #+EMAIL: (concat "doi35077@kwansei.ac.jp")
7
+ #+LANGUAGE: jp
8
+ # +OPTIONS: H:4 toc:t num:2
9
+ #+OPTIONS: toc:nil
10
+ #+TAG: test
11
+ # +SETUPFILE: ~/.emacs.d/org-mode/theme-readtheorg.setup
12
+
13
+ ![Mac OS X-10.13.3](https://img.shields.io/badge/MacOSX-10.13.3-brightgreen) ![ruby-2.7.0p0](https://img.shields.io/badge/ruby-2.7.0p0-brightgreen)
14
+
15
+ fogefoge
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita_org
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Yamamoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -960,6 +960,7 @@ files:
960
960
  - lib/qiita_org/check_pc_os.rb
961
961
  - lib/qiita_org/config.json
962
962
  - lib/qiita_org/config.rb
963
+ - lib/qiita_org/decide_option.rb
963
964
  - lib/qiita_org/get.rb
964
965
  - lib/qiita_org/get_file_path.rb
965
966
  - lib/qiita_org/get_file_url.rb
@@ -976,10 +977,10 @@ files:
976
977
  - qiita_org.gemspec
977
978
  - tests/hoge.rb
978
979
  - tests/test.html
979
- - tests/test.md
980
980
  - tests/test.org
981
981
  - tests/test2.md
982
982
  - tests/test2.org
983
+ - tests/test3.org
983
984
  homepage: https://github.com/yamatoken/qiita_org
984
985
  licenses:
985
986
  - MIT
@@ -1,10 +0,0 @@
1
- \![Mac OS X-10.13.3](<https://img.shields.io/badge/MacOSX-10.13.3-brightgreen>) \![ruby-2.7.0p0](<https://img.shields.io/badge/ruby-2.7.0p0-brightgreen>)
2
-
3
- fogefoge
4
-
5
- [![img](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png)](file:///Users/kentayamamoto/Github/qiita_org/figs/fig1.png)
6
-
7
- ![img](../figs/fig2.png "example qiita template command")
8
-
9
- ![img](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/a3b2ab02-f903-f5d6-d8b9-5407e8db5a2a.png)
10
-