rubyment 0.6.25539312 → 0.6.25540736

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubyment.rb +35 -72
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 064b22e2b33400a6dcc11e12796afa85f3b1e8d7
4
- data.tar.gz: ef785677c15bb6ca87d24c3fe3a34ab277c5b989
3
+ metadata.gz: 8c3bd78fbf756579a1acaf4d66c0b0304b19ccd9
4
+ data.tar.gz: f552296199c8c07387418f165ec96cde9c9cebd4
5
5
  SHA512:
6
- metadata.gz: 783dc274768fd88809eb43f38a4d544b9a0730108ebfd674fc8fc0e176f0abda6804eb73e6cd2b37fe03d670863fa6f27935296ba2c99bdfadfae837c8e394d7
7
- data.tar.gz: 0b2a700200bb24bff7aac1954a55888ffe9cb6ac954d647c669f5e019388a5128ad2505483881729c6e4de7c7e1e2b5fe7d9d4f98fb809f182a5254223028411
6
+ metadata.gz: b3f62542a4c676f4092a896a722aff4ed87cdfa20c7c382c57abc649179f5e15dd3b839626fe67fb36dcab88a0f6ee3609a886d59208a0115ddb2181d38b0f93
7
+ data.tar.gz: d7301f117c410b34304ae6da16cf2edd1b6d133940c51116efd2749de629f6783f092a249d14d582fbf7045f53beb5b8f986b7480d199ef6fbf7fa5e01db1006
data/lib/rubyment.rb CHANGED
@@ -2065,8 +2065,7 @@ require '#{gem_name}'
2065
2065
  gem_is_current_file && (
2066
2066
  FileUtils.mkdir_p 'lib'
2067
2067
  file_backup "lib/#{gem_name}.rb", "lib/"
2068
- # quick hack for backwards compatibility
2069
- gem_is_current_file = gem_is_current_file.kind_of?(TrueClass) && __FILE__ || gem_is_current_file
2068
+ # FIX ME: accept true
2070
2069
  save_file gem_is_current_file, "lib/#{gem_name}.rb"
2071
2070
  )
2072
2071
 
@@ -2167,8 +2166,6 @@ require '#{gem_name}'
2167
2166
  command="gem uninstall #{all} -x #{user_install} #{gem_spec}"
2168
2167
  debug && (stderr.puts "command=#{command}")
2169
2168
  `#{command}`
2170
- #stdin, stdout, stderr, wait_thr = Open3.popen3(":;" + command)
2171
- #stdout
2172
2169
  end
2173
2170
 
2174
2171
  # gem_list
@@ -2586,6 +2583,7 @@ require '#{gem_name}'
2586
2583
  # +keep_alive+:: [Boolean] right not unsupported, always close the connection
2587
2584
  # +debug+:: [Object] if calling the object +nne+ method returns a +false+ value, won't print debug information
2588
2585
  # +eol+:: [String, nil] string to attach to the end of each line in the response
2586
+ # +location+:: [String, nil]
2589
2587
  #
2590
2588
  # @return [String] response with headers
2591
2589
  def http_response_base args = []
@@ -2596,19 +2594,21 @@ require '#{gem_name}'
2596
2594
  keep_alive,
2597
2595
  debug,
2598
2596
  eol,
2597
+ location,
2599
2598
  reserved = args
2600
2599
  stderr = @memory[:stderr]
2601
2600
  debug.nne && (stderr.puts "#{__method__} starting")
2602
2601
  debug.nne && (stderr.puts args.inspect)
2603
2602
  rv = [
2604
2603
  "HTTP/#{version} #{code}",
2605
- "Content-Type: #{content_type};" +
2604
+ content_type && "Content-Type: #{content_type};" +
2606
2605
  " charset=#{payload.encoding.name.downcase}",
2607
- "Content-Length: #{payload.bytesize}",
2606
+ payload && "Content-Length: #{payload.bytesize}",
2607
+ location && "Location: #{location.to_s}",
2608
2608
  keep_alive.negate_me && "Connection: close",
2609
2609
  "",
2610
2610
  "#{payload}"
2611
- ]
2611
+ ].compact
2612
2612
  debug.nne && (stderr.puts "#{__method__} will return #{rv}")
