knjrbfw 0.0.101 → 0.0.102
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -3
- data/Gemfile.lock +26 -18
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/knjrbfw.gemspec +20 -18
- data/lib/knj/autoload/wref.rb +1 -6
- data/lib/knj/cmd_parser.rb +2 -0
- data/lib/knj/datarow.rb +87 -84
- data/lib/knj/eruby.rb +15 -0
- data/lib/knj/google_sitemap.rb +36 -35
- data/lib/knj/gtk2_window.rb +2 -1
- data/lib/knj/knj.rb +12 -0
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql.rb +5 -6
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql_columns.rb +1 -0
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql_indexes.rb +6 -0
- data/lib/knj/knjdb/drivers/mysql/knjdb_mysql_tables.rb +89 -2
- data/lib/knj/knjdb/libknjdb.rb +1 -5
- data/lib/knj/knjdb/query_buffer.rb +7 -5
- data/lib/knj/memory_analyzer.rb +43 -2
- data/lib/knj/objects.rb +2 -2
- data/lib/knj/strings.rb +6 -1
- data/lib/knj/web.rb +30 -25
- data/lib/knj/webscripts/image.rhtml +17 -35
- data/spec/strings_spec.rb +5 -0
- metadata +95 -32
- data/lib/knj/datestamp.rb +0 -91
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knjrbfw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.102
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2013-03-03 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: wref
|
17
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ! '>='
|
@@ -22,10 +21,15 @@ dependencies:
|
|
22
21
|
version: '0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
26
30
|
- !ruby/object:Gem::Dependency
|
27
31
|
name: tsafe
|
28
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
29
33
|
none: false
|
30
34
|
requirements:
|
31
35
|
- - ! '>='
|
@@ -33,10 +37,15 @@ dependencies:
|
|
33
37
|
version: '0'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
37
46
|
- !ruby/object:Gem::Dependency
|
38
47
|
name: datet
|
39
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
40
49
|
none: false
|
41
50
|
requirements:
|
42
51
|
- - ! '>='
|
@@ -44,10 +53,15 @@ dependencies:
|
|
44
53
|
version: '0'
|
45
54
|
type: :runtime
|
46
55
|
prerelease: false
|
47
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
48
62
|
- !ruby/object:Gem::Dependency
|
49
63
|
name: http2
|
50
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
51
65
|
none: false
|
52
66
|
requirements:
|
53
67
|
- - ! '>='
|
@@ -55,10 +69,15 @@ dependencies:
|
|
55
69
|
version: '0'
|
56
70
|
type: :runtime
|
57
71
|
prerelease: false
|
58
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
59
78
|
- !ruby/object:Gem::Dependency
|
60
79
|
name: php4r
|
61
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
62
81
|
none: false
|
63
82
|
requirements:
|
64
83
|
- - ! '>='
|
@@ -66,43 +85,79 @@ dependencies:
|
|
66
85
|
version: '0'
|
67
86
|
type: :runtime
|
68
87
|
prerelease: false
|
69
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: ruby_process
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
70
110
|
- !ruby/object:Gem::Dependency
|
71
111
|
name: rspec
|
72
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
73
113
|
none: false
|
74
114
|
requirements:
|
75
|
-
- -
|
115
|
+
- - ! '>='
|
76
116
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
117
|
+
version: '0'
|
78
118
|
type: :development
|
79
119
|
prerelease: false
|
80
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
81
126
|
- !ruby/object:Gem::Dependency
|
82
127
|
name: bundler
|
83
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
84
129
|
none: false
|
85
130
|
requirements:
|
86
131
|
- - ! '>='
|
87
132
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
133
|
+
version: '0'
|
89
134
|
type: :development
|
90
135
|
prerelease: false
|
91
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
92
142
|
- !ruby/object:Gem::Dependency
|
93
143
|
name: jeweler
|
94
|
-
requirement:
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
95
145
|
none: false
|
96
146
|
requirements:
|
97
|
-
- -
|
147
|
+
- - ! '>='
|
98
148
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
149
|
+
version: '0'
|
100
150
|
type: :development
|
101
151
|
prerelease: false
|
102
|
-
version_requirements:
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
103
158
|
- !ruby/object:Gem::Dependency
|
104
159
|
name: sqlite3
|
105
|
-
requirement:
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
106
161
|
none: false
|
107
162
|
requirements:
|
108
163
|
- - ! '>='
|
@@ -110,10 +165,15 @@ dependencies:
|
|
110
165
|
version: '0'
|
111
166
|
type: :development
|
112
167
|
prerelease: false
|
113
|
-
version_requirements:
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
114
174
|
- !ruby/object:Gem::Dependency
|
115
175
|
name: rmagick
|
116
|
-
requirement:
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
117
177
|
none: false
|
118
178
|
requirements:
|
119
179
|
- - ! '>='
|
@@ -121,7 +181,12 @@ dependencies:
|
|
121
181
|
version: '0'
|
122
182
|
type: :development
|
123
183
|
prerelease: false
|
124
|
-
version_requirements:
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
125
190
|
description: Including stuff for HTTP, SSH and much more.
|
126
191
|
email: k@spernj.org
|
127
192
|
executables: []
|
@@ -174,7 +239,6 @@ files:
|
|
174
239
|
- lib/knj/csv.rb
|
175
240
|
- lib/knj/datarow.rb
|
176
241
|
- lib/knj/datarow_custom.rb
|
177
|
-
- lib/knj/datestamp.rb
|
178
242
|
- lib/knj/db.rb
|
179
243
|
- lib/knj/degulesider.rb
|
180
244
|
- lib/knj/erb/apache_knjerb.conf
|
@@ -375,7 +439,6 @@ files:
|
|
375
439
|
- spec/strings_spec.rb
|
376
440
|
- spec/web_spec.rb
|
377
441
|
- testfiles/image.jpg
|
378
|
-
has_rdoc: true
|
379
442
|
homepage: http://github.com/kaspernj/knjrbfw
|
380
443
|
licenses:
|
381
444
|
- MIT
|
@@ -391,7 +454,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
391
454
|
version: '0'
|
392
455
|
segments:
|
393
456
|
- 0
|
394
|
-
hash:
|
457
|
+
hash: -1533685916724767096
|
395
458
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
396
459
|
none: false
|
397
460
|
requirements:
|
@@ -400,7 +463,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
400
463
|
version: '0'
|
401
464
|
requirements: []
|
402
465
|
rubyforge_project:
|
403
|
-
rubygems_version: 1.
|
466
|
+
rubygems_version: 1.8.25
|
404
467
|
signing_key:
|
405
468
|
specification_version: 3
|
406
469
|
summary: A framework with lots of stuff for Ruby.
|
data/lib/knj/datestamp.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
class Knj::Datestamp
|
2
|
-
def self.in(time = Time.new)
|
3
|
-
if (Float(time) rescue false)
|
4
|
-
time = Time.at(time.to_i)
|
5
|
-
elsif time.is_a?(String)
|
6
|
-
time = Time.local(*ParseDate.parsedate(time))
|
7
|
-
end
|
8
|
-
|
9
|
-
return time
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.dbstr(time = nil)
|
13
|
-
if !time
|
14
|
-
time = Time.new
|
15
|
-
end
|
16
|
-
|
17
|
-
if (Float(time) rescue false)
|
18
|
-
time = Time.at(time.to_i)
|
19
|
-
elsif time.is_a?(String)
|
20
|
-
begin
|
21
|
-
time = Time.local(*ParseDate.parsedate(time))
|
22
|
-
rescue => e
|
23
|
-
raise sprintf("Could not parse date: %s", time.to_s)
|
24
|
-
end
|
25
|
-
else
|
26
|
-
raise "Could not figure out given argument: #{time.class.name}"
|
27
|
-
end
|
28
|
-
|
29
|
-
return "%04d" % time.year.to_s + "-" + "%02d" % time.month.to_s + "-" + "%02d" % time.day.to_s + " " + "%02d" % time.hour.to_s + ":" + "%02d" % time.min.to_s + ":" + "%02d" % time.sec.to_s
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.from_dbstr(date_string)
|
33
|
-
if Knj::Datestamp.is_nullstamp?(date_string)
|
34
|
-
return 0
|
35
|
-
end
|
36
|
-
|
37
|
-
return Time.local(*ParseDate.parsedate(date_string))
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.out(time = nil, args = {})
|
41
|
-
Knj::ArrayExt.hash_sym(args)
|
42
|
-
|
43
|
-
time = Time.new if !time
|
44
|
-
|
45
|
-
if (Float(time) rescue false)
|
46
|
-
time = Time.at(time.to_i)
|
47
|
-
elsif time.is_a?(String)
|
48
|
-
time = Time.at(Php4r.strtotime(time))
|
49
|
-
end
|
50
|
-
|
51
|
-
str = ""
|
52
|
-
|
53
|
-
if !args.key?(:date) or args[:date] == true
|
54
|
-
str << "%02d" % time.day.to_s + "/" + "%02d" % time.month.to_s + " " + "%04d" % time.year.to_s
|
55
|
-
end
|
56
|
-
|
57
|
-
if !args.key?(:time) or args[:time] == true
|
58
|
-
str << " " + "%02d" % time.hour.to_s + ":" + "%02d" % time.min.to_s
|
59
|
-
end
|
60
|
-
|
61
|
-
return str
|
62
|
-
end
|
63
|
-
|
64
|
-
def self.in(timestr)
|
65
|
-
if match = timestr.to_s.match(/^(\d+)\/(\d+) (\d+)/)
|
66
|
-
timestr = timestr.gsub(match[0], "")
|
67
|
-
date = match[1]
|
68
|
-
month = match[2]
|
69
|
-
year = match[3]
|
70
|
-
else
|
71
|
-
raise sprintf(_("Wrong format: %s"), timestr)
|
72
|
-
end
|
73
|
-
|
74
|
-
if match = timestr.match(/\s*(\d+):(\d+)/)
|
75
|
-
timestr = timestr.gsub(match[0], "")
|
76
|
-
hour = match[1]
|
77
|
-
minute = match[2]
|
78
|
-
end
|
79
|
-
|
80
|
-
datestr = ""
|
81
|
-
datestr = "#{year}-#{month}-#{date}" if date and month and year
|
82
|
-
datestr << " #{hour}:#{minute}" if hour and minute
|
83
|
-
|
84
|
-
return Knj::Datestamp.from_dbstr(datestr)
|
85
|
-
end
|
86
|
-
|
87
|
-
def self.is_nullstamp?(datestamp)
|
88
|
-
return true if datestamp.is_a?(String) and datestamp == "0000-00-00 00:00:00"
|
89
|
-
return false
|
90
|
-
end
|
91
|
-
end
|