findyml 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24167ff7d45f6430782e0a071dde14d82c123152a4fc80015de958636a09af66
4
- data.tar.gz: cbd75aa4977eda3ee732361e41af67383cfe34dda933390e2dce3d4ebd44a92d
3
+ metadata.gz: 52cf98578abdfc460a7dd2983b91aa5d8121de3f43846033112ab7da4151f3d3
4
+ data.tar.gz: 367437456f64b85060592b5deab077375ad39b7915d4e99cdf0e9d7f61692a8c
5
5
  SHA512:
6
- metadata.gz: 80fc4923eafba7bce45ace925a9c3f1becd25cbe1da00b7c219a1f90fb50074eb93642a7b260b18c7eb7c803058d8026b4b552ec196de8b68c6bd32a028fbe1d
7
- data.tar.gz: 95c2d6dedf85c7313f5f9e7871740f83b1265e763eb2bc494c66231bf37dca5ce10935ab2e0dc4e08cb65bb2f6da6a8e7774c8568289dfd54e23b94f289e19be
6
+ metadata.gz: c4d8d89095e22b5c066f291b45884b9990fe025edf8a41699b266837026f773d06c8de64ed823c244b8afe64ca37439daac5b4eb6741ae1f9b07c8794600cb86
7
+ data.tar.gz: 2926cd54e783a5bb7d978da7dfc08f878d497998e3d1fd6ad9acad5f1c33434c102f90a6d7062652bc3b1457f24938a3160e7580fb5ca9e76bb3043cd1733632
data/exe/findyml CHANGED
@@ -1,17 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "bundler/setup"
5
- require "findyml"
4
+ $0 = "findyml"
6
5
 
7
- dir, query = case ARGV.size
8
- when 1
9
- [Dir.pwd, ARGV.last]
10
- when 2
11
- ARGV
12
- else
13
- puts "Usage: #{$0} [path] query"
14
- exit(1)
15
- end
6
+ require "findyml"
16
7
 
8
+ dir, query = Findyml.parse_options
17
9
  Findyml.find_and_print(query, dir)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Findyml
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/findyml.rb CHANGED
@@ -84,6 +84,8 @@ module Findyml
84
84
  end
85
85
 
86
86
  def extract(&block)
87
+ return unless @yaml
88
+
87
89
  all_nodes = @yaml.children.map { construct_nodes(_1) }
88
90
 
89
91
  all_nodes.each do |nodes, _|
@@ -146,6 +148,18 @@ module Findyml
146
148
  end
147
149
  end
148
150
 
151
+ def self.parse_options
152
+ case ARGV.size
153
+ when 1
154
+ [Dir.pwd, ARGV.last]
155
+ when 2
156
+ ARGV
157
+ else
158
+ puts "Usage: #{$0} [path] query"
159
+ exit(1)
160
+ end
161
+ end
162
+
149
163
  def self.find(query_string, dir = Dir.pwd)
150
164
  return to_enum(:find, query_string, dir) unless block_given?
151
165
 
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: findyml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danielle Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-21 00:00:00.000000000 Z
11
+ date: 2023-10-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Even wondered where that i18n locale was defined but your project is
13
+ description: Ever wondered where that i18n locale was defined but your project is
14
14
  massive and legacy and has multiple competing inconsistent standards of organisation?
15
15
  Let findyml ease your pain by finding that key for you!
16
16
  email: