easy_app_helper 1.0.5 → 1.0.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
  SHA1:
3
- metadata.gz: 7ecbc48dfd4704a478842023bb560f06c271bf05
4
- data.tar.gz: 903c92b33e0a73983a1be10634fb15c24e506d89
3
+ metadata.gz: 0584c63fd15bf478ad92e3ef47a46bbd1fa1605f
4
+ data.tar.gz: 3831a40b67f1e89390180a82310cf0bc0e414849
5
5
  SHA512:
6
- metadata.gz: cde655e0c910beddfd6708ab94072d766e09094dc0d8d24f0dfe887f56dee45e1277ca5d78321f7385cf6c2270eefc224e091d7fc868a0b251c7ad4dd0d475c9
7
- data.tar.gz: 86f57ebfa4d5046977f0e392b43239630e09189f1e79422c13dfae6bfd15abf0f8ee0d6b463cc556c75a8f977e3ccc0dd5ba6035b1de936861c53345551fa570
6
+ metadata.gz: 5adc276768419c22019d6efa06b3a6f904d3371fcf00a0d8f27b59577b9695249540255eebbf7975e48ab31447dffc2cdd8844755024c386dc3ebdc8150bf606
7
+ data.tar.gz: f154759d2d1a54d9d58157c17930af7284a9ef4a0aacc4322fa6817c499629dffe5ba2b52d7f5008e0f93ecfac7c9299085289fa6d9dc62d398f514b137f4f64
@@ -81,11 +81,13 @@ class EasyAppHelper::Core::Base
81
81
  raise "Incorrect usage" unless block_given?
82
82
  @slop_definition.separator build_separator(title)
83
83
  yield @slop_definition
84
+ ensure
85
+ sync!
84
86
  end
85
87
 
86
88
  # Sets the :command_line layer of internal_configs to the computed {#command_line_config}
87
89
  def load_config
88
- internal_configs[:command_line] = {content: command_line_config, source: 'Command line'}
90
+ sync!
89
91
  self
90
92
  end
91
93
 
@@ -131,6 +133,11 @@ class EasyAppHelper::Core::Base
131
133
 
132
134
  private
133
135
 
136
+ def sync!
137
+ internal_configs[:command_line] = {content: command_line_config, source: 'Command line'}
138
+ end
139
+
140
+
134
141
  # Performs actions related the very specific config parameters
135
142
  # @param [String] key The parameter to check
136
143
  # @param [Object] value The value it expects to be set to
@@ -6,5 +6,5 @@
6
6
  ################################################################################
7
7
 
8
8
  module EasyAppHelper
9
- EASY_APP_HELPER_VERSION = "1.0.5"
9
+ EASY_APP_HELPER_VERSION = "1.0.6"
10
10
  end
data/spec/config_spec.rb CHANGED
@@ -143,4 +143,16 @@ describe EasyAppHelper.config do
143
143
 
144
144
  end
145
145
 
146
+
147
+ context "When dealing with command line" do
148
+
149
+ it 'should have the same content using #command_line_config and #internal_configs[:command_line][:content]' do
150
+ subject.add_command_line_section('Scripts analysis') do |slop|
151
+ slop.on :p, :pipo, 'Directory path where SQL files are located.', argument: false
152
+ end
153
+ expect(subject.command_line_config).to eq subject.internal_configs[:command_line][:content]
154
+ end
155
+
156
+ end
157
+
146
158
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_app_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - L.Briais
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
11
+ date: 2013-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler