innate 2013.02.21 → 2023.01.06

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4d2355b1a19d85209ed8acbafbf477b31bc804b793d9de0f677a83c4d92a8e17
4
+ data.tar.gz: fb39b388cfce21a80fc3ad379b8915d9642a44ee31d6e3beffa27583322edc48
5
+ SHA512:
6
+ metadata.gz: 19c747ca8d094441e416ffb09da46c8c6ade409e71be70c65564cdbbf09d4a121560d4cabeede86fb99370276f6e4a83c4de7208eaadaeda203957865cd4a596
7
+ data.tar.gz: 2dd8608564ae9e6cc0b48ed4ea8dd8ff2898bd853a02ef2ef862aec9e35e0899bb2d9d262e62b0dcf22dcb53b223aebc59eaac02a3d0952f3ade3645d4bf5756
data/AUTHORS CHANGED
@@ -1,11 +1,12 @@
1
1
  Following persons have contributed to innate.
2
2
  (Sorted by number of submitted patches, then alphabetically)
3
3
 
4
- 821 Michael Fellinger <m.fellinger@gmail.com>
4
+ 825 Michael Fellinger <m.fellinger@gmail.com>
5
5
  31 Tadahiko Uehara <kikofx@gmail.com>
6
6
  21 Yorick Peterse <yorickpeterse@gmail.com>
7
7
  9 Lee Jarvis <injekt.me@gmail.com>
8
8
  8 Pistos <gitsomegrace.5.pistos@geoshell.com>
9
+ 6 Michael Faughn <michael.faughn@nist.gov>
9
10
  5 injekt <injekt.me@gmail.com>
10
11
  5 Ryan Grove <ryan@wonko.com>
11
12
  4 Zoxc <zoxc32@gmail.com>
@@ -14,9 +15,12 @@ Following persons have contributed to innate.
14
15
  2 Andreas Karlsson <andreas@proxel.se>
15
16
  2 Arnaud Meuret <arnaud@meuret.name>
16
17
  2 injekt <ljjarvis@gmail.com>
18
+ 2 Michael J. Welch, Ph.D <mjwelchphd@ekgreaders.com>
17
19
  2 TJ Vanderpoel <bougy.man@gmail.com>
18
20
  2 YorickPeterse <yorickpeterse@gmail.com>
19
21
  1 crab <crabtw@gmail.com>
20
22
  1 Jérémy Zurcher <jeremy@asynk.ch>
23
+ 1 Michael Fellinger <github@manveru.dev>
24
+ 1 Patrik Rak <patrik@raxoft.cz>
21
25
  1 ravage <ravage@fragmentized.net>
22
26
  1 Sam Carr <samcarr@gmail.com>
data/CHANGELOG CHANGED
@@ -1,3 +1,47 @@
1
+ [171f18d | 2023-01-05 11:40:11 UTC] Michael Faughn <michael.faughn@nist.gov>
2
+
3
+ * update gemspec to specify modern version of rack and rack-test and add rackup
4
+
5
+ [e58eb0b | 2023-01-05 11:38:55 UTC] Michael Faughn <michael.faughn@nist.gov>
6
+
7
+ * Use Rackup::Handler instead of Rack::Handler. Refactor registration of ebb handler registration into #start_ebb. Not sure this code is covered by the tests but all tests are passing.
8
+
9
+ [0e8a163 | 2023-01-05 11:11:37 UTC] Michael Faughn <michael.faughn@nist.gov>
10
+
11
+ * fix test to expect header keys to be downcase as that is what Rack sends now
12
+
13
+ [a6158c2 | 2023-01-05 11:09:24 UTC] Michael Faughn <michael.faughn@nist.gov>
14
+
15
+ * Fix unless condition in rescue block of Request#local_net? to match any exception message that suggests an invalid address
16
+
17
+ [15a50ff | 2023-01-05 11:06:44 UTC] Michael Faughn <michael.faughn@nist.gov>
18
+
19
+ * Change Rack::File to Rack::Files and Rack::Response#header to #headers to conform with rack ~> 3.0
20
+
21
+ [972432e | 2023-01-05 11:03:20 UTC] Michael Faughn <michael.faughn@nist.gov>
22
+
23
+ * remove Gem::Specification#has_rdoc because it is deprecated and breaks things.
24
+
25
+ [2da7803 | 2016-05-12 20:45:17 UTC] Michael J. Welch, Ph.D <mjwelchphd@ekgreaders.com>
26
+
27
+ * Update adapter.rb.
28
+
29
+ In lib/innate/adapter.rb#self.start_webrick, `:BindAddress => config[:Host]` should be `:Host => config[:Host]` because lib/rack/handler/webrick.rb#self.run looks for :Host, not :BindAddress. What this means is, if you're running Ramaze on a remote server, there is no :Host in the options (which returns nil), and so it defaults to localhost, then your browser won't see the site.
30
+
31
+ [4989626 | 2015-10-28 17:16:46 UTC] Michael Fellinger <m.fellinger@gmail.com>
32
+
33
+ * Version 2015.10.28
34
+
35
+ [105060c | 2015-10-28 17:15:55 UTC] Michael Fellinger <m.fellinger@gmail.com>
36
+
37
+ * update dependencies and gem setup
38
+
39
+ [cde6b36 | 2013-10-16 14:59:44 UTC] Patrik Rak <patrik@raxoft.cz>
40
+
41
+ * Use correct session class in Current.setup.
42
+
43
+ Current.setup should honor the passed in arguments even for session.
44
+
1
45
  [866c9cd | 2013-02-21 12:21:46 UTC] Michael Fellinger <m.fellinger@gmail.com>
