Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rjb fix master for modern ruby #10

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions lib/webby/apps/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ def find_sitefile
end

def import_default_tasks
Dir.glob(::Webby.libpath(%w[webby tasks *.rake])).sort.each {|fn| import fn}
Dir.glob(::Webby.libpath(%w[webby tasks *.rake])).sort.each {|fn| app.add_import fn}
end

def import_website_tasks
Dir.glob(::File.join(%w[tasks *.rake])).sort.each {|fn| import fn}
Dir.glob(::File.join(%w[tasks *.rake])).sort.each {|fn| app.add_import fn}
end

def require_lib_files
Dir.glob(::File.join(%w[lib ** *.rb])).sort.each {|fn| require fn}
Dir.glob(::File.join(%w[lib ** *.rb])).sort.each {|fn| require File.expand_path fn}
end

def capture_command_line_args(args)
Expand Down
9 changes: 8 additions & 1 deletion lib/webby/resources/meta_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ def each
buffer << line
end

h = YAML.load(buffer)
begin
h = YAML.load(buffer)
rescue Psych::SyntaxError => err
msg = ERR_MSG.dup << "\n\t-- " << err.message
msg << "\n Buffer:\n#{buffer}"
raise Error, msg
end

raise Error, ERR_MSG unless h.instance_of?(Hash)

if first then h = first.merge(h)
Expand Down
3 changes: 2 additions & 1 deletion lib/webby/resources/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Resource

instance_methods.each do |m|
undef_method(m) unless m =~ %r/\A__|\?$/ ||
m == 'class'
m == :class ||
m == :object_id
end

# The full path to the resource file
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
end

require 'fileutils'
require 'spec'
require 'spec/logging_helper'

dir = File.expand_path(File.dirname(__FILE__))
Expand Down