2613
2613
  debug.nne && (stderr.puts "#{__method__} returning")
2614
2614
  rv.join eol
@@ -3550,70 +3550,6 @@ n8mFEtUKobsK
3550
3550
  end
3551
3551
 
3552
3552
 
3553
- # tests test__tcp_ssl_server__io_method, creating two
3554
- # servers, one ssl and another plain, redirecting to
3555
- # the ssl one. then, opens a client thread with a client
3556
- # connecting to the root document of the plain server
3557
- # (and in the end being served by the root document of
3558
- # the ssl server).
3559
- # another thread for the client
3560
- def test__tcp_ssl_server__get_root__plain_redirect args = ARGV
3561
- stderr = @memory[:stderr]
3562
- tcp_ssl_server_method,
3563
- http_processing_method,
3564
- http_processing_method_args,
3565
- http_server_port,
3566
- http_ip_addr,
3567
- priv_pemfile,
3568
- cert_pem_file,
3569
- extra_cert_pem_files,
3570
- ssl_cert_pkey_chain_method,
3571
- debug_tcp_ssl_server_method,
3572
- happy_with_request,
3573
- io_method,
3574
- io_method_debug,
3575
- domain,
3576
- admit_non_ssl,
3577
- no_debug_client,
3578
- reserved = args
3579
- tcp_ssl_server_method = tcp_ssl_server_method.nne :test__tcp_ssl_server__io_method
3580
- domain = domain.nne "localhost"
3581
- http_server_port = http_server_port.nne 8003
3582
- no_debug_client = no_debug_client.nne
3583
- server_thread = send tcp_ssl_server_method,
3584
- [
3585
- http_processing_method,
3586
- http_processing_method_args,
3587
- http_server_port,
3588
- http_ip_addr,
3589
- priv_pemfile,
3590
- cert_pem_file,
3591
- extra_cert_pem_files,
3592
- ssl_cert_pkey_chain_method,
3593
- debug_tcp_ssl_server_method,
3594
- happy_with_request,
3595
- io_method,
3596
- io_method_debug,
3597
- admit_non_ssl,
3598
- ]
3599
-
3600
- thread_2 = Thread.new {
3601
- loop {
3602
- response = test__file_read__uri_root [
3603
- domain,
3604
- http_server_port,
3605
- admit_non_ssl,
3606
- no_debug_client.negate_me,
3607
- ]
3608
- sleep 2
3609
- }
3610
- }
3611
- server_thread.first.join
3612
-
3613
- true
3614
- end
3615
-
3616
-
3617
3553
  # tests test__tcp_ssl_server__io_method and opens
3618
3554
  # another thread for the client
3619
3555
  def test__tcp_ssl_server__get_root args = ARGV
@@ -4355,7 +4291,34 @@ n8mFEtUKobsK
4355
4291
  end
4356
4292
 
4357
4293
 
4358
- # test for #string_repetition
4294
+ =begin
4295
+ # documentation_begin
4296
+ # short_desc = "tests the function #string_repetion"
4297
+ @memory[:documentation].push = {
4298
+ :function => :test__string_repetition,
4299
+ :short_desc => short_desc,
4300
+ :description => "",
4301
+ :params => [
4302
+ {
4303
+ :name => :args,
4304
+ :description => "list of parameters",
4305
+ :duck_type => Array,
4306
+ :default_behavior => "interpreted as empty array",
4307
+ :params => [
4308
+ {
4309
+ :name => :reserved,
4310
+ :duck_type => Object,
4311
+ :default_behavior => "interpreted as nil",
4312
+ :description => "for future use",
4313
+ },
4314
+ ],
4315
+ },
4316
+ ],
4317
+ }
4318
+ # documentation_end
4319
+
4320
+
4321
+ =end
4359
4322
  def test__string_repetition args=[]
4360
4323
  expectation = {}
4361
4324
  actual = {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.25539312
4
+ version: 0.6.25540736
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribamar Santarosa