fluent_command_builder 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/lib/command_version_detector.rb +1 -0
  2. data/lib/fluent_command_builder/command_base.rb +20 -11
  3. data/lib/fluent_command_builder/command_builders/appcfg_python.rb +17 -0
  4. data/lib/fluent_command_builder/command_builders/appcfg_python_16.rb +1059 -1059
  5. data/lib/fluent_command_builder/command_builders/appcfg_python_17.rb +1055 -1055
  6. data/lib/fluent_command_builder/command_builders/aspnet_compiler.rb +17 -0
  7. data/lib/fluent_command_builder/command_builders/aspnet_compiler_20.rb +46 -46
  8. data/lib/fluent_command_builder/command_builders/aspnet_compiler_40.rb +46 -46
  9. data/lib/fluent_command_builder/command_builders/bundle.rb +17 -0
  10. data/lib/fluent_command_builder/command_builders/bundle_11.rb +140 -140
  11. data/lib/fluent_command_builder/command_builders/cucumber.rb +17 -0
  12. data/lib/fluent_command_builder/command_builders/cucumber_11.rb +76 -76
  13. data/lib/fluent_command_builder/command_builders/cucumber_12.rb +78 -78
  14. data/lib/fluent_command_builder/command_builders/dev_appserver_python.rb +17 -0
  15. data/lib/fluent_command_builder/command_builders/dev_appserver_python_16.rb +91 -86
  16. data/lib/fluent_command_builder/command_builders/dev_appserver_python_17.rb +91 -86
  17. data/lib/fluent_command_builder/command_builders/dotcover.rb +17 -0
  18. data/lib/fluent_command_builder/command_builders/dotcover_10.rb +33 -33
  19. data/lib/fluent_command_builder/command_builders/dotcover_11.rb +133 -133
  20. data/lib/fluent_command_builder/command_builders/dotcover_12.rb +133 -133
  21. data/lib/fluent_command_builder/command_builders/dotcover_20.rb +137 -137
  22. data/lib/fluent_command_builder/command_builders/installutil.rb +17 -0
  23. data/lib/fluent_command_builder/command_builders/installutil_11.rb +31 -31
  24. data/lib/fluent_command_builder/command_builders/installutil_20.rb +33 -33
  25. data/lib/fluent_command_builder/command_builders/installutil_35.rb +33 -33
  26. data/lib/fluent_command_builder/command_builders/installutil_40.rb +36 -36
  27. data/lib/fluent_command_builder/command_builders/msbuild.rb +17 -0
  28. data/lib/fluent_command_builder/command_builders/msbuild_20.rb +43 -43
  29. data/lib/fluent_command_builder/command_builders/msbuild_30.rb +43 -43
  30. data/lib/fluent_command_builder/command_builders/msbuild_35.rb +59 -59
  31. data/lib/fluent_command_builder/command_builders/msbuild_40.rb +62 -62
  32. data/lib/fluent_command_builder/command_builders/msdeploy.rb +17 -0
  33. data/lib/fluent_command_builder/command_builders/msdeploy_71.rb +177 -0
  34. data/lib/fluent_command_builder/command_builders/mstest.rb +17 -0
  35. data/lib/fluent_command_builder/command_builders/mstest_100.rb +127 -0
  36. data/lib/fluent_command_builder/command_builders/mstest_80.rb +107 -0
  37. data/lib/fluent_command_builder/command_builders/mstest_90.rb +112 -0
  38. data/lib/fluent_command_builder/command_builders/netsh.rb +17 -0
  39. data/lib/fluent_command_builder/command_builders/netsh_61.rb +408 -0
  40. data/lib/fluent_command_builder/command_builders/nunit.rb +17 -0
  41. data/lib/fluent_command_builder/command_builders/nunit_25.rb +69 -64
  42. data/lib/fluent_command_builder/command_builders/nunit_26.rb +85 -80
  43. data/lib/fluent_command_builder/command_builders/rake.rb +17 -0
  44. data/lib/fluent_command_builder/command_builders/rake_09.rb +64 -64
  45. data/lib/fluent_command_builder/command_builders/security_osx.rb +17 -0
  46. data/lib/fluent_command_builder/command_builders/security_osx_107.rb +82 -82
  47. data/lib/fluent_command_builder/command_builders/sevenzip.rb +17 -0
  48. data/lib/fluent_command_builder/command_builders/sevenzip_92.rb +243 -243
  49. data/lib/fluent_command_builder/command_builders/simian.rb +17 -0
  50. data/lib/fluent_command_builder/command_builders/simian_23.rb +63 -63
  51. data/lib/fluent_command_builder/command_builders/team_foundation.rb +17 -0
  52. data/lib/fluent_command_builder/command_builders/team_foundation_100.rb +2155 -0
  53. data/lib/fluent_command_builder/command_builders/team_foundation_tee.rb +17 -0
  54. data/lib/fluent_command_builder/command_builders/team_foundation_tee_100.rb +1978 -0
  55. data/lib/fluent_command_builder/command_builders/xcodebuild.rb +17 -0
  56. data/lib/fluent_command_builder/command_builders/xcodebuild_43.rb +112 -112
  57. data/lib/fluent_command_builder/command_builders/xcodebuild_44.rb +132 -132
  58. data/lib/fluent_command_builder/{command_builder.rb → underlying_builder.rb} +2 -2
  59. data/lib/fluent_command_builder/util.rb +18 -0
  60. data/lib/fluent_command_builder/version_detectors/appcfg_python.rb +9 -0
  61. data/lib/fluent_command_builder/version_detectors/aspnet_compiler.rb +9 -0
  62. data/lib/fluent_command_builder/version_detectors/bundle.rb +9 -0
  63. data/lib/fluent_command_builder/version_detectors/cucumber.rb +9 -0
  64. data/lib/fluent_command_builder/version_detectors/dev_appserver_python.rb +9 -0
  65. data/lib/fluent_command_builder/version_detectors/dotcover.rb +9 -0
  66. data/lib/fluent_command_builder/version_detectors/installutil.rb +9 -0
  67. data/lib/fluent_command_builder/version_detectors/lib/appengine_python_version_detector.rb +16 -0
  68. data/lib/fluent_command_builder/version_detectors/lib/path_finder.rb +43 -0
  69. data/lib/fluent_command_builder/version_detectors/lib/standard_version_detector.rb +14 -0
  70. data/lib/fluent_command_builder/version_detectors/msbuild.rb +9 -0
  71. data/lib/fluent_command_builder/version_detectors/msdeploy.rb +9 -0
  72. data/lib/fluent_command_builder/version_detectors/mstest.rb +9 -0
  73. data/lib/fluent_command_builder/version_detectors/nuget.rb +9 -0
  74. data/lib/fluent_command_builder/version_detectors/nunit.rb +9 -0
  75. data/lib/fluent_command_builder/version_detectors/rake.rb +9 -0
  76. data/lib/fluent_command_builder/version_detectors/security_osx.rb +9 -0
  77. data/lib/fluent_command_builder/version_detectors/sevenzip.rb +9 -0
  78. data/lib/fluent_command_builder/version_detectors/team_foundation.rb +9 -0
  79. data/lib/fluent_command_builder/version_detectors/xcodebuild.rb +9 -0
  80. data/lib/fluent_command_builder.rb +26 -7
  81. metadata +53 -12
  82. data/lib/fluent_command_builder/command_builders/msdeploy_40.rb +0 -177
  83. data/lib/fluent_command_builder/command_builders/mstest_2005.rb +0 -107
  84. data/lib/fluent_command_builder/command_builders/mstest_2008.rb +0 -112
  85. data/lib/fluent_command_builder/command_builders/mstest_2010.rb +0 -127
  86. data/lib/fluent_command_builder/command_builders/netsh_2008.rb +0 -408
  87. data/lib/fluent_command_builder/command_builders/tf_2010.rb +0 -2155
  88. data/lib/fluent_command_builder/command_builders/tf_tee_2010.rb +0 -1978
