mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-26 01:18:51 -05:00
Grand whitespace cleanup.
This commit is contained in:
parent
72579fe9cf
commit
ffa9118e9c
1
.powrc
1
.powrc
@ -2,4 +2,3 @@ if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ] ; then
|
||||
source "$rvm_path/scripts/rvm"
|
||||
source ".rvmrc"
|
||||
fi
|
||||
|
6
Rakefile
6
Rakefile
@ -353,7 +353,7 @@ task :set_root_dir, :dir do |t, args|
|
||||
site_configs[:subscribe_rss] = "#{dir}/atom.xml"
|
||||
site_configs[:root] = "/#{dir.sub(/^\//, '')}"
|
||||
configurator.write_config('site.yml', site_configs)
|
||||
|
||||
|
||||
rm_rf configuration[:destination]
|
||||
mkdir_p site_configs[:destination]
|
||||
puts "\n========================================================"
|
||||
@ -456,7 +456,7 @@ end
|
||||
# usage rake list_posts or rake list_posts[pub|unpub]
|
||||
desc "List all unpublished/draft posts"
|
||||
task :list_drafts do
|
||||
posts = Dir.glob("#{configuration[:source]}/#{configuration[:posts_dir]}/*.*")
|
||||
posts = Dir.glob("#{configuration[:source]}/#{configuration[:posts_dir]}/*.*")
|
||||
unpublished = get_unpublished(posts)
|
||||
puts unpublished.empty? ? "There are no posts currently in draft" : unpublished
|
||||
end
|
||||
@ -467,7 +467,7 @@ def get_unpublished(posts, options={})
|
||||
posts.sort.each do |post|
|
||||
file = File.read(post)
|
||||
data = YAML.load file.match(/(^-{3}\n)(.+?)(\n-{3})/m)[2]
|
||||
|
||||
|
||||
if options[:no_future]
|
||||
future = Time.now < Time.parse(data['date'].to_s) ? "future date: #{data['date']}" : false
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ require 'sinatra/base'
|
||||
# The project root directory
|
||||
$root = ::File.dirname(__FILE__)
|
||||
|
||||
class SinatraStaticServer < Sinatra::Base
|
||||
class SinatraStaticServer < Sinatra::Base
|
||||
|
||||
get(/.+/) do
|
||||
send_sinatra_file(unescape request.path) {404}
|
||||
@ -16,10 +16,10 @@ class SinatraStaticServer < Sinatra::Base
|
||||
|
||||
def send_sinatra_file(path, &missing_file_block)
|
||||
file_path = File.join(File.dirname(__FILE__), 'public', path)
|
||||
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
|
||||
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
|
||||
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
run SinatraStaticServer
|
||||
run SinatraStaticServer
|
||||
|
@ -5,4 +5,3 @@ gem "rake", "~> 10.0"
|
||||
group :test do
|
||||
gem "rspec"
|
||||
end
|
||||
|
||||
|
@ -15,4 +15,3 @@ ARGV.delete_if do |arg|
|
||||
end
|
||||
|
||||
IRB.start
|
||||
|
||||
|
@ -4,7 +4,7 @@ module Octopress
|
||||
class Configuration
|
||||
DEFAULT_CONFIG_DIR = File.join(File.dirname(__FILE__), '../', '../' '_config')
|
||||
attr_accessor :config_directory
|
||||
|
||||
|
||||
def initialize(config_dir = DEFAULT_CONFIG_DIR)
|
||||
self.config_directory = config_dir
|
||||
end
|
||||
@ -79,7 +79,7 @@ module Octopress
|
||||
jekyll_configs = config.to_string_keys.to_yaml :canonical => false
|
||||
f.write(jekyll_configs)
|
||||
end
|
||||
|
||||
|
||||
jekyll_configs
|
||||
end
|
||||
|
||||
|
@ -18,9 +18,9 @@ class Hash
|
||||
target
|
||||
end
|
||||
def to_symbol_keys
|
||||
inject({}) { |memo,(k,v)| memo[k.to_sym] = v; memo }
|
||||
inject({}) { |memo,(k,v)| memo[k.to_sym] = v; memo }
|
||||
end
|
||||
def to_string_keys
|
||||
inject({}) { |memo,(k,v)| memo[k.to_s] = v; memo }
|
||||
inject({}) { |memo,(k,v)| memo[k.to_s] = v; memo }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -7,7 +7,7 @@ describe Octopress::Configuration do
|
||||
before do
|
||||
@octo_config = Octopress::Configuration.new(File.join(File.dirname(__FILE__), '../', 'fixtures', 'no_override'))
|
||||
end
|
||||
|
||||
|
||||
subject do
|
||||
@octo_config.read_configuration
|
||||
end
|
||||
@ -27,7 +27,7 @@ describe Octopress::Configuration do
|
||||
before do
|
||||
@octo_config = Octopress::Configuration.new(File.join(File.dirname(__FILE__), '../', 'fixtures', 'override'))
|
||||
end
|
||||
|
||||
|
||||
subject do
|
||||
@octo_config.read_configuration
|
||||
end
|
||||
|
@ -42,7 +42,7 @@ module Jekyll
|
||||
if parts = @markup.match(/([\d]*) (.*)/)
|
||||
gist, file = parts[1].strip, parts[2].strip
|
||||
|
||||
@options[:title] ||= file.empty? ? "Gist: #{gist}" : file
|
||||
@options[:title] ||= file.empty? ? "Gist: #{gist}" : file
|
||||
@options[:url] ||= "https://gist.github.com/#{gist}"
|
||||
@options[:lang] ||= file.empty? ? @options[:lang] || '' : file.split('.')[-1]
|
||||
@options[:no_cache] = @cache_disabled
|
||||
|
@ -67,7 +67,7 @@ module Jekyll
|
||||
puts "Update include for #{filepath}"
|
||||
puts "### --------------------------------- ###"
|
||||
end
|
||||
|
||||
|
||||
if File.symlink?(code_path)
|
||||
puts "Code directory '#{code_path}' cannot be a symlink"
|
||||
return "Code directory '#{code_path}' cannot be a symlink"
|
||||
|
@ -119,4 +119,3 @@ module OctopressLiquidFilters
|
||||
|
||||
end
|
||||
Liquid::Template.register_filter OctopressLiquidFilters
|
||||
|
||||
|
@ -118,4 +118,3 @@ module Jekyll
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
@ -15,10 +15,10 @@ module HighlightCode
|
||||
include TemplateWrapper
|
||||
include SiteConfig
|
||||
def pygments(code, lang)
|
||||
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
|
||||
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
|
||||
highlighted_code = highlighted_code.gsub(/{{/, '{{').gsub(/{%/, '{%')
|
||||
highlighted_code.to_s
|
||||
rescue
|
||||
rescue
|
||||
puts $!,$@
|
||||
end
|
||||
|
||||
@ -134,7 +134,7 @@ module HighlightCode
|
||||
url: (url.nil? ? nil : url[3] || url[5] || url[6]),
|
||||
start: (start.nil? ? nil : start[1].to_i),
|
||||
end: (endline.nil? ? nil : endline[1].to_i),
|
||||
link_text: (link_text.nil? ? nil : link_text[3] || link_text[5] || link_text[6])
|
||||
link_text: (link_text.nil? ? nil : link_text[3] || link_text[5] || link_text[6])
|
||||
}
|
||||
opts.merge(parse_range(input, opts[:start], opts[:end]))
|
||||
end
|
||||
@ -172,7 +172,7 @@ module HighlightCode
|
||||
end
|
||||
{start: start, end: endline}
|
||||
end
|
||||
|
||||
|
||||
def get_range (code, start, endline)
|
||||
length = code.lines.count
|
||||
start ||= 1
|
||||
|
@ -60,10 +60,10 @@ module Jekyll
|
||||
partial = Liquid::Template.parse(contents)
|
||||
context.stack do
|
||||
contents = partial.render(context)
|
||||
|
||||
|
||||
site = context.registers[:site]
|
||||
converter = site.converters.find { |c| c.matches(ext) }
|
||||
|
||||
|
||||
if converter.nil?
|
||||
contents
|
||||
else
|
||||
|
@ -309,4 +309,3 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -53,4 +53,3 @@ module Jekyll
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('video', Jekyll::VideoTag)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user