2
46
 
3
47
  * Version 2013.02.21
data/Rakefile CHANGED
@@ -9,12 +9,12 @@ PROJECT_README = 'README.md'
9
9
  PROJECT_VERSION = (ENV['VERSION'] || Date.today.strftime('%Y.%m.%d')).dup
10
10
 
11
11
  DEPENDENCIES = {
12
- 'rack' => {:version => '~> 1.5.2'},
12
+ 'rack' => {:version => '~> 3.0'},
13
13
  }
14
14
 
15
15
  DEVELOPMENT_DEPENDENCIES = {
16
16
  'bacon' => {:version => '~> 1.2.0'},
17
- 'rack-test' => {:version => '~> 0.6.2', :lib => 'rack/test'}
17
+ 'rack-test' => {:version => '~> 0.6.3', :lib => 'rack/test'}
18
18
  }
19
19
 
20
20
  GEMSPEC = Gem::Specification.new{|s|
@@ -27,10 +27,7 @@ GEMSPEC = Gem::Specification.new{|s|
27
27
  s.platform = Gem::Platform::RUBY
28
28
  s.version = PROJECT_VERSION
29
29
  s.files = `git ls-files`.split("\n").sort
30
- s.has_rdoc = true
31
30
  s.require_path = 'lib'
32
- s.rubyforge_project = "innate"
33
- s.required_rubygems_version = '>= 1.3.1'
34
31
  }
35
32
 
36
33
  DEPENDENCIES.each do |name, options|
data/innate.gemspec CHANGED
@@ -1,36 +1,32 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # stub: innate 2023.01.06 ruby lib
2
3
 
3
4
  Gem::Specification.new do |s|
4
- s.name = "innate"
5
- s.version = "2013.02.21"
5
+ s.name = "innate".freeze
6
+ s.version = "2023.01.06"
6
7
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3.1") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Michael 'manveru' Fellinger"]
9
- s.date = "2013-02-21"
10
- s.description = "Simple, straight-forward base for web-frameworks."
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/default_middleware.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/lru_hash.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"]
13
- s.homepage = "http://github.com/manveru/innate"
14
- s.require_paths = ["lib"]
15
- s.rubyforge_project = "innate"
16
- s.rubygems_version = "1.8.25"
17
- s.summary = "Powerful web-framework wrapper for Rack."
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib".freeze]
10
+ s.authors = ["Michael 'manveru' Fellinger".freeze]
11
+ s.date = "2023-01-06"
12
+ s.description = "Simple, straight-forward base for web-frameworks.".freeze
13
+ s.email = "m.fellinger@gmail.com".freeze
14
+ s.files = [".gems".freeze, ".gitignore".freeze, ".load_gemset".freeze, ".rvmrc".freeze, ".travis.yml".freeze, "AUTHORS".freeze, "CHANGELOG".freeze, "COPYING".freeze, "MANIFEST".freeze, "README.md".freeze, "Rakefile".freeze, "example/app/retro_games.rb".freeze, "example/app/todo/layout/default.xhtml".freeze, "example/app/todo/spec/todo.rb".freeze, "example/app/todo/start.rb".freeze, "example/app/todo/view/index.xhtml".freeze, "example/app/whywiki_erb/layout/wiki.html.erb".freeze, "example/app/whywiki_erb/spec/wiki.rb".freeze, "example/app/whywiki_erb/start.rb".freeze, "example/app/whywiki_erb/view/edit.erb".freeze, "example/app/whywiki_erb/view/index.erb".freeze, "example/custom_middleware.rb".freeze, "example/hello.rb".freeze, "example/howto_spec.rb".freeze, "example/link.rb".freeze, "example/provides.rb".freeze, "example/session.rb".freeze, "innate.gemspec".freeze, "lib/innate.rb".freeze, "lib/innate/action.rb".freeze, "lib/innate/adapter.rb".freeze, "lib/innate/cache.rb".freeze, "lib/innate/cache/api.rb".freeze, "lib/innate/cache/drb.rb".freeze, "lib/innate/cache/file_based.rb".freeze, "lib/innate/cache/marshal.rb".freeze, "lib/innate/cache/memory.rb".freeze, "lib/innate/cache/yaml.rb".freeze, "lib/innate/current.rb".freeze, "lib/innate/default_middleware.rb".freeze, "lib/innate/dynamap.rb".freeze, "lib/innate/helper.rb".freeze, "lib/innate/helper/aspect.rb".freeze, "lib/innate/helper/cgi.rb".freeze, "lib/innate/helper/flash.rb".freeze, "lib/innate/helper/link.rb".freeze, "lib/innate/helper/redirect.rb".freeze, "lib/innate/helper/render.rb".freeze, "lib/innate/log.rb".freeze, "lib/innate/log/color_formatter.rb".freeze, "lib/innate/log/hub.rb".freeze, "lib/innate/lru_hash.rb".freeze, "lib/innate/mock.rb".freeze, "lib/innate/node.rb".freeze, "lib/innate/options.rb".freeze, "lib/innate/options/dsl.rb".freeze, "lib/innate/options/stub.rb".freeze, "lib/innate/request.rb".freeze, "lib/innate/response.rb".freeze, "lib/innate/route.rb".freeze, "lib/innate/session.rb".freeze, "lib/innate/session/flash.rb".freeze, "lib/innate/spec.rb".freeze, "lib/innate/spec/bacon.rb".freeze, "lib/innate/state.rb".freeze, "lib/innate/state/accessor.rb".freeze, "lib/innate/traited.rb".freeze, "lib/innate/trinity.rb".freeze, "lib/innate/version.rb".freeze, "lib/innate/view.rb".freeze, "lib/innate/view/erb.rb".freeze, "lib/innate/view/etanni.rb".freeze, "lib/innate/view/none.rb".freeze, "spec/example/app/retro_games.rb".freeze, "spec/example/hello.rb".freeze, "spec/example/link.rb".freeze, "spec/example/provides.rb".freeze, "spec/example/session.rb".freeze, "spec/helper.rb".freeze, "spec/innate/action/layout.rb".freeze, "spec/innate/action/layout/file_layout.xhtml".freeze, "spec/innate/cache/common.rb".freeze, "spec/innate/cache/marshal.rb".freeze, "spec/innate/cache/memory.rb".freeze, "spec/innate/cache/yaml.rb".freeze, "spec/innate/dynamap.rb".freeze, "spec/innate/etanni.rb".freeze, "spec/innate/helper.rb".freeze, "spec/innate/helper/aspect.rb".freeze, "spec/innate/helper/cgi.rb".freeze, "spec/innate/helper/flash.rb".freeze, "spec/innate/helper/link.rb".freeze, "spec/innate/helper/redirect.rb".freeze, "spec/innate/helper/render.rb".freeze, "spec/innate/helper/view/aspect_hello.xhtml".freeze, "spec/innate/helper/view/locals.xhtml".freeze, "spec/innate/helper/view/loop.xhtml".freeze, "spec/innate/helper/view/num.xhtml".freeze, "spec/innate/helper/view/partial.xhtml".freeze, "spec/innate/helper/view/recursive.xhtml".freeze, "spec/innate/mock.rb".freeze, "spec/innate/modes.rb".freeze, "spec/innate/node/mapping.rb".freeze, "spec/innate/node/node.rb".freeze, "spec/innate/node/resolve.rb".freeze, "spec/innate/node/view/another_layout/another_layout.xhtml".freeze, "spec/innate/node/view/bar.xhtml".freeze, "spec/innate/node/view/cat2/cat22.xhtml".freeze, "spec/innate/node/view/cat3/cat33.xhtml".freeze, "spec/innate/node/view/foo.html.xhtml".freeze, "spec/innate/node/view/only_view.xhtml".freeze, "spec/innate/node/view/sub/baz.xhtml".freeze, "spec/innate/node/view/sub/foo/baz.xhtml".freeze, "spec/innate/node/view/with_layout.xhtml".freeze, "spec/innate/node/wrap_action_call.rb".freeze, "spec/innate/options.rb".freeze, "spec/innate/parameter.rb".freeze, "spec/innate/provides.rb".freeze, "spec/innate/provides/list.html.xhtml".freeze, "spec/innate/provides/list.txt.xhtml".freeze, "spec/innate/request.rb".freeze, "spec/innate/response.rb".freeze, "spec/innate/route.rb".freeze, "spec/innate/session.rb".freeze, "spec/innate/traited.rb".freeze, "tasks/authors.rake".freeze, "tasks/bacon.rake".freeze, "tasks/changelog.rake".freeze, "tasks/gem.rake".freeze, "tasks/gem_setup.rake".freeze, "tasks/grancher.rake".freeze, "tasks/manifest.rake".freeze, "tasks/rcov.rake".freeze, "tasks/release.rake".freeze, "tasks/reversion.rake".freeze, "tasks/setup.rake".freeze, "tasks/ycov.rake".freeze]
15
+ s.homepage = "http://github.com/manveru/innate".freeze
16
+ s.rubygems_version = "3.3.20".freeze
17
+ s.summary = "Powerful web-framework wrapper for Rack.".freeze
18
18
 
