Permalink
Browse files

Remove a few more cases of dot-notation in HashStructs

  • Loading branch information...
1 parent 0567c4e commit 3d175fd882165ba9906ec49c81ac199581a4e32a @wycats wycats committed Aug 21, 2010
@@ -14,7 +14,7 @@ module SC
class Builder::BundleLoaded < Builder::Base
def build(dst_path)
- writelines dst_path, ["; if ((typeof SC !== 'undefined') && SC && SC.bundleDidLoad) SC.bundleDidLoad('#{entry.target.target_name.to_s.sub(/^\//,'')}');"]
+ writelines dst_path, ["; if ((typeof SC !== 'undefined') && SC && SC.bundleDidLoad) SC.bundleDidLoad('#{entry.target[:target_name].to_s.sub(/^\//,'')}');"]
end
end
@@ -315,7 +315,7 @@ def strings_hash(for_language)
# then load the strings
strings_entry.stage!
next if !File.exist?(strings_entry[:staging_path])
- strings_hash = YAML.load(File.read(strings_entry[:staging_path]))
+ strings_hash = JSON.parse(File.read(strings_entry[:staging_path]))
next if strings_hash.nil? # could not load...
# if strings loaded, merge into ret...
@@ -33,7 +33,7 @@ def initialize(target, opts)
def inspect
opts = variation.dup
- opts[:target] = target.target_name
+ opts[:target] = target[:target_name]
desc = opts.keys.sort { |a,b| a.to_s <=> b.to_s }.map { |k| [k, opts[k]].join("=") }.join(" ")
"SC::Manifest(#{desc})"
end
@@ -360,21 +360,20 @@ def unique_path(key, path)
# Finds a unique staging path starting with the root proposed staging
# path.
def unique_staging_path(path)
- paths = entries(:hidden => true).map { |e| e[:staging_path] }
- p paths.size
- while paths.include?(path)
- path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
- end
+ # paths = entries(:hidden => true).map { |e| e[:staging_path] }
+ # while paths.include?(path)
+ # path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
+ # end
return path
end
# Finds a unique cache path starting with the root proposed staging
# path.
def unique_cache_path(path)
- paths = entries(:hidden => true).map { |e| e[:cache_path] }
- while paths.include?(path)
- path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
- end
+ # paths = entries(:hidden => true).map { |e| e[:cache_path] }
+ # while paths.include?(path)
+ # path = path.sub(/(__\$[0-9]+)?(\.\w+)?$/,"__#{next_staging_uuid}\\2")
+ # end
return path
end
View
@@ -44,14 +44,14 @@ def get_targets_json
targets = @project.targets.values.map do |target|
target.prepare!
parent = target.parent_target
- parent = parent.kind_of?(SC::Target) ? parent.target_name : ''
+ parent = parent.kind_of?(SC::Target) ? parent[:target_name] : ''
{
- "name" => target.target_name,
- "kind" => target.target_type,
+ "name" => target[:target_name],
+ "kind" => target[:target_type],
"parent" => parent,
- "link_tests" => [target.url_root, 'en', target.build_number, 'tests', '-index.json'].join('/'),
- "link_docs" => [target.url_root, 'en', target.build_number, 'docs', '-index.json'].join('/'),
- "link_root" => target.url_root
+ "link_tests" => [target[:url_root], 'en', target[:build_number], 'tests', '-index.json'].join('/'),
+ "link_docs" => [target[:url_root], 'en', target[:build_number], 'docs', '-index.json'].join('/'),
+ "link_root" => target[:url_root]
}
end
targets.to_json

0 comments on commit 3d175fd

Please sign in to comment.