rhodes-framework 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/History.txt +37 -0
- data/Manifest.txt +66 -0
- data/README.rdoc +2 -0
- data/Rakefile +50 -0
- data/lib/ServeME.rb +7 -0
- data/lib/TestServe.rb +9 -0
- data/lib/bsearch.rb +120 -0
- data/lib/builtinME.rb +626 -0
- data/lib/date/format.rb +1339 -0
- data/lib/date.rb +1792 -0
- data/lib/dateME.rb +24 -0
- data/lib/erb.rb +896 -0
- data/lib/find.rb +81 -0
- data/lib/rational.rb +19 -0
- data/lib/rationalME.rb +530 -0
- data/lib/rho/render.rb +51 -0
- data/lib/rho/rho.rb +255 -0
- data/lib/rho/rhoapplication.rb +36 -0
- data/lib/rho/rhocontact.rb +110 -0
- data/lib/rho/rhocontroller.rb +35 -0
- data/lib/rho/rhofsconnector.rb +32 -0
- data/lib/rho/rhosupport.rb +146 -0
- data/lib/rho/rhoviewhelpers.rb +130 -0
- data/lib/rho.rb +1 -0
- data/lib/rhodes-framework.rb +2 -0
- data/lib/rhodes.rb +9 -0
- data/lib/rhoframework.rb +38 -0
- data/lib/rhofsconnector.rb +1 -0
- data/lib/rhom/rhom.rb +58 -0
- data/lib/rhom/rhom_db_adapter.rb +185 -0
- data/lib/rhom/rhom_db_adapterME.rb +93 -0
- data/lib/rhom/rhom_object.rb +69 -0
- data/lib/rhom/rhom_object_factory.rb +309 -0
- data/lib/rhom/rhom_source.rb +60 -0
- data/lib/rhom.rb +1 -0
- data/lib/singleton.rb +137 -0
- data/lib/time.rb +489 -0
- data/lib/version.rb +8 -0
- data/res/sqlite3/constants.rb +49 -0
- data/res/sqlite3/database.rb +715 -0
- data/res/sqlite3/driver/dl/api.rb +154 -0
- data/res/sqlite3/driver/dl/driver.rb +307 -0
- data/res/sqlite3/driver/native/driver.rb +257 -0
- data/res/sqlite3/errors.rb +68 -0
- data/res/sqlite3/pragmas.rb +271 -0
- data/res/sqlite3/resultset.rb +176 -0
- data/res/sqlite3/sqlite3_api.rb +0 -0
- data/res/sqlite3/statement.rb +230 -0
- data/res/sqlite3/translator.rb +109 -0
- data/res/sqlite3/value.rb +57 -0
- data/res/sqlite3/version.rb +14 -0
- data/rhodes-framework.gemspec +18 -0
- data/rhodes.gemspec +18 -0
- data/spec/app_manifest.txt +4 -0
- data/spec/configs/account.rb +3 -0
- data/spec/configs/case.rb +3 -0
- data/spec/configs/employee.rb +3 -0
- data/spec/rho_controller_spec.rb +144 -0
- data/spec/rho_spec.rb +75 -0
- data/spec/rhom_object_factory_spec.rb +372 -0
- data/spec/rhom_spec.rb +45 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +49 -0
- data/spec/stubs.rb +39 -0
- data/spec/syncdbtest.sqlite +0 -0
- metadata +202 -0
data/.gitignore
ADDED
data/History.txt
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
== 0.2.6 2009-01-29
|
2
|
+
* changed signature of url_for, link_to, and redirect
|
3
|
+
|
4
|
+
== 0.2.5 2009-01-28
|
5
|
+
* erb labels are now humanized
|
6
|
+
|
7
|
+
== 0.2.4 2009-01-27
|
8
|
+
* added show.erb to model generator [#164]
|
9
|
+
* base source_adapter should include user_id on sync
|
10
|
+
|
11
|
+
== 0.2.3 2009-01-26
|
12
|
+
* added newgem dependency
|
13
|
+
|
14
|
+
== 0.2.2 2009-01-23
|
15
|
+
* fixed bug in layout.erb template
|
16
|
+
|
17
|
+
== 0.2.1 2009-01-20
|
18
|
+
* adding new layout framework to generator [#45]
|
19
|
+
|
20
|
+
== 0.2.0 2009-01-07
|
21
|
+
* releasing 0.2 version of gem
|
22
|
+
* fixed sqlite3-ruby 1.2.4 dependency [#147]
|
23
|
+
* fixed broken rspec tests [#148]
|
24
|
+
|
25
|
+
== 0.1.3 2008-12-11
|
26
|
+
* Updated source_adapter generator to have base class
|
27
|
+
* fixed #50, removed dependency on Find library
|
28
|
+
|
29
|
+
== 0.1.2 2008-12-09
|
30
|
+
* Added rhogen source <MySourceAdapter>
|
31
|
+
|
32
|
+
== 0.1.1 2008-11-18
|
33
|
+
* Fixed template application name
|
34
|
+
|
35
|
+
== 0.1.0 2008-11-18
|
36
|
+
* 1 major enhancement:
|
37
|
+
* Initial release
|
data/Manifest.txt
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
.gitignore
|
2
|
+
History.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
lib/ServeME.rb
|
7
|
+
lib/TestServe.rb
|
8
|
+
lib/bsearch.rb
|
9
|
+
lib/builtinME.rb
|
10
|
+
lib/date.rb
|
11
|
+
lib/date/format.rb
|
12
|
+
lib/dateME.rb
|
13
|
+
lib/erb.rb
|
14
|
+
lib/find.rb
|
15
|
+
lib/rational.rb
|
16
|
+
lib/rationalME.rb
|
17
|
+
lib/rho.rb
|
18
|
+
lib/rho/render.rb
|
19
|
+
lib/rho/rho.rb
|
20
|
+
lib/rho/rhoapplication.rb
|
21
|
+
lib/rho/rhocontact.rb
|
22
|
+
lib/rho/rhocontroller.rb
|
23
|
+
lib/rho/rhofsconnector.rb
|
24
|
+
lib/rho/rhosupport.rb
|
25
|
+
lib/rho/rhoviewhelpers.rb
|
26
|
+
lib/rhodes-framework.rb
|
27
|
+
lib/rhodes.rb
|
28
|
+
lib/rhoframework.rb
|
29
|
+
lib/rhofsconnector.rb
|
30
|
+
lib/rhom.rb
|
31
|
+
lib/rhom/rhom.rb
|
32
|
+
lib/rhom/rhom_db_adapter.rb
|
33
|
+
lib/rhom/rhom_db_adapterME.rb
|
34
|
+
lib/rhom/rhom_object.rb
|
35
|
+
lib/rhom/rhom_object_factory.rb
|
36
|
+
lib/rhom/rhom_source.rb
|
37
|
+
lib/singleton.rb
|
38
|
+
lib/time.rb
|
39
|
+
lib/version.rb
|
40
|
+
res/sqlite3/constants.rb
|
41
|
+
res/sqlite3/database.rb
|
42
|
+
res/sqlite3/driver/dl/api.rb
|
43
|
+
res/sqlite3/driver/dl/driver.rb
|
44
|
+
res/sqlite3/driver/native/driver.rb
|
45
|
+
res/sqlite3/errors.rb
|
46
|
+
res/sqlite3/pragmas.rb
|
47
|
+
res/sqlite3/resultset.rb
|
48
|
+
res/sqlite3/sqlite3_api.rb
|
49
|
+
res/sqlite3/statement.rb
|
50
|
+
res/sqlite3/translator.rb
|
51
|
+
res/sqlite3/value.rb
|
52
|
+
res/sqlite3/version.rb
|
53
|
+
rhodes-framework.gemspec
|
54
|
+
rhodes.gemspec
|
55
|
+
spec/app_manifest.txt
|
56
|
+
spec/configs/account.rb
|
57
|
+
spec/configs/case.rb
|
58
|
+
spec/configs/employee.rb
|
59
|
+
spec/rho_controller_spec.rb
|
60
|
+
spec/rho_spec.rb
|
61
|
+
spec/rhom_object_factory_spec.rb
|
62
|
+
spec/rhom_spec.rb
|
63
|
+
spec/spec.opts
|
64
|
+
spec/spec_helper.rb
|
65
|
+
spec/stubs.rb
|
66
|
+
spec/syncdbtest.sqlite
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
%w[rubygems rake rake/clean fileutils newgem].each { |f| require f }
|
2
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
3
|
+
require 'lib/version.rb'
|
4
|
+
require 'rhodes-build'
|
5
|
+
|
6
|
+
task :default => [:spec]
|
7
|
+
|
8
|
+
# Generate all the Rake tasks
|
9
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
10
|
+
$hoe = Hoe.new('rhodes-framework', RhodesFramework::VERSION) do |p|
|
11
|
+
p.developer('Rhomobile Dev', 'dev@rhomobile.com')
|
12
|
+
p.changes = p.paragraphs_of("../History.txt", 0..1).join("\n\n") if File.exists? "../History.txt"
|
13
|
+
#p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
14
|
+
p.rubyforge_name = p.name # TODO this is default value
|
15
|
+
p.extra_deps = [
|
16
|
+
['sqlite3-ruby','= 1.2.3'],
|
17
|
+
['rcov'],
|
18
|
+
['rspec'],
|
19
|
+
['diff-lcs'],
|
20
|
+
['extlib'],
|
21
|
+
['newgem'],
|
22
|
+
['activesupport']
|
23
|
+
]
|
24
|
+
|
25
|
+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
26
|
+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
27
|
+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
28
|
+
p.rsync_args = '-av --delete --ignore-errors'
|
29
|
+
p.test_globs = ''
|
30
|
+
p.summary = "rhodes-framework #{RhodesFramework::VERSION}"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
require 'newgem/tasks' # load /tasks/*.rake
|
35
|
+
# remove test task TODO: why does this run anyway?
|
36
|
+
Rake.application.remove_task(:test)
|
37
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
38
|
+
|
39
|
+
desc "Run the specs under spec"
|
40
|
+
Spec::Rake::SpecTask.new do |t|
|
41
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
42
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
43
|
+
t.rcov = true
|
44
|
+
t.rcov_opts = ['--include',
|
45
|
+
'"lib/rhom/*,lib/rho/*"',
|
46
|
+
'-x',
|
47
|
+
'spec,gems,sqlite3/*,lib/date.rb,lib/rational.rb,lib/time.rb,lib/find.rb,config.rb,lib/erb.rb,lib/singleton.rb,lib/pairparser.rb',
|
48
|
+
'--text-report',
|
49
|
+
'--html']
|
50
|
+
end
|
data/lib/ServeME.rb
ADDED
data/lib/TestServe.rb
ADDED
data/lib/bsearch.rb
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
#
|
2
|
+
# Ruby/Bsearch - a binary search library for Ruby.
|
3
|
+
#
|
4
|
+
# Copyright (C) 2001 Satoru Takabayashi <satoru@namazu.org>
|
5
|
+
# All rights reserved.
|
6
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
7
|
+
#
|
8
|
+
# You can redistribute it and/or modify it under the terms of
|
9
|
+
# the Ruby's licence.
|
10
|
+
#
|
11
|
+
# Example:
|
12
|
+
#
|
13
|
+
# % irb -r ./bsearch.rb
|
14
|
+
# >> %w(a b c c c d e f).bsearch_first {|x| x <=> "c"}
|
15
|
+
# => 2
|
16
|
+
# >> %w(a b c c c d e f).bsearch_last {|x| x <=> "c"}
|
17
|
+
# => 4
|
18
|
+
# >> %w(a b c e f).bsearch_first {|x| x <=> "c"}
|
19
|
+
# => 2
|
20
|
+
# >> %w(a b e f).bsearch_first {|x| x <=> "c"}
|
21
|
+
# => nil
|
22
|
+
# >> %w(a b e f).bsearch_last {|x| x <=> "c"}
|
23
|
+
# => nil
|
24
|
+
# >> %w(a b e f).bsearch_lower_boundary {|x| x <=> "c"}
|
25
|
+
# => 2
|
26
|
+
# >> %w(a b e f).bsearch_upper_boundary {|x| x <=> "c"}
|
27
|
+
# => 2
|
28
|
+
# >> %w(a b c c c d e f).bsearch_range {|x| x <=> "c"}
|
29
|
+
# => 2...5
|
30
|
+
# >> %w(a b c d e f).bsearch_range {|x| x <=> "c"}
|
31
|
+
# => 2...3
|
32
|
+
# >> %w(a b d e f).bsearch_range {|x| x <=> "c"}
|
33
|
+
# => 2...2
|
34
|
+
|
35
|
+
module Bsearch
|
36
|
+
VERSION = '1.5'
|
37
|
+
end
|
38
|
+
|
39
|
+
class Array
|
40
|
+
#
|
41
|
+
# The binary search algorithm is extracted from Jon Bentley's
|
42
|
+
# Programming Pearls 2nd ed. p.93
|
43
|
+
#
|
44
|
+
|
45
|
+
#
|
46
|
+
# Return the lower boundary. (inside)
|
47
|
+
#
|
48
|
+
def bsearch_lower_boundary (range = 0 ... self.length, &block)
|
49
|
+
lower = range.first() -1
|
50
|
+
upper = if range.exclude_end? then range.last else range.last + 1 end
|
51
|
+
while lower + 1 != upper
|
52
|
+
mid = ((lower + upper) / 2).to_i # for working with mathn.rb (Rational)
|
53
|
+
if yield(self[mid]) < 0
|
54
|
+
lower = mid
|
55
|
+
else
|
56
|
+
upper = mid
|
57
|
+
end
|
58
|
+
end
|
59
|
+
return upper
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# This method searches the FIRST occurrence which satisfies a
|
64
|
+
# condition given by a block in binary fashion and return the
|
65
|
+
# index of the first occurrence. Return nil if not found.
|
66
|
+
#
|
67
|
+
def bsearch_first (range = 0 ... self.length, &block)
|
68
|
+
boundary = bsearch_lower_boundary(range, &block)
|
69
|
+
if boundary >= self.length || yield(self[boundary]) != 0
|
70
|
+
return nil
|
71
|
+
else
|
72
|
+
return boundary
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
alias bsearch bsearch_first
|
77
|
+
|
78
|
+
#
|
79
|
+
# Return the upper boundary. (outside)
|
80
|
+
#
|
81
|
+
def bsearch_upper_boundary (range = 0 ... self.length, &block)
|
82
|
+
lower = range.first() -1
|
83
|
+
upper = if range.exclude_end? then range.last else range.last + 1 end
|
84
|
+
while lower + 1 != upper
|
85
|
+
mid = ((lower + upper) / 2).to_i # for working with mathn.rb (Rational)
|
86
|
+
if yield(self[mid]) <= 0
|
87
|
+
lower = mid
|
88
|
+
else
|
89
|
+
upper = mid
|
90
|
+
end
|
91
|
+
end
|
92
|
+
return lower + 1 # outside of the matching range.
|
93
|
+
end
|
94
|
+
|
95
|
+
#
|
96
|
+
# This method searches the LAST occurrence which satisfies a
|
97
|
+
# condition given by a block in binary fashion and return the
|
98
|
+
# index of the last occurrence. Return nil if not found.
|
99
|
+
#
|
100
|
+
def bsearch_last (range = 0 ... self.length, &block)
|
101
|
+
# `- 1' for canceling `lower + 1' in bsearch_upper_boundary.
|
102
|
+
boundary = bsearch_upper_boundary(range, &block) - 1
|
103
|
+
|
104
|
+
if (boundary <= -1 || yield(self[boundary]) != 0)
|
105
|
+
return nil
|
106
|
+
else
|
107
|
+
return boundary
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
#
|
112
|
+
# Return the search result as a Range object.
|
113
|
+
#
|
114
|
+
def bsearch_range (range = 0 ... self.length, &block)
|
115
|
+
lower = bsearch_lower_boundary(range, &block)
|
116
|
+
upper = bsearch_upper_boundary(range, &block)
|
117
|
+
return lower ... upper
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|