qiita_org 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/qiita_org.rb +8 -1
- data/lib/qiita_org/check_pc_os.rb +19 -0
- data/lib/qiita_org/post.rb +14 -3
- data/lib/qiita_org/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dd6537ee44be13e6ee3cec336a5d6eaae6aee8422c80493a4b0255f4a19dcf6
|
4
|
+
data.tar.gz: e029336e5fb678e8737db77bedfba19b1045f2c2d142159f8a6424e885744dd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a3a7b0ad871ab96a269c37504bfd500710a1c114ee6c43b9a68deff5bf4849bcd2ac76bb7f2852f3f4829d4e5c70242ba0442997f82f6e8674f75c968748e11
|
7
|
+
data.tar.gz: 3653eedd40df01ed28f68756a4c094cb2a71e5ba87ab11bd81e4a353dd11abc21b25c5273c6695561f14d0f9aa2948164fa80832259f76c248fd6815b1747d4c
|
data/Gemfile.lock
CHANGED
data/lib/qiita_org.rb
CHANGED
@@ -6,6 +6,7 @@ require "qiita_org/config"
|
|
6
6
|
require "qiita_org/get"
|
7
7
|
require "qiita_org/list"
|
8
8
|
require "qiita_org/get_template"
|
9
|
+
require "qiita_org/check_pc_os"
|
9
10
|
#require "qiita_org/qiita_org_thor"
|
10
11
|
|
11
12
|
module QiitaOrg
|
@@ -14,6 +15,11 @@ module QiitaOrg
|
|
14
15
|
# super(*argv)
|
15
16
|
# end
|
16
17
|
#
|
18
|
+
def initialize(*argv)
|
19
|
+
super(*argv)
|
20
|
+
@checkos = CheckPcOs.new
|
21
|
+
end
|
22
|
+
|
17
23
|
desc "say_hello", "say_hello"
|
18
24
|
|
19
25
|
def say_hello(*name)
|
@@ -24,10 +30,11 @@ module QiitaOrg
|
|
24
30
|
desc "post", "post to qiita from org"
|
25
31
|
|
26
32
|
def post(*argv)
|
33
|
+
os = @checkos.return_os()
|
27
34
|
p ["in qiita_org.rb", argv]
|
28
35
|
p file = argv[0] || "README.org"
|
29
36
|
p mode = argv[1] || "private"
|
30
|
-
qiita = QiitaPost.new(file, mode)
|
37
|
+
qiita = QiitaPost.new(file, mode, os)
|
31
38
|
begin
|
32
39
|
qiita.select_option(mode)
|
33
40
|
rescue RuntimeError => e
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CheckPcOs
|
2
|
+
def initialize()
|
3
|
+
@macos = system "sw_vers"
|
4
|
+
@winos = system "wmic.exe os get caption"
|
5
|
+
end
|
6
|
+
|
7
|
+
def return_os()
|
8
|
+
if @macos
|
9
|
+
return os = "mac"
|
10
|
+
elsif @winos
|
11
|
+
return os = "windows"
|
12
|
+
else
|
13
|
+
return nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
#p os = CheckPcOs.new.return_os()
|
19
|
+
|
data/lib/qiita_org/post.rb
CHANGED
@@ -7,9 +7,10 @@ require "colorize"
|
|
7
7
|
require "qiita_org/search_conf_path.rb"
|
8
8
|
|
9
9
|
class QiitaPost
|
10
|
-
def initialize(file, option)
|
10
|
+
def initialize(file, option, os)
|
11
11
|
@src = file
|
12
12
|
@option = (option == "qiita" || option == "open")? "public" : option
|
13
|
+
@os = os
|
13
14
|
search = SearchConfPath.new(Dir.pwd, Dir.home)
|
14
15
|
@conf_dir = search.search_conf_path()
|
15
16
|
p @conf_dir
|
@@ -137,6 +138,17 @@ class QiitaPost
|
|
137
138
|
end
|
138
139
|
end
|
139
140
|
|
141
|
+
# open qiita
|
142
|
+
def open_qiita()
|
143
|
+
if @os == "mac"
|
144
|
+
system "open #{@res_body["url"]}"
|
145
|
+
elsif @os == "windows"
|
146
|
+
system "explorer.exe #{@res_body["url"]}"
|
147
|
+
else
|
148
|
+
system "open #{@res_body["url"]}"
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
140
152
|
def run()
|
141
153
|
get_title_tags()
|
142
154
|
set_config()
|
@@ -147,8 +159,7 @@ class QiitaPost
|
|
147
159
|
qiita_post()
|
148
160
|
get_and_print_qiita_return()
|
149
161
|
|
150
|
-
|
151
|
-
system "open #{@res_body["url"]}"
|
162
|
+
open_qiita()
|
152
163
|
|
153
164
|
add_qiita_id_on_org()
|
154
165
|
end
|
data/lib/qiita_org/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiita_org
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Yamamoto
|
@@ -953,6 +953,7 @@ files:
|
|
953
953
|
- hoge.rb
|
954
954
|
- lib/qiita_org.rb
|
955
955
|
- lib/qiita_org/.qiita.conf
|
956
|
+
- lib/qiita_org/check_pc_os.rb
|
956
957
|
- lib/qiita_org/config.json
|
957
958
|
- lib/qiita_org/config.rb
|
958
959
|
- lib/qiita_org/get.rb
|