geminabox 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of geminabox might be problematic. Click here for more details.

data/lib/geminabox.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'rubygems'
2
- require 'bundler/setup'
3
-
4
2
  require "digest/md5"
5
3
  require "builder"
6
4
  require 'sinatra/base'
@@ -114,7 +112,13 @@ HTML
114
112
  if force_rebuild
115
113
  indexer.generate_index
116
114
  else
117
- indexer.update_index
115
+ begin
116
+ indexer.update_index
117
+ rescue => e
118
+ puts "#{e.class}:#{e.message}"
119
+ puts e.backtrace.join("\n")
120
+ reindex(:force_rebuild)
121
+ end
118
122
  end
119
123
  end
120
124
 
@@ -137,7 +141,7 @@ HTML
137
141
  end
138
142
 
139
143
  def index_gems(gems)
140
- Set.new(gems.map{|gem| gem.name[0..0]})
144
+ Set.new(gems.map{|gem| gem.name[0..0].downcase})
141
145
  end
142
146
 
143
147
  helpers do
@@ -41,7 +41,7 @@ class Geminabox::GemVersionCollection
41
41
  grouped = @gems.inject(hash_of_collections) do |grouped, gem|
42
42
  grouped[gem.name] << gem
43
43
  grouped
44
- end
44
+ end.sort_by{|name, gems| name.downcase }
45
45
 
46
46
  if block_given?
47
47
  grouped.each(&Proc.new)
@@ -52,10 +52,12 @@ class Gem::Commands::InaboxCommand < Gem::Command
52
52
 
53
53
  def send_gem
54
54
  # sanitize printed URL if a password is present
55
- url = URI.parse(geminabox_host)
55
+ url = URI.join(geminabox_host, "upload")
56
+
56
57
  url_for_presentation = url.clone
57
58
  url_for_presentation.password = '***' if url_for_presentation.password
58
59
 
60
+
59
61
  @gemfiles.each do |gemfile|
60
62
  say "Pushing #{File.basename(gemfile)} to #{url_for_presentation}..."
61
63
 
@@ -63,7 +65,7 @@ class Gem::Commands::InaboxCommand < Gem::Command
63
65
  request_body, request_headers = Multipart::MultipartPost.new.prepare_query("file" => file)
64
66
 
65
67
  proxy.start(url.host, url.port) {|con|
66
- req = Net::HTTP::Post.new(url.path+'/upload', request_headers)
68
+ req = Net::HTTP::Post.new(url.path, request_headers)
67
69
  req.basic_auth(url.user, url.password) if url.user
68
70
  handle_response(con.request(req, request_body))
69
71
  }
data/views/index.erb CHANGED
@@ -6,7 +6,7 @@
6
6
  <ul class="gemlist">
7
7
 
8
8
  <% @gems.by_name do |name, versions| %>
9
- <li <%= %{id="jump_#{name[0..0]}"} if @index_gems.delete(name[0..0]) %> class="gem-version">
9
+ <li <%= %{id="jump_#{name[0..0].downcase}"} if @index_gems.delete(name[0..0].downcase) %> class="gem-version">
10
10
  <h2><%= name %> (<%= versions.count == 1 ? versions.first.number : "#{versions.oldest.number} - #{versions.newest.number}" %>)</h2>
11
11
  <% versions.each do |version| %>
12
12
  <p>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminabox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Lea
@@ -15,13 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-13 00:00:00 +00:00
18
+ date: 2012-01-20 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: sinatra
23
- prerelease: false
24
22
  type: :runtime
23
+ name: sinatra
25
24
  version_requirements: &id001 !ruby/object:Gem::Requirement
26
25
  none: false
27
26
  requirements:
@@ -31,11 +30,11 @@ dependencies:
31
30
  segments:
32
31
  - 0
33
32
  version: "0"
33
+ prerelease: false
34
34
  requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: builder
37
- prerelease: false
38
36
  type: :runtime
37
+ name: builder
39
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
@@ -45,11 +44,11 @@ dependencies:
45
44
  segments:
46
45
  - 0
47
46
  version: "0"
47
+ prerelease: false
48
48
  requirement: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- name: rake
51
- prerelease: false
52
50
  type: :development
51
+ name: rake
53
52
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
53
  none: false
55
54
  requirements:
@@ -59,6 +58,7 @@ dependencies:
59
58
  segments:
60
59
  - 0
61
60
  version: "0"
61
+ prerelease: false
62
62
  requirement: *id003
63
63
  description: A sinatra based gem hosting app, with client side gem push style functionality.
64
64
  email: contrib@tomlea.co.uk