innate 2011.10 → 2011.12

Sign up to get free protection for your applications and to get access to all the features.
data/.gems CHANGED
@@ -1,5 +1,4 @@
1
1
  # .gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
2
2
  bacon -v1.1.0
3
- rack -v1.3.5
4
- rack -v1.3.4
3
+ rack -v1.4.0
5
4
  rack-test -v0.6.1
data/.rvmrc CHANGED
@@ -1,3 +1,2 @@
1
- rvm_gemset_create_on_use_flag=1
2
- rvm use --create 1.9.3@innate
1
+ rvm --install --create use 1.9.3@innate
3
2
  [[ -s .gems ]] && rvm gemset import .gems
data/.travis.yml CHANGED
@@ -1,19 +1,19 @@
1
1
  script: 'RUBYOPT=-rubygems rake bacon'
2
2
  before_script:
3
- - "./.load_gemset"
3
+ - test -s "$HOME/.rvm/scripts/rvm" && source "$HOME/.rvm/scripts/rvm"
4
+ - test -s .gems && rvm gemset import .gems
4
5
  rvm:
5
6
  - 1.8.7
6
7
  - 1.9.2
7
8
  - 1.9.3
8
- - rbx
9
- - rbx-2.0
9
+ - ruby-head
10
+ - rbx-18mode
11
+ - rbx-19mode
10
12
  - ree
11
13
  - jruby
12
-
13
14
  notifications:
14
15
  email:
15
16
  - mf@rubyists.com
16
-
17
17
  branches:
18
18
  only:
19
19
  - master
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
- 799 Michael Fellinger <m.fellinger@gmail.com>
4
+ 804 Michael Fellinger <m.fellinger@gmail.com>
5
5
  31 Tadahiko Uehara <kikofx@gmail.com>
6
6
  9 Lee Jarvis <injekt.me@gmail.com>
7
7
  8 Pistos <gitsomegrace.5.pistos@geoshell.com>
@@ -10,6 +10,7 @@ Following persons have contributed to innate.
10
10
  4 Zoxc <zoxc32@gmail.com>
11
11
  3 Antti Tuomi <antti.tuomi@tkk.fi>
12
12
  3 Lin Jen-Shin <godfat@godfat.org>
13
+ 3 Yorick Peterse <yorickpeterse@gmail.com>
13
14
  2 Andreas Karlsson <andreas@proxel.se>
14
15
  2 Arnaud Meuret <arnaud@meuret.name>
15
16
  2 injekt <ljjarvis@gmail.com>
@@ -19,4 +20,3 @@ Following persons have contributed to innate.
19
20
  1 Jérémy Zurcher <jeremy@asynk.ch>
20
21
  1 ravage <ravage@fragmentized.net>
21
22
  1 Sam Carr <samcarr@gmail.com>
22
- 1 Yorick Peterse <yorickpeterse@gmail.com>
data/CHANGELOG CHANGED
@@ -1,3 +1,62 @@
1
+ [d8a1da4 | 2011-12-28 05:06:07 UTC] Michael Fellinger <m.fellinger@gmail.com>
2
+
3
+ * Version 2011.12
4
+
5
+ [13f9372 | 2011-12-28 04:54:29 UTC] Michael Fellinger <m.fellinger@gmail.com>
6
+
7
+ * less obfuscation ftw
8
+
9
+ [10cf300 | 2011-12-28 04:54:09 UTC] Michael Fellinger <m.fellinger@gmail.com>
10
+
11
+ * minor cleanup around specs
12
+
13
+ [7f61483 | 2011-12-28 04:53:40 UTC] Michael Fellinger <m.fellinger@gmail.com>
14
+
15
+ * Update to Rack 1.4.0
16
+
17
+ [575e900 | 2011-12-08 17:05:04 UTC] Michael Fellinger <m.fellinger@gmail.com>
18
+
19
+ * Update travis config
20
+
21
+ [037f35a | 2011-11-06 12:18:30 UTC] Yorick Peterse <yorickpeterse@gmail.com>
22
+
23
+ * Revert "AOP calls can now be stacked."
24
+
25
+ This reverts commit 3ceb18dae7b774ab9b21cba6538b217ba35d5e21.
26
+
27
+ Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
28
+
29
+ [3ceb18d | 2011-11-06 11:30:51 UTC] Yorick Peterse <yorickpeterse@gmail.com>
30
+
31
+ * AOP calls can now be stacked.
32
+
33
+ This means that calling methods such as before_all() or before() multiple times
34
+ in the same controller will no longer in these calls overwriting previously
35
+ defined ones. A short example of this is the following:
36
+
37
+ class Posts
38
+ Innate.node('/posts')
39
+ helper :aspect
40
+
41
+ NUMBERS = []
42
+
43
+ before_all do
44
+ NUMBERS << 10
45
+ end
46
+
47
+ before_all do
48
+ NUMBERS << 20
49
+ end
50
+
51
+ def index
52
+ return NUMBERS
53
+ end
54
+ end
55
+
56
+ Visiting /posts would result in "[10, 20]" being displayed in the browser.
57
+
58
+ Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
59
+
1
60
  [7ad5d81 | 2011-10-23 17:19:58 UTC] Michael Fellinger <m.fellinger@gmail.com>
