manveru-innate 2009.04.08 → 2009.04.18
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +126 -0
- data/MANIFEST +5 -4
- data/README.md +1 -9
- data/Rakefile +6 -6
- data/example/app/retro_games.rb +3 -3
- data/example/app/todo/layout/{default.erb → default.xhtml} +0 -0
- data/example/app/todo/view/{index.erb → index.xhtml} +0 -0
- data/example/app/whywiki_erb/start.rb +2 -2
- data/example/provides.rb +9 -6
- data/innate.gemspec +5 -5
- data/lib/innate.rb +12 -18
- data/lib/innate/action.rb +14 -10
- data/lib/innate/cache/file_based.rb +2 -0
- data/lib/innate/helper.rb +2 -2
- data/lib/innate/helper/link.rb +2 -2
- data/lib/innate/helper/render.rb +3 -1
- data/lib/innate/helper/send_file.rb +9 -1
- data/lib/innate/node.rb +1 -3
- data/lib/innate/response.rb +0 -7
- data/lib/innate/session.rb +1 -2
- data/lib/innate/spec.rb +6 -47
- data/lib/innate/version.rb +1 -1
- data/spec/example/app/retro_games.rb +30 -0
- data/spec/example/provides.rb +16 -0
- data/spec/example/session.rb +8 -14
- data/spec/innate/helper/flash.rb +28 -47
- data/spec/innate/helper/link.rb +8 -0
- data/spec/innate/helper/redirect.rb +58 -43
- data/spec/innate/helper/render.rb +3 -27
- data/spec/innate/session.rb +14 -15
- data/tasks/install_dependencies.rake +2 -4
- data/tasks/release.rake +48 -9
- data/tasks/setup.rake +28 -0
- metadata +8 -7
- data/lib/innate/core_compatibility/basic_object.rb +0 -10
- data/lib/innate/core_compatibility/string.rb +0 -3
@@ -65,19 +65,6 @@ class SpecHelperRenderView
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
class SpecHelperRenderTemplate
|
69
|
-
Innate.node '/render_template'
|
70
|
-
|
71
|
-
def relative
|
72
|
-
render_template('spec/innate/helper/view/num.xhtml', :n => 42)
|
73
|
-
end
|
74
|
-
|
75
|
-
def absolute
|
76
|
-
path = File.join(File.dirname(__FILE__), 'view/num.xhtml')
|
77
|
-
render_template(path, :n => 42)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
68
|
class SpecHelperRenderMisc
|
82
69
|
Innate.node '/misc'
|
83
70
|
map_views '/'
|
@@ -89,7 +76,7 @@ end
|
|
89
76
|
|
90
77
|
describe Innate::Helper::Render do
|
91
78
|
describe '#render_full' do
|
92
|
-
behaves_like :mock
|
79
|
+
behaves_like :mock
|
93
80
|
|
94
81
|
it 'renders a full action' do
|
95
82
|
get('/render_full/standard').body.should == 'foo: []'
|
@@ -107,10 +94,8 @@ describe Innate::Helper::Render do
|
|
107
94
|
# value in the session that we can get afterwards.
|
108
95
|
|
109
96
|
it 'renders full action inside a session' do
|
110
|
-
|
111
|
-
|
112
|
-
mock.get('/render_full/with_session').body.should == '"manveru"'
|
113
|
-
end
|
97
|
+
get('/render_full/set_session/user/manveru')
|
98
|
+
get('/render_full/with_session').body.should == '"manveru"'
|
114
99
|
end
|
115
100
|
end
|
116
101
|
|
@@ -134,15 +119,6 @@ describe Innate::Helper::Render do
|
|
134
119
|
end
|
135
120
|
end
|
136
121
|
|
137
|
-
describe '#render_template' do
|
138
|
-
behaves_like :mock
|
139
|
-
|
140
|
-
it 'renders action with the given template file' do
|
141
|
-
get('/render_template/relative').body.should == '42'
|
142
|
-
get('/render_template/absolute').body.should == '42'
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
122
|
describe 'misc functionality' do
|
147
123
|
behaves_like :mock
|
148
124
|
|
data/spec/innate/session.rb
CHANGED
@@ -29,27 +29,26 @@ class SpecSession
|
|
29
29
|
end
|
30
30
|
|
31
31
|
describe Innate::Session do
|
32
|
-
behaves_like :
|
32
|
+
behaves_like :mock
|
33
33
|
|
34
34
|
should 'initiate session as needed' do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
response['Set-Cookie'].should == nil
|
35
|
+
get '/'
|
36
|
+
last_response.body.should == 'No session here'
|
37
|
+
last_response['Set-Cookie'].should == nil
|
39
38
|
|
40
|
-
|
39
|
+
get('/init')
|
40
|
+
last_response.body.should == '0'
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
1.upto(10) do |n|
|
43
|
+
get('/increment').body.should == n.to_s
|
44
|
+
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
get('/reset')
|
47
|
+
get('/view').body.should == ''
|
48
|
+
get('/init').body.should == '0'
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
end
|
50
|
+
-1.downto(-10) do |n|
|
51
|
+
get('/decrement').body.should == n.to_s
|
53
52
|
end
|
54
53
|
end
|
55
54
|
end
|
data/tasks/release.rake
CHANGED
@@ -1,12 +1,51 @@
|
|
1
|
-
|
2
|
-
task :
|
3
|
-
name, version = GEMSPEC.name, GEMSPEC.version
|
1
|
+
namespace :release do
|
2
|
+
task :all => [:release_github, :release_rubyforge]
|
4
3
|
|
5
|
-
|
4
|
+
desc 'Display instructions to release on github'
|
5
|
+
task :github => [:reversion, :gemspec] do
|
6
|
+
name, version = GEMSPEC.name, GEMSPEC.version
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
puts <<INSTRUCTIONS
|
9
|
+
First add the relevant files:
|
10
|
+
|
11
|
+
git add MANIFEST CHANGELOG #{name}.gemspec lib/#{name}/version.rb
|
12
|
+
|
13
|
+
Then commit them, tag the commit, and push:
|
14
|
+
|
15
|
+
git commit -m 'Version #{version}'
|
16
|
+
git tag -a -m '#{version}' '#{version}'
|
17
|
+
git push
|
18
|
+
|
19
|
+
INSTRUCTIONS
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
# TODO: Not tested
|
24
|
+
desc 'Display instructions to release on rubyforge'
|
25
|
+
task :rubyforge => [:reversion, :gemspec, :package] do
|
26
|
+
name, version = GEMSPEC.name, GEMSPEC.version
|
27
|
+
|
28
|
+
puts <<INSTRUCTIONS
|
29
|
+
To publish to rubyforge do following:
|
30
|
+
|
31
|
+
rubyforge login
|
32
|
+
rubyforge add_release #{name} '#{version}' pkg/#{name}-#{version}.gem
|
33
|
+
|
34
|
+
After you have done these steps, see:
|
35
|
+
|
36
|
+
rake release:rubyforge_archives
|
37
|
+
|
38
|
+
INSTRUCTIONS
|
39
|
+
end
|
40
|
+
|
41
|
+
desc 'Display instructions to add archives after release:rubyforge'
|
42
|
+
task :rubyforge_archives do
|
43
|
+
puts "Adding archives for distro packagers is:", ""
|
44
|
+
|
45
|
+
Dir["pkg/#{name}-#{version}.{gz,zip}"].each do |file|
|
46
|
+
puts "rubyforge add_file #{name} #{name} '#{version}' '#{file}'"
|
47
|
+
end
|
48
|
+
|
49
|
+
puts
|
50
|
+
end
|
12
51
|
end
|
data/tasks/setup.rake
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Currently, Innate is not usable without Rack from the master branch head.
|
2
|
+
# Also, our specs now depend on the latest rack-test.
|
3
|
+
#
|
4
|
+
# In order to make setup simpler for folks, I'll put up some gemspecs on github
|
5
|
+
# and use their automatic building to provide development versions of these
|
6
|
+
# libraries as gems for easier deployment.
|
7
|
+
#
|
8
|
+
# Once the libraries are officially released in a usable state I'll switch
|
9
|
+
# dependencies to the official ones again.
|
10
|
+
#
|
11
|
+
# Please note that this makes running in environments that enforce their own
|
12
|
+
# Rack (like jruby-rack) still quite difficult, but should allow for easier
|
13
|
+
# development.
|
14
|
+
#
|
15
|
+
# Please be patient.
|
16
|
+
|
17
|
+
desc 'install dependencies'
|
18
|
+
task :setup do
|
19
|
+
GemInstaller.new do
|
20
|
+
gem 'bacon', '>= 1.0'
|
21
|
+
gem 'json', '~> 1.1.3'
|
22
|
+
|
23
|
+
gem 'manveru-rack-test', '> 0.1.0', :lib => 'rack-test'
|
24
|
+
gem 'manveru-rack', '>= 0.9.9', :lib => 'rack'
|
25
|
+
|
26
|
+
setup
|
27
|
+
end
|
28
|
+
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.04.
|
4
|
+
version: 2009.04.18
|
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-04-
|
12
|
+
date: 2009-04-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -28,10 +28,10 @@ files:
|
|
28
28
|
- README.md
|
29
29
|
- Rakefile
|
30
30
|
- example/app/retro_games.rb
|
31
|
-
- example/app/todo/layout/default.
|
31
|
+
- example/app/todo/layout/default.xhtml
|
32
32
|
- example/app/todo/spec/todo.rb
|
33
33
|
- example/app/todo/start.rb
|
34
|
-
- example/app/todo/view/index.
|
34
|
+
- example/app/todo/view/index.xhtml
|
35
35
|
- example/app/whywiki_erb/layout/wiki.html.erb
|
36
36
|
- example/app/whywiki_erb/spec/wiki.rb
|
37
37
|
- example/app/whywiki_erb/start.rb
|
@@ -54,8 +54,6 @@ files:
|
|
54
54
|
- lib/innate/cache/marshal.rb
|
55
55
|
- lib/innate/cache/memory.rb
|
56
56
|
- lib/innate/cache/yaml.rb
|
57
|
-
- lib/innate/core_compatibility/basic_object.rb
|
58
|
-
- lib/innate/core_compatibility/string.rb
|
59
57
|
- lib/innate/current.rb
|
60
58
|
- lib/innate/dynamap.rb
|
61
59
|
- lib/innate/helper.rb
|
@@ -92,8 +90,10 @@ files:
|
|
92
90
|
- lib/innate/view/erb.rb
|
93
91
|
- lib/innate/view/etanni.rb
|
94
92
|
- lib/innate/view/none.rb
|
93
|
+
- spec/example/app/retro_games.rb
|
95
94
|
- spec/example/hello.rb
|
96
95
|
- spec/example/link.rb
|
96
|
+
- spec/example/provides.rb
|
97
97
|
- spec/example/session.rb
|
98
98
|
- spec/helper.rb
|
99
99
|
- spec/innate/action/layout.rb
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- tasks/rcov.rake
|
149
149
|
- tasks/release.rake
|
150
150
|
- tasks/reversion.rake
|
151
|
+
- tasks/setup.rake
|
151
152
|
has_rdoc: true
|
152
153
|
homepage: http://github.com/manveru/innate
|
153
154
|
post_install_message:
|
@@ -172,7 +173,7 @@ requirements: []
|
|
172
173
|
rubyforge_project:
|
173
174
|
rubygems_version: 1.2.0
|
174
175
|
signing_key:
|
175
|
-
specification_version:
|
176
|
+
specification_version: 3
|
176
177
|
summary: Powerful web-framework wrapper for Rack.
|
177
178
|
test_files: []
|
178
179
|
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# We define BasicObject for compatibility with 1.9 if it isn't there yet.
|
2
|
-
class BasicObject
|
3
|
-
# Remove all but these methods
|
4
|
-
# NOTE: __id__ is not there in 1.9, but would give a warning in 1.8
|
5
|
-
KEEP = %w[== equal? ! != instance_eval instance_exec __send__ __id__]
|
6
|
-
|
7
|
-
(instance_methods - KEEP).each do |im|
|
8
|
-
undef_method(im)
|
9
|
-
end
|
10
|
-
end unless defined?(BasicObject)
|