manveru-innate 2009.06.12 → 2009.07
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/CHANGELOG +27 -0
- data/Rakefile +18 -6
- data/innate.gemspec +11 -12
- data/lib/innate/session.rb +27 -1
- data/lib/innate/version.rb +1 -1
- data/spec/example/app/retro_games.rb +2 -2
- data/spec/example/hello.rb +2 -2
- data/spec/example/link.rb +2 -2
- data/spec/example/provides.rb +2 -2
- data/spec/example/session.rb +2 -2
- data/spec/helper.rb +1 -1
- data/spec/innate/action/layout.rb +1 -1
- data/spec/innate/cache/common.rb +0 -2
- data/spec/innate/cache/marshal.rb +2 -2
- data/spec/innate/cache/memory.rb +2 -2
- data/spec/innate/cache/yaml.rb +2 -2
- data/spec/innate/dynamap.rb +1 -1
- data/spec/innate/helper.rb +1 -1
- data/spec/innate/helper/aspect.rb +1 -1
- data/spec/innate/helper/cgi.rb +1 -1
- data/spec/innate/helper/flash.rb +1 -1
- data/spec/innate/helper/link.rb +1 -1
- data/spec/innate/helper/redirect.rb +1 -1
- data/spec/innate/helper/render.rb +1 -1
- data/spec/innate/helper/send_file.rb +1 -1
- data/spec/innate/mock.rb +1 -1
- data/spec/innate/modes.rb +1 -1
- data/spec/innate/node/mapping.rb +1 -1
- data/spec/innate/node/node.rb +1 -1
- data/spec/innate/node/resolve.rb +1 -1
- data/spec/innate/node/wrap_action_call.rb +1 -1
- data/spec/innate/options.rb +1 -1
- data/spec/innate/parameter.rb +1 -1
- data/spec/innate/provides.rb +2 -6
- data/spec/innate/request.rb +1 -1
- data/spec/innate/route.rb +1 -1
- data/spec/innate/session.rb +1 -1
- data/spec/innate/traited.rb +1 -1
- data/tasks/gem_setup.rake +18 -5
- data/tasks/setup.rake +8 -2
- metadata +7 -7
data/AUTHORS
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Following persons have contributed to innate.
|
2
2
|
(Sorted by number of submitted patches, then alphabetically)
|
3
3
|
|
4
|
-
|
4
|
+
721 Michael Fellinger <m.fellinger@gmail.com>
|
5
5
|
31 Tadahiko Uehara <kikofx@gmail.com>
|
6
6
|
8 Pistos <gitsomegrace.5.pistos@geoshell.com>
|
7
7
|
5 Ryan Grove <ryan@wonko.com>
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
[3ed8553 | 2009-07-19 03:01:48 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
2
|
+
|
3
|
+
* Update dependencies
|
4
|
+
|
5
|
+
[4e09c15 | 2009-07-06 10:12:43 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
6
|
+
|
7
|
+
* Implement an OpenSSL fallback for Session IDs
|
8
|
+
|
9
|
+
Comes into play in case SecureRandom cannot be found.
|
10
|
+
This should cover 99% of all < 1.8.7 installs.
|
11
|
+
|
12
|
+
[cf9cdce | 2009-07-02 08:05:45 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
13
|
+
|
14
|
+
* More intelligent gem_setup to handle cases where a library can be found via require but ain't a gem
|
15
|
+
|
16
|
+
[337f092 | 2009-07-02 08:05:02 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
17
|
+
|
18
|
+
* Use absolute paths for spec requires
|
19
|
+
|
20
|
+
[7a475b9 | 2009-06-14 14:14:47 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
21
|
+
|
22
|
+
* Require rubygems >= 1.3.1
|
23
|
+
|
24
|
+
[7f41b89 | 2009-06-12 12:54:32 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
25
|
+
|
26
|
+
* Version 2009.06.12
|
27
|
+
|
1
28
|
[e92a8b3 | 2009-06-11 15:41:35 UTC] Michael Fellinger <m.fellinger@gmail.com>
|
2
29
|
|
3
30
|
* Make sure that instance-variables set in the view template can be used in the layout
|
data/Rakefile
CHANGED
@@ -9,6 +9,16 @@ PROJECT_MODULE = 'Innate'
|
|
9
9
|
PROJECT_README = 'README.md'
|
10
10
|
PROJECT_VERSION = ENV['VERSION'] || Date.today.strftime('%Y.%m.%d')
|
11
11
|
|
12
|
+
DEPENDENCIES = {
|
13
|
+
'rack' => {:version => '~> 1.0.0'},
|
14
|
+
}
|
15
|
+
|
16
|
+
DEVELOPMENT_DEPENDENCIES = {
|
17
|
+
'bacon' => {:version => '>= 1.1.0'},
|
18
|
+
'json' => {:version => '~> 1.1.7'},
|
19
|
+
'rack-test' => {:version => '>= 0.4.0', :lib => 'rack/test'}
|
20
|
+
}
|
21
|
+
|
12
22
|
GEMSPEC = Gem::Specification.new{|s|
|
13
23
|
s.name = 'innate'
|
14
24
|
s.author = "Michael 'manveru' Fellinger"
|
@@ -22,14 +32,16 @@ GEMSPEC = Gem::Specification.new{|s|
|
|
22
32
|
s.has_rdoc = true
|
23
33
|
s.require_path = 'lib'
|
24
34
|
s.rubyforge_project = "innate"
|
35
|
+
s.required_rubygems_version = '>= 1.3.1'
|
36
|
+
}
|
25
37
|
|
26
|
-
|
38
|
+
DEPENDENCIES.each do |name, options|
|
39
|
+
GEMSPEC.add_dependency(name, options[:version])
|
40
|
+
end
|
27
41
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
s.add_development_dependency('rack-test', '>= 0.3.0')
|
32
|
-
}
|
42
|
+
DEVELOPMENT_DEPENDENCIES.each do |name, options|
|
43
|
+
GEMSPEC.add_development_dependency(name, options[:version])
|
44
|
+
end
|
33
45
|
|
34
46
|
Dir['tasks/*.rake'].each{|f| import(f) }
|
35
47
|
|
data/innate.gemspec
CHANGED
@@ -2,40 +2,39 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{innate}
|
5
|
-
s.version = "2009.
|
5
|
+
s.version = "2009.07"
|
6
6
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Michael 'manveru' Fellinger"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-07-19}
|
10
10
|
s.description = %q{Simple, straight-forward base for web-frameworks.}
|
11
11
|
s.email = %q{m.fellinger@gmail.com}
|
12
12
|
s.files = ["AUTHORS", "CHANGELOG", "COPYING", "MANIFEST", "README.md", "Rakefile", "example/app/retro_games.rb", "example/app/todo/layout/default.xhtml", "example/app/todo/spec/todo.rb", "example/app/todo/start.rb", "example/app/todo/view/index.xhtml", "example/app/whywiki_erb/layout/wiki.html.erb", "example/app/whywiki_erb/spec/wiki.rb", "example/app/whywiki_erb/start.rb", "example/app/whywiki_erb/view/edit.erb", "example/app/whywiki_erb/view/index.erb", "example/custom_middleware.rb", "example/hello.rb", "example/howto_spec.rb", "example/link.rb", "example/provides.rb", "example/session.rb", "innate.gemspec", "lib/innate.rb", "lib/innate/action.rb", "lib/innate/adapter.rb", "lib/innate/cache.rb", "lib/innate/cache/api.rb", "lib/innate/cache/drb.rb", "lib/innate/cache/file_based.rb", "lib/innate/cache/marshal.rb", "lib/innate/cache/memory.rb", "lib/innate/cache/yaml.rb", "lib/innate/current.rb", "lib/innate/dynamap.rb", "lib/innate/helper.rb", "lib/innate/helper/aspect.rb", "lib/innate/helper/cgi.rb", "lib/innate/helper/flash.rb", "lib/innate/helper/link.rb", "lib/innate/helper/redirect.rb", "lib/innate/helper/render.rb", "lib/innate/helper/send_file.rb", "lib/innate/log.rb", "lib/innate/log/color_formatter.rb", "lib/innate/log/hub.rb", "lib/innate/middleware_compiler.rb", "lib/innate/mock.rb", "lib/innate/node.rb", "lib/innate/options.rb", "lib/innate/options/dsl.rb", "lib/innate/options/stub.rb", "lib/innate/request.rb", "lib/innate/response.rb", "lib/innate/route.rb", "lib/innate/session.rb", "lib/innate/session/flash.rb", "lib/innate/spec.rb", "lib/innate/spec/bacon.rb", "lib/innate/state.rb", "lib/innate/state/accessor.rb", "lib/innate/traited.rb", "lib/innate/trinity.rb", "lib/innate/version.rb", "lib/innate/view.rb", "lib/innate/view/erb.rb", "lib/innate/view/etanni.rb", "lib/innate/view/none.rb", "spec/example/app/retro_games.rb", "spec/example/hello.rb", "spec/example/link.rb", "spec/example/provides.rb", "spec/example/session.rb", "spec/helper.rb", "spec/innate/action/layout.rb", "spec/innate/action/layout/file_layout.xhtml", "spec/innate/cache/common.rb", "spec/innate/cache/marshal.rb", "spec/innate/cache/memory.rb", "spec/innate/cache/yaml.rb", "spec/innate/dynamap.rb", "spec/innate/helper.rb", "spec/innate/helper/aspect.rb", "spec/innate/helper/cgi.rb", "spec/innate/helper/flash.rb", "spec/innate/helper/link.rb", "spec/innate/helper/redirect.rb", "spec/innate/helper/render.rb", "spec/innate/helper/send_file.rb", "spec/innate/helper/view/aspect_hello.xhtml", "spec/innate/helper/view/locals.xhtml", "spec/innate/helper/view/loop.xhtml", "spec/innate/helper/view/num.xhtml", "spec/innate/helper/view/partial.xhtml", "spec/innate/helper/view/recursive.xhtml", "spec/innate/mock.rb", "spec/innate/modes.rb", "spec/innate/node/mapping.rb", "spec/innate/node/node.rb", "spec/innate/node/resolve.rb", "spec/innate/node/view/another_layout/another_layout.xhtml", "spec/innate/node/view/bar.xhtml", "spec/innate/node/view/foo.html.xhtml", "spec/innate/node/view/only_view.xhtml", "spec/innate/node/view/with_layout.xhtml", "spec/innate/node/wrap_action_call.rb", "spec/innate/options.rb", "spec/innate/parameter.rb", "spec/innate/provides.rb", "spec/innate/provides/list.html.xhtml", "spec/innate/provides/list.txt.xhtml", "spec/innate/request.rb", "spec/innate/route.rb", "spec/innate/session.rb", "spec/innate/traited.rb", "tasks/authors.rake", "tasks/bacon.rake", "tasks/changelog.rake", "tasks/gem.rake", "tasks/gem_setup.rake", "tasks/grancher.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake", "tasks/setup.rake", "tasks/ycov.rake"]
|
13
|
-
s.has_rdoc = true
|
14
13
|
s.homepage = %q{http://github.com/manveru/innate}
|
15
14
|
s.require_paths = ["lib"]
|
16
15
|
s.rubyforge_project = %q{innate}
|
17
|
-
s.rubygems_version = %q{1.3.
|
16
|
+
s.rubygems_version = %q{1.3.4}
|
18
17
|
s.summary = %q{Powerful web-framework wrapper for Rack.}
|
19
18
|
|
20
19
|
if s.respond_to? :specification_version then
|
21
20
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
22
|
-
s.specification_version =
|
21
|
+
s.specification_version = 3
|
23
22
|
|
24
23
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
25
24
|
s.add_runtime_dependency(%q<rack>, ["~> 1.0.0"])
|
26
25
|
s.add_development_dependency(%q<bacon>, [">= 1.1.0"])
|
27
|
-
s.add_development_dependency(%q<json>, ["~> 1.1.
|
28
|
-
s.add_development_dependency(%q<rack-test>, [">= 0.
|
26
|
+
s.add_development_dependency(%q<json>, ["~> 1.1.7"])
|
27
|
+
s.add_development_dependency(%q<rack-test>, [">= 0.4.0"])
|
29
28
|
else
|
30
29
|
s.add_dependency(%q<rack>, ["~> 1.0.0"])
|
31
30
|
s.add_dependency(%q<bacon>, [">= 1.1.0"])
|
32
|
-
s.add_dependency(%q<json>, ["~> 1.1.
|
33
|
-
s.add_dependency(%q<rack-test>, [">= 0.
|
31
|
+
s.add_dependency(%q<json>, ["~> 1.1.7"])
|
32
|
+
s.add_dependency(%q<rack-test>, [">= 0.4.0"])
|
34
33
|
end
|
35
34
|
else
|
36
35
|
s.add_dependency(%q<rack>, ["~> 1.0.0"])
|
37
36
|
s.add_dependency(%q<bacon>, [">= 1.1.0"])
|
38
|
-
s.add_dependency(%q<json>, ["~> 1.1.
|
39
|
-
s.add_dependency(%q<rack-test>, [">= 0.
|
37
|
+
s.add_dependency(%q<json>, ["~> 1.1.7"])
|
38
|
+
s.add_dependency(%q<rack-test>, [">= 0.4.0"])
|
40
39
|
end
|
41
40
|
end
|
data/lib/innate/session.rb
CHANGED
@@ -36,6 +36,8 @@ module Innate
|
|
36
36
|
:expires, nil
|
37
37
|
o "Time to live for session cookies and cache, nil/false will prevent setting",
|
38
38
|
:ttl, (60 * 60 * 24 * 30) # 30 days
|
39
|
+
o "Length of generated Session ID (only applies when using SecureRandom)",
|
40
|
+
:sid_length, 64
|
39
41
|
|
40
42
|
trigger(:expires){|v|
|
41
43
|
self.ttl = v - Time.now.to_i
|
@@ -122,8 +124,32 @@ module Innate
|
|
122
124
|
|
123
125
|
begin
|
124
126
|
require 'securerandom'
|
125
|
-
|
127
|
+
|
128
|
+
# Using SecureRandom, optional length.
|
129
|
+
# SecureRandom is available since Ruby 1.8.7.
|
130
|
+
# For Ruby versions earlier than that, you can require the uuidtools gem,
|
131
|
+
# which has a drop-in replacement for SecureRandom.
|
132
|
+
def sid_algorithm; SecureRandom.hex(options.sid_length); end
|
133
|
+
rescue LoadError
|
134
|
+
require 'openssl'
|
135
|
+
|
136
|
+
# Using OpenSSL::Random for generation, this is comparable in performance
|
137
|
+
# with stdlib SecureRandom and also allows for optional length, it should
|
138
|
+
# have the same behaviour as the SecureRandom::hex method of the
|
139
|
+
# uuidtools gem.
|
140
|
+
def sid_algorithm
|
141
|
+
OpenSSL::Random.random_bytes(options.sid_length / 2).unpack('H*')[0]
|
142
|
+
end
|
126
143
|
rescue LoadError
|
144
|
+
warn "Falling back to low-entropy Session ID generation"
|
145
|
+
warn "Avoid this by upgrading Ruby, installing OpenSSL, or UUIDTools"
|
146
|
+
|
147
|
+
# Digest::SHA2::hexdigest produces a string of length 64, although
|
148
|
+
# collisions are not very likely, the entropy is still very low and
|
149
|
+
# length is not optional.
|
150
|
+
#
|
151
|
+
# Replacing it with OS-provided random data would take a lot of code and
|
152
|
+
# won't be as cross-platform as Ruby.
|
127
153
|
def sid_algorithm
|
128
154
|
entropy = [ srand, rand, Time.now.to_f, rand, $$, rand, object_id ]
|
129
155
|
Digest::SHA2.hexdigest(entropy.join)
|
data/lib/innate/version.rb
CHANGED
data/spec/example/hello.rb
CHANGED
data/spec/example/link.rb
CHANGED
data/spec/example/provides.rb
CHANGED
data/spec/example/session.rb
CHANGED
data/spec/helper.rb
CHANGED
@@ -4,7 +4,7 @@ if caller_line = caller.grep(%r!spec/innate/!).first
|
|
4
4
|
$0 = caller_file
|
5
5
|
end
|
6
6
|
|
7
|
-
require File.expand_path(
|
7
|
+
require File.expand_path('../../lib/innate', __FILE__)
|
8
8
|
require 'innate/spec'
|
9
9
|
|
10
10
|
Innate.options.roots = [caller_root] if caller_root
|
data/spec/innate/cache/common.rb
CHANGED
data/spec/innate/cache/memory.rb
CHANGED
data/spec/innate/cache/yaml.rb
CHANGED
data/spec/innate/dynamap.rb
CHANGED
data/spec/innate/helper.rb
CHANGED
data/spec/innate/helper/cgi.rb
CHANGED
data/spec/innate/helper/flash.rb
CHANGED
data/spec/innate/helper/link.rb
CHANGED
data/spec/innate/mock.rb
CHANGED
data/spec/innate/modes.rb
CHANGED
data/spec/innate/node/mapping.rb
CHANGED
data/spec/innate/node/node.rb
CHANGED
data/spec/innate/node/resolve.rb
CHANGED
data/spec/innate/options.rb
CHANGED
data/spec/innate/parameter.rb
CHANGED
data/spec/innate/provides.rb
CHANGED
data/spec/innate/request.rb
CHANGED
data/spec/innate/route.rb
CHANGED
data/spec/innate/session.rb
CHANGED
data/spec/innate/traited.rb
CHANGED
data/tasks/gem_setup.rake
CHANGED
@@ -44,8 +44,10 @@ task :gem_setup do
|
|
44
44
|
setup
|
45
45
|
end
|
46
46
|
|
47
|
-
#
|
48
|
-
# fails
|
47
|
+
# First try to activate.
|
48
|
+
# If activation fails, try to install and activate again.
|
49
|
+
# If the second activation also fails, try to require as it may just as
|
50
|
+
# well be in $LOAD_PATH.
|
49
51
|
def setup_gem(name, options)
|
50
52
|
version = [options[:version]].compact
|
51
53
|
lib_name = options[:lib] || name
|
@@ -53,9 +55,10 @@ task :gem_setup do
|
|
53
55
|
log "activating #{name}"
|
54
56
|
|
55
57
|
Gem.activate(name, *version)
|
56
|
-
rescue LoadError
|
58
|
+
rescue Gem::LoadError
|
59
|
+
log "activating #{name} failed, try to install"
|
60
|
+
|
57
61
|
install_gem(name, options)
|
58
|
-
Gem.activate(name, *version)
|
59
62
|
end
|
60
63
|
|
61
64
|
# tell rubygems to install a gem
|
@@ -63,9 +66,19 @@ task :gem_setup do
|
|
63
66
|
installer = Gem::DependencyInstaller.new(options)
|
64
67
|
|
65
68
|
temp_argv(options[:extconf]) do
|
66
|
-
log "
|
69
|
+
log "installing #{name}"
|
67
70
|
installer.install(name, options[:version])
|
68
71
|
end
|
72
|
+
|
73
|
+
Gem.activate(name, *version)
|
74
|
+
|
75
|
+
log "install and final activation successful"
|
76
|
+
rescue Gem::GemNotFoundException => ex
|
77
|
+
log "installation failed: #{ex}, use normal require"
|
78
|
+
|
79
|
+
require(options[:lib] || name)
|
80
|
+
|
81
|
+
log "require successful, cannot verify version though"
|
69
82
|
end
|
70
83
|
|
71
84
|
# prepare ARGV for rubygems installer
|
data/tasks/setup.rake
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
desc 'install dependencies from gemspec'
|
2
2
|
task :setup => [:gem_setup] do
|
3
|
-
GemSetup.new :verbose =>
|
4
|
-
|
3
|
+
GemSetup.new :verbose => false do
|
4
|
+
DEPENDENCIES.each do |name, options|
|
5
|
+
gem(name, options)
|
6
|
+
end
|
7
|
+
|
8
|
+
DEVELOPMENT_DEPENDENCIES.each do |name, options|
|
9
|
+
gem(name, options)
|
10
|
+
end
|
5
11
|
end
|
6
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manveru-innate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2009.
|
4
|
+
version: "2009.07"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael 'manveru' Fellinger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.1.
|
43
|
+
version: 1.1.7
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: rack-test
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.
|
53
|
+
version: 0.4.0
|
54
54
|
version:
|
55
55
|
description: Simple, straight-forward base for web-frameworks.
|
56
56
|
email: m.fellinger@gmail.com
|
@@ -188,7 +188,7 @@ files:
|
|
188
188
|
- tasks/reversion.rake
|
189
189
|
- tasks/setup.rake
|
190
190
|
- tasks/ycov.rake
|
191
|
-
has_rdoc:
|
191
|
+
has_rdoc: false
|
192
192
|
homepage: http://github.com/manveru/innate
|
193
193
|
post_install_message:
|
194
194
|
rdoc_options: []
|
@@ -205,14 +205,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements:
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 1.3.1
|
209
209
|
version:
|
210
210
|
requirements: []
|
211
211
|
|
212
212
|
rubyforge_project: innate
|
213
213
|
rubygems_version: 1.2.0
|
214
214
|
signing_key:
|
215
|
-
specification_version:
|
215
|
+
specification_version: 3
|
216
216
|
summary: Powerful web-framework wrapper for Rack.
|
217
217
|
test_files: []
|
218
218
|
|