curses 1.1.3-x64-mingw32 → 1.2.0-x64-mingw32

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: 9b4cf50588910963afee4f81ebc68d5675fd9760
4
- data.tar.gz: 95da1ffb64b5f3887e60635619121c95a1cfd6e9
3
+ metadata.gz: 04d04686d090e2a3913983232742be67966d9fbd
4
+ data.tar.gz: 8843bf19009918d55b4e3bc7d7284aa47c4c5785
5
5
  SHA512:
6
- metadata.gz: 34a335070bfee6c2139c64fd7562132cd057b0e0aa4a4b7d6144c13f5ad7492267fa7d30dfb16846738a9355e1da3789a5da467f5644d7487b3f838ac84792e1
7
- data.tar.gz: 2751b223334fa9977e2e26880f624bd7689232e62dac66b32d5774df2daeeafd36bedc88a98337a97d31345a92056f6f03df5f08a36f8ef5167c40d2ea3af005
6
+ metadata.gz: 56acbf3928bb3c762a57759f8caca3e03cbe4c148ef8878054ee4d4554ccc13b5e24b8541644a9249bf4cf40e898077f4c6536500d3f51f83b740d79d23bde6e
7
+ data.tar.gz: f34c4f2341d67915db884a7252113120d8fb08204800af5fddf223dfaf92142f03cb9a4b228fae88d62a9633ed6e8adf8b297137e233d9c5558bd4acca8c9165
data/History.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 1.2.0 / 2017-02-19
2
+
3
+ New features:
4
+
5
+ * Add Curses.assume_default_colors.
6
+
7
+ Bug fixes:
8
+
9
+ * Curses.unget_char should use String#ord even if unget_wch() is not available.
10
+ * The default value of keyboard_encoding should be ASCII-8BIT if get_wch() is
11
+ not available.
12
+ * NUM2ULONG() should be used in Window#bkgd etc.
13
+
1
14
  ### 1.1.3 / 2017-02-08
2
15
 
