gembox 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ == 0.2.0 2009-07-06
2
+
3
+ * Updated to latest version of Vegas for Windows compatability
4
+ * Links to RDoc should only display if Rdoc actually exists
5
+ * Format the Gem description with RDoc
6
+ * Reloads the gem list if the gem dir changes
7
+ * Minor formatting updates
8
+
1
9
  == 0.1.5 2009-05-22
2
10
 
3
11
  * Fixed the config.ru so gembox can run on passenger [Thanks Lenary]
@@ -0,0 +1,37 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ bin/gembox
7
+ config.ru
8
+ gembox.gemspec
9
+ lib/gembox.rb
10
+ lib/gembox/app.rb
11
+ lib/gembox/extensions.rb
12
+ lib/gembox/gem_list.rb
13
+ lib/gembox/gems.rb
14
+ lib/gembox/view_helpers.rb
15
+ public/images/edit.png
16
+ public/images/folder.png
17
+ public/images/git.gif
18
+ public/images/page.png
19
+ public/images/page_white_text.png
20
+ public/images/rubygems-125x125t.png
21
+ public/javascripts/base.js
22
+ public/javascripts/gembox.js
23
+ public/javascripts/jquery.form.js
24
+ public/javascripts/jquery.js
25
+ public/javascripts/jquery.metadata.js
26
+ public/javascripts/jquery.ui.js
27
+ public/swf/clippy.swf
28
+ views/doc.haml
29
+ views/file_tree.haml
30
+ views/gem.haml
31
+ views/gembox.sass
32
+ views/gems_columns.haml
33
+ views/gems_header.haml
34
+ views/gems_table.haml
35
+ views/index.haml
36
+ views/layout.haml
37
+ views/no_results.haml
data/Rakefile CHANGED
@@ -13,8 +13,9 @@ $hoe = Hoe.new('gembox', Gembox::VERSION) do |p|
13
13
  p.url = ['http://code.quirkey.com/gembox', 'http://github.com/quirkey/gembox']
14
14
  p.extra_deps = [
15
15
  ['sinatra', '>=0.9.2'],
16
- ['vegas', '>=0.0.1'],
16
+ ['vegas', '>=0.0.3.1'],
17
17
  ['haml', '>=2.0.9'],
18
+ ['rdoc', '=2.4.3'],
18
19
  ['activesupport', '>=2.2.2'],
19
20
  ['mislav-will_paginate', '>=2.3.7']
20
21
  ]