@@ -1,306 +1,306 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../command_base')
2
- require File.expand_path(File.dirname(__FILE__) + '/../command_builder')
2
+ require File.expand_path(File.dirname(__FILE__) + '/../underlying_builder')
3
3
 
4
4
  module FluentCommandBuilder
5
+ def xcodebuild_44
6
+ FluentCommandBuilder::XCodeBuild::V44.create { |b| yield b if block_given? }
7
+ end
5
8
  module XCodeBuild
6
9
  module V44
7
- COMMAND_NAME = 'xcodebuild'
10
+ def self.create
11
+ b = UnderlyingBuilder.new FluentCommandBuilder::XCodeBuild::COMMAND_NAME
12
+ c = XCodeBuild.new(b)
13
+ yield b if block_given?
14
+ c
15
+ end
16
+ def xcodebuild
17
+ FluentCommandBuilder::XCodeBuild::V44.create { |b| yield b if block_given? }
18
+ end
8
19
  class XCodeBuild < CommandBase
9
- def initialize(builder)
10
- super builder
20
+ def initialize(underlying_builder)
21
+ super underlying_builder
11
22
  end
12
23
  def build_project(build_action=nil)
13
- BuildProject.new @builder, build_action
24
+ BuildProject.new b, build_action
14
25
  end
