hiiro 0.1.246 → 0.1.248

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: 3bfe4b9c356a502d288415cb04d05d63eaa5ba590e5cd65a6146ae9c538d4d63
4
- data.tar.gz: 12cf7e0c27e3f6c1dadb19400a930f340b4c927eccf056f2d153f134b6477fe2
3
+ metadata.gz: a1d9359776e9e191a52cf66894d68c9479b65ac7ee158d8431827cbb798491c2
4
+ data.tar.gz: aac408e2d02c99e647f83f874f544bdb0faa4cb03f98fa84079c74cb6345ba69
5
5
  SHA512:
6
- metadata.gz: 5e73eadaf5b66a61f72baa404788a83fa513b15f2633ea2f8f0ae1955c792a6194b0e19f14a5f4b85d55a57696cfce103e0746be1276523bdfdf4849ace440a8
7
- data.tar.gz: e19abec87d466385cd3c01fbf75d21818b57f1f4f9688e9648e70bc8a0a2da871d6b300916cc0316aea0a23fdfaf72f3bd48e1d29037b8589bb21af44580eee4
6
+ metadata.gz: f25d0b437741af5e30d8bc9fb5a366a99f569695d9d251638d17413b08e4be989d159532135b87817b4e490fc9d28add036ac029b88e7cd8b70feeacc562c25c
7
+ data.tar.gz: cb7ce0fe3ebccd1fb8f78ac077f17411e6045f8b64ead13b99efa775dc5577b62cf87b11d24bdcc85cc483bff3385db062b4f0dbe991eb194e66f6e83667f366
data/bin/h-branch CHANGED
@@ -158,15 +158,12 @@ Hiiro.run(*ARGV) do
158
158
  branches = git.branches(sort_by: 'authordate', ignore_case: true)
159
159
 
160
160
  if opts.edit
161
- branch_lines = branches.map { |b| "- #{b}" }
161
+ branch_lines = branches.map { |b| "#{b}:" }
162
162
  yaml_content = <<~YAML
163
163
  # Select branches to tag and list the tags to apply.
164
164
  # All listed branches will receive all listed tags.
165
165
 
166
- branches:
167
- #{branch_lines.join("\n")}
168
-
169
- tags:
166
+ #{branch_lines.join("\n -\n")}
170
167
  -
171
168
  YAML
172
169
 
@@ -184,23 +181,15 @@ Hiiro.run(*ARGV) do
184
181
  next
185
182
  end
186
183
 
187
- selected = Array(parsed['branches']).map(&:to_s).reject(&:empty?)
188
- new_tags = Array(parsed['tags']).map(&:to_s).reject(&:empty?)
189
-
190
- if selected.empty? || new_tags.empty?
191
- puts "Aborted: need at least one branch and one tag"
192
- next
193
- end
194
-
195
- selected.each do |b|
196
- tag_store.add(b, *new_tags)
197
- puts "Tagged #{b} with: #{new_tags.join(', ')}"
184
+ parsed.each do |branch, tags|
185
+ tag_store.add(branch, *tags)
186
+ puts "Tagged #{branch} with: #{tags.join(', ')}"
198
187
  end
199
188
  else
200
189
  branch = opts.args[0] || git.branch
201
190
  tag_names = opts.args[1..]
202
191
 
203
- if tag_names.empty?
192
+ if tag_names&.count.to_i == 0
204
193
  puts "Usage: h branch tag [branch] <tag> [tag2 ...]"
205
194
  puts " h branch tag -e (bulk edit mode)"
206
195
  next
data/exe/h CHANGED
@@ -6,7 +6,7 @@ require "fileutils"
6
6
  def update_hiiro(version=nil)
7
7
  ver = version || Hiiro::Rbenv.current_version
8
8
  puts
9
- puts "INSTALLING RUBY VERSION #{ver}"
9
+ puts "INSTALLING hiiro for RUBY #{ver}"
10
10
 
11
11
  Hiiro::Rbenv.install_gem('hiiro', version: ver)
12
12
  Hiiro::Rbenv.run('h', 'setup', version: ver)
@@ -0,0 +1,29 @@
1
+ class Hiiro
2
+ module AnyStruct
3
+ attr_reader :_args, :_raw_data
4
+
5
+ def initialize(*args, **raw_data)
6
+ @_args = args
7
+ @_raw_data = raw_data
8
+
9
+ hashes = args.select{|arg| arg.is_a?(Hash) }.each
10
+ init_data(*hashes, raw_data)
11
+ end
12
+
13
+ private def init_data(*hashes)
14
+ hashes.each do |h|
15
+ h.each do |key, value|
16
+ instance_variable_set(:"@#{key}", value)
17
+
18
+ define_singleton_method(key) do
19
+ instance_variable_get(:"@#{key}")
20
+ end
21
+
22
+ define_singleton_method(:"#{key}=") do |val|
23
+ instance_variable_set(:"@#{key}", val)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.246"
2
+ VERSION = "0.1.248"
3
3
  end
data/lib/hiiro.rb CHANGED
@@ -23,6 +23,7 @@ require_relative "hiiro/service_manager"
23
23
  require_relative "hiiro/runner_tool"
24
24
  require_relative "hiiro/app_files"
25
25
  require_relative "hiiro/rbenv"
26
+ require_relative "hiiro/any_struct"
26
27
 
27
28
  class String
28
29
  def underscore(camel_cased_word=self)
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.246
4
+ version: 0.1.248
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota
@@ -138,6 +138,7 @@ files:
138
138
  - h-tmux-plugins.tmux
139
139
  - hiiro.gemspec
140
140
  - lib/hiiro.rb
141
+ - lib/hiiro/any_struct.rb
141
142
  - lib/hiiro/app_files.rb
142
143
  - lib/hiiro/bins.rb
143
144
  - lib/hiiro/config.rb