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 +4 -4
- data/exe/findyml +3 -11
- data/lib/findyml/version.rb +1 -1
- data/lib/findyml.rb +14 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52cf98578abdfc460a7dd2983b91aa5d8121de3f43846033112ab7da4151f3d3
|
4
|
+
data.tar.gz: 367437456f64b85060592b5deab077375ad39b7915d4e99cdf0e9d7f61692a8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
require "findyml"
|
4
|
+
$0 = "findyml"
|
6
5
|
|
7
|
-
|
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)
|
data/lib/findyml/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
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:
|