19
19
  if s.respond_to? :specification_version then
20
- s.specification_version = 3
20
+ s.specification_version = 4
21
+ end
21
22
 
22
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
23
- s.add_runtime_dependency(%q<rack>, ["~> 1.5.2"])
24
- s.add_development_dependency(%q<bacon>, ["~> 1.2.0"])
25
- s.add_development_dependency(%q<rack-test>, ["~> 0.6.2"])
26
- else
27
- s.add_dependency(%q<rack>, ["~> 1.5.2"])
28
- s.add_dependency(%q<bacon>, ["~> 1.2.0"])
29
- s.add_dependency(%q<rack-test>, ["~> 0.6.2"])
30
- end
23
+ if s.respond_to? :add_runtime_dependency then
24
+ s.add_runtime_dependency(%q<rack>.freeze, ["~> 1.6.4"])
25
+ s.add_development_dependency(%q<bacon>.freeze, ["~> 1.2.0"])
26
+ s.add_development_dependency(%q<rack-test>.freeze, ["~> 0.6.3"])
31
27
  else
32
- s.add_dependency(%q<rack>, ["~> 1.5.2"])
33
- s.add_dependency(%q<bacon>, ["~> 1.2.0"])
34
- s.add_dependency(%q<rack-test>, ["~> 0.6.2"])
28
+ s.add_dependency(%q<rack>.freeze, ["~> 1.6.4"])
29
+ s.add_dependency(%q<bacon>.freeze, ["~> 1.2.0"])
30
+ s.add_dependency(%q<rack-test>.freeze, ["~> 0.6.3"])
35
31
  end
