hiiro 0.1.22 → 0.1.24
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/history.rb +4 -3
- data/lib/hiiro/version.rb +1 -1
- data/lib/hiiro.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: 6a46d6691bc65a663bdbcb63dfe0fe6643572ee377c5f1448bbd34a5e9efe3f1
|
|
4
|
+
data.tar.gz: 2edd95e23a40d0910b88c0844e70f7839da22dbce3f86c2f2518b238abf68706
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d402b962e9e2c51870a586a8f83ea0209b43109b92135d468ac33336d15e37e882b564a1848e1c8efcf0fd6acf1739d6b356a8cf06bfc7069ea1f251457f280
|
|
7
|
+
data.tar.gz: df17f16075ceff456b6ee512424b962f207a25b72a1eaa2867fabbccaf91a64a9c015bdb5706f0a37bce3882d7c6ec927e0325984bfebc5828f6810a03562092
|
data/lib/hiiro/history.rb
CHANGED
|
@@ -7,7 +7,7 @@ class Hiiro
|
|
|
7
7
|
HISTORY_FILE = File.join(Dir.home, '.config/hiiro/history.yml')
|
|
8
8
|
|
|
9
9
|
class Entry
|
|
10
|
-
attr_reader :id, :timestamp, :source, :cmd, :description
|
|
10
|
+
attr_reader :id, :timestamp, :source, :cmd, :description, :pwd
|
|
11
11
|
attr_reader :tmux_session, :tmux_window, :tmux_pane
|
|
12
12
|
attr_reader :git_branch, :git_worktree
|
|
13
13
|
attr_reader :task, :subtask
|
|
@@ -18,6 +18,7 @@ class Hiiro
|
|
|
18
18
|
@timestamp = data['timestamp']
|
|
19
19
|
@source = data['source']
|
|
20
20
|
@cmd = data['cmd']
|
|
21
|
+
@pwd = data['pwd'] || Dir.pwd
|
|
21
22
|
@description = data['description']
|
|
22
23
|
@tmux_session = data['tmux_session']
|
|
23
24
|
@tmux_window = data['tmux_window']
|
|
@@ -34,6 +35,7 @@ class Hiiro
|
|
|
34
35
|
'timestamp' => timestamp,
|
|
35
36
|
'source' => source,
|
|
36
37
|
'cmd' => cmd,
|
|
38
|
+
'pwd' => pwd,
|
|
37
39
|
'description' => description,
|
|
38
40
|
'tmux_session' => tmux_session,
|
|
39
41
|
'tmux_window' => tmux_window,
|
|
@@ -46,7 +48,7 @@ class Hiiro
|
|
|
46
48
|
end
|
|
47
49
|
|
|
48
50
|
def short_line(index)
|
|
49
|
-
time_str = Time.parse(timestamp).strftime('%Y-%m-%d %H:%M')
|
|
51
|
+
time_str = timestamp ? Time.parse(timestamp).strftime('%Y-%m-%d %H:%M') : Time.now.iso8601
|
|
50
52
|
desc = description || cmd || '(no description)'
|
|
51
53
|
desc = desc[0..60] + '...' if desc.length > 63
|
|
52
54
|
[
|
|
@@ -181,7 +183,6 @@ class Hiiro
|
|
|
181
183
|
end
|
|
182
184
|
|
|
183
185
|
def add(description: nil, cmd: nil, source: nil, task: nil, subtask: nil, pwd: Dir.pwd)
|
|
184
|
-
cmd ||=
|
|
185
186
|
entry_data = {
|
|
186
187
|
'id' => generate_id,
|
|
187
188
|
'timestamp' => Time.now.iso8601,
|
data/lib/hiiro/version.rb
CHANGED
data/lib/hiiro.rb
CHANGED