Permalink
Browse files

more renames

  • Loading branch information...
1 parent a475a27 commit f3b3bb4aa3aa1d4bf3ac1930d8025c85656e9600 @darwin darwin committed Mar 24, 2009
Showing with 34 additions and 29 deletions.
  1. +1 −0 Rakefile
  2. +1 −1 lib/hpdev-server.rb
  3. +9 −5 lib/hpdev.rb
  4. +3 −3 lib/hpdev/builder.rb
  5. +8 −8 lib/hpdev/bundle.rb
  6. +6 −6 lib/hpdev/checkout.rb
  7. +2 −2 lib/hpdev/editor.rb
  8. +1 −1 lib/hpdev/front.rb
  9. +1 −1 lib/hpdev/repo.rb
  10. +1 −1 lib/hpdev/skin.rb
  11. +1 −1 lib/hpdev/system.rb
View
@@ -11,6 +11,7 @@ begin
s.authors = ["Antonin Hildebrand"]
s.add_dependency('grit')
s.add_dependency('sinatra')
+ s.add_dependency('hpricot')
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install hashpage-hpdev -s http://gems.github.com"
View
@@ -57,7 +57,7 @@
get '/:kind/:author/:name/master/*' do
path = params["splat"][0]
- name = params[:name] # e.g. pbw.tabs
+ name = params[:name] # e.g. hpw.tabs
author = params[:author] # github username e.g. darwin
kind = params[:kind] # e.g. widgets or skins
serve_widget(path, name, author, kind)
View
@@ -7,7 +7,11 @@
rescue
raise "Do: sudo gem install hpricot"
end
-require 'grit'
+begin
+ require 'grit'
+rescue
+ raise "Do: sudo gem install grit"
+end
#Grit.debug = true
unless defined? OSX then
@@ -37,7 +41,7 @@ def die(s)
exit(1)
end
-class PBLogger
+class HPLogger
def debug(s)
#puts yellow(s)
end
@@ -51,15 +55,15 @@ def fatal(s)
end
end
-class PBC
+class HPC
attr :logger
def initialize()
- @logger = PBLogger.new
+ @logger = HPLogger.new
end
end
-PB = PBC.new
+HP = HPC.new
require 'hpdev/utils.rb'
View
@@ -100,7 +100,7 @@ def _build_one(filename, lines, required, link_only = false)
lines << filename
elsif file_lines.size > 0
# if entry.ext == "sass"
-# PB.logger.fatal("TODO sass")
+# HP.logger.fatal("TODO sass")
# # file_lines = [ HPDev::Renderers::Sass.compile(entry, file_lines.join()) ]
# end
lines += _process_file_lines(file_lines, filename)
@@ -142,11 +142,11 @@ def comment_out_js_line(line)
def _target()
case bundle.build_kind
when :widget
- return "PB.widgets['\#{BASE_URL}'].prototype"
+ return "HP.widgets['\#{BASE_URL}'].prototype"
when :engine
return "PB"
when :editor
- return "PB.e"
+ return "HP.e"
when :system
return "PBS"
when :redbug
View
@@ -204,12 +204,12 @@ def build_entries(entries, opts={})
# skip if hidden, already seen, or already built (unless forced)
if entry.hidden? && with_hidden == :none
- PB.logger.debug("~ Skipping Entry: #{entry.filename} because it is hidden")
+ HP.logger.debug("~ Skipping Entry: #{entry.filename} because it is hidden")
next
end
if !entry.hidden? && with_hidden == :only
- PB.logger.debug("~ Skipping Entry: #{entry.filename} because it is not hidden")
+ HP.logger.debug("~ Skipping Entry: #{entry.filename} because it is not hidden")
next
end
@@ -222,17 +222,17 @@ def build_entries(entries, opts={})
source_mtime = entry.source_path_mtime
if source_mtime && (File.mtime(entry.build_path) >= source_mtime)
entry.fresh = false
- PB.logger.debug("~ Skipping Entry: #{entry.filename} because it has not changed")
+ HP.logger.debug("~ Skipping Entry: #{entry.filename} because it has not changed")
next
end
end
# OK, looks like this is ready to be built.
# if the entry is served directly from source
if entry.use_source_directly?
- PB.logger.debug("~ No Build Required: #{entry.filename} (will be served directly)")
+ HP.logger.debug("~ No Build Required: #{entry.filename} (will be served directly)")
else
- PB.logger.debug("~ Building #{entry.type.to_s.capitalize}: #{entry.filename}")
+ HP.logger.debug("~ Building #{entry.type.to_s.capitalize}: #{entry.filename}")
HPDev.send("build_#{entry.type}".to_sym, entry, self)
entry.fresh = true
end
@@ -249,9 +249,9 @@ def build_entry(entry, opts={})
# This will perform a complete build
def build()
- PB.logger.debug("~ Build Mode: #{build_mode}")
- PB.logger.debug("~ Source Root: #{source_root}")
- PB.logger.debug("~ Build Root: #{build_root}")
+ HP.logger.debug("~ Build Mode: #{build_mode}")
+ HP.logger.debug("~ Source Root: #{source_root}")
+ HP.logger.debug("~ Build Root: #{build_root}")
build_entries(entries())
end
View
@@ -87,13 +87,13 @@ def minify(path)
yui_root = File.expand_path(File.join(File.dirname(__FILE__), '..', 'yui-compressor'))
jar_path = File.join(yui_root, 'yuicompressor-2.4.2.jar')
filecompress = "java -jar \"" + jar_path + "\" --charset utf-8 --line-break 120 \"" + path + "\" -o \"" + path + "\""
- PB.logger.info(' crunching with YUI Compressor ...')
+ HP.logger.info(' crunching with YUI Compressor ...')
# puts "> "+yellow(filecompress)
res = `#{filecompress} 2>&1`
if $?.exitstatus != 0
- PB.logger.fatal("!!!!YUI compressor failed, please check that your js code is valid and doesn't contain reserved statements like debugger;")
- PB.logger.fatal("!!!!Failed compressing ... "+ path)
- PB.logger.fatal(res)
+ HP.logger.fatal("!!!!YUI compressor failed, please check that your js code is valid and doesn't contain reserved statements like debugger;")
+ HP.logger.fatal("!!!!Failed compressing ... "+ path)
+ HP.logger.fatal(res)
failed_path = File.join(File.dirname(path), "failed_"+File.basename(path))
`mv "#{path}" "#{failed_path}"`
raise YUICompressorError.new(failed_path + "\n\n" + res)
@@ -114,10 +114,10 @@ def bakein(path, ext="js", what = %w(tpl html css js), prolog="", bundle=nil)
end
final_path = final_path(path, ext, *results)
if File.exists?(final_path) && !(fresh.any? {|x| x }) then
- PB.logger.debug("~ Skipping Entry: #{final_path} because it has not changed")
+ HP.logger.debug("~ Skipping Entry: #{final_path} because it has not changed")
return final_path
end
- PB.logger.info("Baking #{@url}/#{path} ...")
+ HP.logger.info("Baking #{@url}/#{path} ...")
prepare_final(final_path, prolog, *results)
minify(final_path) if bundle.minify?
final_path
View
@@ -18,9 +18,9 @@ def postprocess(dir)
class EditorCheckout < Checkout
def serve(path)
resource_path = File.join(@path, path)
- PB.logger.debug(resource_path)
+ HP.logger.debug(resource_path)
return resource_path unless path=="editor.js"
- bakein(path, "js", %w(tpl html css js), "PB.e={templates:{}};")
+ bakein(path, "js", %w(tpl html css js), "HP.e={templates:{}};")
end
end
end
View
@@ -20,7 +20,7 @@ def postprocess(dir)
class FrontCheckout < Checkout
def serve(path)
resource_path = File.join(@path, path)
- PB.logger.debug(resource_path)
+ HP.logger.debug(resource_path)
return bakein(path, "js", %w(tpl html js), "window.FT = { templates:{} };") if path=="front.js"
return bakein(path, "css", %w(css)) if path=="front.css"
resource_path
View
@@ -64,7 +64,7 @@ def collect_meta()
end
require 'open-uri'
- PB.logger.info("Fetching: #{home}")
+ HP.logger.info("Fetching: #{home}")
doc = open(home) { |f| Hpricot(f) }
raise RepoError.new("unable to download: #{home}") unless doc
View
@@ -25,7 +25,7 @@ def postprocess(dir)
class SkinCheckout < Checkout
def serve(path, build_mode = :development)
- PB.logger.debug(path)
+ HP.logger.debug(path)
resource_path = File.join(@path, path)
return resource_path unless path=="index.html"
# the path is index.html
View
@@ -20,7 +20,7 @@ def postprocess(dir)
class SystemCheckout < Checkout
def serve(path)
resource_path = File.join(@path, path)
- PB.logger.debug(resource_path)
+ HP.logger.debug(resource_path)
return bakein(path, "js", %w(tpl html js), "PBS.templates={};") if path=="system.js"
return bakein(path, "css", %w(css)) if path=="system.css"
resource_path

0 comments on commit f3b3bb4

Please sign in to comment.