36
32
  end
@@ -1,10 +1,4 @@
1
- # Rack doesn't ship with ebb handler, but it doesn't get picked up under some
2
- # circumstances, so we do that here.
3
- # Jruby Rack doesn't have the Handler::register method, so we have to check.
4
- if Rack::Handler.respond_to?(:register)
5
- Rack::Handler.register('ebb', 'Rack::Handler::Ebb')
6
- end
7
-
1
+ require 'rackup/handler'
8
2
  module Innate
9
3
 
10
4
  # Lightweight wrapper around Rack::Handler, will apply our options in a
@@ -44,7 +38,7 @@ module Innate
44
38
  if respond_to?(method = "start_#{handler}")
45
39
  send(method, app, config)
46
40
  else
47
- Rack::Handler.get(handler).run(app, config)
41
+ Rackup::Handler.get(handler).run(app, config)
48
42
  end
49
43
  end
50
44
 
@@ -53,14 +47,21 @@ module Innate
53
47
  # rubygems and uses the C require directly.
54
48
  def self.start_ebb(app, config)
55
49
  require 'ebb'
56
- Rack::Handler.get('ebb').run(app, config)
50
+ # Rack doesn't ship with ebb handler, but it doesn't get picked up under some
51
+ # circumstances, so we do that here.
52
+ # Jruby Rack doesn't have the Handler::register method, so we have to check.
53
+ # This has changed since Rack moved Handler to Rackup. Not sure about JRuby
54
+ if Rackup::Handler.respond_to?(:register)
55
+ Rackup::Handler.register('ebb', 'Rackup::Handler::Ebb')
56
+ end
57
+ Rackup::Handler.get('ebb').run(app, config)
57
58
  end
