rumai 4.1.0 → 4.1.1
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.
- data/lib/rumai/inochi.rb +1 -1
- data/lib/rumai/wm.rb +36 -25
- data/man/man1/rumai.1 +5 -2
- metadata +1 -1
    
        data/lib/rumai/inochi.rb
    CHANGED
    
    
    
        data/lib/rumai/wm.rb
    CHANGED
    
    | @@ -878,15 +878,8 @@ module Rumai | |
| 878 878 | 
             
                #
         | 
| 879 879 | 
             
                def each_column starting_column_id = 1
         | 
| 880 880 | 
             
                  i = starting_column_id
         | 
| 881 | 
            -
                   | 
| 882 | 
            -
                     | 
| 883 | 
            -
             | 
| 884 | 
            -
                    if a.exist?
         | 
| 885 | 
            -
                      yield a
         | 
| 886 | 
            -
                    else
         | 
| 887 | 
            -
                      break
         | 
| 888 | 
            -
                    end
         | 
| 889 | 
            -
             | 
| 881 | 
            +
                  while (column = Area.new(i, self)).exist?
         | 
| 882 | 
            +
                    yield column
         | 
| 890 883 | 
             
                    i += 1
         | 
| 891 884 | 
             
                  end
         | 
| 892 885 | 
             
                end
         | 
| @@ -916,8 +909,8 @@ module Rumai | |
| 916 909 | 
             
                # its peak on the left side of the screen.
         | 
| 917 910 | 
             
                #
         | 
| 918 911 | 
             
                def tile_rightward
         | 
| 919 | 
            -
                   | 
| 920 | 
            -
                  heights = (1 | 
| 912 | 
            +
                  num_rising_columns, num_summit_clients = calculate_right_triangle
         | 
| 913 | 
            +
                  heights = (1..num_rising_columns).to_a.push(num_summit_clients)
         | 
| 921 914 | 
             
                  arrange_columns heights, :default
         | 
| 922 915 | 
             
                end
         | 
| 923 916 |  | 
| @@ -940,8 +933,8 @@ module Rumai | |
| 940 933 | 
             
                # its peak on the right side of the screen.
         | 
| 941 934 | 
             
                #
         | 
| 942 935 | 
             
                def tile_leftward
         | 
| 943 | 
            -
                   | 
| 944 | 
            -
                  heights = (1 | 
| 936 | 
            +
                  num_rising_columns, num_summit_clients = calculate_right_triangle
         | 
| 937 | 
            +
                  heights = (1..num_rising_columns).to_a.push(num_summit_clients).reverse
         | 
| 945 938 | 
             
                  arrange_columns heights, :default
         | 
| 946 939 | 
             
                end
         | 
| 947 940 |  | 
| @@ -954,7 +947,23 @@ module Rumai | |
| 954 947 | 
             
                # sides of the screen and their peaks meeting in the middle of the screen.
         | 
| 955 948 | 
             
                #
         | 
| 956 949 | 
             
                def tile_inward
         | 
| 957 | 
            -
                   | 
| 950 | 
            +
                  rising, num_summit_clients, falling = calculate_equilateral_triangle
         | 
| 951 | 
            +
             | 
| 952 | 
            +
                  # distribute extra clients in the middle
         | 
| 953 | 
            +
                  summit =
         | 
| 954 | 
            +
                    if num_summit_clients <= rising.length
         | 
| 955 | 
            +
                      # try to minimize the number of columns created in the middle by
         | 
| 956 | 
            +
                      # putting all summit clients in a single column--if they can fit
         | 
| 957 | 
            +
                      [num_summit_clients]
         | 
| 958 | 
            +
                    else
         | 
| 959 | 
            +
                      # no choice but to divide the summit clients into multiple columns
         | 
| 960 | 
            +
                      split = num_summit_clients / 2
         | 
| 961 | 
            +
                      carry = num_summit_clients % 2
         | 
| 962 | 
            +
                      [split, carry, split]
         | 
| 963 | 
            +
                    end.
         | 
| 964 | 
            +
                    reject(&:zero?)
         | 
| 965 | 
            +
             | 
| 966 | 
            +
                  arrange_columns rising + summit + falling, :default
         | 
| 958 967 | 
             
                end
         | 
| 959 968 |  | 
| 960 969 | 
             
                ##
         | 
| @@ -967,14 +976,14 @@ module Rumai | |
| 967 976 | 
             
                # sides of the screen.
         | 
| 968 977 | 
             
                #
         | 
| 969 978 | 
             
                def tile_outward
         | 
| 970 | 
            -
                  rising,  | 
| 971 | 
            -
                  heights = falling[ | 
| 979 | 
            +
                  rising, num_summit_clients, falling = calculate_equilateral_triangle
         | 
| 980 | 
            +
                  heights = falling + rising[1..-1]
         | 
| 972 981 |  | 
| 973 982 | 
             
                  # distribute extra clients on the outsides
         | 
| 974 | 
            -
                   | 
| 975 | 
            -
                  if  | 
| 976 | 
            -
                    split =  | 
| 977 | 
            -
                    carry =  | 
| 983 | 
            +
                  num_summit_clients += rising[0].to_i
         | 
| 984 | 
            +
                  if num_summit_clients > 0
         | 
| 985 | 
            +
                    split = num_summit_clients / 2
         | 
| 986 | 
            +
                    carry = num_summit_clients % 2
         | 
| 978 987 | 
             
                    # put the remainder on the left side to minimize the need for
         | 
| 979 988 | 
             
                    # rearrangement when clients are removed or added to the view
         | 
| 980 989 | 
             
                    heights.unshift split + carry
         | 
| @@ -1029,8 +1038,8 @@ module Rumai | |
| 1029 1038 | 
             
                # the given layout is applied to all columns, if specified.
         | 
| 1030 1039 | 
             
                #
         | 
| 1031 1040 | 
             
                def arrange_columns lengths, layout = nil
         | 
| 1032 | 
            -
                  i = 0
         | 
| 1033 1041 | 
             
                  maintain_focus do
         | 
| 1042 | 
            +
                    i = 0
         | 
| 1034 1043 | 
             
                    each_column do |column|
         | 
| 1035 1044 | 
             
                      if i < lengths.length
         | 
| 1036 1045 | 
             
                        column.length = lengths[i]
         | 
| @@ -1050,13 +1059,15 @@ module Rumai | |
| 1050 1059 | 
             
                  return [] unless num_clients > 1
         | 
| 1051 1060 |  | 
| 1052 1061 | 
             
                  # calculate the dimensions of the rising sub-triangle
         | 
| 1053 | 
            -
                  num_rising_columns,  | 
| 1062 | 
            +
                  num_rising_columns, num_rising_summit_clients =
         | 
| 1054 1063 | 
             
                    calculate_right_triangle(num_clients / 2)
         | 
| 1055 1064 |  | 
| 1065 | 
            +
                  num_summit_clients =
         | 
| 1066 | 
            +
                    (num_rising_summit_clients * 2) + (num_clients % 2)
         | 
| 1067 | 
            +
             | 
| 1056 1068 | 
             
                  # quantify entire triangle as a sequence of heights
         | 
| 1057 | 
            -
                   | 
| 1058 | 
            -
                   | 
| 1059 | 
            -
                  [heights, summit, heights.reverse]
         | 
| 1069 | 
            +
                  rising = (1 .. num_rising_columns).to_a
         | 
| 1070 | 
            +
                  [rising, num_summit_clients, rising.reverse]
         | 
| 1060 1071 | 
             
                end
         | 
| 1061 1072 |  | 
| 1062 1073 | 
             
                def calculate_right_triangle num_rising_clients = num_managed_clients
         | 
    
        data/man/man1/rumai.1
    CHANGED
    
    | @@ -4,10 +4,10 @@ | |
| 4 4 | 
             
            .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
         | 
| 5 5 | 
             
            .\"      Date: 2011-03-28
         | 
| 6 6 | 
             
            .\"    Manual: \ \&
         | 
| 7 | 
            -
            .\"    Source: \ \& 4.1. | 
| 7 | 
            +
            .\"    Source: \ \& 4.1.1
         | 
| 8 8 | 
             
            .\"  Language: English
         | 
| 9 9 | 
             
            .\"
         | 
| 10 | 
            -
            .TH "RUMAI" "1" "2011\-03\-28" "\ \& 4\&.1\&. | 
| 10 | 
            +
            .TH "RUMAI" "1" "2011\-03\-28" "\ \& 4\&.1\&.1" "\ \&"
         | 
| 11 11 | 
             
            .\" -----------------------------------------------------------------
         | 
| 12 12 | 
             
            .\" * Define some portability stuff
         | 
| 13 13 | 
             
            .\" -----------------------------------------------------------------
         | 
| @@ -856,6 +856,9 @@ Its exit status will indicate whether all tests have passed\&. It may also print | |
| 856 856 | 
             
            .sp
         | 
| 857 857 | 
             
            \m[blue]\fBFork this project on GitHub\fR\m[] and send a pull request\&.
         | 
| 858 858 | 
             
            .SH "HISTORY"
         | 
| 859 | 
            +
            .SS "Version 4\&.1\&.1 (2011\-03\-28)"
         | 
| 860 | 
            +
            .sp
         | 
| 861 | 
            +
            This release fixes bugs in the inward & outward automated client arrangements\&.
         | 
| 859 862 | 
             
            .SS "Version 4\&.1\&.0 (2011\-03\-28)"
         | 
| 860 863 | 
             
            .sp
         | 
| 861 864 | 
             
            This release adds new automated client arrangements and cleans up the code\&.
         |