15
26
  def build_project_scheme(build_action=nil)
16
- BuildProjectScheme.new @builder, build_action
27
+ BuildProjectScheme.new b, build_action
17
28
  end
18
29
  def build_workspace(workspace_name, build_action=nil)
19
- BuildWorkspace.new @builder, workspace_name, build_action
30
+ BuildWorkspace.new b, workspace_name, build_action
20
31
  end
21
32
  def version
22
- Version.new @builder
33
+ Version.new b
23
34
  end
24
35
  def list
25
- @builder.append ' -list'
26
- yield @builder if block_given?
36
+ b.append ' -list'
37
+ yield b if block_given?
27
38
  self
28
39
  end
29
40
  def list_project(project_name)
30
- @builder.append " -list -project #{@builder.format project_name}"
31
- yield @builder if block_given?
41
+ b.append " -list -project #{b.format project_name}"
42
+ yield b if block_given?
32
43
  self
33
44
  end
34
45
  def list_workspace(workspace_name)
35
- @builder.append " -list -workspace #{@builder.format workspace_name}"
36
- yield @builder if block_given?
46
+ b.append " -list -workspace #{b.format workspace_name}"
47
+ yield b if block_given?
37
48
  self
38
49
  end
39
50
  def find(binary)
40
- @builder.append " -find #{@builder.format binary}"
41
- yield @builder if block_given?
51
+ b.append " -find #{b.format binary}"
52
+ yield b if block_given?
42
53
  self
43
54
  end
44
55
  def help
45
- @builder.append ' -help'
46
- yield @builder if block_given?
56
+ b.append ' -help'
57
+ yield b if block_given?
47
58
  self
48
59
  end
49
60
  def license
50
- @builder.append ' -license'
51
- yield @builder if block_given?
61
+ b.append ' -license'
62
+ yield b if block_given?
52
63
  self
53
64
  end
54
65
  def show_sdks
55
- @builder.append ' -showsdks'
56
- yield @builder if block_given?
66
+ b.append ' -showsdks'
67
+ yield b if block_given?
57
68
  self
58
69
  end
59
70
  def usage
60
- @builder.append ' -usage'
61
- yield @builder if block_given?
71
+ b.append ' -usage'
72
+ yield b if block_given?
62
73
  self
63
74
  end
64
75
  end
65
76
  class BuildProject < CommandBase
66
- def initialize(builder, build_action=nil)
67
- super builder
68
- @builder.append ' '
69
- @builder.append "#{@builder.format build_action, ' '}" unless build_action.nil?
77
+ def initialize(underlying_builder, build_action=nil)
78
+ super underlying_builder
79
+ b.append ' '
80
+ b.append "#{b.format build_action, ' '}" unless build_action.nil?
70
81
  end
71
82
  def all_targets
72
- @builder.append ' -alltargets'
73
- yield @builder if block_given?
83
+ b.append ' -alltargets'
84
+ yield b if block_given?
74
85
  self
