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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfa152be618514c41e457bc388e16dee713a2c1493d51c0644291dd7364de3ec
4
- data.tar.gz: 1c9fb76cbe0980f8c974f8d445aa866475676d1e4c515591869db4ba7f680c6b
3
+ metadata.gz: 7432f8cbb1d81b5046b5752b8e1e6d1cd023a1ac3d908d8374da9d0173c1bd93
4
+ data.tar.gz: 2f3de17c963f54fbdbaa6c1f2ad93416b8aafb2367264f174d1eb02e29637510
5
5
  SHA512:
6
- metadata.gz: ddb9df84a84bc23cde535cfdc86df63a39feeea05799843f39a9f575afa4d98689d50e46c603cf4cedaeb9b81da0bc89da9710a6f6f9ea7ddb62fcb7a43fb438
7
- data.tar.gz: f4139d409c8c9aca1d3c3e66e17d2e5ececbfdee59ee3073ddd7f5bb2473c1e3486c5c3dabae112324679eaab4e799aa5e8764350ae2c2d7458bc2fa8d3e451a
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.reject { |l| l.start_with?('---') || l.match?(/^\w+:/) }.first.to_s.strip)
239
- return nil if name.empty?
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, task_info: ti)
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
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.115"
2
+ VERSION = "0.1.117"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.115
4
+ version: 0.1.117
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota