hiiro 0.1.115 → 0.1.117
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 +4 -4
- data/lib/hiiro/queue.rb +9 -6
- data/lib/hiiro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7432f8cbb1d81b5046b5752b8e1e6d1cd023a1ac3d908d8374da9d0173c1bd93
|
|
4
|
+
data.tar.gz: 2f3de17c963f54fbdbaa6c1f2ad93416b8aafb2367264f174d1eb02e29637510
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c9b633aa825c1680593cdeb36179303815120cabd0136565d7f46e51b9b70f19460f4e3fe937cf4e5fa45d7d62f86dc9e18c8e30418a1c1c3858996c5e42ae4
|
|
7
|
+
data.tar.gz: 2bc3d50b7a0de0a738689104fe7935b75eafa1d826be2877b7fa6e6b4a9b73606216e3ec75c957f49f2d26eb22b7d1500740f45f389a53a652cdc99f0c0496fd
|
data/lib/hiiro/queue.rb
CHANGED
|
@@ -3,6 +3,7 @@ require 'fileutils'
|
|
|
3
3
|
require 'shellwords'
|
|
4
4
|
require 'time'
|
|
5
5
|
require 'front_matter_parser'
|
|
6
|
+
require 'tempfile'
|
|
6
7
|
|
|
7
8
|
class Hiiro
|
|
8
9
|
class Queue
|
|
@@ -235,8 +236,11 @@ class Hiiro
|
|
|
235
236
|
end
|
|
236
237
|
end
|
|
237
238
|
|
|
238
|
-
name = slugify(content.lines.
|
|
239
|
-
|
|
239
|
+
name = slugify(content.lines.drop_while { |l| l.strip.empty? || l.start_with?('---') || l.match?(/^\w+:/) }.first.to_s.strip)
|
|
240
|
+
binding.pry
|
|
241
|
+
if name.empty?
|
|
242
|
+
name = Time.now.strftime("%Y%m%d%H%M%S") + '-' + task_info[:task_name]
|
|
243
|
+
end
|
|
240
244
|
|
|
241
245
|
base_name = name
|
|
242
246
|
counter = 1
|
|
@@ -394,14 +398,13 @@ class Hiiro
|
|
|
394
398
|
args, flag_task = q.extract_task_flag(args)
|
|
395
399
|
ti = flag_task ? q.task_info_for(flag_task) : task_info
|
|
396
400
|
|
|
401
|
+
tmpfile = Tempfile.new(['hq-', '.md'])
|
|
402
|
+
prompt_file = tmpfile.path
|
|
397
403
|
if args.empty? && !$stdin.tty?
|
|
398
404
|
content = $stdin.read.strip
|
|
399
405
|
elsif args.any?
|
|
400
406
|
content = args.join(' ')
|
|
401
407
|
else
|
|
402
|
-
require 'tempfile'
|
|
403
|
-
tmpfile = Tempfile.new(['hq-', '.md'])
|
|
404
|
-
|
|
405
408
|
# Pre-fill with frontmatter template if task_info is available
|
|
406
409
|
if ti
|
|
407
410
|
fm_lines = ["---"]
|
|
@@ -424,7 +427,7 @@ class Hiiro
|
|
|
424
427
|
end
|
|
425
428
|
end
|
|
426
429
|
|
|
427
|
-
result = q.add_with_frontmatter(content
|
|
430
|
+
result = q.add_with_frontmatter(content)
|
|
428
431
|
if result
|
|
429
432
|
puts "Created: #{result[:path]}"
|
|
430
433
|
else
|
data/lib/hiiro/version.rb
CHANGED