75
86
  end
76
87
  def architecture(architecture)
77
- @builder.append " -arch #{@builder.format architecture}"
78
- yield @builder if block_given?
88
+ b.append " -arch #{b.format architecture}"
89
+ yield b if block_given?
79
90
  self
80
91
  end
81
92
  def configuration(configuration_name)
82
- @builder.append " -configuration #{@builder.format configuration_name}"
83
- yield @builder if block_given?
93
+ b.append " -configuration #{b.format configuration_name}"
94
+ yield b if block_given?
84
95
  self
85
96
  end
86
97
  def dry_run
87
- @builder.append ' -dry-run'
88
- yield @builder if block_given?
98
+ b.append ' -dry-run'
99
+ yield b if block_given?
89
100
  self
90
101
  end
91
102
  def jobs(number)
92
- @builder.append " -jobs #{@builder.format number}"
93
- yield @builder if block_given?
103
+ b.append " -jobs #{b.format number}"
104
+ yield b if block_given?
94
105
  self
95
106
  end
96
107
  def parallelize_targets
97
- @builder.append ' -parallelizeTargets'
98
- yield @builder if block_given?
108
+ b.append ' -parallelizeTargets'
109
+ yield b if block_given?
99
110
  self
100
111
  end
101
112
  def project(project_name)
102
- @builder.append " -project #{@builder.format project_name}"
103
- yield @builder if block_given?
113
+ b.append " -project #{b.format project_name}"
114
+ yield b if block_given?
104
115
  self
105
116
  end
106
117
  def target(target_name)
107
- @builder.append " -target #{@builder.format target_name}"
108
- yield @builder if block_given?
118
+ b.append " -target #{b.format target_name}"
119
+ yield b if block_given?
109
120
  self
110
121
  end
111
122
  def sdk(sdk_name)
112
- @builder.append " -sdk #{@builder.format sdk_name}"
113
- yield @builder if block_given?
123
+ b.append " -sdk #{b.format sdk_name}"
124
+ yield b if block_given?
114
125
  self
115
126
  end
116
127
  def show_build_settings
117
- @builder.append ' -showBuildSettings'
118
- yield @builder if block_given?
128
+ b.append ' -showBuildSettings'
129
+ yield b if block_given?
119
130
  self
120
131
  end
121
132
  def toolchain(name)
122
- @builder.append " -toolchain #{@builder.format name}"
123
- yield @builder if block_given?
133
+ b.append " -toolchain #{b.format name}"
134
+ yield b if block_given?
124
135
  self
125
136
  end
126
137
  def verbose
127
- @builder.append ' -verbose'
128
- yield @builder if block_given?
138
+ b.append ' -verbose'
139
+ yield b if block_given?
129
140
  self
130
141
  end
131
142
  def xcconfig(path)
132
- @builder.append " -xcconfig #{@builder.format path}"
133
- yield @builder if block_given?
143
+ b.append " -xcconfig #{b.format path}"
144
+ yield b if block_given?
134
145
  self
135
146
  end
136
147
  def setting(setting, value)
137
- @builder.append " #{@builder.format setting}=#{@builder.format value}"
138
- yield @builder if block_given?
148
+ b.append " #{b.format setting}=#{b.format value}"
149
+ yield b if block_given?
139
150
  self
140
151
  end
141
152
  end
142
153
  class BuildProjectScheme < CommandBase
143
- def initialize(builder, build_action=nil)
144
- super builder
145
- @builder.append ' '
146
- @builder.append "#{@builder.format build_action, ' '}" unless build_action.nil?
154
+ def initialize(underlying_builder, build_action=nil)
155
+ super underlying_builder
156
+ b.append ' '
157
+ b.append "#{b.format build_action, ' '}" unless build_action.nil?
147
158
  end
148
159
  def architecture(architecture)
149
- @builder.append " -arch #{@builder.format architecture}"
150
- yield @builder if block_given?
160
+ b.append " -arch #{b.format architecture}"
161
+ yield b if block_given?
151
162
  self
