Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Big whitespace fix

  • Loading branch information...
commit 177700d9a7f1f530a9956c639a63f36051135348 1 parent 06417ca
@lsegal authored
View
2  README.md
@@ -3,7 +3,7 @@ RubyDoc.info: YARD Doc Server
RubyDoc.info is the next generation Ruby doc server, replacing
[http://rdoc.info](http://rdoc.info) and
-[http://yardoc.org/docs](http://yardoc.org/docs).
+[http://yardoc.org/docs](http://yardoc.org/docs).
This doc server uses YARD to generate project documentation on the fly, for
both published RubyGems as well as GitHub projects.
View
6 Rakefile
@@ -7,12 +7,12 @@ namespace :server do
task :start do
sh "unicorn -E production -D -c unicorn.conf.rb"
end
-
+
desc 'Restart the server'
task :restart do
sh "kill -USR2 `cat tmp/pids/unicorn.pid`"
end
-
+
desc 'Shut down the server'
task :stop do
sh "kill -QUIT `cat tmp/pids/unicorn.pid`"
@@ -52,7 +52,7 @@ namespace :cache do
end
namespace :stdlib do
- desc 'Installs a standard library SOURCE=pathtolib VERSION=targetversion'
+ desc 'Installs a standard library SOURCE=pathtolib VERSION=targetversion'
task :install do
require 'stdlib_installer'
StdlibInstaller.new(ENV['SOURCE'], ENV['VERSION']).install
View
64 app.rb
@@ -31,7 +31,7 @@ def self.adapter_options
:server_options => {DocumentRoot: STATIC_PATH}
}
end
-
+
def self.load_configuration
set :name, 'RubyDoc.info'
set :url, 'http://rubydoc.info'
@@ -47,7 +47,7 @@ def self.load_configuration
$GOOGLE_ANALYTICS = value if key == 'google_analytics' # Hack for GA settings
end
end
-
+
def self.copy_static_files
# Copy template files
puts ">> Copying static system files..."
@@ -79,14 +79,14 @@ def self.load_gems_adapter
rescue Errno::ENOENT
log.error "No remote_gems file to load remote gems from, not serving gems."
end
-
+
def self.load_scm_adapter
opts = adapter_options
opts[:options][:router] = ScmRouter
opts[:libraries] = ScmLibraryStore.new
set :scm_adapter, RackAdapter.new(*opts.values)
end
-
+
def self.find_featured_yardoc(name, libdir)
[File.join(FEATURED_PATH, libdir, '.yardoc'), File.join(libdir, '.yardoc')].each do |path|
return path if File.directory?(path)
@@ -94,7 +94,7 @@ def self.find_featured_yardoc(name, libdir)
log.error "Invalid featured repository #{libdir} for #{name}"
exit
end
-
+
def self.load_featured_adapter
raise(Errno::ENOENT) unless the_options.has_key?(:featured)
opts = adapter_options
@@ -116,7 +116,7 @@ def self.load_featured_adapter
set :featured_adapter, nil
end
-
+
def self.load_stdlib_adapter
unless File.directory?(STDLIB_PATH)
log.error "No stdlib repository, not serving standard library"
@@ -140,7 +140,7 @@ def self.load_stdlib_adapter
end
set :stdlib_adapter, RackAdapter.new(*opts.values)
end
-
+
def self.post_all(*args, &block)
args.each {|arg| post(arg, &block) }
end
@@ -171,7 +171,7 @@ class << self; attr_accessor :the_options end
STDOUT.reopen(file)
STDERR.reopen(file)
end
-
+
configure do
load_configuration
load_gems_adapter
@@ -180,10 +180,10 @@ class << self; attr_accessor :the_options end
load_stdlib_adapter
copy_static_files
end
-
+
helpers do
include YARD::Templates::Helpers::HtmlHelper
-
+
def recent_store
@@recent_store ||= RecentStore.new(20)
end
@@ -204,7 +204,7 @@ def notify_error
end
erb(:error)
end
-
+
def cache(output)
return output if settings.caching != true
path = request.path.gsub(%r{^/|/$}, '')
@@ -214,11 +214,11 @@ def cache(output)
File.open(path, "w") {|f| f.write(output) }
output
end
-
+
def next_row(prefix = 'r', base = 1)
prefix + (@row = @row == base ? base + 1 : base).to_s
end
-
+
def translate_file_links(extra)
extra.sub(%r{^/(frames/)?file:}, '/\1file/')
end
@@ -227,9 +227,9 @@ def shorten_commit_link(commit)
commit.slice(0..5)
end
end
-
+
# Checkout and post commit hooks
-
+
post_all '/checkout', '/projects/update' do
begin
if params[:payload]
@@ -257,10 +257,10 @@ def shorten_commit_link(commit)
if libs = settings.scm_adapter.libraries[git.name]
if lib = libs.find {|l| l.version == git.commit }
return "NO" unless File.exist?(File.join(lib.source_path, '.yardoc', 'complete'))
- return "YES"
+ return "YES"
end
end
-
+
if File.exist?(git.error_file)
puts "#{git.error_file} found"
"ERROR"
@@ -269,9 +269,9 @@ def shorten_commit_link(commit)
"NO"
end
end
-
+
# Main URL handlers
-
+
get %r{^/github(?:/([a-z])?)?$} do |letter|
if letter.nil?
@adapter = settings.scm_adapter
@@ -285,14 +285,14 @@ def shorten_commit_link(commit)
cache erb(:scm_index)
end
end
-
+
get %r{^/gems(?:/([a-z])?)?$} do |letter|
@letter = letter || 'a'
@adapter = settings.gems_adapter
@libraries = @adapter.libraries.find_all {|k, v| k[0].downcase == @letter }
cache erb(:gems_index)
end
-
+
get %r{^/(?:(?:search|list)/)?github/([^/]+)/([^/]+)} do |username, project|
@username, @project = username, project
result = settings.scm_adapter.call(env)
@@ -307,9 +307,9 @@ def shorten_commit_link(commit)
return status(404) && erb(:gems_404) if result.first == 404
result
end
-
+
# Stdlib
-
+
get %r{^/(?:(?:search|list)/)?stdlib/([^/]+)} do |libname|
@libname = libname
pass unless settings.stdlib_adapter.libraries[libname]
@@ -317,14 +317,14 @@ def shorten_commit_link(commit)
return status(404) && erb(:stdlib_404) if result.first == 404
result
end
-
+
get %r{^/stdlib/?$} do
@stdlib = settings.stdlib_adapter.libraries
cache erb(:stdlib_index)
end
# Featured libraries
-
+
get %r{^/(?:(?:search|list)/)?docs/([^/]+)} do |libname|
@libname = libname
pass unless settings.featured_adapter.libraries[libname]
@@ -332,7 +332,7 @@ def shorten_commit_link(commit)
return status(404) && erb(:featured_404) if result.first == 404
result
end
-
+
get %r{^/(featured|docs/?$)} do
@featured = settings.featured_adapter.libraries
cache erb(:featured_index)
@@ -360,14 +360,14 @@ def shorten_commit_link(commit)
get(%r{^/docs/ruby-core/?(.*)}) do |all|
redirect("/stdlib/core/#{all}", 301)
end
-
+
# Redirect /docs/ruby-stdlib
get(%r{^/docs/ruby-stdlib/?(.*)}) do |all|
redirect("/stdlib")
end
# Old URL structure redirection for yardoc.org
-
+
get(%r{^/docs/([^/]+)-([^/]+)(/?.*)}) do |user, proj, extra|
redirect("/github/#{user}/#{proj}#{translate_file_links extra}", 301)
end
@@ -375,9 +375,9 @@ def shorten_commit_link(commit)
get(%r{^/docs/([^/]+)(/?.*)}) do |lib, extra|
redirect("/gems/#{lib}#{translate_file_links extra}", 301)
end
-
+
get('/docs/?') { redirect('/github', 301) }
-
+
# Old URL structure redirection for rdoc.info
get(%r{^/(?:projects|rdoc)/([^/]+)/([^/]+)(/?.*)}) do |user, proj, extra|
@@ -385,14 +385,14 @@ def shorten_commit_link(commit)
end
# Root URL redirection
-
+
get '/' do
@adapter = settings.scm_adapter
@libraries = recent_store
@featured = settings.featured_adapter.libraries if settings.featured_adapter
cache erb(:home)
end
-
+
error do
@page_title = "Unknown Error!"
@error = "Something quite unexpected just happened.
View
4 config/config.yaml.sample
@@ -28,8 +28,8 @@
# sponsor: linode.com
# To add a "Featured" section to the site with a set of statically generated
-# YARD documentation directories, add your own projects below followed by the
-# path to the library root relative to repos/featured. You can also use an
+# YARD documentation directories, add your own projects below followed by the
+# path to the library root relative to repos/featured. You can also use an
# absolute path.
#
# featured:
View
2  init.rb
@@ -13,7 +13,7 @@
YARD::Server::Adapter.setup
YARD::Templates::Engine.template_paths.push(File.dirname(__FILE__) + '/templates')
-def __p(*extra)
+def __p(*extra)
file = extra.last == :file
extra.pop if file
path = File.join(File.dirname(__FILE__), *extra)
View
32 lib/extensions.rb
@@ -9,36 +9,36 @@ def initialize(command = nil)
@asset_path = File.join('assets', command.library.to_s)
super(:basepath => command.adapter.document_root, :extension => '')
end
-
+
def serialized_path(object)
if String === object
- File.join(@asset_path, object)
+ File.join(@asset_path, object)
else
super(object)
end
end
end
-
+
class Commands::LibraryCommand
def initialize(opts = {})
super
self.serializer = DocServerSerializer.new(self)
end
end
-
+
class LibraryVersion
attr_accessor :platform
-
+
protected
-
+
def load_yardoc_from_disk_on_demand
yfile = File.join(source_path, '.yardoc')
if File.directory?(yfile)
if File.exist?(File.join(yfile, 'complete'))
- self.yardoc_file = yfile
+ self.yardoc_file = yfile
return
else
- raise LibraryNotPreparedError
+ raise LibraryNotPreparedError
end
end
@@ -54,10 +54,10 @@ def load_yardoc_from_remote_gem
yfile = File.join(source_path, '.yardoc')
if File.directory?(yfile)
if File.exist?(File.join(yfile, 'complete'))
- self.yardoc_file = yfile
+ self.yardoc_file = yfile
return
else
- raise LibraryNotPreparedError
+ raise LibraryNotPreparedError
end
end
@@ -67,7 +67,7 @@ def load_yardoc_from_remote_gem
log.debug "Searching for remote gem file #{url}"
Thread.new do
begin
- open(url) do |io|
+ open(url) do |io|
expand_gem(io)
generate_yardoc
clean_source
@@ -84,13 +84,13 @@ def load_yardoc_from_remote_gem
def source_path_for_remote_gem
File.join(::REMOTE_GEMS_PATH, name[0].downcase, name, version)
end
-
+
def source_path_for_disk_on_demand
File.join(::STDLIB_PATH, version, name)
end
-
+
alias load_yardoc_from_github load_yardoc_from_disk
-
+
def source_path_for_github
File.join(::REPOS_PATH, name.split('/', 2).reverse.join('/'), version)
end
@@ -112,13 +112,13 @@ def expand_gem(io)
end
end
end
-
+
def clean_source
SourceCleaner.new(source_path).clean
end
end
end
-
+
module CLI
class Yardoc
def yardopts
View
6 lib/recent_store.rb
@@ -25,9 +25,9 @@ def push(library_versions)
library_name = library_versions.first.name
unless LibraryStore.select(:name).where(:name => library_name).first
LibraryStore.create(
- :name => library_name,
- :versions => library_versions,
- :source => 'github',
+ :name => library_name,
+ :versions => library_versions,
+ :source => 'github',
:created_at => Time.now)
end
end
View
56 lib/scm_checkout.rb
@@ -7,81 +7,81 @@ class InvalidSchemeError < RuntimeError; end
class ScmCheckout
attr_accessor :name, :url, :settings, :app, :commit
-
+
def initialize(app, url, commit = nil)
self.settings = app.settings
self.app = app
self.url = url
self.commit = commit
end
-
+
def name=(name)
@name = name.gsub(/[^a-z0-9\-\/]/i, '_')
end
-
+
def register_project
puts "#{Time.now}: Registering project #{name}"
ready_project
app.recent_store.push(settings.scm_adapter.libraries[name])
puts "#{Time.now}: Adding #{name} to recent projects list"
end
-
+
def remove_project
end
-
+
def ready_project
cmd = "touch #{repository_path}/.yardoc/complete"
sh(cmd, "Readying project #{name}", false)
unlink_error_file
end
-
+
def unready_project
cmd = "rm #{repository_path}/.yardoc/complete"
sh(cmd, "Unreadying project #{name}", false)
end
-
+
def repository_path
File.join(settings.repos, name, commit)
end
-
+
def flush_cache
- files = ["github.html", "github/#{project[0,1]}.html",
- "github/#{name}.html", "github/#{name}", "list/github/#{name}",
+ files = ["github.html", "github/#{project[0,1]}.html",
+ "github/#{name}.html", "github/#{name}", "list/github/#{name}",
"index.html", ".html"]
rm_cmd = "rm -rf #{files.map {|f| File.join(settings.public_folder, f) }.join(' ')}"
sh(rm_cmd, "Flushing cache for #{name}", false)
end
-
+
def checkout
unlink_error_file
unready_project
success = sh(checkout_command, "Checking out #{name}") == 0
if success
clear_source_files
- register_project
+ register_project
else
remove_project
end
success
end
-
+
def checkout_command
raise NotImplementedError
end
-
+
def error_file
- @error_file ||=
+ @error_file ||=
"#{settings.tmp}/#{[name.gsub('/', '_'), commit || 'master'].join('_')}.error.txt"
end
-
+
def write_error_file(out)
File.open(error_file, "a") {|f| f.write(out + "\n") }
end
-
+
def unlink_error_file
File.unlink(error_file) if File.file?(error_file)
end
-
+
def sh(command, title = "", write_error = true)
puts(log = "#{Time.now}: #{title}: #{command}")
if write_error
@@ -100,14 +100,14 @@ def sh(command, title = "", write_error = true)
end
result
end
-
+
def clear_source_files
end
end
class GithubCheckout < ScmCheckout
attr_accessor :username, :project
-
+
def initialize(app, url, commit = nil)
super
case url
@@ -120,18 +120,18 @@ def initialize(app, url, commit = nil)
end
self.name = "#{username}/#{project}"
end
-
+
def commit=(value)
value = nil if value == ''
@commit = value || 'master'
@commit = @commit[0,6] if @commit.length == 40
@commit
end
-
+
def repository_path
File.join(settings.repos, project, username, commit)
end
-
+
def remove_project
cmd = "rm -rf #{settings.repos}/#{project}/#{username} #{settings.repos}/#{project}"
sh(cmd, "Removing #{name}", false)
@@ -140,11 +140,11 @@ def remove_project
def checkout_command
"#{git_checkout_command} && #{YARD::ROOT}/../bin/yardoc -n -q --safe"
end
-
+
def clear_source_files
SourceCleaner.new(repository_path).clean
end
-
+
def fork?
return @is_fork unless @is_fork.nil?
if !File.directory?(File.join(settings.repos, name))
@@ -159,7 +159,7 @@ def fork?
@is_fork = false
ensure
end
-
+
private
def git_checkout_command
@@ -172,8 +172,8 @@ def git_checkout_command
else
nil
end
- ["mkdir -p #{settings.repos}/#{project}/#{username}",
- "cd #{settings.repos}/#{project}/#{username}",
+ ["mkdir -p #{settings.repos}/#{project}/#{username}",
+ "cd #{settings.repos}/#{project}/#{username}",
"git clone #{url} #{commit}", "cd #{commit}",
checkout, fork_cmd].compact.join(" && ")
end
View
24 lib/scm_router.rb
@@ -2,7 +2,7 @@ class ScmRouter < YARD::Server::Router
def docs_prefix; 'github' end
def list_prefix; 'list/github' end
def search_prefix; 'search/github' end
-
+
def parse_library_from_path(paths)
library, paths = nil, paths.dup
github_proj = paths[0, 2].join('/')
@@ -22,7 +22,7 @@ def parse_library_from_path(paths)
class ScmLibraryStore
include Enumerable
-
+
def [](name)
path = File.join(REPOS_PATH, project_dirname(name))
return unless File.directory?(path)
@@ -36,15 +36,15 @@ def [](name)
end
end.compact
end
-
+
def []=(name, value)
# read-only db
end
-
+
def has_key?(key)
self[key] ? true : false
end
-
+
def keys
dirs = []
Dir.entries(REPOS_PATH).each do |project|
@@ -56,15 +56,15 @@ def keys
end
dirs
end
-
+
def values
keys.map {|key| self[key] }
end
-
+
def each(&block)
keys.zip(values).each(&block)
end
-
+
def master_fork(name)
project = name.split('/', 2).last
File.read(File.join(REPOS_PATH, project, '.master_fork')).strip
@@ -89,17 +89,17 @@ def sorted_by_project(filter = '')
end
projects.sort_by {|name, users| name.downcase }
end
-
+
def sorted_versions(name)
self[name].sort_by {|lib| [lib.version == "master" ? 0 : 1, File.ctime(lib.source_path)] }
end
-
+
private
-
+
def project_dirname(name)
name.split('/', 2).reverse.join('/')
end
-
+
def dir_valid?(*dir)
File.directory?(File.join(REPOS_PATH, *dir)) && dir.last !~ /^\.\.?$/
end
View
2  lib/source_cleaner.rb
@@ -47,7 +47,7 @@ def add_extra_files(*files)
exclude += link_exclude
# delete all source files minus excluded ones
- files = Dir.glob(basepath + '/**/**') +
+ files = Dir.glob(basepath + '/**/**') +
Dir.glob(basepath + '/.*')
files = files.map {|f| remove_basepath(f) }
files -= ['.', '..']
View
20 lib/stdlib_installer.rb
@@ -2,14 +2,14 @@
class StdlibInstaller
PREFIX = File.join(File.dirname(__FILE__), '..', 'repos', 'stdlib')
-
+
attr_accessor :path, :version
-
+
def initialize(path, version)
self.path = File.expand_path(path)
self.version = version
end
-
+
def install
FileUtils.mkdir_p(File.join(PREFIX, version))
install_exts
@@ -18,7 +18,7 @@ def install
end
private
-
+
def install_core
puts "Installing core libraries"
FileUtils.mkdir_p(repo_path('core'))
@@ -30,7 +30,7 @@ def install_core
file.puts '*.c *.y - README.EXT LEGAL'
end
end
-
+
def install_exts
exts = Dir[File.join(path, 'ext', '*')].select {|t| File.directory?(t) }
exts = exts.reject {|t| t =~ /-test-/ }
@@ -45,7 +45,7 @@ def install_exts
write_yardopts(ext)
end
end
-
+
def install_libs
libs = Dir[File.join(path, 'lib', '*')]
installed = {}
@@ -70,15 +70,15 @@ def install_libs
installed[lib] = true
end
end
-
+
def clean_glob(directory)
directory.sub(/^#{path}\/(ext|lib)\//, '').sub(/\.rb$/, '')
end
-
+
def mkdir_repo(name)
FileUtils.mkdir_p(repo_path(name))
end
-
+
def repo_path(name)
File.join(PREFIX, version, clean_glob(name))
end
@@ -88,7 +88,7 @@ def write_yardopts(name)
file.puts '**/*.rb **/*.c'
end
end
-
+
def extract_readme(name)
puts "Extracting README from #{clean_glob(name)}"
readme_contents = ""
View
14 public/css/projects.css
@@ -28,19 +28,19 @@ a { outline: none; }
#top_nav { padding: 0; list-style: none; position: absolute; right: 140px; top: 3px; z-index: 9999; }
#top_nav li { float: left; margin-right: 10px; }
-#top_nav a { display: block; padding: 5px 8px; background: #58a; text-decoration: none;
+#top_nav a { display: block; padding: 5px 8px; background: #58a; text-decoration: none;
color: #eee;
opacity: 0.7;
- -webkit-border-radius: 5px; -moz-border-radius: 5px;
+ -webkit-border-radius: 5px; -moz-border-radius: 5px;
-webkit-transition: all 0.1s ease-in;
}
#top_nav a:hover { opacity: 1; color: #fff; }
-#info {
+#info {
font-size: 1.1em;
line-height: 1.4em;
- display: none; position: absolute; width: 350px; padding: 10px 20px; top: 55px;
- right: 120px; background: #fff; z-index: 10000; border: 1px solid #aaa;
+ display: none; position: absolute; width: 350px; padding: 10px 20px; top: 55px;
+ right: 120px; background: #fff; z-index: 10000; border: 1px solid #aaa;
-webkit-box-shadow: 0px 2px 15px #aaa; -moz-box-shadow: 0px 2px 15px #aaa;
}
#info a { color: #05a; }
@@ -64,7 +64,7 @@ a { outline: none; }
#checkout.error:after { content: "Invalid git repository or URL"; color: #e00; display: block; }
#checkout.loading .loadicon { display: block; }
#checkout .url { width: 225px; margin-bottom: 3px; }
-#checkout {
+#checkout {
display: none;
position: absolute;
top: 42px;
@@ -134,7 +134,7 @@ a { outline: none; }
#footer .sponsor a { border: 0; }
#content.fof h1 { margin-bottom: 0; font-size: 3em; }
-#content.fof h2.nomargin { margin-top: 0; border: 0; font-size: 1.2em; color: #888; margin-bottom: 20px; }
+#content.fof h2.nomargin { margin-top: 0; border: 0; font-size: 1.2em; color: #888; margin-bottom: 20px; }
#content.fof.scm #checkout { display: block; position: relative; top: 0; right: 0; margin: 40px 0; }
.libraries .icon { width: 16px; height: 16px; position: relative; float: right; top: 6px; border: 1px solid #ccc; background: #eee; padding: 2px; -webkit-border-radius: 3px; -moz-border-radius: 3px; margin-left: 3px; }
View
8 public/js/project_checkout.js
@@ -1,6 +1,6 @@
function pollCheckout(project) {
- $.ajax({
- url: '/checkout/' + project,
+ $.ajax({
+ url: '/checkout/' + project,
success: function(data) {
if (data == "YES") {
window.location = '/github/' + project + '/frames';
@@ -13,14 +13,14 @@ function pollCheckout(project) {
} else {
setTimeout("pollCheckout('" + project + "');", 2000);
}
- },
+ },
error: function(data) {
$('#checkout').removeClass('loading');
$('#checkout').addClass('error');
$('#submit')[0].disabled = false;
return;
},
- dataType: 'text'
+ dataType: 'text'
});
}
View
2  scripts/clean_repos.rb
@@ -4,7 +4,7 @@
require 'source_cleaner'
[File.join(REPOS_PATH, '*', '*', '*'), File.join(REMOTE_GEMS_PATH, '*', '**')].each do |dir|
- Dir[dir].each do |d|
+ Dir[dir].each do |d|
puts ">> Deleting source files for #{d}"
SourceCleaner.new(d).clean
end
View
2  scripts/migrate_to_single_object_db.rb
@@ -4,7 +4,7 @@
include YARD
[File.join(REPOS_PATH, '*', '*', '*'), File.join(REMOTE_GEMS_PATH, '*', '*', '*')].each do |dir|
- Dir[dir].each do |d|
+ Dir[dir].each do |d|
puts ">> Migrating .yardoc to single db for #{d}"
Dir.chdir(d)
Registry.load!
View
4 scripts/update_remote_gems.rb
@@ -8,7 +8,7 @@ class GemVersion
def initialize(name, version, platform)
@name, @version, @platform = name.to_s, version.to_s, platform.to_s
end
-
+
def to_s
platform == "ruby" ? version : [version,platform].join(',')
end
@@ -54,6 +54,6 @@ def pick_best_versions(versions)
end
if changed_gems.size > 0
- puts ">> Updated #{changed_gems.size} gems:"
+ puts ">> Updated #{changed_gems.size} gems:"
puts changed_gems.keys.join(', ')
end
View
18 spec/github_checkout_spec.rb
@@ -6,11 +6,11 @@
before do
@settings = OpenStruct.new(:settings => OpenStruct.new(:repos => 'x'))
end
-
+
def git(url, commit = nil)
@git = GithubCheckout.new(@settings, url, commit)
end
-
+
describe '#initialize' do
%w(git http https).each do |scheme|
it "should accept github URLs with #{scheme}://" do
@@ -27,41 +27,41 @@ def git(url, commit = nil)
@git.project.should == "yard"
@git.name.should == "lsegal/yard"
end
-
+
it "should sanitize project names" do
git("git://github.com/foo!/bar!")
@git.name.should == "foo_/bar_"
end
-
+
it "should sanitize SHA-1 commit" do
@git = GithubCheckout.new(@settings, "git://github.com/lsegal/yard", "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3")
@git.commit.should == "a94a8f"
end
-
+
it "should use master as commit if not selected" do
git("git://github.com/lsegal/yard")
@git.commit.should == "master"
end
it "should throw InvalidSchemeError on non github URL" do
- %w( http:// git:// sgdfhij gi://github.com/lsegal/yard git://github.com
+ %w( http:// git:// sgdfhij gi://github.com/lsegal/yard git://github.com
git://github.com/lsegal/ ).each do |url|
lambda { GithubCheckout.new(@settings, url) }.should raise_error(InvalidSchemeError)
end
end
end
-
+
describe '#is_fork?' do
it "should return false for master repo" do
File.should_receive(:directory?).and_return(false)
git("git://github.com/lsegal/yard")
@git.should_not be_fork
- end
+ end
it "should return true for non-master repo" do
File.should_receive(:directory?).and_return(false)
git("git://github.com/lsegal/rails")
@git.should be_fork
- end
+ end
end
end
View
2  templates/checkout.erb
@@ -5,7 +5,7 @@
<h2>Add your own project</h2>
<small class="example">(eg. git://github.com/lsegal/yard.git)</small>
<form id="checkout_form" action="/checkout" method="post">
- <input class="url" type="text" id="url" name="url" placeholder="git://github.com/username/project" />
+ <input class="url" type="text" id="url" name="url" placeholder="git://github.com/username/project" />
<div class="loadicon"></div>
<input type="hidden" id="scheme" name="scheme" value="git" />
<br/>
View
6 templates/default/fulldoc/html/js/rubydoc_custom.js
@@ -7,14 +7,14 @@ function createGithubLinks() {
if (match = $(this).find(".info.file").text().match(/^# File '([^']+)', line (\d+)/)) {
var file = match[1];
var line = match[2];
-
- var url = "https://github.com/" + github_project +
+
+ var url = "https://github.com/" + github_project +
"/blob/" + github_commit + "/" +
file +
"#L" + line;
$(this).before(' [<a target="_new" href="' + url + '">View on Github</a>]');
- }
+ }
});
}
}
View
2  templates/default/layout/html/footer.erb
@@ -1,5 +1,5 @@
<div id="footer">
- Generated on <%= Time.now.strftime("%c") %> by
+ Generated on <%= Time.now.strftime("%c") %> by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
<%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
</div>
View
2  templates/error.erb
@@ -3,6 +3,6 @@
<div id="content" class="error">
<h1 class="title noborder"><%= settings.name %> sez</h1>
<h1>Oops! A Problem Occurred</h1>
-
+
<p class="note <%= @class || 'deprecated' %>"><%= @error %></p>
</div>
View
6 templates/featured_index.erb
@@ -9,16 +9,16 @@
<li><a href="/gems">RubyGems</a></li>
<li><a href="/github">Github</a></li>
</ul>
-
+
<h2>Featured Libraries <small>(<a class="framelink" href="#">links without frames</a>)</small></h2>
<ul class="libraries">
<% @featured.each do |name, library_versions| %>
<li class="r<%= @row = @row == 1 ? 2 : 1 %>">
<% library_versions = library_versions.dup %>
<% first_lib = library_versions.pop %>
- <a href="/docs/<%= first_lib.name %>/frames"><%= name %></a>
+ <a href="/docs/<%= first_lib.name %>/frames"><%= name %></a>
<% if first_lib && first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..3].map {|lib| "<a href=\"/docs/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
</li>
View
8 templates/gems_index.erb
@@ -7,7 +7,7 @@
}
});
}
-
+
$(function() { saveIndex('gems'); });
$(fixGemLinks);
</script>
@@ -30,15 +30,15 @@
<% end %>
<% end %>
</ul>
-
+
<ul class="libraries">
<% @libraries.sort_by {|name, y| name.downcase }.each do |name, library_versions| %>
<li class="r<%= @row = @row == 1 ? 2 : 1 %>">
<% library_versions = library_versions.dup %>
<% first_lib = library_versions.pop %>
- <a href="#/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><%= name %></a>
+ <a href="#/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><%= name %></a>
<% if first_lib && first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..3].map {|lib| "<a href=\"#/#{@adapter.router.docs_prefix}/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
</li>
View
14 templates/home.erb
@@ -8,7 +8,7 @@
return;
}
}
-
+
var list = document.cookie.split(/\s*;\s*/);
for (var i = 0; i < list.length; i++) {
var key = list[i].split('=', 1)[0];
@@ -30,7 +30,7 @@
<li class="selected">Github</li>
<li class="search"><form action="/find/github" method="GET"><input type="text" id="docSearch" name="q" value="<%= h @search || 'Search Github Projects' %>"/></form></li>
</ul>
-
+
<% if @featured && @featured.size > 0 %>
<h2>Featured Libraries <small>(<a class="framelink" href="#">links without frames</a>)</small></h2>
<ul class="libraries">
@@ -38,16 +38,16 @@
<li class="r<%= @row = @row == 1 ? 2 : 1 %>">
<% library_versions = library_versions.dup %>
<% first_lib = library_versions.pop %>
- <a href="/docs/<%= first_lib %>/frames"><%= name %></a>
+ <a href="/docs/<%= first_lib %>/frames"><%= name %></a>
<% if first_lib && first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..3].map {|lib| "<a href=\"/docs/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
</li>
<% end %>
</ul>
<% end %>
-
+
<h2>Recently Updated Github Projects <small>(<a class="framelink" href="#">links without frames</a>)</small></h2>
<ul class="alpha_index">
<% (?a..?z).each do |letter| %>
@@ -64,13 +64,13 @@
<% @libraries.each do |lib| %>
<% latest_version = lib.versions.first %>
<li>
- <a href="/<%= @adapter.router.docs_prefix %>/<%= latest_version %>/frames"><strong><%= lib.name %></strong></a>
+ <a href="/<%= @adapter.router.docs_prefix %>/<%= latest_version %>/frames"><strong><%= lib.name %></strong></a>
<a href="#" class="project_reload" title="Reload this project"><img class="icon reload" src="/images/reload.png" /></a>
<a href="http://github.com/<%= lib.name %>" title="View this project on Github"><img class="icon github" src="/images/git.png" /></a>
<small>(<%= latest_version.version %>)</small>
</li>
<% end %>
</ul>
-
+
</div>
View
26 templates/layout.erb
@@ -38,7 +38,7 @@
}
});
}
-
+
function aboutLink() {
$('#about').click(function() {
if ($('#info').is(':hidden')) { $('#checkout').hide(); $('#tender_window').hide(); $('#info').fadeIn('fast'); }
@@ -46,7 +46,7 @@
return false;
});
}
-
+
function checkoutLink() {
$('#new_checkout').click(function() {
if ($('#checkout').is(':hidden')) { $('#info').hide(); $('#tender_window').hide(); $('#checkout').fadeIn('fast'); }
@@ -57,7 +57,7 @@
function helpLink() {
$('#help').click(function() {
- if ($('#tender_window').is(':visible')) {
+ if ($('#tender_window').is(':visible')) {
$('#tender_window').hide();
} else {
$('#help_tender').click();
@@ -77,7 +77,7 @@
return false;
});
}
-
+
function saveIndex(url) {
var date = new Date();
date.setDate(date.getDate() + (url == '' ? -999 : 99999));
@@ -104,7 +104,7 @@
#noscript { background: #111; color: #fff; padding: 10px 20px; }
#top_nav { top: 48px; }
</style>
- <div id="noscript"><strong>It seems you've disabled Javascript.</strong>
+ <div id="noscript"><strong>It seems you've disabled Javascript.</strong>
That's okay, but you might run into some problems. We try to make things work without script support
as much as possible, but sometimes it needs to be used. We apologize for any inconvenience and hope you understand.</div>
</noscript>
@@ -118,24 +118,24 @@
</ul>
<a id="help_tender" href="#" style="display:none;"/>
<div class="clear"></div>
-
+
<div id="info">
<p>
- <strong><%= settings.name %></strong> is your source for open source Ruby library documentation,
+ <strong><%= settings.name %></strong> is your source for open source Ruby library documentation,
generating fresh docs for Gems and popular Git repositories.
</p>
<p>
- This site uses <a href="http://yardoc.org">YARD</a> to generate docs on the fly.
- To make your docs look better, you can check out some of YARD's
+ This site uses <a href="http://yardoc.org">YARD</a> to generate docs on the fly.
+ To make your docs look better, you can check out some of YARD's
<a href="/gems/yard/frames/file/docs/WhatsNew.md">killer features</a>.
</p>
<p>
- <strong>We have DISQUS integration!</strong> Click the <em>permalink</em>
+ <strong>We have DISQUS integration!</strong> Click the <em>permalink</em>
(<a href="/gems/yard/frames/YARD/Templates/Engine.render">like this one</a>)
on a method to see user comments on a method page.
</p>
<p>
- Looking for a <a href="http://github.com">GitHub</a>
+ Looking for a <a href="http://github.com">GitHub</a>
<a href="http://help.github.com/post-receive-hooks/">post-receive hook</a>?
Use <tt><%= settings.url %>/checkout</tt>.
</p>
@@ -145,8 +145,8 @@
</small>
</p>
</div>
-
-
+
+
<%= yield %>
<div id="footer">
View
10 templates/scm_index.erb
@@ -34,9 +34,9 @@
<% username, library_versions = *repos.first %>
<% if first_lib = library_versions.find {|l| l.name == master } %>
<% library_versions -= [first_lib] %>
- <a href="/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><strong><%= username %>/<%= project %></strong></a>
+ <a href="/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><strong><%= username %>/<%= project %></strong></a>
<% if first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..2].map {|lib| "<a href=\"/#{@adapter.router.docs_prefix}/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
<a href="#" class="project_reload" title="Reload this project"><img class="icon reload" src="/images/reload.png" /></a>
@@ -54,9 +54,9 @@
<li class="alternate_fork">
<% library_versions = library_versions.dup %>
<% first_lib = library_versions.pop %>
- <a href="/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><%= username %>/<%= project %></a>
+ <a href="/<%= @adapter.router.docs_prefix %>/<%= first_lib.name %>/frames"><%= username %>/<%= project %></a>
<% if first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..3].map {|lib| "<a href=\"/#{@adapter.router.docs_prefix}/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
<a href="#" class="project_reload" title="Reload this project"><img class="icon reload" src="/images/reload.png" /></a>
@@ -66,6 +66,6 @@
</ul>
<% end %>
</ul>
-
+
</div>
View
6 templates/stdlib_index.erb
@@ -9,16 +9,16 @@
<li><a href="/gems">RubyGems</a></li>
<li><a href="/github">Github</a></li>
</ul>
-
+
<h2>Ruby Standard Library <small>(<a class="framelink" href="#">links without frames</a>)</small></h2>
<ul class="libraries">
<% @stdlib.sort_by {|n| n[0] == "core" ? '_' : n[0].downcase }.each do |name, library_versions| %>
<li class="r<%= @row = @row == 1 ? 2 : 1 %> <% if name == "core" %>core<% end%>">
<% library_versions = library_versions.dup %>
<% first_lib = library_versions.pop %>
- <a href="/stdlib/<%= first_lib.name %>/frames"><%= name %></a>
+ <a href="/stdlib/<%= first_lib.name %>/frames"><%= name %></a>
<% if first_lib && first_lib.version %>
- <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
+ <small>(<%= first_lib.version %><% if library_versions.size > 0 %>,
<%= library_versions.reverse[0..3].map {|lib| "<a href=\"/stdlib/#{lib}/frames\">#{lib.version}</a>" }.join(', ') %><% end %>)</small>
<% end %>
</li>
Please sign in to comment.
Something went wrong with that request. Please try again.