58
59
 
59
60
  # We want webrick to use our logger.
60
61
  def self.start_webrick(app, config)
61
- handler = Rack::Handler.get('webrick')
62
+ handler = Rackup::Handler.get('webrick')
62
63
  config = {
63
- :BindAddress => config[:Host],
64
+ :Host => config[:Host],
64
65
  :Port => config[:Port],
65
66
  :Logger => Log,
66
67
  }
@@ -70,7 +71,7 @@ module Innate
70
71
 
71
72
  # Thin shouldn't give excessive output, especially not to $stdout
72
73
  def self.start_thin(app, config)
73
- handler = Rack::Handler.get('thin')
74
+ handler = Rackup::Handler.get('thin')
74
75
  ::Thin::Logging.silent = true
75
76
  handler.run(app, config)
76
77
  end
@@ -29,7 +29,7 @@ module Innate
29
29
  req = current[:request] = request.new(env)
30
30
  res = current[:response] = response.new
31
31
  current[:actions] = []
32
- current[:session] = Session.new(req, res)
32
+ current[:session] = session.new(req, res)
33
33
  end
34
34
  end
35
35
  end
@@ -57,7 +57,7 @@ module Innate
57
57
  end
58
58
 
59
59
  def raw_redirect(target, options = {}, &block)
60
- header = response.header.merge('Location' => target.to_s)
60
+ header = response.headers.merge('Location' => target.to_s)
61
61
  status = options[:status] || 302
62
62
  body = options[:body] || redirect_body(target)
63
63
 
@@ -135,7 +135,7 @@ module Innate
135
135
  addr = IPAddr.new(address)
136
136
  LOCAL.find{|range| range.include?(addr) }
137
137
  rescue ArgumentError => ex
138
- raise ArgumentError, ex unless ex.message == 'invalid address'
138
+ raise ArgumentError, ex unless ex.message =~ /invalid address/
139
139
  end
140
140
  end
141
141
  end
@@ -13,7 +13,7 @@ module Innate
13
13
 
14
14
  def reset
15
15
  self.status = 200
16
- self.header.delete('Content-Type')
16
+ self.headers.delete('Content-Type')
17
17
  body.clear
18
18
  self.length = 0
19
19
  self
data/lib/innate/route.rb CHANGED
@@ -5,7 +5,7 @@ module Innate
5
5
  #
6
6
  # This middleware should wrap Innate::DynaMap.
7
7
  #
8
- # Please note that Rack::File is put before Route and Rewrite, that means
8
+ # Please note that Rack::Files is put before Route and Rewrite, that means
9
9
  # that you cannot apply routes to static files unless you add your own route
10
10
  # middleware before.
11
11
  #
@@ -1,3 +1,3 @@
1
1
  module Innate
2
- VERSION = "2013.02.21"
2
+ VERSION = "2023.01.06"
3
3
  end
data/lib/innate.rb CHANGED
@@ -213,7 +213,7 @@ module Innate
213
213
  roots, publics = options[:roots], options[:publics]
214
214
 
215
215
  joined = roots.map { |root| publics.map { |p| File.join(root, p) } }
