lg_pod_plugin 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git/author.rb +14 -0
  3. data/lib/git/base/factory.rb +101 -0
  4. data/lib/git/base.rb +670 -0
  5. data/lib/git/branch.rb +126 -0
  6. data/lib/git/branches.rb +71 -0
  7. data/lib/git/config.rb +22 -0
  8. data/lib/git/diff.rb +155 -0
  9. data/lib/git/encoding_utils.rb +33 -0
  10. data/lib/git/escaped_path.rb +77 -0
  11. data/lib/git/index.rb +5 -0
  12. data/lib/git/lib.rb +1215 -0
  13. data/lib/git/log.rb +135 -0
  14. data/lib/git/object.rb +312 -0
  15. data/lib/git/path.rb +31 -0
  16. data/lib/git/remote.rb +36 -0
  17. data/lib/git/repository.rb +6 -0
  18. data/lib/git/stash.rb +27 -0
  19. data/lib/git/stashes.rb +55 -0
  20. data/lib/git/status.rb +199 -0
  21. data/lib/git/url.rb +127 -0
  22. data/lib/git/version.rb +5 -0
  23. data/lib/git/working_directory.rb +4 -0
  24. data/lib/git/worktree.rb +38 -0
  25. data/lib/git/worktrees.rb +47 -0
  26. data/lib/git.rb +326 -0
  27. data/lib/lg_pod_plugin/database.rb +104 -104
  28. data/lib/lg_pod_plugin/{download.rb → downloader.rb} +1 -1
  29. data/lib/lg_pod_plugin/file_path.rb +1 -1
  30. data/lib/lg_pod_plugin/git_util.rb +154 -50
  31. data/lib/lg_pod_plugin/install.rb +27 -21
  32. data/lib/lg_pod_plugin/l_cache.rb +13 -14
  33. data/lib/lg_pod_plugin/l_util.rb +39 -0
  34. data/lib/lg_pod_plugin/request.rb +9 -10
  35. data/lib/lg_pod_plugin/version.rb +1 -1
  36. data/lib/lg_pod_plugin.rb +1 -3
  37. data/lib/rchardet/big5freq.rb +927 -0
  38. data/lib/rchardet/big5prober.rb +42 -0
  39. data/lib/rchardet/chardistribution.rb +250 -0
  40. data/lib/rchardet/charsetgroupprober.rb +110 -0
  41. data/lib/rchardet/charsetprober.rb +70 -0
  42. data/lib/rchardet/codingstatemachine.rb +67 -0
  43. data/lib/rchardet/constants.rb +42 -0
  44. data/lib/rchardet/escprober.rb +90 -0
  45. data/lib/rchardet/escsm.rb +245 -0
  46. data/lib/rchardet/eucjpprober.rb +88 -0
  47. data/lib/rchardet/euckrfreq.rb +597 -0
  48. data/lib/rchardet/euckrprober.rb +42 -0
  49. data/lib/rchardet/euctwfreq.rb +431 -0
  50. data/lib/rchardet/euctwprober.rb +42 -0
  51. data/lib/rchardet/gb18030freq.rb +474 -0
  52. data/lib/rchardet/gb18030prober.rb +42 -0
  53. data/lib/rchardet/hebrewprober.rb +289 -0
  54. data/lib/rchardet/jisfreq.rb +571 -0
  55. data/lib/rchardet/jpcntx.rb +229 -0
  56. data/lib/rchardet/langbulgarianmodel.rb +229 -0
  57. data/lib/rchardet/langcyrillicmodel.rb +330 -0
  58. data/lib/rchardet/langgreekmodel.rb +227 -0
  59. data/lib/rchardet/langhebrewmodel.rb +202 -0
  60. data/lib/rchardet/langhungarianmodel.rb +226 -0
  61. data/lib/rchardet/langthaimodel.rb +201 -0
  62. data/lib/rchardet/latin1prober.rb +147 -0
  63. data/lib/rchardet/mbcharsetprober.rb +89 -0
  64. data/lib/rchardet/mbcsgroupprober.rb +47 -0
  65. data/lib/rchardet/mbcssm.rb +542 -0
  66. data/lib/rchardet/sbcharsetprober.rb +122 -0
  67. data/lib/rchardet/sbcsgroupprober.rb +58 -0
  68. data/lib/rchardet/sjisprober.rb +88 -0
  69. data/lib/rchardet/universaldetector.rb +179 -0
  70. data/lib/rchardet/utf8prober.rb +87 -0
  71. data/lib/rchardet/version.rb +3 -0
  72. data/lib/rchardet.rb +67 -0
  73. data/lib/zip/central_directory.rb +212 -0
  74. data/lib/zip/compressor.rb +9 -0
  75. data/lib/zip/constants.rb +115 -0
  76. data/lib/zip/crypto/decrypted_io.rb +40 -0
  77. data/lib/zip/crypto/encryption.rb +11 -0
  78. data/lib/zip/crypto/null_encryption.rb +43 -0
  79. data/lib/zip/crypto/traditional_encryption.rb +99 -0
  80. data/lib/zip/decompressor.rb +31 -0
  81. data/lib/zip/deflater.rb +34 -0
  82. data/lib/zip/dos_time.rb +53 -0
  83. data/lib/zip/entry.rb +719 -0
  84. data/lib/zip/entry_set.rb +88 -0
  85. data/lib/zip/errors.rb +19 -0
  86. data/lib/zip/extra_field/generic.rb +44 -0
  87. data/lib/zip/extra_field/ntfs.rb +94 -0
  88. data/lib/zip/extra_field/old_unix.rb +46 -0
  89. data/lib/zip/extra_field/universal_time.rb +77 -0
  90. data/lib/zip/extra_field/unix.rb +39 -0
  91. data/lib/zip/extra_field/zip64.rb +70 -0
  92. data/lib/zip/extra_field/zip64_placeholder.rb +15 -0
  93. data/lib/zip/extra_field.rb +103 -0
  94. data/lib/zip/file.rb +468 -0
  95. data/lib/zip/filesystem.rb +643 -0
  96. data/lib/zip/inflater.rb +54 -0
  97. data/lib/zip/input_stream.rb +180 -0
  98. data/lib/zip/ioextras/abstract_input_stream.rb +122 -0
  99. data/lib/zip/ioextras/abstract_output_stream.rb +43 -0
  100. data/lib/zip/ioextras.rb +36 -0
  101. data/lib/zip/null_compressor.rb +15 -0
  102. data/lib/zip/null_decompressor.rb +19 -0
  103. data/lib/zip/null_input_stream.rb +10 -0
  104. data/lib/zip/output_stream.rb +198 -0
  105. data/lib/zip/pass_thru_compressor.rb +23 -0
  106. data/lib/zip/pass_thru_decompressor.rb +31 -0
  107. data/lib/zip/streamable_directory.rb +15 -0
  108. data/lib/zip/streamable_stream.rb +52 -0
  109. data/lib/zip/version.rb +3 -0
  110. data/lib/zip.rb +72 -0
  111. metadata +103 -31
@@ -0,0 +1,147 @@
1
+ ######################## BEGIN LICENSE BLOCK ########################
2
+ # The Original Code is Mozilla Universal charset detector code.
3
+ #
4
+ # The Initial Developer of the Original Code is
5
+ # Netscape Communications Corporation.
6
+ # Portions created by the Initial Developer are Copyright (C) 2001
7
+ # the Initial Developer. All Rights Reserved.
8
+ #
9
+ # Contributor(s):
10
+ # Jeff Hodges - port to Ruby
11
+ # Mark Pilgrim - port to Python
12
+ # Shy Shalom - original C code
13
+ #
14
+ # This library is free software; you can redistribute it and/or
15
+ # modify it under the terms of the GNU Lesser General Public
16
+ # License as published by the Free Software Foundation; either
17
+ # version 2.1 of the License, or (at your option) any later version.
18
+ #
19
+ # This library is distributed in the hope that it will be useful,
20
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
+ # Lesser General Public License for more details.
23
+ #
24
+ # You should have received a copy of the GNU Lesser General Public
25
+ # License along with this library; if not, write to the Free Software
26
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27
+ # 02110-1301 USA
28
+ ######################### END LICENSE BLOCK #########################
29
+
30
+ module CharDet
31
+ FREQ_CAT_NUM = 4
32
+
33
+ UDF = 0 # undefined
34
+ OTH = 1 # other
35
+ ASC = 2 # ascii capital letter
36
+ ASS = 3 # ascii small letter
37
+ ACV = 4 # accent capital vowel
38
+ ACO = 5 # accent capital other
39
+ ASV = 6 # accent small vowel
40
+ ASO = 7 # accent small other
41
+ CLASS_NUM = 8 # total classes
42
+
43
+ Latin1_CharToClass = [
44
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 00 - 07
45
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 08 - 0F
46
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 10 - 17
47
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 18 - 1F
48
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 20 - 27
49
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 28 - 2F
50
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 30 - 37
51
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 38 - 3F
52
+ OTH, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 40 - 47
53
+ ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 48 - 4F
54
+ ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 50 - 57
55
+ ASC, ASC, ASC, OTH, OTH, OTH, OTH, OTH, # 58 - 5F
56
+ OTH, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 60 - 67
57
+ ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 68 - 6F
58
+ ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 70 - 77
59
+ ASS, ASS, ASS, OTH, OTH, OTH, OTH, OTH, # 78 - 7F
60
+ OTH, UDF, OTH, ASO, OTH, OTH, OTH, OTH, # 80 - 87
61
+ OTH, OTH, ACO, OTH, ACO, UDF, ACO, UDF, # 88 - 8F
62
+ UDF, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 90 - 97
63
+ OTH, OTH, ASO, OTH, ASO, UDF, ASO, ACO, # 98 - 9F
64
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A0 - A7
65
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A8 - AF
66
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B0 - B7
67
+ OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B8 - BF
68
+ ACV, ACV, ACV, ACV, ACV, ACV, ACO, ACO, # C0 - C7
69
+ ACV, ACV, ACV, ACV, ACV, ACV, ACV, ACV, # C8 - CF
70
+ ACO, ACO, ACV, ACV, ACV, ACV, ACV, OTH, # D0 - D7
71
+ ACV, ACV, ACV, ACV, ACV, ACO, ACO, ACO, # D8 - DF
72
+ ASV, ASV, ASV, ASV, ASV, ASV, ASO, ASO, # E0 - E7
73
+ ASV, ASV, ASV, ASV, ASV, ASV, ASV, ASV, # E8 - EF
74
+ ASO, ASO, ASV, ASV, ASV, ASV, ASV, OTH, # F0 - F7
75
+ ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO, # F8 - FF
76
+ ].freeze
77
+
78
+ # 0 : illegal
79
+ # 1 : very unlikely
80
+ # 2 : normal
81
+ # 3 : very likely
82
+ Latin1ClassModel = [
83
+ # UDF OTH ASC ASS ACV ACO ASV ASO
84
+ 0, 0, 0, 0, 0, 0, 0, 0, # UDF
85
+ 0, 3, 3, 3, 3, 3, 3, 3, # OTH
86
+ 0, 3, 3, 3, 3, 3, 3, 3, # ASC
87
+ 0, 3, 3, 3, 1, 1, 3, 3, # ASS
88
+ 0, 3, 3, 3, 1, 2, 1, 2, # ACV
89
+ 0, 3, 3, 3, 3, 3, 3, 3, # ACO
90
+ 0, 3, 1, 3, 1, 1, 1, 3, # ASV
91
+ 0, 3, 1, 3, 1, 1, 3, 3, # ASO
92
+ ].freeze
93
+
94
+ class Latin1Prober < CharSetProber
95
+ def initialize
96
+ super
97
+ reset()
98
+ end
99
+
100
+ def reset
101
+ @lastCharClass = OTH
102
+ @freqCounter = [0] * FREQ_CAT_NUM
103
+ super
104
+ end
105
+
106
+ def get_charset_name
107
+ return "windows-1252"
108
+ end
109
+
110
+ def feed(aBuf)
111
+ aBuf = filter_with_english_letters(aBuf)
112
+ aBuf.each_byte do |b|
113
+ c = b.chr
114
+ charClass = Latin1_CharToClass[c.bytes.first]
115
+ freq = Latin1ClassModel[(@lastCharClass * CLASS_NUM) + charClass]
116
+ if freq == 0
117
+ @state = ENotMe
118
+ break
119
+ end
120
+ @freqCounter[freq] += 1
121
+ @lastCharClass = charClass
122
+ end
123
+
124
+ return get_state()
125
+ end
126
+
127
+ def get_confidence
128
+ if get_state() == ENotMe
129
+ return 0.01
130
+ end
131
+
132
+ total = @freqCounter.inject{|a,b| a+b}
133
+ if total < 0.01
134
+ confidence = 0.0
135
+ else
136
+ confidence = (@freqCounter[3] / total) - (@freqCounter[1] * 20.0 / total)
137
+ end
138
+ if confidence < 0.0
139
+ confidence = 0.0
140
+ end
141
+ # lower the confidence of latin1 so that other more accurate detector
142
+ # can take priority.
143
+ confidence = confidence * 0.5
144
+ return confidence
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,89 @@
1
+ ######################## BEGIN LICENSE BLOCK ########################
2
+ # The Original Code is Mozilla Universal charset detector code.
3
+ #
4
+ # The Initial Developer of the Original Code is
5
+ # Netscape Communications Corporation.
6
+ # Portions created by the Initial Developer are Copyright (C) 2001
7
+ # the Initial Developer. All Rights Reserved.
8
+ #
9
+ # Contributor(s):
10
+ # Jeff Hodges - port to Ruby
11
+ # Mark Pilgrim - port to Python
12
+ # Shy Shalom - original C code
13
+ # Proofpoint, Inc.
14
+ #
15
+ # This library is free software; you can redistribute it and/or
16
+ # modify it under the terms of the GNU Lesser General Public
17
+ # License as published by the Free Software Foundation; either
18
+ # version 2.1 of the License, or (at your option) any later version.
19
+ #
20
+ # This library is distributed in the hope that it will be useful,
21
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
+ # Lesser General Public License for more details.
24
+ #
25
+ # You should have received a copy of the GNU Lesser General Public
26
+ # License along with this library; if not, write to the Free Software
27
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28
+ # 02110-1301 USA
29
+ ######################### END LICENSE BLOCK #########################
30
+
31
+ module CharDet
32
+ class MultiByteCharSetProber < CharSetProber
33
+ def initialize
34
+ super
35
+ @distributionAnalyzer = nil
36
+ @codingSM = nil
37
+ @lastChar = "\x00\x00"
38
+ end
39
+
40
+ def reset
41
+ super
42
+ if @codingSM
43
+ @codingSM.reset()
44
+ end
45
+ if @distributionAnalyzer
46
+ @distributionAnalyzer.reset()
47
+ end
48
+ @lastChar = "\x00\x00"
49
+ end
50
+
51
+ def get_charset_name
52
+ end
53
+
54
+ def feed(aBuf)
55
+ aLen = aBuf.length
56
+ for i in (0...aLen)
57
+ codingState = @codingSM.next_state(aBuf[i, 1])
58
+ if codingState == EError
59
+ $stderr << "#{get_charset_name} prober hit error at byte #{i}\n" if $debug
60
+ @state = ENotMe
61
+ break
62
+ elsif codingState == EItsMe
63
+ @state = EFoundIt
64
+ break
65
+ elsif codingState == EStart
66
+ charLen = @codingSM.get_current_charlen()
67
+ if i == 0
68
+ @lastChar[1] = aBuf[0, 1]
69
+ @distributionAnalyzer.feed(@lastChar, charLen)
70
+ else
71
+ @distributionAnalyzer.feed(aBuf[i-1, 2], charLen)
72
+ end
73
+ end
74
+ end
75
+ @lastChar[0] = aBuf[aLen-1, 1]
76
+
77
+ if get_state() == EDetecting
78
+ if @distributionAnalyzer.got_enough_data() and (get_confidence() > SHORTCUT_THRESHOLD)
79
+ @state = EFoundIt
80
+ end
81
+ end
82
+ return get_state()
83
+ end
84
+
85
+ def get_confidence
86
+ return @distributionAnalyzer.get_confidence()
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,47 @@
1
+ ######################## BEGIN LICENSE BLOCK ########################
2
+ # The Original Code is Mozilla Universal charset detector code.
3
+ #
4
+ # The Initial Developer of the Original Code is
5
+ # Netscape Communications Corporation.
6
+ # Portions created by the Initial Developer are Copyright (C) 2001
7
+ # the Initial Developer. All Rights Reserved.
8
+ #
9
+ # Contributor(s):
10
+ # Jeff Hodges - port to Ruby
11
+ # Mark Pilgrim - port to Python
12
+ # Shy Shalom - original C code
13
+ # Proofpoint, Inc.
14
+ #
15
+ # This library is free software; you can redistribute it and/or
16
+ # modify it under the terms of the GNU Lesser General Public
17
+ # License as published by the Free Software Foundation; either
18
+ # version 2.1 of the License, or (at your option) any later version.
19
+ #
20
+ # This library is distributed in the hope that it will be useful,
21
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
+ # Lesser General Public License for more details.
24
+ #
25
+ # You should have received a copy of the GNU Lesser General Public
26
+ # License along with this library; if not, write to the Free Software
27
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28
+ # 02110-1301 USA
29
+ ######################### END LICENSE BLOCK #########################
30
+
31
+ module CharDet
32
+ class MBCSGroupProber < CharSetGroupProber
33
+ def initialize
34
+ super
35
+ @probers = [
36
+ UTF8Prober.new,
37
+ SJISProber.new,
38
+ EUCJPProber.new,
39
+ GB18030Prober.new,
40
+ EUCKRProber.new,
41
+ Big5Prober.new,
42
+ EUCTWProber.new
43
+ ]
44
+ reset()
45
+ end
46
+ end
47
+ end