152
163
  end
153
164
  def configuration(configuration_name)
154
- @builder.append " -configuration #{@builder.format configuration_name}"
155
- yield @builder if block_given?
165
+ b.append " -configuration #{b.format configuration_name}"
166
+ yield b if block_given?
156
167
  self
157
168
  end
158
169
  def dry_run
159
- @builder.append ' -dry-run'
160
- yield @builder if block_given?
170
+ b.append ' -dry-run'
171
+ yield b if block_given?
161
172
  self
162
173
  end
163
174
  def jobs(number)
164
- @builder.append " -jobs #{@builder.format number}"
165
- yield @builder if block_given?
175
+ b.append " -jobs #{b.format number}"
176
+ yield b if block_given?
166
177
  self
167
178
  end
168
179
  def parallelize_targets
169
- @builder.append ' -parallelizeTargets'
170
- yield @builder if block_given?
180
+ b.append ' -parallelizeTargets'
181
+ yield b if block_given?
171
182
  self
172
183
  end
173
184
  def scheme(scheme_name)
174
- @builder.append " -scheme #{@builder.format scheme_name}"
175
- yield @builder if block_given?
185
+ b.append " -scheme #{b.format scheme_name}"
186
+ yield b if block_given?
176
187
  self
177
188
  end
178
189
  def sdk(sdk_name)
179
- @builder.append " -sdk #{@builder.format sdk_name}"
180
- yield @builder if block_given?
190
+ b.append " -sdk #{b.format sdk_name}"
191
+ yield b if block_given?
181
192
  self
182
193
  end
183
194
  def show_build_settings
184
- @builder.append ' -showBuildSettings'
185
- yield @builder if block_given?
195
+ b.append ' -showBuildSettings'
196
+ yield b if block_given?
186
197
  self
187
198
  end
188
199
  def toolchain(name)
189
- @builder.append " -toolchain #{@builder.format name}"
190
- yield @builder if block_given?
200
+ b.append " -toolchain #{b.format name}"
201
+ yield b if block_given?
191
202
  self
192
203
  end
193
204
  def verbose
194
- @builder.append ' -verbose'
195
- yield @builder if block_given?
205
+ b.append ' -verbose'
206
+ yield b if block_given?
196
207
  self
197
208
  end
198
209
  def xcconfig(path)
199
- @builder.append " -xcconfig #{@builder.format path}"
200
- yield @builder if block_given?
210
+ b.append " -xcconfig #{b.format path}"
211
+ yield b if block_given?
201
212
  self
202
213
  end
203
214
  def setting(setting, value)
204
- @builder.append " #{@builder.format setting}=#{@builder.format value}"
205
- yield @builder if block_given?
215
+ b.append " #{b.format setting}=#{b.format value}"
216
+ yield b if block_given?
206
217
  self
207
218
  end
208
219
  end
209
220
  class BuildWorkspace < CommandBase
210
- def initialize(builder, workspace_name, build_action=nil)
211
- super builder
212
- @builder.append " -workspace #{@builder.format workspace_name}"
213
- @builder.append " #{@builder.format build_action, ' '}" unless build_action.nil?
221
+ def initialize(underlying_builder, workspace_name, build_action=nil)
222
+ super underlying_builder
223
+ b.append " -workspace #{b.format workspace_name}"
224
+ b.append " #{b.format build_action, ' '}" unless build_action.nil?
214
225
  end
215
226
  def architecture(architecture)
216
- @builder.append " -arch #{@builder.format architecture}"
217
- yield @builder if block_given?
227
+ b.append " -arch #{b.format architecture}"
228
+ yield b if block_given?
218
229
  self
219
230
  end
220
231
  def configuration(configuration_name)
221
- @builder.append " -configuration #{@builder.format configuration_name}"
222
- yield @builder if block_given?
232
+ b.append " -configuration #{b.format configuration_name}"
233
+ yield b if block_given?
223
234
  self
224
235
  end
225
236
  def dry_run
226
- @builder.append ' -dry-run'
227
- yield @builder if block_given?
237
+ b.append ' -dry-run'
238
+ yield b if block_given?
228
239
  self