@@ -0,0 +1,61 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{gembox}
5
+ s.version = "0.2.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Aaron Quint"]
9
+ s.date = %q{2009-07-06}
10
+ s.default_executable = %q{gembox}
11
+ s.description = %q{A sinatra based interface for browsing and admiring your gems.}
12
+ s.email = ["aaron@quirkey.com"]
13
+ s.executables = ["gembox"]
14
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
15
+ s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "bin/gembox", "config.ru", "gembox.gemspec", "lib/gembox.rb", "lib/gembox/app.rb", "lib/gembox/extensions.rb", "lib/gembox/gem_list.rb", "lib/gembox/gems.rb", "lib/gembox/view_helpers.rb", "public/images/edit.png", "public/images/folder.png", "public/images/git.gif", "public/images/page.png", "public/images/page_white_text.png", "public/images/rubygems-125x125t.png", "public/javascripts/base.js", "public/javascripts/gembox.js", "public/javascripts/jquery.form.js", "public/javascripts/jquery.js", "public/javascripts/jquery.metadata.js", "public/javascripts/jquery.ui.js", "public/swf/clippy.swf", "views/doc.haml", "views/file_tree.haml", "views/gem.haml", "views/gembox.sass", "views/gems_columns.haml", "views/gems_header.haml", "views/gems_table.haml", "views/index.haml", "views/layout.haml", "views/no_results.haml", "test/test_gembox_app.rb", "test/test_gembox_gems.rb", "test/test_helper.rb"]
16
+ s.homepage = %q{http://code.quirkey.com/gembox}
17
+ s.post_install_message = %q{PostInstall.txt}
18
+ s.rdoc_options = ["--main", "README.rdoc"]
19
+ s.require_paths = ["lib"]
20
+ s.rubyforge_project = %q{quirkey}
21
+ s.rubygems_version = %q{1.3.3}
22
+ s.summary = %q{A sinatra based interface for browsing and admiring your gems.}
23
+ s.test_files = ["test/test_gembox_app.rb", "test/test_gembox_gems.rb", "test/test_helper.rb"]
24
+
25
+ if s.respond_to? :specification_version then
26
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
+ s.specification_version = 3
28
+
29
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
+ s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
31
+ s.add_runtime_dependency(%q<vegas>, [">= 0.0.3.1"])
32
+ s.add_runtime_dependency(%q<haml>, [">= 2.0.9"])
33
+ s.add_runtime_dependency(%q<rdoc>, ["= 2.4.3"])
34
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.2.2"])
35
+ s.add_runtime_dependency(%q<mislav-will_paginate>, [">= 2.3.7"])
36
+ s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
37
+ s.add_development_dependency(%q<rack-test>, [">= 0.1.0"])
38
+ s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
39
+ else
40
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
41
+ s.add_dependency(%q<vegas>, [">= 0.0.3.1"])
42
+ s.add_dependency(%q<haml>, [">= 2.0.9"])
43
+ s.add_dependency(%q<rdoc>, ["= 2.4.3"])
44
+ s.add_dependency(%q<activesupport>, [">= 2.2.2"])
45
+ s.add_dependency(%q<mislav-will_paginate>, [">= 2.3.7"])
46
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
47
+ s.add_dependency(%q<rack-test>, [">= 0.1.0"])
48
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
49
+ end
50
+ else
51
+ s.add_dependency(%q<sinatra>, [">= 0.9.2"])
52
+ s.add_dependency(%q<vegas>, [">= 0.0.3.1"])
53
+ s.add_dependency(%q<haml>, [">= 2.0.9"])
54
+ s.add_dependency(%q<rdoc>, ["= 2.4.3"])
55
+ s.add_dependency(%q<activesupport>, [">= 2.2.2"])
56
+ s.add_dependency(%q<mislav-will_paginate>, [">= 2.3.7"])
57
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
58
+ s.add_dependency(%q<rack-test>, [">= 0.1.0"])
59
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
60
+ end
61
+ end
@@ -5,14 +5,15 @@ require 'rubygems'
5
5
  require 'haml'
6
6
  require 'sass'
7
7
  require 'active_support'
8
+ require 'rdoc/markup/to_html'
8
9
  require 'will_paginate/array'
9
10
  require 'will_paginate/view_helpers'
10
11
 
11
12
  module Gembox
12
- VERSION = '0.1.5'
13
+ VERSION = '0.2.0'
13
14
  end
14
15
 
15
- require 'extensions'
16
+ require 'gembox/extensions'
16
17
  require 'gembox/gem_list'
17
18
  require 'gembox/gems'
18
19
  require 'gembox/view_helpers'
@@ -15,6 +15,7 @@ module Gembox
15
15
  @gems = Gembox::Gems.local_gems.paginate :page => params[:page], :per_page => 30
16
16
  @stats = Gembox::Gems.stats
17
17
  @search ||= ''
18
+ @environment = options.environment
18
19
  end
19
20
 
20
21
  get '/stylesheets/:stylesheet.css' do
@@ -26,16 +27,14 @@ module Gembox
26
27
  end
27
28
 
28
29
  get %r{/gems/doc/([\w\-\_]+)/?([\d\.]+)?/?(.*)?} do
30
+ load_gem_by_version
31
+ @rdoc_path = @gem.rdoc_path
29
32
  if params[:captures].length == 3 && !params[:captures][2].blank?
30
33
  # we have a path
31
- load_gem_by_version
32
- @rdoc_path = File.join(@gem.installation_path, "doc", @gem.full_name, 'rdoc')
33
34
  full_path = File.join(@rdoc_path, params[:captures].pop)
34
35
  content_type File.extname(full_path)
35
36
  File.read(full_path)
36
37
  else
37
- load_gem_by_version
38
- @rdoc_path = File.join(@gem.installation_path, "doc", @gem.full_name, 'rdoc')
39
38
  haml :doc, :layout => false
40
39
  end
41
40
  end
@@ -17,5 +17,14 @@ module Gem
17
17
  def on_github?
18
18
  homepage =~ /github\.com\/([\w\d\-\_]+)\/([\w\d\-\_]+)\/tree/
19
19
  end
20
+
21
+ alias :has_rdoc_checked? :has_rdoc?
22
+ def has_rdoc?
23
+ has_rdoc_checked? && File.exists?(rdoc_path)
24
+ end
25
+
26
+ def rdoc_path
27
+ File.join(installation_path, 'doc', full_name, 'rdoc')
28
+ end
20
29
  end
21
30
  end
@@ -4,12 +4,17 @@ module Gembox
4
4
  attr_accessor :source_index
5
5
 
6
6
  def load
7
- @source_index ||= ::Gem.source_index
7
+ if !@source_index || reload?
8
+ @source_index = ::Gem.source_index
9
+ end
8
10
  local_gems
9
11
  end
10
12
 
11
13
  def local_gems
12
- @local_gems ||= group_gems(source_index.gems)
14
+ if !@local_gems || reload?
15
+ @local_gems = group_gems(source_index.gems)
16
+ end
17
+ @local_gems
13
18
  end
14
19
 
15
20
  def search(search_term, version = nil, strict = false)
@@ -23,8 +28,8 @@ module Gembox
23
28
  def stats
24
29
  num_versions = source_index.length
25
30
  num_gems = local_gems.length
26
- oldest_gem = source_index.min {|a,b| a[1].date <=> b[1].date }.last
27
- {:num_versions => num_versions, :num_gems => num_gems, :oldest_gem => oldest_gem}
31
+ newest_gem = source_index.max {|a,b| a[1].date <=> b[1].date }.last
32
+ {:num_versions => num_versions, :num_gems => num_gems, :newest_gem => newest_gem}
28
33
  end
29
34
 
30
35
  protected
@@ -38,7 +43,17 @@ module Gembox
38
43
  end
39
44
  gem_hash.sort {|a, b| a[0].downcase <=> b[0].downcase }
40
45
  end
46
+
47
+ def reload?
48
+ @now_mtime = File.mtime(File.join(::Gem.dir, 'gems'))
49
+ if @old_mtime != @now_mtime
50
+ @old_mtime = @now_mtime
51
+ true
52
+ else
53
+ false
54
+ end
55
+ end
41
56
  end
42
57
 
43
58
  end
44
- end
59
+ end
@@ -38,6 +38,11 @@ module Gembox
38
38
  time.strftime('%b %d, %Y') if time
39
39
  end
40
40
 
41
+ def rdocify(text)
42
+ @_rdoc ||= RDoc::Markup::ToHtml.new
43
+ @_rdoc.convert(text)
44
+ end
45
+
41
46
  def clippy(text, bgcolor='#FFFFFF')
42
47
  html = <<-EOF
43
48
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
@@ -2,9 +2,9 @@
2
2
  %h2
3
3
  =@gem.name
4
4
  %span.version=@gem.version
5
-
6
- .description
7
- %p=@gem.description
5
+ - if @gem.description
6
+ .description
7
+ =rdocify @gem.description
8
8
  .meta
9
9
  %p.authors
10
10
  By
@@ -25,10 +25,10 @@
25
25
  versions of
26
26
  =@stats[:num_gems]
27
27
  gems.
28
- Your oldest gem is
29
- =link_to_gem(@stats[:oldest_gem])
28
+ Your newest gem is
29
+ =link_to_gem(@stats[:newest_gem])
30
30
  from
31
- =ts(@stats[:oldest_gem].date)
31
+ =ts(@stats[:newest_gem].date)
32
32
 
33
33
  #main.contained
34
34
  =yield
@@ -37,7 +37,10 @@
37
37
  Gembox, developed by
38
38
  =link_to 'Quirkey.', 'http://code.quirkey.com'
39
39
  Powered by
40
- =link_to 'Sinatra.', 'http://sinatrrb.com'
40
+ =link_to 'Sinatra.', 'http://sinatrarb.com'
41
+ Running in
42
+ = @environment
43
+ mode.
41
44
  %p.copyright
42
45
  Hey! I'm
43
46
  =link_to 'open-source!', 'http://github.com/quirkey/gembox'
@@ -45,4 +48,4 @@
45
48
  :erb
46
49
  <script type="text/javascript" charset="utf-8">
47
50
  jQuery('body').data('sinatra-env', '<%= options.environment %>');
48
- </script>
51
+ </script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gembox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Quint
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-22 00:00:00 -04:00
12
+ date: 2009-07-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.1
33
+ version: 0.0.3.1
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: haml
@@ -42,6 +42,16 @@ dependencies:
42
42
  - !ruby/object:Gem::Version
43
43
  version: 2.0.9
44
44
  version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: rdoc
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "="
52
+ - !ruby/object:Gem::Version
53
+ version: 2.4.3
54
+ version:
45
55
  - !ruby/object:Gem::Dependency
46
56
  name: activesupport
47
57
  type: :runtime
@@ -101,18 +111,21 @@ extensions: []
101
111
 
102
112
  extra_rdoc_files:
103
113
  - History.txt
114
+ - Manifest.txt
104
115
  - PostInstall.txt
105
116
  - README.rdoc
106
117
  files:
107
118
  - History.txt
119
+ - Manifest.txt
108
120
  - PostInstall.txt
109
121
  - README.rdoc
110
122
  - Rakefile
111
- - config.ru
112
123
  - bin/gembox
113
- - lib/extensions.rb
124
+ - config.ru
125
+ - gembox.gemspec
114
126
  - lib/gembox.rb
115
127
  - lib/gembox/app.rb
128
+ - lib/gembox/extensions.rb
116
129
  - lib/gembox/gem_list.rb
117
130
  - lib/gembox/gems.rb
118
131
  - lib/gembox/view_helpers.rb
@@ -129,10 +142,6 @@ files:
129
142
  - public/javascripts/jquery.metadata.js
130
143
  - public/javascripts/jquery.ui.js
131
144
  - public/swf/clippy.swf
132
- - test/.bacon
133
- - test/test_gembox_app.rb
134
- - test/test_gembox_gems.rb
135
- - test/test_helper.rb
136
145
  - views/doc.haml
137
146
  - views/file_tree.haml
138
147
  - views/gem.haml
File without changes