3
16
  Bug fixes:
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # curses
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/curses.svg)](https://badge.fury.io/rb/curses)
3
4
  [![Build Status](https://travis-ci.org/ruby/curses.svg?branch=master)](https://travis-ci.org/ruby/curses)
4
5
  [![Build status](https://ci.appveyor.com/api/projects/status/kdvksgjo4fyd3c4m/branch/master?svg=true)](https://ci.appveyor.com/project/ruby/curses/branch/master)
5
6
 
data/curses.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new { |s|
2
2
  s.name = "curses"
3
- s.version = "1.1.3"
3
+ s.version = "1.2.0"
4
4
  s.author = ["Shugo Maeda", 'Eric Hodel']
5
5
  s.email = ["shugo@ruby-lang.org", 'drbrain@segment7.net']
6
6
  s.homepage = "https://github.com/ruby/curses"
data/ext/curses/curses.c CHANGED
@@ -954,7 +954,7 @@ curses_bkgdset(VALUE obj, VALUE ch)
954
954
  {
955
955
  #ifdef HAVE_BKGDSET
956
956
  curses_stdscr();
957
- bkgdset(NUM2CH(ch));
957
+ bkgdset(NUM2ULONG(ch));
958
958
  #endif
959
959
  return Qnil;
960
960
  }
@@ -975,7 +975,7 @@ curses_bkgd(VALUE obj, VALUE ch)
975
975
  {
976
976
  #ifdef HAVE_BKGD
977
977
  curses_stdscr();
978
- return (bkgd(NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
978
+ return (bkgd(NUM2ULONG(ch)) == OK) ? Qtrue : Qfalse;
979
979
  #else
980
980
  return Qfalse;
981
981
  #endif
@@ -998,6 +998,23 @@ curses_use_default_colors(VALUE obj)
998
998
  #define curses_use_default_colors rb_f_notimplement
999
999
  #endif
1000
1000
 
1001
+ #if defined(HAVE_ASSUME_DEFAULT_COLORS)
1002
+ /*
1003
+ * tells which colors to paint for color pair 0.
1004
+ *
1005
+ * see also the system manual for default_colors(3)
1006
+ */
1007
+ static VALUE
1008
+ curses_assume_default_colors(VALUE obj, VALUE fg, VALUE bg)
1009
+ {
1010
+ curses_stdscr();
1011
+ assume_default_colors(NUM2INT(fg), NUM2INT(bg));
1012
+ return Qnil;
1013
+ }
1014
+ #else
1015
+ #define curses_assume_default_colors rb_f_notimplement
1016
+ #endif
1017
+
1001
1018
  #if defined(HAVE_TABSIZE)
1002
1019
  /*
1003
1020
  * Document-method: Curses.TABSIZE=
@@ -2385,7 +2402,7 @@ window_bkgdset(VALUE obj, VALUE ch)
2385
2402
  struct windata *winp;
2386
2403
 
2387
2404
  GetWINDOW(obj,winp);
2388
- wbkgdset(winp->window, NUM2CH(ch));
2405
+ wbkgdset(winp->window, NUM2ULONG(ch));
2389
2406
  #endif
2390
2407
  return Qnil;
2391
2408
  }
@@ -2406,7 +2423,7 @@ window_bkgd(VALUE obj, VALUE ch)
2406
2423
  struct windata *winp;
2407
2424
 
2408
2425
  GetWINDOW(obj,winp);
2409
- return (wbkgd(winp->window, NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
2426
+ return (wbkgd(winp->window, NUM2ULONG(ch)) == OK) ? Qtrue : Qfalse;
2410
2427
  #else
2411
2428
  return Qfalse;
2412
2429
  #endif
@@ -2425,7 +2442,7 @@ window_getbkgd(VALUE obj)
2425
2442
  struct windata *winp;
2426
2443
 
2427
2444
  GetWINDOW(obj,winp);
2428
- return (c = getbkgd(winp->window) != ERR) ? CH2FIX(c) : Qnil;
2445
+ return (c = getbkgd(winp->window) != ERR) ? ULONG2NUM(c) : Qnil;
2429
2446
  #else
2430
2447
  return Qnil;
2431
2448
  #endif
@@ -2747,9 +2764,8 @@ curses_set_terminal_encoding(VALUE obj, VALUE enc)
2747
2764
  static VALUE
2748
2765
  curses_unget_char(VALUE obj, VALUE ch)
2749
2766
  {
2750
- #ifdef HAVE_UNGET_WCH
2751
2767
  ID id_ord;
2752
- #endif
2768
+ unsigned int c;
2753
2769
 
2754
2770
  curses_stdscr();
2755
2771
  if (FIXNUM_P(ch)) {
@@ -2757,11 +2773,15 @@ curses_unget_char(VALUE obj, VALUE ch)
2757
2773
  }
2758
2774
  else {
2759
2775
  StringValue(ch);
2760
- #ifdef HAVE_UNGET_WCH
2761
2776
  CONST_ID(id_ord, "ord");
2762
- unget_wch(NUM2UINT(rb_funcall(ch, id_ord, 0)));
2777
+ c = NUM2UINT(rb_funcall(ch, id_ord, 0));
2778
+ #ifdef HAVE_UNGET_WCH
2779
+ unget_wch(c);
2763
2780
  #else
2764
- ungetch(NUM2UINT(ch));
2781
+ if (c > 0xff) {
2782
+ rb_raise(rb_eRangeError, "Out of range: %u", c);
2783
+ }
2784
+ ungetch(c);
2765
2785
  #endif
2766
2786
  }
2767
2787
  return Qnil;
@@ -2929,7 +2949,12 @@ window_get_char(VALUE obj)
2929
2949
  void
2930
2950
  Init_curses(void)
2931
2951
  {
2932
- keyboard_encoding = terminal_encoding = rb_locale_encoding();
2952
+ #ifdef HAVE_GET_WCH
2953
+ keyboard_encoding = rb_locale_encoding();
2954
+ #else
2955
+ keyboard_encoding = rb_ascii8bit_encoding();
2956
+ #endif
2957
+ terminal_encoding = rb_locale_encoding();
2933
2958
 
2934
2959
  mCurses = rb_define_module("Curses");
2935
2960
 
@@ -2975,6 +3000,7 @@ Init_curses(void)
2975
3000
  rb_define_module_function(mCurses, "TABSIZE=", curses_tabsize_set, 1);
2976
3001
 
2977
3002
  rb_define_module_function(mCurses, "use_default_colors", curses_use_default_colors, 0);
3003
+ rb_define_module_function(mCurses, "assume_default_colors", curses_assume_default_colors, 2);
2978
3004
  rb_define_module_function(mCurses, "init_screen", curses_init_screen, 0);
2979
3005
  rb_define_module_function(mCurses, "close_screen", curses_close_screen, 0);
2980
3006
  rb_define_module_function(mCurses, "closed?", curses_closed, 0);
@@ -61,8 +61,8 @@ if header_library
61
61
  wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr
62
62
  wresize wscrl wsetscrreg werase redrawwin
63
63
  def_prog_mode reset_prog_mode timeout wtimeout nodelay
64
- init_color wcolor_set use_default_colors newpad
65
- unget_wch get_wch wget_wch)
64
+ init_color wcolor_set use_default_colors assume_default_colors
65
+ newpad unget_wch get_wch wget_wch)
66
66
  have_func(f) || (have_macro(f, curses) && $defs.push(format("-DHAVE_%s", f.upcase)))
67
67
  end
68
68
  flag = "-D_XOPEN_SOURCE_EXTENDED"
data/lib/2.2/curses.so CHANGED
Binary file
data/lib/2.3/curses.so CHANGED
Binary file
data/lib/2.4/curses.so CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Shugo Maeda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-08 00:00:00.000000000 Z
12
+ date: 2017-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.6.8
112
+ rubygems_version: 2.6.10
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: A Ruby binding for curses, ncurses, and PDCurses. curses is an extension