229
240
  end
230
241
  def jobs(number)
231
- @builder.append " -jobs #{@builder.format number}"
232
- yield @builder if block_given?
242
+ b.append " -jobs #{b.format number}"
243
+ yield b if block_given?
233
244
  self
234
245
  end
235
246
  def parallelize_targets
236
- @builder.append ' -parallelizeTargets'
237
- yield @builder if block_given?
247
+ b.append ' -parallelizeTargets'
248
+ yield b if block_given?
238
249
  self
239
250
  end
240
251
  def scheme(scheme_name)
241
- @builder.append " -scheme #{@builder.format scheme_name}"
242
- yield @builder if block_given?
252
+ b.append " -scheme #{b.format scheme_name}"
253
+ yield b if block_given?
243
254
  self
244
255
  end
245
256
  def sdk(sdk_name)
246
- @builder.append " -sdk #{@builder.format sdk_name}"
247
- yield @builder if block_given?
257
+ b.append " -sdk #{b.format sdk_name}"
258
+ yield b if block_given?
248
259
  self
249
260
  end
250
261
  def show_build_settings
251
- @builder.append ' -showBuildSettings'
252
- yield @builder if block_given?
262
+ b.append ' -showBuildSettings'
263
+ yield b if block_given?
253
264
  self
254
265
  end
255
266
  def toolchain(name)
256
- @builder.append " -toolchain #{@builder.format name}"
257
- yield @builder if block_given?
267
+ b.append " -toolchain #{b.format name}"
268
+ yield b if block_given?
258
269
  self
259
270
  end
260
271
  def verbose
261
- @builder.append ' -verbose'
262
- yield @builder if block_given?
272
+ b.append ' -verbose'
273
+ yield b if block_given?
263
274
  self
264
275
  end
265
276
  def xcconfig(path)
266
- @builder.append " -xcconfig #{@builder.format path}"
267
- yield @builder if block_given?
277
+ b.append " -xcconfig #{b.format path}"
278
+ yield b if block_given?
268
279
  self
269
280
  end
270
281
  def setting(setting, value)
271
- @builder.append " #{@builder.format setting}=#{@builder.format value}"
272
- yield @builder if block_given?
282
+ b.append " #{b.format setting}=#{b.format value}"
283
+ yield b if block_given?
273
284
  self
274
285
  end
275
286
  end
276
287
  class Version < CommandBase
277
- def initialize(builder)
278
- super builder
279
- @builder.append ' -version'
288
+ def initialize(underlying_builder)
289
+ super underlying_builder
290
+ b.append ' -version'
280
291
  end
281
292
  def sdk(sdk_name)
282
- @builder.append " -sdk #{@builder.format sdk_name}"
283
- yield @builder if block_given?
293
+ b.append " -sdk #{b.format sdk_name}"
294
+ yield b if block_given?
284
295
  self
285
296
  end
286
297
  def info_item(info_item)
287
- @builder.append " #{@builder.format info_item}"
288
- yield @builder if block_given?
298
+ b.append " #{b.format info_item}"
299
+ yield b if block_given?
289
300
  self
290
301
  end
291
302
  end
292
- def xcodebuild
293
- builder = CommandBuilder.new COMMAND_NAME
294
- command = XCodeBuild.new builder
295
- yield builder if block_given?
296
- command
297
- end
303
+
298
304
  end
299
305
  end
300
- def xcodebuild_44
301
- builder = CommandBuilder.new XCodeBuild::V44::COMMAND_NAME
302
- command = XCodeBuild::V44::XCodeBuild.new builder
303
- yield builder if block_given?
304
- command
305
- end
306
- end
306
+ end
@@ -1,11 +1,11 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/command_base')
2
2
 
3
3
  module FluentCommandBuilder
4
- class CommandBuilder
4
+ class UnderlyingBuilder
5
5
 
6
6
  attr_accessor :command_name, :path
7
7
 
8
- def initialize(command_name)
8
+ def initialize(command_name=nil)
9
9
  @command_name = command_name
10
10
  @path = nil
