Rename readObject() to readObjectSync()

This commit is contained in:
Kevin Sawicki
2013-06-12 18:28:25 -07:00
parent d77705a039
commit d8de321074
5 changed files with 8 additions and 8 deletions

View File

@@ -92,7 +92,7 @@ class AtomPackage extends Package
@scopedProperties = []
scopedPropertiessDirPath = path.join(@path, 'scoped-properties')
for scopedPropertiesPath in fsUtils.listSync(scopedPropertiessDirPath, ['.json', '.cson'])
for selector, properties of fsUtils.readObject(scopedPropertiesPath)
for selector, properties of fsUtils.readObjectSync(scopedPropertiesPath)
@scopedProperties.push([scopedPropertiesPath, selector, properties])
serialize: ->

View File

@@ -19,7 +19,7 @@ class AtomTheme extends Theme
else
metadataPath = fsUtils.resolveExtension(path.join(@path, 'package'), ['cson', 'json'])
if fsUtils.isFileSync(metadataPath)
stylesheetNames = fsUtils.readObject(metadataPath)?.stylesheets
stylesheetNames = fsUtils.readObjectSync(metadataPath)?.stylesheets
if stylesheetNames
for name in stylesheetNames
filename = fsUtils.resolveExtension(path.join(@path, name), ['.css', '.less', ''])

View File

@@ -16,14 +16,14 @@ class TextMateGrammar
fsUtils.readPlist(path)
@load: (path, done) ->
fsUtils.readObjectAsync path, (err, object) ->
fsUtils.readObject path, (err, object) ->
if err
done(err)
else
done(null, new TextMateGrammar(object))
@loadSync: (path) ->
new TextMateGrammar(fsUtils.readObject(path))
new TextMateGrammar(fsUtils.readObjectSync(path))
name: null
rawPatterns: null

View File

@@ -95,7 +95,7 @@ class TextMatePackage extends Package
@scopedProperties.push({selector, properties})
for preferencePath in fsUtils.listSync(@getPreferencesPath())
{scope, settings} = fsUtils.readObject(preferencePath)
{scope, settings} = fsUtils.readObjectSync(preferencePath)
if properties = @propertiesFromTextMateSettings(settings)
selector = syntax.cssSelectorFromScopeSelector(scope) if scope?
@scopedProperties.push({selector, properties})
@@ -136,7 +136,7 @@ class TextMatePackage extends Package
return
loadPreferencesAtPath = (preferencePath, done) ->
fsUtils.readObjectAsync preferencePath, (error, preferences) =>
fsUtils.readObject preferencePath, (error, preferences) =>
if error?
console.warn("Failed to parse preference at path '#{preferencePath}'", error.stack, error)
else

View File

@@ -300,14 +300,14 @@ module.exports =
catch err
done(err)
readObject: (path) ->
readObjectSync: (path) ->
CSON = require 'season'
if CSON.isObjectPath(path)
CSON.readFileSync(path)
else
@readPlist(path)
readObjectAsync: (path, done) ->
readObject: (path, done) ->
CSON = require 'season'
if CSON.isObjectPath(path)
CSON.readFile(path, done)