216
- joined = joined.flatten.map { |p| Rack::File.new(p) }
216
+ joined = joined.flatten.map { |p| Rack::Files.new(p) }
217
217
  current = Current.new(Route.new(DynaMap), Rewrite.new(DynaMap))
218
218
 
219
219
  return Rack::Cascade.new(joined << current, [404, 405])
data/spec/innate/modes.rb CHANGED
@@ -16,12 +16,11 @@ describe 'Innate modes' do
16
16
  describe 'dev' do
17
17
  behaves_like :rack_test
18
18
  Innate.options.mode = :dev
19
-
20
19
  should 'handle GET request' do
21
20
  get('/').status.
22
21
  should == 200
23
22
  last_response.headers.
24
- should == {'Content-Length' => '13', 'Content-Type' => 'text/html'}
23
+ should == {'content-length' => '13', 'content-type' => 'text/html'}
25
24
  last_response.body.
26
25
  should == 'Hello, World!'
27
26
  end
@@ -30,7 +29,7 @@ describe 'Innate modes' do
30
29
  head('/').status.
31
30
  should == 200
32
31
  last_response.headers.
33
- should == {'Content-Length' => '13', 'Content-Type' => 'text/html'}
32
+ should == {'content-length' => '13', 'content-type' => 'text/html'}
34
33
  last_response.body.
35
34
  should == ''
36
35
  end
@@ -44,7 +43,7 @@ describe 'Innate modes' do
44
43
  get('/').status.
45
44
  should == 200
46
45
  last_response.headers.
47
- should == {'Content-Length' => '13', 'Content-Type' => 'text/html'}
46
+ should == {'content-length' => '13', 'content-type' => 'text/html'}
48
47
  last_response.body.
49
48
  should == 'Hello, World!'
50
49
  end
@@ -53,7 +52,7 @@ describe 'Innate modes' do
53
52
  head('/').status.
54
53
  should == 200
55
54
  last_response.headers.
56
- should == {'Content-Length' => '13', 'Content-Type' => 'text/html'}
55
+ should == {'content-length' => '13', 'content-type' => 'text/html'}
57
56
  last_response.body.
58
57
  should == ''
59
58
  end
data/tasks/gem_setup.rake CHANGED
@@ -14,7 +14,7 @@ task :gem_setup do
14
14
  setup
15
15
  end
16
16
 
17
- def gem(name, version = nil, options = {})
17
+ def use_gem(name, version = nil, options = {})
18
18
  if version.respond_to?(:merge!)
19
19
  options = version
20
20
  else
@@ -26,8 +26,7 @@ task :gem_setup do
26
26
 
27
27
  # all gems defined, let's try to load/install them
28
28
  def setup
29
- require 'rubygems'
30
- require 'rubygems/dependency_installer'
29
+ require 'rubygems/commands/install_command'
31
30
 
32
31
  @gems.each do |name, options|
33
32
  setup_gem(name, options)
@@ -37,7 +36,7 @@ task :gem_setup do
37
36
  def setup_gemspec(gemspec)
38
37
  gemspec.dependencies.each do |dependency|
39
38
  dependency.version_requirements.as_list.each do |version|
40
- gem(dependency.name, version)
39
+ use_gem(dependency.name, version)
41
40
  end
42
41
  end
43
42
 
@@ -49,49 +48,41 @@ task :gem_setup do
49
48
  # If the second activation also fails, try to require as it may just as
50
49
  # well be in $LOAD_PATH.
51
50
  def setup_gem(name, options)
52
- version = [options[:version]].compact
53
- lib_name = options[:lib] || name
54
-
55
- log "activating #{name}"
56
-
57
- Gem.activate(name, *version)
58
- rescue Gem::LoadError
59
- log "activating #{name} failed, try to install"
60
-
61
- install_gem(name, version, options)
51
+ try_require_gem(name, options)
52
+ rescue Exception
53
+ try_installing_gem(name, options)
62
54
  end
63
55
 
64
- # tell rubygems to install a gem
65
- def install_gem(name, version, options)
66
- installer = Gem::DependencyInstaller.new(options)
67
-
68
- temp_argv(options[:extconf]) do
69
- log "installing #{name}"
70
- installer.install(name, *version)
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"
56
+ def try_require_gem(name, options)
57
+ lib_name = options[:lib] || name
58
+ version = [options[:version]].compact
59
+ gem name, version[0]
60
+ require lib_name
82
61
  end
