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 +7 -0
- data/AUTHORS +5 -1
- data/CHANGELOG +44 -0
- data/Rakefile +2 -5
- data/innate.gemspec +22 -26
- data/lib/innate/adapter.rb +13 -12
- data/lib/innate/current.rb +1 -1
- data/lib/innate/helper/redirect.rb +1 -1
- data/lib/innate/request.rb +1 -1
- data/lib/innate/response.rb +1 -1
- data/lib/innate/route.rb +1 -1
- data/lib/innate/version.rb +1 -1
- data/lib/innate.rb +1 -1
- data/spec/innate/modes.rb +4 -5
- data/tasks/gem_setup.rake +33 -43
- data/tasks/setup.rake +2 -2
- metadata +26 -35
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
|
-
|
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 => '~>
|
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.
|
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 = "
|
5
|
+
s.name = "innate".freeze
|
6
|
+
s.version = "2023.01.06"
|
6
7
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
8
|
-
s.
|
9
|
-
s.
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
s.
|
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 =
|
20
|
+
s.specification_version = 4
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
33
|
-
s.add_dependency(%q<bacon
|
34
|
-
s.add_dependency(%q<rack-test
|
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
|
data/lib/innate/adapter.rb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
|
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
|
-
|
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
|
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 =
|
62
|
+
handler = Rackup::Handler.get('webrick')
|
62
63
|
config = {
|
63
|
-
:
|
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 =
|
74
|
+
handler = Rackup::Handler.get('thin')
|
74
75
|
::Thin::Logging.silent = true
|
75
76
|
handler.run(app, config)
|
76
77
|
end
|
data/lib/innate/current.rb
CHANGED
@@ -57,7 +57,7 @@ module Innate
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def raw_redirect(target, options = {}, &block)
|
60
|
-
header = response.
|
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
|
|
data/lib/innate/request.rb
CHANGED
@@ -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
|
138
|
+
raise ArgumentError, ex unless ex.message =~ /invalid address/
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
data/lib/innate/response.rb
CHANGED
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::
|
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
|
#
|
data/lib/innate/version.rb
CHANGED
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::
|
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 == {'
|
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 == {'
|
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 == {'
|
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 == {'
|
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
|
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
|
-
|
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
|
-
|
53
|
-
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
85
|
-
|
86
|
-
|
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
|
-
|
94
|
-
|
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
|
-
|
5
|
+
use_gem(name, options)
|
6
6
|
end
|
7
7
|
|
8
8
|
DEVELOPMENT_DEPENDENCIES.each do |name, options|
|
9
|
-
|
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:
|
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:
|
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:
|
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:
|
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.
|
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.
|
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
|
-
|
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:
|
214
|
+
version: '0'
|
223
215
|
requirements: []
|
224
|
-
|
225
|
-
|
226
|
-
|
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: []
|