Module: Curl
- Defined in:
- lib/curl/spawn.rb,
lib/curl/spawn/args.rb,
lib/curl/spawn/example.rb,
lib/curl/spawn/version.rb,
lib/curl/spawn/args_builder.rb
Defined Under Namespace
Modules: Spawn
Class Method Summary collapse
Class Method Details
.spawn(*supplied_argv, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/curl/spawn.rb', line 14 def self.spawn(*supplied_argv, &block) built_args = Curl::Spawn.build_args(&block) normalized_argv = [] supplied_opt = supplied_argv.last.kind_of?(Hash) ? supplied_argv.pop : {} # Merge the argv contents built_args.argv.each do |arg| normalized_argv.push(arg.to_s) end supplied_argv.each do |arg| normalized_argv.push(arg.to_s) end # Merge the spawn options hash argument normalized_argv.push(supplied_opt.merge(built_args.opt)) Kernel.spawn(*normalized_argv) end |
.url_encode(str) ⇒ Object
36 37 38 |
# File 'lib/curl/spawn.rb', line 36 def self.url_encode(str) ERB::Util.url_encode(str) end |