tabry 0.2.5 → 0.2.6

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: c824df1e6a6631ef74c0d450831fbb665dec5f95fd9ea204b539ed1042225e5b
4
- data.tar.gz: c4c88089e043818c58e38ea126a2eb40b9710e0e7b3204aa615c89e6cace9ca5
3
+ metadata.gz: 7733876522770c3037de86e663ddadd59cf1a86b2ddb1bc993934789e5b8d34a
4
+ data.tar.gz: 383673dc7f2ba427e70808fc08484829db28cd5b2c263b21ed1a4971ee2427be
5
5
  SHA512:
6
- metadata.gz: c3a91bd4f7f95c2ec10fda6747329c66b7d276cf17e1852af2a3c32cb314914598fee712e88a429b094bf6b5ca8e2269d13c64af51433e2eba54384470c5ec52
7
- data.tar.gz: 989588444d36596bf18310f35428b545d2489935469ad0fe58069f53f7f7e8bb19627720ada337c2f5b2b4917cb53b9471a0c00eb86e16f6e7b6b48fbef0c424
6
+ metadata.gz: e3f75ff33d1b2d3c9e959debc066a672687b906a64a7b414ed57091878cb4ede0ae815d18c563ea619be7ca148bc51c2a571d9cb4075ff4a10ca0c05e64a97cd
7
+ data.tar.gz: 29d82a30fe87411c11c97287bd6af5f1fd279bf2f1a1e44890273c7844d6dd5e0f35916bf4756f2c9fbfbc84f9e6a206862f8d73addbae14cce90666b2b16f89
@@ -19,6 +19,10 @@ module Tabry
19
19
  nil
20
20
  end
21
21
 
22
+ def to_hash
23
+ @hash
24
+ end
25
+
22
26
  def slice(*keys)
23
27
  [keys].flatten.each_with_object({}) do |key, result_hash|
24
28
  result_hash[key] = self[key]
data/lib/tabry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tabry
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -7,4 +7,4 @@ SimpleCov.start do
7
7
  add_filter "spec"
8
8
  track_files "lib/**/*.rb"
9
9
  end
10
- SimpleCov.minimum_coverage(80)
10
+ SimpleCov.minimum_coverage(83)
@@ -0,0 +1,39 @@
1
+ require_relative '../../../lib/tabry/replty/builder'
2
+ require_relative '../../../lib/tabry/replty/base'
3
+ require_relative '../../../lib/tabry/config_builder'
4
+
5
+ module Tabry
6
+ module Specs
7
+ class TestRepl < Tabry::Replty::Base
8
+ def log
9
+ @log ||= []
10
+ end
11
+
12
+ def foo
13
+ log << [:foo]
14
+ end
15
+
16
+ def bar
17
+ log << [:bar, args.waz, flags.ok]
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ describe Tabry::Replty::Builder do
24
+ it 'calls the repl method for the subcommand' do
25
+ conf = Tabry::ConfigBuilder.build do |c|
26
+ sub :foo
27
+ sub :bar do
28
+ arg :waz
29
+ flag :ok
30
+ end
31
+ end
32
+
33
+ repl = Tabry::Specs::TestRepl.new
34
+ builder = Tabry::Replty::Builder.new(conf, repl)
35
+ expect(builder).to receive(:readline).and_return("bar waz --ok")
36
+ expect(builder).to receive(:readline).and_return(nil)
37
+ builder.run
38
+ end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Battaglia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry-byebug
@@ -203,6 +203,7 @@ files:
203
203
  - spec/tabry/models/shell_option_spec.rb
204
204
  - spec/tabry/models/subs_list_spec.rb
205
205
  - spec/tabry/options_finder_spec.rb
206
+ - spec/tabry/replty/builder_spec.rb
206
207
  - spec/tabry/result_spec.rb
207
208
  - spec/tabry/runner_spec.rb
208
209
  - spec/tabry/shell_tokenizer_spec.rb