From c9eebcf00adf2b8c06ac2d1ef7b19a09becfc0e4 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 1 Nov 2013 15:15:17 -0700 Subject: [PATCH 01/23] Fixture hashes depend on line returns --- spec/spec-helper.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 36ff7f235..ed6050ddc 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -280,5 +280,10 @@ $.fn.textInput = (data) -> event = $.event.fix(event) $(this).trigger(event) -unless fs.md5ForPath(require.resolve('./fixtures/sample.js')) == "dd38087d0d7e3e4802a6d3f9b9745f2b" +if process.platform is 'win32' + unmodifiedHash = '15b13ffbc8d1c1ba5af845e5902ae67c' +else + unmodifiedHash = "dd38087d0d7e3e4802a6d3f9b9745f2b" + +unless fs.md5ForPath(require.resolve('./fixtures/sample.js')) is unmodifiedHash throw new Error("Sample.js is modified") From 0695aafe80b0e5bbbcceaea2b658e0d348c28a4e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 1 Nov 2013 15:33:11 -0700 Subject: [PATCH 02/23] Devmode hard-codes the location of the atom repo --- docs/building-atom.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/building-atom.md b/docs/building-atom.md index 14bdf82d1..46046048b 100644 --- a/docs/building-atom.md +++ b/docs/building-atom.md @@ -17,13 +17,13 @@ atom][download]. * Install the [latest 32bit Node 0.10.x][win-node] * Install the [latest Python 2.7.x][win-python] * Install [Github for Windows][win-github] -* Clone [atom/atom][atom-git] to `C:\Users\\Documents\GitHub\atom\` -* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\\Documents\GitHub\atom\node_modules\` +* Clone [atom/atom][atom-git] to `C:\Users\\github\atom\` +* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\\github\atom\node_modules\` to your PATH * Set ATOM_ACCESS_TOKEN to your oauth2 credentials (run `security -q find-generic-password -ws 'GitHub API Token'` on OSX to get your credentials). -* Use the Windows GitHub shell and cd into `C:\Users\\Documents\GitHub\atom` +* Use the Windows GitHub shell and cd into `C:\Users\\github\atom` * Run `node script/bootstrap` [download]: http://www.atom.io From ec761d00eff7543928fd6e11e1373401554aa6dd Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 4 Nov 2013 14:53:43 -0800 Subject: [PATCH 03/23] Remove modified check on fixture file --- spec/spec-helper.coffee | 8 -------- 1 file changed, 8 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index ed6050ddc..39a086e0d 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -279,11 +279,3 @@ $.fn.textInput = (data) -> event.initTextEvent('textInput', true, true, window, data) event = $.event.fix(event) $(this).trigger(event) - -if process.platform is 'win32' - unmodifiedHash = '15b13ffbc8d1c1ba5af845e5902ae67c' -else - unmodifiedHash = "dd38087d0d7e3e4802a6d3f9b9745f2b" - -unless fs.md5ForPath(require.resolve('./fixtures/sample.js')) is unmodifiedHash - throw new Error("Sample.js is modified") From e312050163f17e4a1339d68a01fee023a4fa51c4 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 4 Nov 2013 16:21:50 -0800 Subject: [PATCH 04/23] Create valid DOM ids for stylesheets --- src/theme-manager.coffee | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index ac0192dbc..34e0baac8 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -159,19 +159,23 @@ class ThemeManager #{e.message} """ + # Internal-only: + stringToId: (string) -> + string.replace(/\\/g, '') + # Internal-only: removeStylesheet: (stylesheetPath) -> unless fullPath = @resolveStylesheet(stylesheetPath) throw new Error("Could not find a file at path '#{stylesheetPath}'") - @stylesheetElementForId(fullPath).remove() + @stylesheetElementForId(@stringToId(fullPath)).remove() # Internal-only: - applyStylesheet: (id, text, ttype = 'bundled') -> - styleElement = @stylesheetElementForId(id) + applyStylesheet: (path, text, ttype = 'bundled') -> + styleElement = @stylesheetElementForId(@stringToId(path)) if styleElement.length styleElement.text(text) else if $("head style.#{ttype}").length - $("head style.#{ttype}:last").after "" + $("head style.#{ttype}:last").after "" else - $("head").append "" + $("head").append "" From ee280d87f9a31885ff13434ae7470ae4c815a6d2 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Mon, 4 Nov 2013 16:33:11 -0800 Subject: [PATCH 05/23] Ensure we're using proper dom ids in specs --- spec/atom-spec.coffee | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec/atom-spec.coffee b/spec/atom-spec.coffee index 981036868..e7d4d1e65 100644 --- a/spec/atom-spec.coffee +++ b/spec/atom-spec.coffee @@ -3,7 +3,7 @@ Exec = require('child_process').exec path = require 'path' ThemeManager = require '../src/theme-manager' -describe "the `atom` global", -> +fdescribe "the `atom` global", -> beforeEach -> window.rootView = new RootView @@ -200,6 +200,11 @@ describe "the `atom` global", -> one = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/1.css") two = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/2.less") three = require.resolve("./fixtures/packages/package-with-stylesheets-manifest/stylesheets/3.css") + + one = atom.themes.stringToId(one) + two = atom.themes.stringToId(two) + three = atom.themes.stringToId(three) + expect(atom.themes.stylesheetElementForId(one)).not.toExist() expect(atom.themes.stylesheetElementForId(two)).not.toExist() expect(atom.themes.stylesheetElementForId(three)).not.toExist() @@ -216,6 +221,12 @@ describe "the `atom` global", -> one = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/1.css") two = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/2.less") three = require.resolve("./fixtures/packages/package-with-stylesheets/stylesheets/3.css") + + + one = atom.themes.stringToId(one) + two = atom.themes.stringToId(two) + three = atom.themes.stringToId(three) + expect(atom.themes.stylesheetElementForId(one)).not.toExist() expect(atom.themes.stylesheetElementForId(two)).not.toExist() expect(atom.themes.stylesheetElementForId(three)).not.toExist() From 6bd7dd88417ee3a0003db53c0c254445171e2fed Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 15:44:38 -0800 Subject: [PATCH 06/23] Add jasmine-tagged, for filtering platform specs --- package.json | 1 + spec/jasmine-helper.coffee | 2 ++ 2 files changed, 3 insertions(+) diff --git a/package.json b/package.json index a23576549..2dfc1f9ce 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "json-front-matter": "~0.1.3", "grunt-shell": "~0.3.1", "jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks", + "jasmine-tagged": "0.1.0", "request": "~2.27.0", "unzip": "~0.1.9" }, diff --git a/spec/jasmine-helper.coffee b/spec/jasmine-helper.coffee index b7e70b607..3d84e9d46 100644 --- a/spec/jasmine-helper.coffee +++ b/spec/jasmine-helper.coffee @@ -3,6 +3,7 @@ module.exports.runSpecSuite = (specSuite, logErrors=true) -> window[key] = value for key, value of require '../vendor/jasmine' require 'jasmine-focused' + require 'jasmine-tagged' TimeReporter = require './time-reporter' timeReporter = new TimeReporter() @@ -27,6 +28,7 @@ module.exports.runSpecSuite = (specSuite, logErrors=true) -> jasmineEnv = jasmine.getEnv() jasmineEnv.addReporter(reporter) jasmineEnv.addReporter(timeReporter) + jasmineEnv.setIncludedTags([process.platform]) $('body').append $$ -> @div id: 'jasmine-content' From 9863386644bbae4c89399f36eedb056c66f64d50 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 16:36:51 -0800 Subject: [PATCH 07/23] Update Directory specs for platform specific issues --- spec/directory-spec.coffee | 70 +++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/spec/directory-spec.coffee b/spec/directory-spec.coffee index 56b40fe05..c611a7b05 100644 --- a/spec/directory-spec.coffee +++ b/spec/directory-spec.coffee @@ -66,32 +66,45 @@ describe "Directory", -> waits 20 runs -> expect(changeHandler.callCount).toBe 0 - it "includes symlink information about entries", -> - entries = directory.getEntries() - for entry in entries - name = entry.getBaseName() - if name is 'symlink-to-dir' or name is 'symlink-to-file' - expect(entry.symlink).toBeTruthy() - else - expect(entry.symlink).toBeFalsy() + describe "on #darwin or #linux", -> + it "includes symlink information about entries", -> + entries = directory.getEntries() + for entry in entries + name = entry.getBaseName() + if name is 'symlink-to-dir' or name is 'symlink-to-file' + expect(entry.symlink).toBeTruthy() + else + expect(entry.symlink).toBeFalsy() describe ".relativize(path)", -> - it "returns a relative path based on the directory's path", -> - absolutePath = directory.getPath() - expect(directory.relativize(absolutePath)).toBe '' - expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b" - expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b/file.coffee" - expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee" + describe "on #darwin or #linux", -> + it "returns a relative path based on the directory's path", -> + absolutePath = directory.getPath() + expect(directory.relativize(absolutePath)).toBe '' + expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b" + expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b/file.coffee" + expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee" - it "returns a relative path based on the directory's symlinked source path", -> - symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir') - symlinkDirectory = new Directory(symlinkPath) - realFilePath = require.resolve('./fixtures/dir/a') - expect(symlinkDirectory.relativize(symlinkPath)).toBe '' - expect(symlinkDirectory.relativize(realFilePath)).toBe 'a' + it "returns a relative path based on the directory's symlinked source path", -> + symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir') + symlinkDirectory = new Directory(symlinkPath) + realFilePath = require.resolve('./fixtures/dir/a') + expect(symlinkDirectory.relativize(symlinkPath)).toBe '' + expect(symlinkDirectory.relativize(realFilePath)).toBe 'a' - it "returns the full path if the directory's path is not a prefix of the path", -> - expect(directory.relativize('/not/relative')).toBe '/not/relative' + it "returns the full path if the directory's path is not a prefix of the path", -> + expect(directory.relativize('/not/relative')).toBe '/not/relative' + + describe "on #win32", -> + it "returns a relative path based on the directory's path", -> + absolutePath = directory.getPath() + expect(directory.relativize(absolutePath)).toBe '' + expect(directory.relativize(path.join(absolutePath, "b"))).toBe "b" + expect(directory.relativize(path.join(absolutePath, "b/file.coffee"))).toBe "b\\file.coffee" + expect(directory.relativize(path.join(absolutePath, "file.coffee"))).toBe "file.coffee" + + it "returns the full path if the directory's path is not a prefix of the path", -> + expect(directory.relativize('/not/relative')).toBe "\\not\\relative" describe ".contains(path)", -> it "returns true if the path is a child of the directory's path", -> @@ -100,11 +113,12 @@ describe "Directory", -> expect(directory.contains(path.join(absolutePath, "b", "file.coffee"))).toBe true expect(directory.contains(path.join(absolutePath, "file.coffee"))).toBe true - it "returns true if the path is a child of the directory's symlinked source path", -> - symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir') - symlinkDirectory = new Directory(symlinkPath) - realFilePath = require.resolve('./fixtures/dir/a') - expect(symlinkDirectory.contains(realFilePath)).toBe true - it "returns false if the directory's path is not a prefix of the path", -> expect(directory.contains('/not/relative')).toBe false + + describe "on #darwin or #linux", -> + it "returns true if the path is a child of the directory's symlinked source path", -> + symlinkPath = path.join(__dirname, 'fixtures', 'symlink-to-dir') + symlinkDirectory = new Directory(symlinkPath) + realFilePath = require.resolve('./fixtures/dir/a') + expect(symlinkDirectory.contains(realFilePath)).toBe true From 7ba4782ceb96ee09d7b3c157ae4d944c5ff71f08 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 16:37:54 -0800 Subject: [PATCH 08/23] Don't focus atom-spec.coffee --- spec/atom-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/atom-spec.coffee b/spec/atom-spec.coffee index e7d4d1e65..eaa958965 100644 --- a/spec/atom-spec.coffee +++ b/spec/atom-spec.coffee @@ -3,7 +3,7 @@ Exec = require('child_process').exec path = require 'path' ThemeManager = require '../src/theme-manager' -fdescribe "the `atom` global", -> +describe "the `atom` global", -> beforeEach -> window.rootView = new RootView From edc789173b1cb036be1b7e0fc390c4953b28664e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 16:44:03 -0800 Subject: [PATCH 09/23] Don't install commands on windows --- spec/command-installer-spec.coffee | 33 +++++++++++++++--------------- spec/spec-suite.coffee | 8 ++++---- src/window.coffee | 5 +++-- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/spec/command-installer-spec.coffee b/spec/command-installer-spec.coffee index 0e1ef7789..c6b8ee321 100644 --- a/spec/command-installer-spec.coffee +++ b/spec/command-installer-spec.coffee @@ -14,22 +14,23 @@ describe "install(commandPath, callback)", -> fs.removeSync(directory) if fs.existsSync(directory) - it "symlinks the command and makes it executable", -> - fs.writeFileSync(commandPath, 'test') - expect(fs.isFileSync(commandPath)).toBeTruthy() - expect(fs.isExecutableSync(commandPath)).toBeFalsy() - expect(fs.isFileSync(destinationPath)).toBeFalsy() + describe "on #darwin", -> + it "symlinks the command and makes it executable", -> + fs.writeFileSync(commandPath, 'test') + expect(fs.isFileSync(commandPath)).toBeTruthy() + expect(fs.isExecutableSync(commandPath)).toBeFalsy() + expect(fs.isFileSync(destinationPath)).toBeFalsy() - installDone = false - installError = null - installer.install commandPath, (error) -> - installDone = true - installError = error + installDone = false + installError = null + installer.install commandPath, (error) -> + installDone = true + installError = error - waitsFor -> installDone + waitsFor -> installDone - runs -> - expect(installError).toBeNull() - expect(fs.isFileSync(destinationPath)).toBeTruthy() - expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath) - expect(fs.isExecutableSync(destinationPath)).toBeTruthy() + runs -> + expect(installError).toBeNull() + expect(fs.isFileSync(destinationPath)).toBeTruthy() + expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath) + expect(fs.isExecutableSync(destinationPath)).toBeTruthy() diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index 599cf1d7a..bb7d41079 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -40,12 +40,12 @@ measure 'spec suite require time', -> 'user' # Run bundled package specs - requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.bundled ? [] - setSpecType('bundled') + #requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.bundled ? [] + #setSpecType('bundled') # Run user package specs - requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.user ? [] - setSpecType('user') + #requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.user ? [] + #setSpecType('user') if specDirectory = atom.getLoadSettings().specDirectory requireSpecs(specDirectory) diff --git a/src/window.coffee b/src/window.coffee index 6f7ec2d0a..c8254cf76 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -42,8 +42,9 @@ window.setUpDefaultEvents = -> # This method is only called when opening a real application window window.startEditorWindow = -> - installAtomCommand() - installApmCommand() + if process.platform is 'darwin' + installAtomCommand() + installApmCommand() windowEventHandler = new WindowEventHandler restoreDimensions() From fb6b8029bec3f65a12a4d1b500588b09af8bf417 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 16:58:42 -0800 Subject: [PATCH 10/23] Run bundled and user specs --- spec/spec-suite.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/spec-suite.coffee b/spec/spec-suite.coffee index bb7d41079..599cf1d7a 100644 --- a/spec/spec-suite.coffee +++ b/spec/spec-suite.coffee @@ -40,12 +40,12 @@ measure 'spec suite require time', -> 'user' # Run bundled package specs - #requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.bundled ? [] - #setSpecType('bundled') + requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.bundled ? [] + setSpecType('bundled') # Run user package specs - #requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.user ? [] - #setSpecType('user') + requireSpecs(path.join(packagePath, 'spec')) for packagePath in packagePaths.user ? [] + setSpecType('user') if specDirectory = atom.getLoadSettings().specDirectory requireSpecs(specDirectory) From 5b187e7a8ca118373560994b900d48dfc2f8f0f6 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 5 Nov 2013 17:35:44 -0800 Subject: [PATCH 11/23] Upgrade jasmine-tagged@0.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2dfc1f9ce..63bcdc78e 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "json-front-matter": "~0.1.3", "grunt-shell": "~0.3.1", "jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks", - "jasmine-tagged": "0.1.0", + "jasmine-tagged": "0.2.0", "request": "~2.27.0", "unzip": "~0.1.9" }, From face4a3f768fc86fcf92dc5e075afdedc70281ea Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 14:11:36 -0800 Subject: [PATCH 12/23] Force Unix line endings in spec/fixtures --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1247a5b9e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Specs depend on character counts, if we don't specify the line endings the +# fixtures will vary depending on platform +spec/fixtures/**/*.js text eol=lf +spec/fixtures/**/*.coffee text eol=lf +spec/fixtures/**/*.less text eol=lf +spec/fixtures/**/*.css text eol=lf +spec/fixtures/**/*.txt text eol=lf From 01f41207d4279439a4a3dc4ca525d9ab843e4b3e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 14:39:47 -0800 Subject: [PATCH 13/23] Update font specs for windows --- spec/editor-spec.coffee | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 5147a8ec8..5d3faa8b0 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -296,20 +296,28 @@ describe "Editor", -> expect(editor.css('font-family')).toBe '' describe "when the font family changes", -> + [fontFamily] = [] + + beforeEach -> + if process.platform is 'darwin' + fontFamily = "PCMyungjo" + else + fontFamily = "Consolas" + it "updates the font family of editors and recalculates dimensions critical to cursor positioning", -> editor.attachToDom(12) lineHeightBefore = editor.lineHeight charWidthBefore = editor.charWidth editor.setCursorScreenPosition [5, 6] - config.set("editor.fontFamily", "PCMyungjo") - expect(editor.css('font-family')).toBe 'PCMyungjo' + config.set("editor.fontFamily", fontFamily) + expect(editor.css('font-family')).toBe fontFamily expect(editor.charWidth).not.toBe charWidthBefore expect(editor.getCursorView().position()).toEqual { top: 5 * editor.lineHeight, left: 6 * editor.charWidth } newEditor = new Editor(editor.activeEditSession.copy()) newEditor.attachToDom() - expect(newEditor.css('font-family')).toBe 'PCMyungjo' + expect(newEditor.css('font-family')).toBe fontFamily describe "font size", -> beforeEach -> @@ -911,11 +919,19 @@ describe "Editor", -> beforeEach -> editor.setFontFamily('sans-serif') - it "correctly positions the cursor", -> - editor.setCursorBufferPosition([3, 30]) - expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 178} - editor.setCursorBufferPosition([3, Infinity]) - expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 353} + describe "on #darwin or #linux", -> + it "correctly positions the cursor", -> + editor.setCursorBufferPosition([3, 30]) + expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 178} + editor.setCursorBufferPosition([3, Infinity]) + expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 353} + + describe "on #win32", -> + it "correctly positions the cursor", -> + editor.setCursorBufferPosition([3, 30]) + expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 175} + editor.setCursorBufferPosition([3, Infinity]) + expect(editor.getCursorView().position()).toEqual {top: 3 * editor.lineHeight, left: 346} describe "autoscrolling", -> it "only autoscrolls when the last cursor is moved", -> From a8fe8ab982164e99395755e1f96bb15487ebbb48 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 14:52:28 -0800 Subject: [PATCH 14/23] Update keymap-spec.coffee paths for windows --- spec/keymap-spec.coffee | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/keymap-spec.coffee b/spec/keymap-spec.coffee index 015a822d5..2e9616856 100644 --- a/spec/keymap-spec.coffee +++ b/spec/keymap-spec.coffee @@ -1,3 +1,5 @@ +path = require 'path' + Keymap = require '../src/keymap' {$, $$, RootView} = require 'atom' @@ -351,7 +353,7 @@ describe "Keymap", -> describe ".getAllKeyMappings", -> it "returns the all bindings", -> - keymap.bindKeys '~/.atom/packages/dummy/keymaps/a.cson', '.command-mode', 'k': 'c' + keymap.bindKeys path.join('~', '.atom', 'packages', 'dummy', 'keymaps', 'a.cson'), '.command-mode', 'k': 'c' mappings = keymap.getAllKeyMappings() expect(mappings.length).toBe 1 @@ -363,20 +365,20 @@ describe "Keymap", -> describe ".determineSource", -> describe "for a package", -> it "returns ''", -> - expect(keymap.determineSource('~/.atom/packages/dummy/keymaps/a.cson')).toEqual 'dummy' + expect(keymap.determineSource(path.join('~', '.atom', 'packages', 'dummy', 'keymaps', 'a.cson'))).toEqual 'dummy' describe "for a linked package", -> it "returns ''", -> - expect(keymap.determineSource('/Users/john/github/dummy/keymaps/a.cson')).toEqual 'dummy' + expect(keymap.determineSource(path.join('Users', 'john', 'github', 'dummy', 'keymaps', 'a.cson'))).toEqual 'dummy' describe "for a user defined keymap", -> it "returns 'User'", -> - expect(keymap.determineSource('~/.atom/keymaps/a.cson')).toEqual 'User' + expect(keymap.determineSource(path.join('~', '.atom', 'keymaps', 'a.cson'))).toEqual 'User' describe "for a core keymap", -> it "returns 'Core'", -> - expect(keymap.determineSource('/Applications/Atom.app/.../node_modules/dummy/keymaps/a.cson')).toEqual 'Core' + expect(keymap.determineSource(path.join('Applications', 'Atom.app', '..', 'node_modules', 'dummy', 'keymaps', 'a.cson'))).toEqual 'Core' describe "for a linked core keymap", -> it "returns 'Core'", -> - expect(keymap.determineSource('/Users/john/github/atom/keymaps/a.cson')).toEqual 'Core' + expect(keymap.determineSource(path.join('Users', 'john', 'github', 'atom', 'keymaps', 'a.cson'))).toEqual 'Core' From 3f0f3267c192aa62d2551bfbad696a844859d41e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 16:40:14 -0800 Subject: [PATCH 15/23] Upgrade scandal@0.6.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9506b4f7e..71bccb9da 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "pathwatcher": "0.9.0", "pegjs": "0.7.0", "q": "0.9.7", - "scandal": "0.6.2", + "scandal": "0.6.3", "season": "0.14.0", "semver": "1.1.4", "space-pen": "2.0.0", From 3119ed9dfe1207da70ec0975e56e988c43f4883e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 16:45:10 -0800 Subject: [PATCH 16/23] Update project-spec.coffee for windows --- .gitattributes | 1 + spec/project-spec.coffee | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 1247a5b9e..97905fcb8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,4 @@ spec/fixtures/**/*.coffee text eol=lf spec/fixtures/**/*.less text eol=lf spec/fixtures/**/*.css text eol=lf spec/fixtures/**/*.txt text eol=lf +spec/fixtures/dir/**/* text eol=lf \ No newline at end of file diff --git a/spec/project-spec.coffee b/spec/project-spec.coffee index fc48ca191..ba00de225 100644 --- a/spec/project-spec.coffee +++ b/spec/project-spec.coffee @@ -406,7 +406,7 @@ describe "Project", -> paths = [] matches = [] waitsForPromise -> - project.scan /aaa/, paths: ['a-dir/'], (result) -> + project.scan /aaa/, paths: ["a-dir#{path.sep}"], (result) -> paths.push(result.filePath) matches = matches.concat(result.matches) From d6cb848503e09a746c2899df8f62f8735c3fb34e Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 16:52:58 -0800 Subject: [PATCH 17/23] Upgrade language-mode@0.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71bccb9da..8a00c419e 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "language-coffee-script": "0.2.0", "language-css": "0.2.0", "language-gfm": "0.8.0", - "language-git": "0.2.0", + "language-git": "0.3.0", "language-go": "0.2.0", "language-html": "0.2.0", "language-hyperlink": "0.3.0", From 98db48eae6ae8daa4f93bfe742f5206faf183d73 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 17:04:50 -0800 Subject: [PATCH 18/23] Fix syntax path matching --- src/text-mate-grammar.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-mate-grammar.coffee b/src/text-mate-grammar.coffee index bb520af2b..815d7ad0f 100644 --- a/src/text-mate-grammar.coffee +++ b/src/text-mate-grammar.coffee @@ -6,7 +6,7 @@ path = require 'path' {Emitter} = require 'emissary' {ScopeSelector} = require 'first-mate' -pathSplitRegex = new RegExp("[#{path.sep}.]") +pathSplitRegex = new RegExp("[#{"\\"+path.sep}.]") ### Internal ### From 28d7160c3b7889859ab5ba173568213d2791dc2d Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Wed, 6 Nov 2013 17:12:47 -0800 Subject: [PATCH 19/23] Update specs concerning stylesheet ids --- spec/theme-manager-spec.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/theme-manager-spec.coffee b/spec/theme-manager-spec.coffee index 0c7adfbeb..1f7638e43 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec/theme-manager-spec.coffee @@ -85,7 +85,7 @@ describe "ThemeManager", -> expect($('head style').length).toBe lengthBefore + 1 element = $('head style[id*="css.css"]') - expect(element.attr('id')).toBe cssPath + expect(element.attr('id')).toBe themeManager.stringToId(cssPath) expect(element.text()).toBe fs.readFileSync(cssPath, 'utf8') # doesn't append twice @@ -101,7 +101,7 @@ describe "ThemeManager", -> expect($('head style').length).toBe lengthBefore + 1 element = $('head style[id*="sample.less"]') - expect(element.attr('id')).toBe lessPath + expect(element.attr('id')).toBe themeManager.stringToId(lessPath) expect(element.text()).toBe """ #header { color: #4d926f; @@ -119,9 +119,9 @@ describe "ThemeManager", -> it "supports requiring css and less stylesheets without an explicit extension", -> themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'css') - expect($('head style[id*="css.css"]').attr('id')).toBe project.resolve('css.css') + expect($('head style[id*="css.css"]').attr('id')).toBe themeManager.stringToId(project.resolve('css.css')) themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'sample') - expect($('head style[id*="sample.less"]').attr('id')).toBe project.resolve('sample.less') + expect($('head style[id*="sample.less"]').attr('id')).toBe themeManager.stringToId(project.resolve('sample.less')) $('head style[id*="css.css"]').remove() $('head style[id*="sample.less"]').remove() From b69bc8ce71733913c9d03233fbd15fb4e13d293b Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 7 Nov 2013 09:22:41 -0800 Subject: [PATCH 20/23] Add a newline to the end of .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 97905fcb8..3b45561a0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,4 @@ spec/fixtures/**/*.coffee text eol=lf spec/fixtures/**/*.less text eol=lf spec/fixtures/**/*.css text eol=lf spec/fixtures/**/*.txt text eol=lf -spec/fixtures/dir/**/* text eol=lf \ No newline at end of file +spec/fixtures/dir/**/* text eol=lf From 38a3c0dbd3f3975835b9fed296d4eccf02dabcc2 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 7 Nov 2013 09:26:56 -0800 Subject: [PATCH 21/23] Simplify regexp escaping in text-mate-grammar.coffee --- src/text-mate-grammar.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-mate-grammar.coffee b/src/text-mate-grammar.coffee index 815d7ad0f..8cedf4c19 100644 --- a/src/text-mate-grammar.coffee +++ b/src/text-mate-grammar.coffee @@ -6,7 +6,7 @@ path = require 'path' {Emitter} = require 'emissary' {ScopeSelector} = require 'first-mate' -pathSplitRegex = new RegExp("[#{"\\"+path.sep}.]") +pathSplitRegex = new RegExp("[#{_.escapeRegExp(path.sep)}.]") ### Internal ### From 8754a0cbafedf7e3ce9e01fc56c4b8e24f20d934 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 7 Nov 2013 13:42:12 -0800 Subject: [PATCH 22/23] Upgrade to oniguruma@0.23.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a00c419e..21000ab37 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "mkdirp": "0.3.5", "less-cache": "0.9.0", "nslog": "0.1.0", - "oniguruma": "0.22.0", + "oniguruma": "0.23.0", "optimist": "0.4.0", "pathwatcher": "0.9.0", "pegjs": "0.7.0", From 43419fdef2bd30d6af68ed20919dd7056ac73317 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Thu, 7 Nov 2013 14:41:58 -0800 Subject: [PATCH 23/23] Normalize dom ids rather than remove --- src/theme-manager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index 34e0baac8..9993cf5aa 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -161,7 +161,7 @@ class ThemeManager # Internal-only: stringToId: (string) -> - string.replace(/\\/g, '') + string.replace(/\\/g, '/') # Internal-only: removeStylesheet: (stylesheetPath) ->