script_executor 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,22 +13,6 @@
13
13
  <content url="file://$MODULE_DIR$" />
14
14
  <orderEntry type="inheritedJdk" />
15
15
  <orderEntry type="sourceFolder" forTests="false" />
16
- <orderEntry type="library" scope="PROVIDED" name="archive-tar-minitar (v0.5.2, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.2.3, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="file_utils (v1.0.6, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="gemcutter (v0.7.1, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="gemspec_deps_gen (v1.0.5, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="highline (v1.6.15, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="metaclass (v0.0.1, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="mocha (v0.13.1, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="net-ssh (v2.6.2, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="rake (v10.0.3, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="rspec (v2.12.0, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.12.2, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.12.1, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.12.0, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="ruby_core_source (v0.1.5, RVM: ruby-1.9.3-p374 [script_executor]) [gem]" level="application" />
32
16
  </component>
33
17
  </module>
34
18
 
data/.idea/workspace.xml CHANGED
@@ -2,20 +2,17 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="6995392e-f204-4557-be32-fd20f300d877" name="Default" comment="">
5
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/script_executor/output_buffer.rb" />
5
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.rvmrc" afterPath="$PROJECT_DIR$/.rvmrc" />
6
6
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/CHANGES" afterPath="$PROJECT_DIR$/CHANGES" />
7
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
8
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
9
7
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/script_executor/executable.rb" afterPath="$PROJECT_DIR$/lib/script_executor/executable.rb" />
10
8
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/executable_spec.rb" afterPath="$PROJECT_DIR$/spec/executable_spec.rb" />
11
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
12
9
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/script_executor.iml" afterPath="$PROJECT_DIR$/.idea/script_executor.iml" />
13
10
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/script_executor/version.rb" afterPath="$PROJECT_DIR$/lib/script_executor/version.rb" />
14
11
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
15
12
  </list>
16
13
  <ignored path="script_executor.iws" />
17
14
  <ignored path=".idea/workspace.xml" />
18
- <file path="/Dummy.txt" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360087073170" ignored="false" />
15
+ <file path="/Dummy.txt" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360162850018" ignored="false" />
19
16
  <file path="/Gemfile" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355437179953" ignored="false" />
20
17
  <file path="/script_executor_spec.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355762516678" ignored="false" />
21
18
  <file path="$PROJECT_DIR$/../../ui/src/thor/oracle_client.thor" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355417447890" ignored="false" />
@@ -68,7 +65,7 @@
68
65
  <file path="$PROJECT_DIR$/../../ui/src/Gemfile" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355507081269" ignored="false" />
69
66
  <file path="/fragment.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355433500821" ignored="false" />
70
67
  <file path="/script_executor.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355762503911" ignored="false" />
71
- <file path="/CHANGES" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360095742407" ignored="false" />
68
+ <file path="/CHANGES" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360163657090" ignored="false" />
72
69
  <file path="$USER_HOME$/.rvm/gems/ruby-1.8.7-p371@r21/gems/rake-0.8.7/lib/rake.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355156976039" ignored="false" />
73
70
  <file path="$USER_HOME$/.rvm/gems/ruby-1.8.7-p371@r21/gems/file_utils-1.0.5/lib/file_utils/file_utils.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355082830869" ignored="false" />
74
71
  <file path="$PROJECT_DIR$/../../ui/src/bin/install_oracle_client.sh" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355179739279" ignored="false" />
@@ -120,7 +117,7 @@
120
117
  <file path="$PROJECT_DIR$/../../ui/src/config/dbauth/proteusui-billing-dev" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355236991453" ignored="false" />
121
118
  <file path="$PROJECT_DIR$/../../ui/src/config/dbauthfiles/proteusui-billing-dev" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355244789972" ignored="false" />
122
119
  <file path="$PROJECT_DIR$/../../ui/src/app/domain/partner.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355762106018" ignored="false" />
123
- <file path="/executable.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360095536136" ignored="false" />
120
+ <file path="/executable.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360163580731" ignored="false" />
124
121
  <file path="$PROJECT_DIR$/../../ui/src/thor/tomcat.thor" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355410403079" ignored="false" />
125
122
  <file path="/tomcat.thor" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355410403079" ignored="false" />
126
123
  <file path="$PROJECT_DIR$/../../ui/src/thor/ssh.thor" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1355767370410" ignored="false" />
@@ -186,6 +183,7 @@
186
183
  <file path="/media_adapter_spec.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360086911017" ignored="false" />
187
184
  <file path="$PROJECT_DIR$/../etv/spec/resource_accessor_spec.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360086178796" ignored="false" />
188
185
  <file path="/capturer.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360095357175" ignored="false" />
186
+ <file path="/executable_spec.rb" changelist="6995392e-f204-4557-be32-fd20f300d877" time="1360163629582" ignored="false" />
189
187
  <option name="TRACKING_ENABLED" value="true" />
190
188
  <option name="SHOW_DIALOG" value="false" />
191
189
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -205,7 +203,7 @@
205
203
  <file leaf-file-name="executable_spec.rb" pinned="false" current="false" current-in-tab="false">
206
204
  <entry file="file://$PROJECT_DIR$/spec/executable_spec.rb">
207
205
  <provider selected="true" editor-type-id="text-editor">
208
- <state line="34" column="131" selection-start="768" selection-end="768" vertical-scroll-proportion="0.0">
206
+ <state line="88" column="127" selection-start="2079" selection-end="2079" vertical-scroll-proportion="0.0">
209
207
  <folding />
210
208
  </state>
211
209
  </provider>
@@ -214,7 +212,7 @@
214
212
  <file leaf-file-name="CHANGES" pinned="false" current="true" current-in-tab="true">
215
213
  <entry file="file://$PROJECT_DIR$/CHANGES">
216
214
  <provider selected="true" editor-type-id="text-editor">
217
- <state line="26" column="2" selection-start="340" selection-end="369" vertical-scroll-proportion="0.68874174">
215
+ <state line="30" column="2" selection-start="391" selection-end="423" vertical-scroll-proportion="0.794702">
218
216
  <folding />
219
217
  </state>
220
218
  </provider>
@@ -223,7 +221,7 @@
223
221
  <file leaf-file-name="executable.rb" pinned="false" current="false" current-in-tab="false">
224
222
  <entry file="file://$PROJECT_DIR$/lib/script_executor/executable.rb">
225
223
  <provider selected="true" editor-type-id="text-editor">
226
- <state line="17" column="111" selection-start="360" selection-end="360" vertical-scroll-proportion="0.0">
224
+ <state line="42" column="114" selection-start="1090" selection-end="1090" vertical-scroll-proportion="-16.0">
227
225
  <folding />
228
226
  </state>
229
227
  </provider>
@@ -232,7 +230,34 @@
232
230
  <file leaf-file-name="spec_helper.rb" pinned="false" current="false" current-in-tab="false">
233
231
  <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
234
232
  <provider selected="true" editor-type-id="text-editor">
235
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
233
+ <state line="0" column="123" selection-start="56" selection-end="56" vertical-scroll-proportion="0.0">
234
+ <folding />
235
+ </state>
236
+ </provider>
237
+ </entry>
238
+ </file>
239
+ <file leaf-file-name=".rvmrc" pinned="false" current="false" current-in-tab="false">
240
+ <entry file="file://$PROJECT_DIR$/.rvmrc">
241
+ <provider selected="true" editor-type-id="text-editor">
242
+ <state line="4" column="118" selection-start="131" selection-end="131" vertical-scroll-proportion="0.0">
243
+ <folding />
244
+ </state>
245
+ </provider>
246
+ </entry>
247
+ </file>
248
+ <file leaf-file-name="version.rb" pinned="false" current="false" current-in-tab="false">
249
+ <entry file="file://$PROJECT_DIR$/lib/script_executor/version.rb">
250
+ <provider selected="true" editor-type-id="text-editor">
251
+ <state line="2" column="17" selection-start="45" selection-end="45" vertical-scroll-proportion="0.0">
252
+ <folding />
253
+ </state>
254
+ </provider>
255
+ </entry>
256
+ </file>
257
+ <file leaf-file-name="output_buffer.rb" pinned="false" current="false" current-in-tab="false">
258
+ <entry file="file://$PROJECT_DIR$/lib/script_executor/output_buffer.rb">
259
+ <provider selected="true" editor-type-id="text-editor">
260
+ <state line="7" column="10" selection-start="93" selection-end="93" vertical-scroll-proportion="0.0">
236
261
  <folding />
237
262
  </state>
238
263
  </provider>
@@ -265,9 +290,10 @@
265
290
  <option value="$PROJECT_DIR$/lib/script_executor/script_locator.rb" />
266
291
  <option value="$PROJECT_DIR$/spec/script_locator_spec.rb" />
267
292
  <option value="$PROJECT_DIR$/Gemfile" />
268
- <option value="$PROJECT_DIR$/lib/script_executor/version.rb" />
269
293
  <option value="$PROJECT_DIR$/lib/script_executor/capturer.rb" />
270
294
  <option value="$PROJECT_DIR$/lib/script_executor/output_buffer.rb" />
295
+ <option value="$PROJECT_DIR$/.rvmrc" />
296
+ <option value="$PROJECT_DIR$/lib/script_executor/version.rb" />
271
297
  <option value="$PROJECT_DIR$/lib/script_executor/executable.rb" />
272
298
  <option value="$PROJECT_DIR$/spec/executable_spec.rb" />
273
299
  <option value="$PROJECT_DIR$/CHANGES" />
@@ -306,6 +332,7 @@
306
332
  <sortByType />
307
333
  </navigator>
308
334
  <panes>
335
+ <pane id="Scope" />
309
336
  <pane id="ProjectPane">
310
337
  <subPane>
311
338
  <PATH>
@@ -313,10 +340,6 @@
313
340
  <option name="myItemId" value="script_executor" />
314
341
  <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
315
342
  </PATH_ELEMENT>
316
- <PATH_ELEMENT>
317
- <option name="myItemId" value="External Libraries" />
318
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
319
- </PATH_ELEMENT>
320
343
  </PATH>
321
344
  <PATH>
322
345
  <PATH_ELEMENT>
@@ -376,7 +399,6 @@
376
399
  </PATH>
377
400
  </subPane>
378
401
  </pane>
379
- <pane id="Scope" />
380
402
  </panes>
381
403
  </component>
382
404
  <component name="PropertiesComponent">
@@ -657,7 +679,7 @@
657
679
  <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
658
680
  <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
659
681
  <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
660
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2373963" sideWeight="0.63838387" order="0" side_tool="false" content_ui="combo" />
682
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24377792" sideWeight="0.63838387" order="0" side_tool="false" content_ui="combo" />
661
683
  <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3979798" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
662
684
  <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
663
685
  <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
@@ -730,7 +752,7 @@
730
752
  <breakpoints>
731
753
  <line-breakpoint enabled="true" type="ruby-line">
732
754
  <url>file://$PROJECT_DIR$/lib/script_executor/executable.rb</url>
733
- <line>93</line>
755
+ <line>98</line>
734
756
  <option name="timeStamp" value="2" />
735
757
  </line-breakpoint>
736
758
  </breakpoints>
@@ -756,30 +778,19 @@
756
778
  <state line="61" column="8" selection-start="2147" selection-end="2147" vertical-scroll-proportion="0.016859852" />
757
779
  </provider>
758
780
  </entry>
759
- <entry file="file://$PROJECT_DIR$/.rvmrc">
760
- <provider selected="true" editor-type-id="text-editor">
761
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
762
- </provider>
763
- </entry>
764
781
  <entry file="file://$PROJECT_DIR$/lib/script_executor/script_executor.rb">
765
782
  <provider selected="true" editor-type-id="text-editor">
766
- <state line="7" column="0" selection-start="109" selection-end="109" vertical-scroll-proportion="0.0">
767
- <folding />
768
- </state>
783
+ <state line="7" column="0" selection-start="109" selection-end="109" vertical-scroll-proportion="0.0" />
769
784
  </provider>
770
785
  </entry>
771
786
  <entry file="file://$PROJECT_DIR$/lib/script_executor.rb">
772
787
  <provider selected="true" editor-type-id="text-editor">
773
- <state line="2" column="41" selection-start="96" selection-end="96" vertical-scroll-proportion="0.0">
774
- <folding />
775
- </state>
788
+ <state line="2" column="41" selection-start="96" selection-end="96" vertical-scroll-proportion="0.0" />
776
789
  </provider>
777
790
  </entry>
778
791
  <entry file="file://$PROJECT_DIR$/lib/script_executor/script_locator.rb">
779
792
  <provider selected="true" editor-type-id="text-editor">
780
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
781
- <folding />
782
- </state>
793
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
783
794
  </provider>
784
795
  </entry>
785
796
  <entry file="file://$PROJECT_DIR$/spec/script_locator_spec.rb">
@@ -791,9 +802,7 @@
791
802
  </entry>
792
803
  <entry file="file://$PROJECT_DIR$/Rakefile">
793
804
  <provider selected="true" editor-type-id="text-editor">
794
- <state line="31" column="3" selection-start="675" selection-end="675" vertical-scroll-proportion="0.0">
795
- <folding />
796
- </state>
805
+ <state line="31" column="3" selection-start="675" selection-end="675" vertical-scroll-proportion="0.0" />
797
806
  </provider>
798
807
  </entry>
799
808
  <entry file="file://$PROJECT_DIR$/Gemfile">
@@ -803,44 +812,51 @@
803
812
  </state>
804
813
  </provider>
805
814
  </entry>
806
- <entry file="file://$PROJECT_DIR$/lib/script_executor/output_buffer.rb">
815
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
816
+ <provider selected="true" editor-type-id="text-editor">
817
+ <state line="0" column="123" selection-start="56" selection-end="56" vertical-scroll-proportion="0.0">
818
+ <folding />
819
+ </state>
820
+ </provider>
821
+ </entry>
822
+ <entry file="file://$PROJECT_DIR$/.rvmrc">
807
823
  <provider selected="true" editor-type-id="text-editor">
808
- <state line="7" column="10" selection-start="93" selection-end="93" vertical-scroll-proportion="0.174727">
824
+ <state line="4" column="118" selection-start="131" selection-end="131" vertical-scroll-proportion="0.0">
809
825
  <folding />
810
826
  </state>
811
827
  </provider>
812
828
  </entry>
813
829
  <entry file="file://$PROJECT_DIR$/lib/script_executor/version.rb">
814
830
  <provider selected="true" editor-type-id="text-editor">
815
- <state line="2" column="3" selection-start="45" selection-end="45" vertical-scroll-proportion="0.049921997">
831
+ <state line="2" column="17" selection-start="45" selection-end="45" vertical-scroll-proportion="0.0">
816
832
  <folding />
817
833
  </state>
818
834
  </provider>
819
835
  </entry>
820
- <entry file="file://$PROJECT_DIR$/lib/script_executor/executable.rb">
836
+ <entry file="file://$PROJECT_DIR$/lib/script_executor/output_buffer.rb">
821
837
  <provider selected="true" editor-type-id="text-editor">
822
- <state line="17" column="111" selection-start="360" selection-end="360" vertical-scroll-proportion="0.0">
838
+ <state line="7" column="10" selection-start="93" selection-end="93" vertical-scroll-proportion="0.0">
823
839
  <folding />
824
840
  </state>
825
841
  </provider>
826
842
  </entry>
827
- <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
843
+ <entry file="file://$PROJECT_DIR$/lib/script_executor/executable.rb">
828
844
  <provider selected="true" editor-type-id="text-editor">
829
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
845
+ <state line="42" column="114" selection-start="1090" selection-end="1090" vertical-scroll-proportion="-16.0">
830
846
  <folding />
831
847
  </state>
832
848
  </provider>
833
849
  </entry>
834
850
  <entry file="file://$PROJECT_DIR$/spec/executable_spec.rb">
835
851
  <provider selected="true" editor-type-id="text-editor">
836
- <state line="34" column="131" selection-start="768" selection-end="768" vertical-scroll-proportion="0.0">
852
+ <state line="88" column="127" selection-start="2079" selection-end="2079" vertical-scroll-proportion="0.0">
837
853
  <folding />
838
854
  </state>
839
855
  </provider>
840
856
  </entry>
841
857
  <entry file="file://$PROJECT_DIR$/CHANGES">
842
858
  <provider selected="true" editor-type-id="text-editor">
843
- <state line="26" column="2" selection-start="340" selection-end="369" vertical-scroll-proportion="0.68874174">
859
+ <state line="30" column="2" selection-start="391" selection-end="423" vertical-scroll-proportion="0.794702">
844
860
  <folding />
845
861
  </state>
846
862
  </provider>
data/.rvmrc CHANGED
@@ -1,5 +1,5 @@
1
1
  rvm_gemset_create_on_use_flag=1
2
2
  rvm_pretty_print_flag=1
3
3
 
4
- rvm use ruby-1.9.3@script_executor
4
+ rvm use 1.9.3@script_executor
5
5
  #rvm use ruby-2.0.0-preview1@script_executor
data/CHANGES CHANGED
@@ -24,4 +24,8 @@
24
24
 
25
25
  == Version 1.3.0
26
26
 
27
- * Adding line action parameter.
27
+ * Adding line action parameter.
28
+
29
+ == Version 1.3.1
30
+
31
+ * Adding suppress output parameter.
@@ -5,6 +5,10 @@ require 'script_executor/output_buffer'
5
5
 
6
6
  module Executable
7
7
 
8
+ def initialize
9
+ @output = $stdout
10
+ end
11
+
8
12
  def execute params={}, &code
9
13
  if params.class != Hash
10
14
  simple_commands = commands_from_object(params)
@@ -17,7 +21,7 @@ module Executable
17
21
  commands = locate_commands script, &code
18
22
 
19
23
  if commands.nil?
20
- puts "No commands were provided!"
24
+ @output.puts "No commands were provided!"
21
25
  return
22
26
  end
23
27
 
@@ -28,19 +32,20 @@ module Executable
28
32
  user = params[:user]
29
33
  password = params[:password]
30
34
  capture_output = params[:capture_output]
35
+ suppress_output = params[:suppress_output]
31
36
  simulate = params[:simulate]
32
37
  line_action = params[:line_action]
33
38
 
34
39
  print_execution commands, remote, domain, user, nil, simulate
35
40
 
36
41
  unless simulate
37
- line_action = lambda { |line| print line } unless line_action
38
42
  storage = capture_output ? OutputBuffer.new : nil
43
+ suppress_output = suppress_output.nil? ? capture_output : suppress_output
39
44
 
40
45
  if remote
41
- execute_ssh commands, domain, user, password, line_action, storage
46
+ execute_ssh commands, domain, user, password, line_action, suppress_output, storage
42
47
  else
43
- execute_command commands, password, line_action, storage
48
+ execute_command commands, password, line_action, suppress_output, storage
44
49
  end
45
50
 
46
51
  storage.buffer.join("\n") if storage
@@ -54,27 +59,27 @@ module Executable
54
59
  ssh_command = ssh_command(domain, user, identity_file)
55
60
 
56
61
  if simulate
57
- puts "Remote script: '#{ssh_command}'"
58
- puts "-------"
62
+ @output.puts "Remote script: '#{ssh_command}'"
63
+ @output.puts "-------"
59
64
  print_commands commands
60
- puts "-------"
65
+ @output.puts "-------"
61
66
  else
62
- puts "Remote execution on: '#{ssh_command}'"
63
- puts "-------"
67
+ @output.puts "Remote execution on: '#{ssh_command}'"
68
+ @output.puts "-------"
64
69
  print_commands commands
65
- puts "-------"
70
+ @output.puts "-------"
66
71
  end
67
72
  else
68
73
  if simulate
69
- puts "Script:"
70
- puts "-------"
74
+ @output.puts "Script:"
75
+ @output.puts "-------"
71
76
  print_commands commands
72
- puts "-------"
77
+ @output.puts "-------"
73
78
  else
74
- puts "Local execution:"
75
- puts "-------"
79
+ @output.puts "Local execution:"
80
+ @output.puts "-------"
76
81
  print_commands(commands)
77
- puts "-------"
82
+ @output.puts "-------"
78
83
  end
79
84
  end
80
85
  end
@@ -83,18 +88,20 @@ module Executable
83
88
  lines = StringIO.new commands
84
89
 
85
90
  lines.each_line do |line|
86
- puts line
91
+ @output.puts line
87
92
  end
88
93
  end
89
94
 
90
- def execute_command commands, password, line_action, storage
95
+ def execute_command commands, password, line_action, suppress_output, storage
91
96
  commands = commands + inline_password(password) if password
92
97
 
93
98
  IO.popen(commands) do |pipe|
94
99
  pipe.each("\r") do |line|
100
+ @output.print(line) unless suppress_output
101
+
95
102
  storage.save(line.chomp) if storage
96
103
 
97
- line_action.call(line)
104
+ line_action.call(line) if line_action
98
105
  end
99
106
  end
100
107
  end
@@ -103,7 +110,7 @@ module Executable
103
110
  password ? "<<EOF\n#{password}\nEOF" : ""
104
111
  end
105
112
 
106
- def execute_ssh commands, domain, user, password, line_action, storage
113
+ def execute_ssh commands, domain, user, password, line_action, suppress_output, storage
107
114
  if password.nil?
108
115
  password = ask("Enter password for #{user}: ") { |q| q.echo = '*' }
109
116
  end
@@ -115,9 +122,11 @@ module Executable
115
122
  channel.request_pty # <- problem must be here.
116
123
  channel.send_data password + "\n"
117
124
  else
125
+ @output.print(line) unless suppress_output
126
+
118
127
  storage.save(line.chomp) if storage
119
128
 
120
- line_action.call(line)
129
+ line_action.call(line) if line_action
121
130
  end
122
131
  end
123
132
 
@@ -1,3 +1,3 @@
1
1
  module ScriptExecutor
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -80,7 +80,7 @@ describe MyExecutable do
80
80
  end
81
81
 
82
82
  it "should execute sudo command" do
83
- result = subject.execute @remote_info.merge(:sudo => true, :password => @password) do
83
+ result = subject.execute @remote_info.merge(:sudo => true, :password => @password, :suppress_output => false) do
84
84
  %Q(
85
85
  ~/apache-tomcat-7.0.34/bin/shutdown.sh
86
86
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: script_executor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline