rumai 3.3.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,12 +18,12 @@ module Rumai
18
18
  ##
19
19
  # Number of this release of this project.
20
20
  #
21
- VERSION = '3.3.1'
21
+ VERSION = '4.0.0'
22
22
 
23
23
  ##
24
24
  # Date of this release of this project.
25
25
  #
26
- RELDATE = '2010-08-11'
26
+ RELDATE = '2011-02-25'
27
27
 
28
28
  ##
29
29
  # Description of this release of this project.
@@ -234,7 +234,13 @@ module Rumai
234
234
  #
235
235
  module CounterField
236
236
  def to_9p field_values
237
- value_to_9p field_values[@countee.name].length
237
+ value = field_values[@countee.name]
238
+ count =
239
+ case value
240
+ when String then value.bytesize
241
+ else value.length
242
+ end
243
+ value_to_9p count
238
244
  end
239
245
  end
240
246
 
@@ -401,7 +407,7 @@ module Rumai
401
407
  #
402
408
  def to_9p
403
409
  data = type.to_9p(1) << super
404
- size = (data.length + 4).to_9p(4)
410
+ size = (data.bytesize + 4).to_9p(4)
405
411
  size << data
406
412
  end
407
413
 
@@ -683,7 +689,8 @@ class String
683
689
  # Transforms this object into a string of 9P2000 bytes.
684
690
  #
685
691
  def to_9p
686
- length.to_9p(2) << self[0, Rumai::IXP::BYTE2_MASK]
692
+ count = [bytesize, Rumai::IXP::BYTE2_MASK].min
693
+ count.to_9p(2) << byteslice(0, count)
687
694
  end
688
695
 
689
696
  ##
@@ -693,6 +700,16 @@ class String
693
700
  def self.from_9p stream
694
701
  stream.read stream.read_9p(2)
695
702
  end
703
+
704
+ unless method_defined? :byteslice
705
+ ##
706
+ # Does the same thing as String#slice but
707
+ # operates on bytes instead of characters.
708
+ #
709
+ def byteslice(*args)
710
+ unpack('C*').slice(*args).pack('C*')
711
+ end
712
+ end
696
713
  end
697
714
 
698
715
  class Time
@@ -327,15 +327,15 @@ module Rumai
327
327
  raise 'cannot write to a directory' if @stat.directory?
328
328
 
329
329
  data = content.to_s
330
- limit = data.length + @pos
330
+ limit = data.bytesize + @pos
331
331
 
332
332
  while @pos < limit
333
- chunk = data[@pos, @msize]
333
+ chunk = data.byteslice(@pos, @msize)
334
334
 
335
335
  req = Twrite.new(
336
336
  :fid => @fid,
337
337
  :offset => @pos,
338
- :count => chunk.length,
338
+ :count => chunk.bytesize,
339
339
  :data => chunk
340
340
  )
341
341
  rsp = @agent.talk(req)
@@ -172,17 +172,27 @@ module Rumai
172
172
  end
173
173
 
174
174
  ##
175
- # Moves this client in the given direction on the given view.
175
+ # Moves this client by the given amount in
176
+ # the given direction on the given view.
176
177
  #
177
- def nudge direction, view = View.curr
178
- reshape :nudge, direction, view
178
+ def nudge direction, amount = 1, view = View.curr
179
+ reshape :nudge, view, direction, amount
179
180
  end
180
181
 
181
182
  ##
182
- # Grows this client in the given direction on the given view.
183
+ # Grows this client by the given amount in
184
+ # the given direction on the given view.
183
185
  #
184
- def grow direction, view = View.curr
185
- reshape :grow, direction, view
186
+ def grow direction, amount = 1, view = View.curr
187
+ reshape :grow, view, direction, amount
188
+ end
189
+
190
+ ##
191
+ # Shrinks this client by the given amount
192
+ # in the given direction on the given view.
193
+ #
194
+ def shrink direction, amount = 1, view = View.curr
195
+ reshape :grow, view, direction, -amount.to_i
186
196
  end
187
197
 
188
198
  ##
@@ -448,10 +458,10 @@ module Rumai
448
458
 
449
459
  private
450
460
 
451
- def reshape method, direction, view
461
+ def reshape command, view, direction, amount
452
462
  area = self.area(view)
453
463
  index = area.client_ids.index(@id) + 1 # numbered as 1..N
454
- view.ctl.write "#{method} #{area.id} #{index} #{direction}"
464
+ view.ctl.write "#{command} #{area.id} #{index} #{direction} #{amount}"
455
465
  end
456
466
 
457
467
  ##
@@ -630,10 +640,9 @@ module Rumai
630
640
  # Inserts the given clients at the bottom of this area.
631
641
  #
632
642
  def push *clients
633
- clients.flatten!
634
643
  return if clients.empty?
635
644
 
636
- insert clients
645
+ insert *clients
637
646
 
638
647
  # move inserted clients to bottom
639
648
  clients.reverse.each_with_index do |c, i|
@@ -650,9 +659,6 @@ module Rumai
650
659
  # currently focused client in this area.
651
660
  #
652
661
  def insert *clients
653
- clients.flatten!
654
- return if clients.empty?
655
-
656
662
  clients.each do |c|
657
663
  import_client c
658
664
  end
@@ -662,10 +668,9 @@ module Rumai
662
668
  # Inserts the given clients at the top of this area.
663
669
  #
664
670
  def unshift *clients
665
- clients.flatten!
666
671
  return if clients.empty?
667
672
 
668
- insert clients
673
+ insert *clients
669
674
 
670
675
  # move inserted clients to top
671
676
  clients.each_with_index do |c, i|
@@ -679,7 +684,7 @@ module Rumai
679
684
  # Concatenates the given area to the bottom of this area.
680
685
  #
681
686
  def concat area
682
- push area.clients
687
+ push *area.clients
683
688
  end
684
689
 
685
690
  ##
@@ -693,14 +698,14 @@ module Rumai
693
698
  len, out = length, fringe
694
699
 
695
700
  if len > max_clients
696
- out.unshift clients[max_clients..-1]
701
+ out.unshift *clients[max_clients..-1]
697
702
 
698
703
  elsif len < max_clients
699
704
  until (diff = max_clients - length) == 0
700
705
  importable = out.clients[0, diff]
701
706
  break if importable.empty?
702
707
 
703
- push importable
708
+ push *importable
704
709
  end
705
710
  end
706
711
  end
@@ -840,7 +845,7 @@ module Rumai
840
845
  # Returns the IDs of all areas in this view.
841
846
  #
842
847
  def area_ids
