Skip to content

Commit

Permalink
Remove dead & deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
5long committed May 28, 2013
1 parent bbf48f7 commit 9ae66dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 3 additions & 7 deletions lib/sup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ class Module
def yaml_properties *props
props = props.map { |p| p.to_s }

def self.to_yaml_tag
path = name.gsub(/::/, "/")
"!#{Redwood::YAML_DOMAIN},#{Redwood::YAML_DATE}/#{path}"
end
path = name.gsub(/::/, "/")
yaml_tag "!#{Redwood::YAML_DOMAIN},#{Redwood::YAML_DATE}/#{path}"

define_method(:to_yaml_type) { self.class.to_yaml_tag }
define_method :init_with do |coder|
initialize(*coder.map.values_at(*props))
end
Expand All @@ -40,8 +37,7 @@ def self.to_yaml_tag
end
end

yaml_tag to_yaml_tag
path = name.gsub(/::/, "/")
# Legacy
Psych.load_tags["!#{Redwood::LEGACY_YAML_DOMAIN},#{Redwood::YAML_DATE}/#{path}"] = self
end
end
Expand Down
7 changes: 5 additions & 2 deletions lib/sup/draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ class DraftLoader < Source
attr_accessor :dir
yaml_properties

def initialize
dir = Redwood::DRAFT_DIR
def initialize dir=Redwood::DRAFT_DIR
Dir.mkdir dir unless File.exists? dir
super DraftManager.source_name, true, false
@dir = dir
@cur_offset = 0
end

def properly_initialized?
!!(@dir && @cur_offset)
end

def id; DraftManager.source_id; end
def to_s; DraftManager.source_name; end
def uri; DraftManager.source_name; end
Expand Down

0 comments on commit 9ae66dc

Please sign in to comment.