backlink_zon 0.0.1 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/backlink_zon.rb +52 -17
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0e4aa0d589039bf117d67fdce8410805e6c090e7d7142f9b1303faf5e9eebc5
4
- data.tar.gz: 04e22e4a6aafbfd8577bd6ea4563ca9d862acce9aad0700b4daebe164f13aaad
3
+ metadata.gz: db63e71f1e682dad48646eba57eeb254e32cc95979b1e672d430c9d9d80065a8
4
+ data.tar.gz: 01ac91719959a590386120f7e8d1a6ded7610a6edcc84f5a401dbd28b8d85f84
5
5
  SHA512:
6
- metadata.gz: 4614140ddd940bc669b84d1d2e8fcf7098330112c16e63fe26568deee8266ec308f2968bac21490e53a4e0f92e1187707ac6b7236ecf48801216701ae9bac201
7
- data.tar.gz: 3066fb12656cf7a714309fd4ff4d2c89fd74b13013299b31ca1ee5107cd035f5665c5a43a12e6bb8421378c8643da434d994c6297455b60beced1b4cd152d69b
6
+ metadata.gz: eb4bc5a043084bd2953960440c75ff868e5bc81d1b4808951783c40321c153b6b1cef7b5d16c4d63ab67937e24cf01bda48581bcb73163b392519f057aa76d66
7
+ data.tar.gz: 93510928be69a908b5800aa83189b0f52dff77217312c571dce3936a2f16bdd1fcf7fc4d2a6599674b3cc705245e71f26769c6e4b916ebb65ac729e709a0a5aa
data/lib/backlink_zon.rb CHANGED
@@ -865,6 +865,11 @@ class Wordpress
865
865
  if @data['포스트설정']['내용과자동생성'].checked? == false and @data['포스트설정']['내용을자동생성'].checked? == false and @data['포스트설정']['막글삽입'].checked? == true
866
866
  snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
867
867
  enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
868
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
869
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
870
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
871
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
872
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
868
873
  last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
869
874
  content22 = last_text.split(' ')
870
875
  else
@@ -1254,6 +1259,11 @@ class Wordpress
1254
1259
  else
1255
1260
  snumber = @data['포스트설정']['막글삽입시작숫자'].text.to_s.to_i
1256
1261
  enumber = @data['포스트설정']['막글삽입끝숫자'].text.to_s.to_i
1262
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1263
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1264
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1265
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1266
+ @data['포스트설정']['막글'] = @data['포스트설정']['막글'].split(' ').shuffle.join(' ')
1257
1267
  last_text = @data['포스트설정']['막글'][0..rand(snumber..enumber)].split(' ').shuffle.join(' ')
1258
1268
 
1259
1269
  if @data['포스트설정']['막글키워드삽입'].checked?
@@ -2053,18 +2063,33 @@ class Wordpress
2053
2063
  }
2054
2064
  button('폴더째로불러오기'){
2055
2065
  stretchy false
2056
- on_clicked{
2057
- path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8').force_encoding('utf-8')
2058
- Dir.entries(@data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')).each do |file|
2059
- if file == '.' or file == '..'
2060
-
2061
- else
2062
- file_data = File.open(path+'/'+file,'r', :encoding => 'utf-8').read()
2063
- @data['내용설정']['내용'] << [false, file, file_data]
2066
+ on_clicked {
2067
+ path = @data['이미지설정']['폴더경로2'].text.to_s.force_encoding('utf-8')
2068
+
2069
+ # 경로가 유효한지 확인
2070
+ if Dir.exist?(path)
2071
+ Dir.entries(path).each do |file|
2072
+ if file == '.' or file == '..'
2073
+ next
2074
+ else
2075
+ begin
2076
+ # 파일을 열고 내용을 읽어서 추가
2077
+ file_data = File.open(path + '/' + file, 'r', encoding: 'utf-8').read
2078
+ @data['내용설정']['내용'] << [false, file, file_data]
2079
+ rescue => e
2080
+ # 파일을 열 수 없는 경우, 오류 메시지 출력
2081
+ puts "파일을 열 수 없습니다: #{file}, 오류: #{e.message}"
2082
+ end
2083
+ end
2064
2084
  end
2085
+
2086
+ # 내용 배열에서 마지막 빈 항목 제거
2087
+ @data['내용설정']['내용'] << []
2088
+ @data['내용설정']['내용'].pop
2089
+ else
2090
+ # 경로가 유효하지 않을 경우, 오류 메시지 출력
2091
+ puts "경로가 존재하지 않습니다: #{path}"
2065
2092
  end
2066
- @data['내용설정']['내용'] << []
2067
- @data['내용설정']['내용'].pop
2068
2093
  }
2069
2094
  }
2070
2095
  }
@@ -2156,17 +2181,27 @@ class Wordpress
2156
2181
  }
2157
2182
  button('폴더째로불러오기'){
2158
2183
  stretchy false
2159
- on_clicked{
2184
+ on_clicked {
2160
2185
  path = @data['이미지설정']['폴더경로'].text.to_s.force_encoding('utf-8')
2161
- Dir.entries(@data['이미지설정']['폴더경로'].text.to_s).each do |file|
2162
- if file == '.' or file == '..'
2163
2186
 
2164
- else
2165
- @data['이미지설정']['이미지'] << [false, file, path+"\\"+file.force_encoding('utf-8')]
2187
+ # 경로가 유효한지 확인
2188
+ if Dir.exist?(path)
2189
+ Dir.entries(path).each do |file|
2190
+ if file == '.' or file == '..'
2191
+ next
2192
+ else
2193
+ # 폴더 내의 파일을 이미지 리스트에 추가
2194
+ @data['이미지설정']['이미지'] << [false, file, path + "\\" + file.force_encoding('utf-8')]
2195
+ end
2166
2196
  end
2197
+
2198
+ # 마지막 빈 항목 추가 후 제거 (원래 로직에 맞춰)
2199
+ @data['이미지설정']['이미지'] << []
2200
+ @data['이미지설정']['이미지'].pop
2201
+ else
2202
+ # 경로가 존재하지 않으면 경고 메시지 출력
2203
+ puts "경로가 존재하지 않습니다: #{path}"
2167
2204
  end
2168
- @data['이미지설정']['이미지'] << []
2169
- @data['이미지설정']['이미지'].pop
2170
2205
  }
2171
2206
  }
2172
2207
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backlink_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-22 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: File to Clipboard gem
14
14
  email: rnjstnswp123@naver.com