baf 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/baf/cli.rb +9 -1
  3. data/lib/baf/version.rb +1 -1
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e012a75cf9bb4b0b0a480a05a226734bb99f5bda
4
- data.tar.gz: 0fec7f1fddc5e577b8b788c3fbd88b4d318ebcf9
3
+ metadata.gz: 7091d7bfbb0d1d56888a9210f7585e8f6b5d3cac
4
+ data.tar.gz: ef092a44d2b3596f9814c19250f087430ff172b9
5
5
  SHA512:
6
- metadata.gz: 6f2729161ce545abfa3c88ebaa6f599b56b6858824a11cf41b0b72e954e8deb50be03953f59e5e8490860c0ec10049346e6f0bdaf70c38d0450588e57821a95d
7
- data.tar.gz: d98e8d9e303aa0bd7cd4d1028cc7275839d88cdb9a39afb061d9d8c9b316cdec4fc44f836e37a643bc3b4ffcdc669fd2711c7a280970bd6d8dd39a1cae8c51b6
6
+ metadata.gz: 69f39a7ff0f4bf2e05d184bc5e3c840a0eb8edd9e86b00f74f310a82ff94b5089935a16e81b17a8b90364f17762c0bd7a98d6241cb0ac3656b986853734f8096
7
+ data.tar.gz: 319caad20f725d0baf5b67dec5cb19d723403a33aa10b85af647a57f57d64ef225b5ff90ead9bb8d66000fe32ed07ef69aaa42c022612a86f105e8c5f1b1c415
data/lib/baf/cli.rb CHANGED
@@ -15,7 +15,7 @@ module Baf
15
15
 
16
16
  class << self
17
17
  def run arguments, stdout: $stdout, stderr: $stderr
18
- cli = new Env.new(stdout), arguments
18
+ cli = new env_class.new(stdout), arguments
19
19
  cli.parse_arguments!
20
20
  cli.run
21
21
  rescue ArgumentError => e
@@ -26,6 +26,14 @@ module Baf
26
26
  stderr.puts e.backtrace.map { |l| ' %s' % l }
27
27
  exit EX_SOFTWARE
28
28
  end
29
+
30
+ private
31
+
32
+ def env_class
33
+ return Env unless parent_name = name =~ /::[^:]+\Z/ ? $` : nil
34
+ parent = Object.const_get(parent_name)
35
+ parent.const_defined?(:Env) ? parent.const_get(:Env) : Env
36
+ end
29
37
  end
30
38
 
31
39
  attr_reader :arguments, :env, :parser
data/lib/baf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Baf
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.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.4.0
4
+ version: 0.5.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-03-28 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: baf-testing
@@ -79,4 +79,3 @@ signing_key:
79
79
  specification_version: 4
80
80
  summary: Basic Application Framework
81
81
  test_files: []
82
- has_rdoc: