knjrbfw 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -1
- data/VERSION +1 -1
- data/knjrbfw.gemspec +14 -4
- data/lib/knj/amixer.rb +148 -0
- data/lib/knj/arrayext.rb +14 -5
- data/lib/knj/autoload.rb +63 -57
- data/lib/knj/autoload/backups/facets_dictionary.rb +2 -2
- data/lib/knj/autoload/erubis.rb +2 -0
- data/lib/knj/cmd_gen.rb +71 -0
- data/lib/knj/compiler.rb +2 -2
- data/lib/knj/datarow.rb +138 -38
- data/lib/knj/datestamp.rb +2 -2
- data/lib/knj/datet.rb +72 -17
- data/lib/knj/erb/include.rb +5 -5
- data/lib/knj/errors.rb +4 -1
- data/lib/knj/eruby.rb +25 -11
- data/lib/knj/event_filemod.rb +27 -26
- data/lib/knj/event_handler.rb +8 -8
- data/lib/knj/exchangerates.rb +1 -1
- data/lib/knj/facebook_connect.rb +37 -0
- data/lib/knj/gettext_threadded.rb +4 -3
- data/lib/knj/google_sitemap.rb +1 -1
- data/lib/knj/hash_methods.rb +1 -1
- data/lib/knj/http.rb +35 -19
- data/lib/knj/http2.rb +249 -0
- data/lib/knj/image.rb +128 -0
- data/lib/knj/jruby-gtk2/gtk2.rb +1 -1
- data/lib/knj/knj.rb +1 -1
- data/lib/knj/knj_controller.rb +0 -2
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql.rb +3 -3
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql_columns.rb +11 -11
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql_tables.rb +2 -2
- data/lib/knj/knjdb/drivers/sqlite3/knjdb_sqlite3.rb +71 -14
- data/lib/knj/knjdb/drivers/sqlite3/knjdb_sqlite3_columns.rb +17 -14
- data/lib/knj/knjdb/drivers/sqlite3/knjdb_sqlite3_tables.rb +5 -5
- data/lib/knj/knjdb/libknjdb.rb +33 -16
- data/lib/knj/knjdb/libknjdb_row.rb +8 -8
- data/lib/knj/maemo/fremantle-calendar/fremantle-calendar.rb +1 -1
- data/lib/knj/mount.rb +6 -6
- data/lib/knj/mutexcl.rb +2 -2
- data/lib/knj/objects.rb +286 -73
- data/lib/knj/opts.rb +11 -4
- data/lib/knj/os.rb +16 -3
- data/lib/knj/php.rb +73 -26
- data/lib/knj/php_parser/php_parser.rb +1 -77
- data/lib/knj/retry.rb +4 -4
- data/lib/knj/rhodes/rhodes.rb +106 -0
- data/lib/knj/sshrobot/sshrobot.rb +1 -1
- data/lib/knj/strings.rb +72 -0
- data/lib/knj/sysuser.rb +1 -1
- data/lib/knj/tests/test_http2.rb +18 -0
- data/lib/knj/thread.rb +1 -5
- data/lib/knj/thread2.rb +3 -3
- data/lib/knj/threadhandler.rb +2 -2
- data/lib/knj/threadpool.rb +4 -4
- data/lib/knj/translations.rb +2 -17
- data/lib/knj/unix_proc.rb +3 -3
- data/lib/knj/web.rb +156 -77
- data/lib/knj/webscripts/image.rhtml +22 -3
- data/lib/knj/x11vnc.rb +3 -3
- data/spec/amixer_spec.rb +27 -0
- data/spec/knjrbfw_spec.rb +70 -12
- data/testfiles/image.jpg +0 -0
- metadata +32 -14
- data/Gemfile.lock +0 -32
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/knjrbfw.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{knjrbfw}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kasper Johansen"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-11-15}
|
13
13
|
s.description = %q{Including stuff for HTTP, SSH and much more.}
|
14
14
|
s.email = %q{k@spernj.org}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -20,13 +20,13 @@ Gem::Specification.new do |s|
|
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
22
|
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
23
|
"LICENSE.txt",
|
25
24
|
"README.rdoc",
|
26
25
|
"Rakefile",
|
27
26
|
"VERSION",
|
28
27
|
"knjrbfw.gemspec",
|
29
28
|
"lib/knj/.gitignore",
|
29
|
+
"lib/knj/amixer.rb",
|
30
30
|
"lib/knj/arrayext.rb",
|
31
31
|
"lib/knj/autoload.rb",
|
32
32
|
"lib/knj/autoload/activesupport.rb",
|
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
|
|
52
52
|
"lib/knj/autoload/twitter.rb",
|
53
53
|
"lib/knj/autoload/xmlsimple.rb",
|
54
54
|
"lib/knj/autoload/zip.rb",
|
55
|
+
"lib/knj/cmd_gen.rb",
|
55
56
|
"lib/knj/compiler.rb",
|
56
57
|
"lib/knj/cpufreq.rb",
|
57
58
|
"lib/knj/datarow.rb",
|
@@ -74,6 +75,7 @@ Gem::Specification.new do |s|
|
|
74
75
|
"lib/knj/event_handler.rb",
|
75
76
|
"lib/knj/exchangerates.rb",
|
76
77
|
"lib/knj/ext/webrick.rb",
|
78
|
+
"lib/knj/facebook_connect.rb",
|
77
79
|
"lib/knj/filesystem.rb",
|
78
80
|
"lib/knj/fs/drivers/filesystem.rb",
|
79
81
|
"lib/knj/fs/drivers/ftp.rb",
|
@@ -89,6 +91,8 @@ Gem::Specification.new do |s|
|
|
89
91
|
"lib/knj/gtk2_tv.rb",
|
90
92
|
"lib/knj/hash_methods.rb",
|
91
93
|
"lib/knj/http.rb",
|
94
|
+
"lib/knj/http2.rb",
|
95
|
+
"lib/knj/image.rb",
|
92
96
|
"lib/knj/includes/appserver_cli.rb",
|
93
97
|
"lib/knj/ip2location.rb",
|
94
98
|
"lib/knj/ironruby-gtk2/button.rb",
|
@@ -208,6 +212,7 @@ Gem::Specification.new do |s|
|
|
208
212
|
"lib/knj/tests/compiler/compiler_test.rb",
|
209
213
|
"lib/knj/tests/compiler/compiler_test_file.rb",
|
210
214
|
"lib/knj/tests/test_degulesider.rb",
|
215
|
+
"lib/knj/tests/test_http2.rb",
|
211
216
|
"lib/knj/tests/test_mount.rb",
|
212
217
|
"lib/knj/tests/test_retry.rb",
|
213
218
|
"lib/knj/thread.rb",
|
@@ -224,8 +229,10 @@ Gem::Specification.new do |s|
|
|
224
229
|
"lib/knj/x11vnc.rb",
|
225
230
|
"lib/knj/youtube.rb",
|
226
231
|
"lib/knjrbfw.rb",
|
232
|
+
"spec/amixer_spec.rb",
|
227
233
|
"spec/knjrbfw_spec.rb",
|
228
|
-
"spec/spec_helper.rb"
|
234
|
+
"spec/spec_helper.rb",
|
235
|
+
"testfiles/image.jpg"
|
229
236
|
]
|
230
237
|
s.homepage = %q{http://github.com/kaspernj/knjrbfw}
|
231
238
|
s.licenses = ["MIT"]
|
@@ -242,12 +249,14 @@ Gem::Specification.new do |s|
|
|
242
249
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.3"])
|
243
250
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
244
251
|
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
252
|
+
s.add_development_dependency(%q<rmagick>, [">= 0"])
|
245
253
|
else
|
246
254
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
247
255
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
248
256
|
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
249
257
|
s.add_dependency(%q<rcov>, [">= 0"])
|
250
258
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
259
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
251
260
|
end
|
252
261
|
else
|
253
262
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
@@ -255,6 +264,7 @@ Gem::Specification.new do |s|
|
|
255
264
|
s.add_dependency(%q<jeweler>, ["~> 1.6.3"])
|
256
265
|
s.add_dependency(%q<rcov>, [">= 0"])
|
257
266
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
267
|
+
s.add_dependency(%q<rmagick>, [">= 0"])
|
258
268
|
end
|
259
269
|
end
|
260
270
|
|
data/lib/knj/amixer.rb
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
#This class is a Ruby-interface to the amixer-binary. It can read and set the volume.
|
2
|
+
class Knj::Amixer
|
3
|
+
attr_reader :args
|
4
|
+
|
5
|
+
def initialize(args = {})
|
6
|
+
@args = {
|
7
|
+
:amixer_bin => "/usr/bin/amixer",
|
8
|
+
:aplay_bin => "/usr/bin/aplay"
|
9
|
+
}.merge(args)
|
10
|
+
|
11
|
+
@devices = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
#Returns a hash with devices.
|
15
|
+
def devices
|
16
|
+
ret = %x[#{@args[:aplay_bin]} -l]
|
17
|
+
|
18
|
+
ret.scan(/card (\d+): (.+?) \[(.+?)\],/) do |match|
|
19
|
+
id = match[0]
|
20
|
+
|
21
|
+
if !@devices.key?(id)
|
22
|
+
@devices[id] = Knj::Amixer::Device.new(
|
23
|
+
:amixer => self,
|
24
|
+
:id => id,
|
25
|
+
:name => match[2],
|
26
|
+
:code => match[1]
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
return @devices
|
32
|
+
end
|
33
|
+
|
34
|
+
class Device
|
35
|
+
def initialize(args)
|
36
|
+
@args = args
|
37
|
+
@mixers = {}
|
38
|
+
end
|
39
|
+
|
40
|
+
def id
|
41
|
+
return @args[:id]
|
42
|
+
end
|
43
|
+
|
44
|
+
def name
|
45
|
+
return @args[:name]
|
46
|
+
end
|
47
|
+
|
48
|
+
def code
|
49
|
+
return @args[:code]
|
50
|
+
end
|
51
|
+
|
52
|
+
def amixer
|
53
|
+
return @args[:amixer]
|
54
|
+
end
|
55
|
+
|
56
|
+
#Returns true if the device is active by looking in '/proc/asounc/card*/pcm*/sub*/status'.
|
57
|
+
def active?(args = {})
|
58
|
+
proc_path = "/proc/asound/#{@args[:code]}"
|
59
|
+
|
60
|
+
Dir.foreach(proc_path) do |file|
|
61
|
+
next if file == "." or file == ".." or !file.match(/^pcm(\d+)[a-z]+$/)
|
62
|
+
sub_path = "#{proc_path}/#{file}"
|
63
|
+
info_path = "#{sub_path}/info"
|
64
|
+
info_cont = File.read(info_path)
|
65
|
+
|
66
|
+
if stream_match = info_cont.match(/stream: (.+?)\s+/)
|
67
|
+
next if args.key?(:stream) and stream_match[1] != args[:stream]
|
68
|
+
end
|
69
|
+
|
70
|
+
Dir.foreach(sub_path) do |file_sub|
|
71
|
+
next if file_sub == "." or file_sub == ".." or !file_sub.match(/^sub(\d+)$/)
|
72
|
+
status_path = "#{sub_path}/#{file_sub}/status"
|
73
|
+
cont = File.read(status_path)
|
74
|
+
return true if cont.strip != "closed"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
return false
|
79
|
+
end
|
80
|
+
|
81
|
+
#Returns a hash of the various mixers.
|
82
|
+
def mixers
|
83
|
+
ret = %x[#{@args[:amixer].args[:amixer_bin]} -c #{@args[:id]} scontrols]
|
84
|
+
|
85
|
+
ret.scan(/Simple mixer control '(.+)',0/) do |match|
|
86
|
+
name = match[0]
|
87
|
+
|
88
|
+
if !@mixers.key?(name)
|
89
|
+
@mixers[name] = Knj::Amixer::Mixer.new(
|
90
|
+
:amixer => @args[:amixer],
|
91
|
+
:device => self,
|
92
|
+
:name => name
|
93
|
+
)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
return @mixers
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
#This class controls each mixer.
|
102
|
+
class Mixer
|
103
|
+
def initialize(args)
|
104
|
+
@args = args
|
105
|
+
end
|
106
|
+
|
107
|
+
#Returns the name of the mixer (example: Master).
|
108
|
+
def name
|
109
|
+
return @args[:name]
|
110
|
+
end
|
111
|
+
|
112
|
+
#Returns a bool. If the mixer supports volume-operations (some mixers are just switches and doenst support volume).
|
113
|
+
def volume?
|
114
|
+
ret = %x[#{@args[:amixer].args[:amixer_bin]} -c #{@args[:device].id} sget "#{@args[:name]}"]
|
115
|
+
raise "No content for mixer: '#{@args[:name]}'." if !ret
|
116
|
+
|
117
|
+
match = ret.match(/(Capture|Playback) (\d+) \[(\d+%)\]/)
|
118
|
+
return false if !match
|
119
|
+
return true
|
120
|
+
end
|
121
|
+
|
122
|
+
#Returns the volume-value as an integer (or as the percent if {:percent => true} if given in arguments).
|
123
|
+
def vol(args = {})
|
124
|
+
ret = %x[#{@args[:amixer].args[:amixer_bin]} -c #{@args[:device].id} sget "#{@args[:name]}"]
|
125
|
+
raise "No content for mixer: '#{@args[:name]}'." if !ret
|
126
|
+
|
127
|
+
match = ret.match(/(Capture|Playback) (\d+) \[(\d+%)\]/)
|
128
|
+
raise "Couldnt figure out volume for '#{@args[:name]}' from:\n'#{ret}'\n" if !match
|
129
|
+
|
130
|
+
return match[3].to_i if args[:percent]
|
131
|
+
return match[2].to_i
|
132
|
+
end
|
133
|
+
|
134
|
+
#Sets a new value for the volume.
|
135
|
+
def vol=(newvol)
|
136
|
+
ret = %x[#{@args[:amixer].args[:amixer_bin]} -c #{@args[:device].id} sset "#{@args[:name]}" "#{newvol}"]
|
137
|
+
#NOTE: Do some error handeling here?
|
138
|
+
end
|
139
|
+
|
140
|
+
#Adds a number to the volume.
|
141
|
+
def vol_add(add_vol)
|
142
|
+
vol = self.vol
|
143
|
+
newvol = vol + add_vol.to_i
|
144
|
+
newvol = 0 if newvol < 0
|
145
|
+
self.vol=(newvol)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
data/lib/knj/arrayext.rb
CHANGED
@@ -24,7 +24,7 @@ module Knj::ArrayExt
|
|
24
24
|
value = value if !args[:key]
|
25
25
|
|
26
26
|
if args[:callback]
|
27
|
-
if args[:callback].is_a?(Proc)
|
27
|
+
if args[:callback].is_a?(Proc) or args[:callback].is_a?(Method)
|
28
28
|
value = args[:callback].call(value)
|
29
29
|
else
|
30
30
|
value = Knj::Php.call_user_func(args[:callback], value) if args[:callback]
|
@@ -94,9 +94,9 @@ module Knj::ArrayExt
|
|
94
94
|
|
95
95
|
#Compares the keys and values of two hashes and returns true if they are different.
|
96
96
|
def self.hash_diff?(h1, h2, args = {})
|
97
|
-
if !args.
|
97
|
+
if !args.key?("h1_to_h2") or args["h1_to_h2"]
|
98
98
|
h1.each do |key, val|
|
99
|
-
return true if !h2.
|
99
|
+
return true if !h2.key?(key)
|
100
100
|
|
101
101
|
hash_val = h2[key].to_s
|
102
102
|
hash_val = hash_val.force_encoding("UTF-8") if hash_val.respond_to?(:force_encoding)
|
@@ -108,9 +108,9 @@ module Knj::ArrayExt
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
if !args.
|
111
|
+
if !args.key?("h2_to_h1") or args["h2_to_h1"]
|
112
112
|
h2.each do |key, val|
|
113
|
-
return true if !h1.
|
113
|
+
return true if !h1.key?(key)
|
114
114
|
|
115
115
|
hash_val = h1[key].to_s
|
116
116
|
hash_val = hash_val.force_encoding("UTF-8") if hash_val.respond_to?(:force_encoding)
|
@@ -154,4 +154,13 @@ module Knj::ArrayExt
|
|
154
154
|
|
155
155
|
return Digest::MD5.hexdigest(hashes.join("_"))
|
156
156
|
end
|
157
|
+
|
158
|
+
#Validates a hash of data.
|
159
|
+
def self.validate_hash(h, args)
|
160
|
+
h.each do |key, val|
|
161
|
+
if args.key?(:not_empty) and args[:not_empty].index(key) != nil and val.to_s.strip.length <= 0
|
162
|
+
raise Knj::Errors::InvalidData, sprintf(args[:not_empty_error], key)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
157
166
|
end
|
data/lib/knj/autoload.rb
CHANGED
@@ -1,61 +1,66 @@
|
|
1
1
|
$knjpath = File.dirname(__FILE__) + "/" if !$knjpath
|
2
|
-
require "#{$knjpath}/knj
|
2
|
+
require "#{$knjpath}/knj"
|
3
3
|
|
4
4
|
module Knj
|
5
|
-
|
6
|
-
autoload :
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
autoload :
|
10
|
-
autoload :
|
11
|
-
autoload :
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
autoload :
|
15
|
-
autoload :
|
16
|
-
autoload :
|
17
|
-
autoload :
|
18
|
-
autoload :
|
19
|
-
autoload :
|
20
|
-
autoload :
|
21
|
-
autoload :
|
22
|
-
autoload :
|
23
|
-
autoload :
|
24
|
-
autoload :
|
25
|
-
autoload :
|
26
|
-
autoload :
|
27
|
-
autoload :
|
28
|
-
autoload :
|
29
|
-
autoload :
|
30
|
-
autoload :
|
31
|
-
autoload :
|
32
|
-
autoload :
|
33
|
-
autoload :
|
34
|
-
autoload :
|
35
|
-
autoload :
|
36
|
-
autoload :
|
37
|
-
autoload :
|
38
|
-
autoload :
|
39
|
-
autoload :
|
40
|
-
autoload :
|
41
|
-
autoload :
|
42
|
-
autoload :
|
43
|
-
autoload :
|
44
|
-
autoload :
|
45
|
-
autoload :
|
46
|
-
autoload :
|
47
|
-
autoload :
|
48
|
-
autoload :
|
49
|
-
autoload :
|
50
|
-
autoload :
|
51
|
-
autoload :
|
52
|
-
autoload :
|
53
|
-
autoload :
|
54
|
-
autoload :
|
55
|
-
autoload :
|
56
|
-
autoload :
|
57
|
-
autoload :
|
58
|
-
autoload :
|
5
|
+
autoload :Amixer, $knjpath + "amixer"
|
6
|
+
autoload :ArrayExt, $knjpath + "arrayext"
|
7
|
+
autoload :Datestamp, $knjpath + "datestamp"
|
8
|
+
autoload :Datet, $knjpath + "datet"
|
9
|
+
autoload :Cmd_gen, $knjpath + "cmd_gen"
|
10
|
+
autoload :Compiler, $knjpath + "compiler"
|
11
|
+
autoload :Cpufreq, $knjpath + "cpufreq"
|
12
|
+
autoload :Datarow, $knjpath + "datarow"
|
13
|
+
autoload :Db, $knjpath + "knjdb/libknjdb"
|
14
|
+
autoload :Db_row, $knjpath + "knjdb/libknjdb_row"
|
15
|
+
autoload :Degulesider, $knjpath + "degulesider"
|
16
|
+
autoload :Errors, $knjpath + "errors"
|
17
|
+
autoload :Eruby, $knjpath + "eruby"
|
18
|
+
autoload :Event_filemod, $knjpath + "event_filemod"
|
19
|
+
autoload :Event_handler, $knjpath + "event_handler"
|
20
|
+
autoload :Exchangerates, $knjpath + "exchangerates"
|
21
|
+
autoload :Facebook_connect, $knjpath + "facebook_connect"
|
22
|
+
autoload :Fs, $knjpath + "fs/fs"
|
23
|
+
autoload :Filesystem, $knjpath + "filesystem"
|
24
|
+
autoload :Gettext_threadded, $knjpath + "gettext_threadded"
|
25
|
+
autoload :Hash_methods, $knjpath + "hash_methods"
|
26
|
+
autoload :Http, $knjpath + "http"
|
27
|
+
autoload :Http2, $knjpath + "http2"
|
28
|
+
autoload :Image, $knjpath + "image"
|
29
|
+
autoload :Ip2location, $knjpath + "ip2location"
|
30
|
+
autoload :Jruby_compiler, $knjpath + "jruby_compiler"
|
31
|
+
autoload :Locales, $knjpath + "locales"
|
32
|
+
autoload :Objects, $knjpath + "objects"
|
33
|
+
autoload :Opts, $knjpath + "opts"
|
34
|
+
autoload :Mail, $knjpath + "mail"
|
35
|
+
autoload :Mailobj, $knjpath + "mailobj"
|
36
|
+
autoload :Mutexcl, $knjpath + "mutexcl"
|
37
|
+
autoload :Mount, $knjpath + "mount"
|
38
|
+
autoload :Mplayer, $knjpath + "mplayer"
|
39
|
+
autoload :Notify, $knjpath + "notify"
|
40
|
+
autoload :Nvidia_settings, $knjpath + "nvidia_settings"
|
41
|
+
autoload :Web, $knjpath + "web"
|
42
|
+
autoload :Google_sitemap, $knjpath + "google_sitemap"
|
43
|
+
autoload :Sms, $knjpath + "sms"
|
44
|
+
autoload :Os, $knjpath + "os"
|
45
|
+
autoload :Gtk2, $knjpath + "gtk2"
|
46
|
+
autoload :Php, $knjpath + "php"
|
47
|
+
autoload :Php_parser, $knjpath + "php_parser/php_parser"
|
48
|
+
autoload :Power_manager, $knjpath + "power_manager"
|
49
|
+
autoload :Rand, $knjpath + "rand"
|
50
|
+
autoload :Retry, $knjpath + "retry"
|
51
|
+
autoload :RSVGBIN, $knjpath + "rsvgbin"
|
52
|
+
autoload :Strings, $knjpath + "strings"
|
53
|
+
autoload :SSHRobot, $knjpath + "sshrobot/sshrobot"
|
54
|
+
autoload :Sysuser, $knjpath + "sysuser"
|
55
|
+
autoload :Thread, $knjpath + "thread"
|
56
|
+
autoload :Thread2, $knjpath + "thread2"
|
57
|
+
autoload :Threadpool, $knjpath + "threadpool"
|
58
|
+
autoload :Threadhandler, $knjpath + "threadhandler"
|
59
|
+
autoload :Translations, $knjpath + "translations"
|
60
|
+
autoload :X11VNC, $knjpath + "x11vnc"
|
61
|
+
autoload :Unix_proc, $knjpath + "unix_proc"
|
62
|
+
autoload :YouTube, $knjpath + "youtube"
|
63
|
+
autoload :Win, $knjpath + "win"
|
59
64
|
end
|
60
65
|
|
61
66
|
#ruby objects.
|
@@ -77,7 +82,7 @@ autoload :Mysql, $knjpath + "autoload/mysql"
|
|
77
82
|
autoload :Open3, "open3"
|
78
83
|
autoload :OpenSSL, "openssl"
|
79
84
|
autoload :OptionParser, "optparse"
|
80
|
-
autoload :ParseDate, $knjpath + "autoload/backups/parsedate
|
85
|
+
autoload :ParseDate, $knjpath + "autoload/backups/parsedate"
|
81
86
|
autoload :Pathname, "pathname"
|
82
87
|
autoload :Ping, $knjpath + "autoload/ping"
|
83
88
|
autoload :REXML, $knjpath + "autoload/rexml"
|
@@ -90,9 +95,10 @@ autoload :TCPServer, "socket"
|
|
90
95
|
autoload :URI, "uri"
|
91
96
|
autoload :Win32, "win32/registry"
|
92
97
|
autoload :WIN32OLE, "win32ole"
|
98
|
+
autoload :WeakRef, "weakref"
|
93
99
|
autoload :WEBrick, "webrick"
|
94
100
|
autoload :XmlSimple, $knjpath + "autoload/xmlsimple"
|
95
|
-
autoload :Zip, $knjpath + "autoload/zip
|
101
|
+
autoload :Zip, $knjpath + "autoload/zip"
|
96
102
|
autoload :Zlib, "zlib"
|
97
103
|
|
98
104
|
if RUBY_PLATFORM == "java"
|
@@ -237,7 +237,7 @@ class Dictionary
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def store( a,b )
|
240
|
-
@order.push( a ) unless @hash.
|
240
|
+
@order.push( a ) unless @hash.key?( a )
|
241
241
|
@hash.store( a,b )
|
242
242
|
end
|
243
243
|
|
@@ -403,7 +403,7 @@ class Dictionary
|
|
403
403
|
end
|
404
404
|
|
405
405
|
def has_key?(key)
|
406
|
-
@hash.
|
406
|
+
@hash.key?(key)
|
407
407
|
end
|
408
408
|
|
409
409
|
def key?(key)
|