843
- manifest.scan(/^# (\d+)/).flatten.unshift(FLOATING_AREA_ID)
848
+ manifest.scan(/^# (\d+) /).flatten.unshift(FLOATING_AREA_ID)
844
849
  end
845
850
 
846
851
  ##
@@ -1,13 +1,22 @@
1
1
  '\" t
2
2
  .\" Title: rumai
3
3
  .\" Author: [see the "AUTHORS" section]
4
- .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5
- .\" Date: 08/11/2010
4
+ .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5
+ .\" Date: 2011-02-25
6
6
  .\" Manual: \ \&
7
- .\" Source: \ \& 3.3.1
7
+ .\" Source: \ \& 4.0.0
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "RUMAI" "1" "08/11/2010" "\ \& 3\&.3\&.1" "\ \&"
10
+ .TH "RUMAI" "1" "2011\-02\-25" "\ \& 4\&.0\&.0" "\ \&"
11
+ .\" -----------------------------------------------------------------
12
+ .\" * Define some portability stuff
13
+ .\" -----------------------------------------------------------------
14
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ .\" http://bugs.debian.org/507673
16
+ .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+ .ie \n(.g .ds Aq \(aq
19
+ .el .ds Aq '
11
20
  .\" -----------------------------------------------------------------
12
21
  .\" * set default formatting
13
22
  .\" -----------------------------------------------------------------
@@ -156,7 +165,7 @@ Issue tracker (report bugs, request features, get help)
156
165
  .\}
157
166
 
158
167
  [Ruby]
159
- 1\&.8\&.6 or newer\&.
168
+ 1\&.8\&.7 or newer\&.
160
169
  .RE
161
170
  .sp
162
171
  .RS 4
@@ -443,7 +452,7 @@ Set the last column\(cqs layout to stacking mode:
443
452
  .RS 4
444
453
  .\}
445
454
  .nf
446
- b\&.layout = \'stack\'
455
+ b\&.layout = \*(Aqstack\*(Aq
447
456
  .fi
448
457
  .if n \{\
449
458
  .RE
@@ -554,7 +563,7 @@ Do complex operations on the red client\(cqs tags:
554
563
  .RS 4
555
564
  .\}
556
565
  .nf
557
- red\&.with_tags { concat %w[a b c]; push \'z\'; delete \'c\' }
566
+ red\&.with_tags { concat %w[a b c]; push \*(Aqz\*(Aq; delete \*(Aqc\*(Aq }
558
567
  .fi
559
568
  .if n \{\
560
569
  .RE
@@ -682,7 +691,7 @@ Navigate into to the /lbar/ directory:
682
691
  .\}
683
692
  .nf
684
693
  n1 = fs\&.lbar
685
- n2 = fs[\'lbar\']
694
+ n2 = fs[\*(Aqlbar\*(Aq]
686
695
  n1 == n2 #=> true
687
696
  left_bar = n1
688
697
  .fi
@@ -847,6 +856,90 @@ Its exit status will indicate whether all tests have passed\&. It may also print
847
856
  .sp
848
857
  \m[blue]\fBFork this project on GitHub\fR\m[] and send a pull request\&.
849
858
  .SH "HISTORY"
859
+ .SS "Version 4\&.0\&.0 (2011\-02\-25)"
860
+ .sp
861
+ This release fixes a bug regarding the $WMII_ADDRESS environment variable\&.
862
+ .PP
863
+ \fBIncompatible changes\fR
864
+ .sp
865
+ .RS 4
866
+ .ie n \{\
867
+ \h'-04'\(bu\h'+03'\c
868
+ .\}
869
+ .el \{\
870
+ .sp -1
871
+ .IP \(bu 2.3
872
+ .\}
873
+
874
+ Rumai::Area#push(),
875
+ #insert(), and
876
+ #unshift()
877
+ methods no longer accept an Array object as an argument\&. If you still wish to pass an Array, then use the splat operator to pass the contents of your Array to these methods\&.
878
+ .sp
879
+ Thanks to Mattia Gheda for reporting
880
+ \m[blue]\fBthis issue\fR\m[]\&\s-2\u[4]\d\s+2\&.
881
+ .RE
882
+ .sp
883
+ .RS 4
884
+ .ie n \{\
885
+ \h'-04'\(bu\h'+03'\c
886
+ .\}
887
+ .el \{\
888
+ .sp -1
889
+ .IP \(bu 2.3
890
+ .\}
891
+ Add
892
+ \fIamount\fR
893
+ parameter to
894
+ Rumai::Client#nudge()
895
+ and
896
+ #grow()\&.
897
+ .RE
898
+ .PP
899
+ \fBNew features\fR
900
+ .sp
901
+ .RS 4
902
+ .ie n \{\
903
+ \h'-04'\(bu\h'+03'\c
904
+ .\}
905
+ .el \{\
906
+ .sp -1
907
+ .IP \(bu 2.3
908
+ .\}
909
+ Add
910
+ Rumai::Client#shrink()
911
+ method for opposite of
912
+ #grow()\&.
913
+ .RE
914
+ .PP
915
+ \fBBug fixes\fR
916
+ .sp
917
+ .RS 4
918
+ .ie n \{\
919
+ \h'-04'\(bu\h'+03'\c
920
+ .\}
921
+ .el \{\
922
+ .sp -1
923
+ .IP \(bu 2.3
924
+ .\}
925
+ Fix ability to read and write Unicode strings to files in wmii IXP\&.
926
+ .sp
927
+ Thanks to OneLastTry for reporting
928
+ \m[blue]\fBthis issue\fR\m[]\&\s-2\u[5]\d\s+2\&.
929
+ .RE
930
+ .sp
931
+ .RS 4
932
+ .ie n \{\
933
+ \h'-04'\(bu\h'+03'\c
934
+ .\}
935
+ .el \{\
936
+ .sp -1
937
+ .IP \(bu 2.3
938
+ .\}
939
+ Fix parsing of area IDs from view manifest when
940
+ \fBwitray\fR
941
+ is present\&.
942
+ .RE
850
943
  .SS "Version 3\&.3\&.1 (2010\-08\-11)"
851
944
  .sp
852
945
  This release fixes a bug regarding the $WMII_ADDRESS environment variable\&.
@@ -927,7 +1020,7 @@ Rumai::Client#grow
927
1020
  and
928
1021
  Rumai::Client#nudge
929
1022
  methods
930
- \m[blue]\fBrequested by Nathan Neff\fR\m[]\&\s-2\u[4]\d\s+2\&. See "The /tag/ Hierarchy" in the wmii manpage for usage information\&.
1023
+ \m[blue]\fBrequested by Nathan Neff\fR\m[]\&\s-2\u[6]\d\s+2\&. See "The /tag/ Hierarchy" in the wmii manpage for usage information\&.
931
1024
  .RE
932
1025
  .PP
933
1026
  \fBBug fixes\fR
@@ -941,7 +1034,7 @@ methods
941
1034
  .IP \(bu 2.3
942
1035
  .\}
943
1036
  Add workaround for the
944
- \m[blue]\fBwmii\-hg2734 color tuple bug\fR\m[]\&\s-2\u[5]\d\s+2
1037
+ \m[blue]\fBwmii\-hg2734 color tuple bug\fR\m[]\&\s-2\u[7]\d\s+2
945
1038
  in the test suite\&.
946
1039
  .RE
947
1040
  .PP
@@ -984,8 +1077,10 @@ This release fixes an IXP transport layer bug under Ruby 1\&.8\&.7\&.
984
1077
  .\}
985
1078
 
986
1079
  IO#ungetc
987
- does not accept a one\-character string in Ruby 1\&.8\&.7\&. Thanks to Sebastian Chmielewski for reporting
988
- \m[blue]\fBthis issue\fR\m[]\&\s-2\u[6]\d\s+2\&.
1080
+ does not accept a one\-character string in Ruby 1\&.8\&.7\&.
1081
+ .sp
1082
+ Thanks to Sebastian Chmielewski for reporting
1083
+ \m[blue]\fBthis issue\fR\m[]\&\s-2\u[8]\d\s+2\&.
989
1084
  .RE
990
1085
  .SS "Version 3\&.2\&.3 (2010\-04\-28)"
991
1086
  .sp
@@ -1003,8 +1098,10 @@ This release adds a UNIX manual page and requires wmii 3\&.9 or newer\&.
1003
1098
  .\}
1004
1099
 
1005
1100
  Rumai::Area#unshift
1006
- needs wmii 3\&.9 or newer\&. The help manual has been corrected accordingly\&. Thanks to Mattia Gheda for reporting
1007
- \m[blue]\fBthis issue\fR\m[]\&\s-2\u[7]\d\s+2\&.
1101
+ needs wmii 3\&.9 or newer\&. The help manual has been corrected accordingly\&.
1102
+ .sp
1103
+ Thanks to Mattia Gheda for reporting
1104
+ \m[blue]\fBthis issue\fR\m[]\&\s-2\u[9]\d\s+2\&.
1008
1105
  .RE
1009
1106
  .PP
1010
1107
  \fBHousekeeping\fR
@@ -1054,7 +1151,7 @@ Warnings of the following form appeared during gem installation:
1054
1151
  .RS 4
1055
1152
  .\}
1056
1153
  .nf
1057
- Unrecognized directive \'\&.\&.\&.\' in lib/rumai/inochi\&.yaml
1154
+ Unrecognized directive \*(Aq\&.\&.\&.\*(Aq in lib/rumai/inochi\&.yaml
1058
1155
  .fi
1059
1156
  .if n \{\
1060
1157
  .RE
@@ -1208,7 +1305,9 @@ This release fixes bugs in automated view arrangements and updates the user manu
1208
1305
  .sp -1
1209
1306
  .IP \(bu 2.3
1210
1307
  .\}
1211
- The relative order of clients was not being preserved during view arrangements\&. Thanks to Nathan Neff for reporting this\&.
1308
+ The relative order of clients was not being preserved during view arrangements\&.
1309
+ .sp
1310
+ Thanks to Nathan Neff for reporting this bug\&.
1212
1311
  .RE
1213
1312
  .sp
1214
1313
  .RS 4
@@ -1828,7 +1927,7 @@ which would cause Rumai to hang when multiple threads used it\&.
1828
1927
  .RE
1829
1928
  .SS "Version 1\&.0\&.0 (2008\-01\-26)"
1830
1929
  .sp
1831
- This is the first release of Rumai, the evolution of \m[blue]\fBwmii\-irb\fR\m[]\&\s-2\u[8]\d\s+2, which lets you manipulate the [wmii] window manager through [Ruby]\&. Enjoy!
1930
+ This is the first release of Rumai, the evolution of \m[blue]\fBwmii\-irb\fR\m[]\&\s-2\u[10]\d\s+2, which lets you manipulate the [wmii] window manager through [Ruby]\&. Enjoy!
1832
1931
  .SH "AUTHORS"
1833
1932
  .sp
1834
1933
  Suraj N\&. Kurapati
@@ -1839,7 +1938,7 @@ Christoph Blank, Kenneth De Winter, Mattia Gheda, Michael Andrus, Nathan Neff, S
1839
1938
  .sp
1840
1939
  (the ISC license)
1841
1940
  .sp
1842
- Copyright 2006 Suraj N\&. Kurapati <\m[blue]\fBsunaku@gmail\&.com\fR\m[]\&\s-2\u[9]\d\s+2>
1941
+ Copyright 2006 Suraj N\&. Kurapati <\m[blue]\fBsunaku@gmail\&.com\fR\m[]\&\s-2\u[11]\d\s+2>
1843
1942
  .sp
1844
1943
  Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies\&.
1845
1944
  .sp
@@ -1925,31 +2024,41 @@ ruby-wrapper
1925
2024
  \%http://github.com/chneukirchen/rup/blob/master/ruby-wrapper
1926
2025
  .RE
1927
2026
  .IP " 4." 4
2027
+ this issue
2028
+ .RS 4
2029
+ \%http://github.com/sunaku/rumai/issues/10
2030
+ .RE
2031
+ .IP " 5." 4
2032
+ this issue
2033
+ .RS 4
2034
+ \%http://github.com/sunaku/rumai/issues/9
2035
+ .RE
2036
+ .IP " 6." 4
1928
2037
  requested by Nathan Neff
1929
2038
  .RS 4
1930
2039
  \%http://github.com/sunaku/rumai/issues/6
1931
2040
  .RE
1932
- .IP " 5." 4
2041
+ .IP " 7." 4
1933
2042
  wmii-hg2734 color tuple bug
1934
2043
  .RS 4
1935
2044
  \%http://code.google.com/p/wmii/issues/detail?id=206
1936
2045
  .RE
1937
- .IP " 6." 4
2046
+ .IP " 8." 4
1938
2047
  this issue
1939
2048
  .RS 4
1940
2049
  \%http://github.com/sunaku/rumai/issues/3
1941
2050
  .RE
1942
- .IP " 7." 4
2051
+ .IP " 9." 4
1943
2052
  this issue
1944
2053
  .RS 4
1945
2054
  \%http://github.com/sunaku/wmiirc/issues/8
1946
2055
  .RE
1947
- .IP " 8." 4
2056
+ .IP "10." 4
1948
2057
  wmii-irb
1949
2058
  .RS 4
1950
2059
  \%http://article.gmane.org/gmane.comp.window-managers.wmii/1704
1951
2060
  .RE
1952
- .IP " 9." 4
2061
+ .IP "11." 4
1953
2062
  sunaku@gmail.com
1954
2063
  .RS 4
1955
2064
  \%mailto:sunaku@gmail.com
metadata CHANGED
@@ -3,10 +3,10 @@ name: rumai
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 3
7
- - 3
8
- - 1
9
- version: 3.3.1
6
+ - 4
7
+ - 0
8
+ - 0
9
+ version: 4.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Suraj N. Kurapati
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-11 00:00:00 -07:00
17
+ date: 2011-02-25 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -68,13 +68,13 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - bin/rumai
70
70
  - lib/rumai.rb
71
- - lib/rumai/fs.rb
72
- - lib/rumai/wm.rb
73
71
  - lib/rumai/ixp.rb
74
72
  - lib/rumai/inochi.rb
75
- - lib/rumai/ixp/transport.rb
76
73
  - lib/rumai/ixp/message.rb
74
+ - lib/rumai/ixp/transport.rb
77
75
  - lib/rumai/irb.rb
76
+ - lib/rumai/fs.rb
77
+ - lib/rumai/wm.rb
78
78
  - LICENSE
79
79
  - CREDITS
80
80
  - man/man1/rumai.1