83
62
 
84
- # prepare ARGV for rubygems installer
85
- def temp_argv(extconf)
86
- if extconf ||= @options[:extconf]
87
- old_argv = ARGV.clone
88
- ARGV.replace(extconf.split(' '))
89
- end
90
-
91
- yield
63
+ def try_installing_gem(name, options)
64
+ cmd = Gem::Commands::InstallCommand.new
65
+ version = [options[:version]].compact
92
66
 
93
- ensure
94
- ARGV.replace(old_argv) if extconf
67
+ if version.any?
68
+ version.each do |v|
69
+ cmd.handle_options(["--no-ri", "--no-rdoc", "--user-install", name, '--version', v])
70
+ Process.waitpid fork{
71
+ begin
72
+ cmd.execute
73
+ rescue Exception
74
+ end
75
+ }
76
+ end
77
+ else
78
+ cmd.handle_options(["--no-ri", "--no-rdoc", "--user-install", name])
79
+ Process.waitpid fork{
80
+ begin
81
+ cmd.execute
82
+ rescue Exception
83
+ end
84
+ }
85
+ end
95
86
  end
96
87
 
97
88
  private
@@ -106,7 +97,6 @@ task :gem_setup do
106
97
  end
107
98
  end
108
99
 
109
- def rubyforge; 'http://gems.rubyforge.org/' end
110
100
  def github; 'http://gems.github.com/' end
111
101
  end
112
102
  end
data/tasks/setup.rake CHANGED
@@ -2,11 +2,11 @@ desc 'install dependencies from gemspec'
2
2
  task :setup => [:gem_setup] do
3
3
  GemSetup.new :verbose => false do
4
4
  DEPENDENCIES.each do |name, options|
5
- gem(name, options)
5
+ use_gem(name, options)
6
6
  end
7
7
 
8
8
  DEVELOPMENT_DEPENDENCIES.each do |name, options|
9
- gem(name, options)
9
+ use_gem(name, options)
10
10
  end
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,75 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: innate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2013.02.21
5
- prerelease:
4
+ version: 2023.01.06
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael 'manveru' Fellinger
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-21 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 1.5.2
19
+ version: '3.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.5.2
26
+ version: '3.0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bacon
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.2.0
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.2.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rack-test
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 0.6.2
47
+ version: 0.6.3
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: 0.6.2
54
+ version: 0.6.3
62
55
  description: Simple, straight-forward base for web-frameworks.
63
56
  email: m.fellinger@gmail.com
64
57
  executables: []
65
58
  extensions: []
66
59
  extra_rdoc_files: []
67
60
  files:
68
- - .gems
69
- - .gitignore
70
- - .load_gemset
71
- - .rvmrc
72
- - .travis.yml
61
+ - ".gems"
62
+ - ".gitignore"
63
+ - ".load_gemset"
64
+ - ".rvmrc"
65
+ - ".travis.yml"
73
66
  - AUTHORS
74
67
  - CHANGELOG
75
68
  - COPYING
@@ -204,26 +197,24 @@ files:
204
197
  - tasks/ycov.rake
205
198
  homepage: http://github.com/manveru/innate
206
199
  licenses: []
207
- post_install_message:
200
+ metadata: {}
201
+ post_install_message:
208
202
  rdoc_options: []
209
203
  require_paths:
210
204
  - lib
211
205
  required_ruby_version: !ruby/object:Gem::Requirement
212
- none: false
213
206
  requirements:
214
- - - ! '>='
207
+ - - ">="
215
208
  - !ruby/object:Gem::Version
216
209
  version: '0'
217
210
  required_rubygems_version: !ruby/object:Gem::Requirement
218
- none: false
219
211
  requirements:
220
- - - ! '>='
212
+ - - ">="
221
213
  - !ruby/object:Gem::Version
222
- version: 1.3.1
214
+ version: '0'
223
215
  requirements: []
224
- rubyforge_project: innate
225
- rubygems_version: 1.8.25
226
- signing_key:
227
- specification_version: 3
216
+ rubygems_version: 3.3.20
217
+ signing_key:
218
+ specification_version: 4
228
219
  summary: Powerful web-framework wrapper for Rack.
229
220
  test_files: []