2
61
 
3
62
  * Version 2011.10
data/MANIFEST CHANGED
@@ -54,6 +54,7 @@ lib/innate/node.rb
54
54
  lib/innate/options.rb
55
55
  lib/innate/options/dsl.rb
56
56
  lib/innate/options/stub.rb
57
+ lib/innate/rack_file_wrapper.rb
57
58
  lib/innate/request.rb
58
59
  lib/innate/response.rb
59
60
  lib/innate/route.rb
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- require 'rake'
2
1
  require 'rake/clean'
3
2
  require 'rubygems/package_task'
4
3
  require 'time'
@@ -10,7 +9,7 @@ PROJECT_README = 'README.md'
10
9
  PROJECT_VERSION = (ENV['VERSION'] || Date.today.strftime('%Y.%m.%d')).dup
11
10
 
12
11
  DEPENDENCIES = {
13
- 'rack' => {:version => '>= 1.1.0'},
12
+ 'rack' => {:version => '~> 1.4.0'},
14
13
  }
15
14
 
16
15
  DEVELOPMENT_DEPENDENCIES = {
data/innate.gemspec CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "innate"
5
- s.version = "2011.10"
5
+ s.version = "2011.12"
6
6
 
7
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 = "2011-10-23"
9
+ s.date = "2011-12-28"
10
10
  s.description = "Simple, straight-forward base for web-frameworks."
11
11
  s.email = "m.fellinger@gmail.com"
12
- s.files = [".gems", ".gitignore", ".load_gemset", ".rvmrc", ".travis.yml", "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/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/etanni.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/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/cat2/cat22.xhtml", "spec/innate/node/view/cat3/cat33.xhtml", "spec/innate/node/view/foo.html.xhtml", "spec/innate/node/view/only_view.xhtml", "spec/innate/node/view/sub/baz.xhtml", "spec/innate/node/view/sub/foo/baz.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/response.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"]
12
+ s.files = [".gems", ".gitignore", ".load_gemset", ".rvmrc", ".travis.yml", "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/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/rack_file_wrapper.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/etanni.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/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/cat2/cat22.xhtml", "spec/innate/node/view/cat3/cat33.xhtml", "spec/innate/node/view/foo.html.xhtml", "spec/innate/node/view/only_view.xhtml", "spec/innate/node/view/sub/baz.xhtml", "spec/innate/node/view/sub/foo/baz.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/response.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
13
  s.homepage = "http://github.com/manveru/innate"
14
14
  s.require_paths = ["lib"]
15
15
  s.rubyforge_project = "innate"
@@ -20,16 +20,16 @@ Gem::Specification.new do |s|
20
20
  s.specification_version = 3
21
21
 
22
22
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
23
- s.add_runtime_dependency(%q<rack>, [">= 1.1.0"])
23
+ s.add_runtime_dependency(%q<rack>, ["~> 1.4.0"])
24
24
  s.add_development_dependency(%q<bacon>, [">= 1.1.0"])
25
25
  s.add_development_dependency(%q<rack-test>, [">= 0.6.1"])
26
26
  else
27
- s.add_dependency(%q<rack>, [">= 1.1.0"])
27
+ s.add_dependency(%q<rack>, ["~> 1.4.0"])
28
28
  s.add_dependency(%q<bacon>, [">= 1.1.0"])
29
29
  s.add_dependency(%q<rack-test>, [">= 0.6.1"])
30
30
  end
31
31
  else
32
- s.add_dependency(%q<rack>, [">= 1.1.0"])
32
+ s.add_dependency(%q<rack>, ["~> 1.4.0"])
33
33
  s.add_dependency(%q<bacon>, [">= 1.1.0"])
34
34
  s.add_dependency(%q<rack-test>, [">= 0.6.1"])
35
35
  end
data/lib/innate.rb CHANGED
@@ -53,6 +53,7 @@ module Innate
53
53
  require 'innate/session'
54
54
  require 'innate/session/flash'
55
55
  require 'innate/route'
56
+ require 'innate/rack_file_wrapper'
56
57
 
57
58
  extend Trinity
58
59
 
data/lib/innate/cache.rb CHANGED
@@ -101,9 +101,9 @@ module Innate
101
101
  #
102
102
  # @param [Cache] cache
103
103
  def self.register(cache)
104
- key = cache.name
105
- source = "def self.%s() @%s; end
106
- def self.%s=(o) @%s = o; end" % [key, key, key, key]
104
+ key = cache.name.to_s
105
+ source = "def self.#{key}() @#{key}; end
106
+ def self.#{key}=(o) @#{key} = o; end"
107
107
  self.class_eval(source, __FILE__, __LINE__)
108
108
 
109
109
  self.send("#{key}=", cache)
@@ -41,7 +41,7 @@ module Innate
41
41
 
42
42
  joined = roots.map{|root| publics.map{|public| ::File.join(root, public)}}
43
43
 
44
- apps = joined.flatten.map{|public_root| Rack::File.new(public_root) }
44
+ apps = joined.flatten.map{|public_root| RackFileWrapper.new(public_root) }
45
45
  apps << Current.new(Route.new(app), Rewrite.new(app))
46
46
 
47
47
  cascade(*apps)
@@ -0,0 +1,24 @@
1
+ module Innate
2
+ class RackFileWrapper
3
+ def initialize(root, cache_control = nil)
4
+ @file = Rack::File.new(root, cache_control)
5
+ end
6
+
7
+ def call(env)
8
+ status, header, body = @file.call(env)
9
+
10
+ if status == 403
11
+ unless Rack::File::ALLOWED_VERBS.include?(env['REQUEST_METHOD'])
12
+ body = "File not Found: #{Rack::Utils.unescape(env['PATH_INFO'])}\n"
13
+ return 404, {
14
+ 'Content-Type' => 'text/plain',
15
+ 'Content-Length' => body.size,
16
+ 'X-Cascade' => 'pass',
17
+ }, [body]
18
+ end
19
+ end
20
+
21
+ return status, header, body
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,3 @@
1
- begin; require 'rubygems'; rescue LoadError; end
2
-
3
1
  require 'bacon'
4
2
  require 'rack/test'
5
3
  require File.expand_path('../../', __FILE__) unless defined?(Innate)
@@ -1,3 +1,3 @@
1
1
  module Innate
2
- VERSION = "2011.10"
2
+ VERSION = "2011.12"
3
3
  end
@@ -15,7 +15,9 @@ describe 'Retro-games app' do
15
15
  end
16
16
 
17
17
  it 'allows you to add another game' do
18
- post '/create', :name => 'Street Fighter II'
18
+ response = post('/create', :name => 'Street Fighter II')
19
+ response.status.should == 302
20
+
19
21
  follow_redirect!
20
22
  last_response.should =~ /0 =&gt; Street Fighter II/
21
23
  end
data/tasks/bacon.rake CHANGED
@@ -21,7 +21,7 @@ task :bacon do
21
21
  specs.each_with_index do |spec, idx|
22
22
  print(left_format % [idx + 1, specs_size, spec])
23
23
 
24
- Open3.popen3(FileUtils::RUBY, spec) do |sin, sout, serr|
24
+ Open3.popen3(FileUtils::RUBY, '-w', spec) do |sin, sout, serr|
25
25
  out = sout.read.strip
26
26
  err = serr.read.strip
27
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: innate
3
3
  version: !ruby/object:Gem::Version
4
- version: '2011.10'
4
+ version: '2011.12'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-23 00:00:00.000000000 Z
12
+ date: 2011-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
- requirement: &8662480 !ruby/object:Gem::Requirement
16
+ requirement: &16472440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.1.0
21
+ version: 1.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *8662480
24
+ version_requirements: *16472440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
27
- requirement: &8661860 !ruby/object:Gem::Requirement
27
+ requirement: &16472000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *8661860
35
+ version_requirements: *16472000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack-test
38
- requirement: &8661300 !ruby/object:Gem::Requirement
38
+ requirement: &16471480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.6.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *8661300
46
+ version_requirements: *16471480
47
47
  description: Simple, straight-forward base for web-frameworks.
48
48
  email: m.fellinger@gmail.com
49
49
  executables: []
@@ -106,6 +106,7 @@ files:
106
106
  - lib/innate/options.rb
107
107
  - lib/innate/options/dsl.rb
108
108
  - lib/innate/options/stub.rb
109
+ - lib/innate/rack_file_wrapper.rb
109
110
  - lib/innate/request.rb
110
111
  - lib/innate/response.rb
111
112
  - lib/innate/route.rb