11
11
  @args = ''
@@ -0,0 +1,18 @@
1
+ module FluentCommandBuilder
2
+
3
+ def version_module(command_module)
4
+ version = command_module.respond_to?(:version) ? command_module.version : nil
5
+ raise "Unable to determine version for #{command_module::COMMAND_NAME}." unless version
6
+ module_name = "#{command_module.name}::V#{compact_version version}"
7
+ begin
8
+ eval module_name
9
+ rescue
10
+ raise "Unable to load #{module_name}. Please consider contributing."
11
+ end
12
+ end
13
+
14
+ def compact_version(version)
15
+ version.match(/^\d+\.\d+/)[0].sub('.', '')
16
+ end
17
+
18
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/appengine_python_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module AppCfgPython
5
+ def self.version(path=nil)
6
+ AppEnginePythonVersionDetector.version 'appcfg.py', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/msbuild')
2
+
3
+ module FluentCommandBuilder
4
+ module AspnetCompiler
5
+ def self.version(path=nil)
6
+ MSBuild.version path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module Bundle
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'bundle', '--version', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module Cucumber
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'cucumber', '--version', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/appengine_python_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module DevAppserverPython
5
+ def self.version(path=nil)
6
+ AppEnginePythonVersionDetector.version 'dev_appserver.py', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module DotCover
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'dotcover', 'version', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module InstallUtil
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'installutil', '', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ require 'yaml'
2
+ require File.expand_path(File.dirname(__FILE__) + '/path_finder')
3
+
4
+ module FluentCommandBuilder
5
+ class AppEnginePythonVersionDetector
6
+
7
+ def self.version(executable_name, path=nil)
8
+ path ||= PathFinder.find_path executable_name
9
+ return unless path
10
+ version_file = File.join path, 'VERSION'
11
+ version_hash = YAML::load_file version_file
12
+ version_hash['release']
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,43 @@
1
+ module FluentCommandBuilder
2
+ class PathFinder
3
+
4
+ def initialize(executable_name)
5
+ @executable_name = executable_name
6
+ end
7
+
8
+ def find_path
9
+ executable = find_executable
10
+ return unless executable
11
+ File.dirname executable
12
+ end
13
+
14
+ def self.find_path(executable_name)
15
+ path_finder = PathFinder.new executable_name
16
+ path_finder.find_path
17
+ end
18
+
19
+ private
20
+
21
+ def find_executable
22
+ is_windows? ? find_executable_on_windows : find_executable_on_unix
23
+ end
24
+
25
+ def find_executable_on_unix
26
+ executable = `which #{@executable_name}`
27
+ real_executable = `readlink #{executable}`.strip
28
+ real_executable == '' ? executable : real_executable
29
+ end
30
+
31
+ def find_executable_on_windows
32
+ paths = ENV['PATH'].split ';'
33
+ extensions = ENV['PATHEXT'].split ';'
34
+ possibilities = paths.map { |path| extensions.map { |ext| File.join(path, @executable_name + ext.downcase).gsub('/', '\\') } }.flatten
35
+ possibilities.select { |exe| File.exist? exe }.first
36
+ end
37
+
38
+ def is_windows?
39
+ !ENV['WINDIR'].nil?
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/path_finder')
2
+
3
+ module FluentCommandBuilder
4
+ class StandardVersionDetector
5
+ def self.version(executable_name, executable_args, path=nil)
6
+ path ||= PathFinder.find_path executable_name
7
+ return unless path
8
+ executable = File.join path, executable_name
9
+ command = %Q["#{executable}" #{executable_args} 2>&1]
10
+ output = `#{command}`
11
+ output.match(/(?:\d+\.)(?:\d+\.?)+/) { |m| m[0] }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module MSBuild
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'msbuild', '/version', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module MSDeploy
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'msdeploy', '', path
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/lib/standard_version_detector')
2
+
3
+ module FluentCommandBuilder
4
+ module MSTest
5
+ def self.version(path=nil)
6
+ StandardVersionDetector.version 'mstest', '/help', path
7
+ end
8
+ end
9
+ end