baf 0.8.0 → 0.9.0

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
  SHA1:
3
- metadata.gz: b3a700ddf69fa72662bedcd615650976088b1c99
4
- data.tar.gz: d5e015f25de39e5508709f2f0468afec6aef5ce0
3
+ metadata.gz: 5cd4714ae2ee6f378952487c36e712b724dfbf47
4
+ data.tar.gz: 3d9d1d78fb55f41e218076db17fd8d31616a6889
5
5
  SHA512:
6
- metadata.gz: 1dc17e3e690bbf5fc21d9e920b02a6ef202b6639d524b3fa40cc985ef46034f90eb3ce67dc8808094e3bca459f411a51ea4549f8579ce4d722a54edc486faf81
7
- data.tar.gz: f546d51c5fc72731f5c383494c57e49320fa90b746e525e345c548ca4e51fe2191a02fb45190317cb2163bf94d7a5e7a26d29c4bcc81f22208c30583c3b90c83
6
+ metadata.gz: 0ae8328b276044b956bf2ae313405eeb6b0ae94d219007abba5951aba3a13f69463c0b4e223f16d9b6ff9507ccb66da4d167f2b730842bf7788492470a73a84d
7
+ data.tar.gz: b6ec44109fef3836e7588396058bd648e6227bcfbaea41f8a13b3c12ca231acc398cb1059800b1598e48192bd5ddc4dc7475a4c8a20188d326483d70db15ee8c
data/lib/baf/cli.rb CHANGED
@@ -14,8 +14,8 @@ module Baf
14
14
  EX_SOFTWARE = 70
15
15
 
16
16
  class << self
17
- def run arguments, stdout: $stdout, stderr: $stderr
18
- cli = new env_class.new(output: stdout), arguments
17
+ def run arguments, stdin: $stdin, stdout: $stdout, stderr: $stderr
18
+ cli = new env_class.new(input: stdin, output: stdout), arguments
19
19
  cli.parse_arguments!
20
20
  cli.run
21
21
  rescue ArgumentError => e
data/lib/baf/env.rb CHANGED
@@ -3,9 +3,11 @@ require 'forwardable'
3
3
  module Baf
4
4
  class Env
5
5
  extend Forwardable
6
+ def_delegators :@input, :gets
6
7
  def_delegators :@output, :print, :puts
7
8
 
8
- def initialize output: $stdout
9
+ def initialize input: $input, output: $stdout
10
+ @input = input
9
11
  @output = output
10
12
  end
11
13
  end
data/lib/baf/option.rb CHANGED
@@ -42,7 +42,8 @@ module Baf
42
42
  def build_attrs short, long, arg_or_desc = nil, desc_or_block = nil, block = nil
43
43
  {
44
44
  short: short,
45
- long: long
45
+ long: long,
46
+ desc: arg_or_desc
46
47
  }.merge case desc_or_block
47
48
  when Proc
48
49
  {
data/lib/baf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Baf
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-13 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: baf-testing
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.5.1
79
+ rubygems_version: 2.6.8
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Basic Application Framework