Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d19080
commit 864f767
Showing
12 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2014 <Your name here> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
atom-rails | ||
========== | ||
|
||
Commands for Ruby on Rails development | ||
Commands for Ruby on Rails development. Porting the best features of [tpope's](https://twitter.com/tpope) awesome [vim-rails](https://github.com/tpope/vim-rails). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Keybindings require three things to be fully defined: A selector that is | ||
# matched against the focused element, the keystroke and the command to | ||
# execute. | ||
# | ||
# Below is a basic keybinding which registers on all platforms by applying to | ||
# the root workspace element. | ||
|
||
# For more detailed documentation see | ||
# https://atom.io/docs/latest/advanced/keymaps | ||
'.workspace': | ||
'ctrl-alt-o': 'atom-rails:toggle' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Model = require './model' | ||
|
||
module.exports = | ||
atomRailsView: null | ||
|
||
activate: (state) -> | ||
atom.workspaceView.command "atom-rails:switch-to-model", => @switchToModel() | ||
|
||
switchToModel: -> | ||
currentFile = atom.workspace.getActiveEditor().getPath() | ||
file = new Model(currentFile).path() | ||
atom.workspaceView.open(file) if file? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
fs = require 'fs' | ||
Path = require 'path' | ||
|
||
module.exports = | ||
class Model | ||
constructor: (@currentFile) -> | ||
|
||
path: -> | ||
if @currentFile.match /_controller\.rb$/ | ||
@getModel @currentFile | ||
|
||
getModel: (currentFile) -> | ||
"/Users/tomkadwill/.atom/packages/atom-rails/README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# See https://atom.io/docs/latest/creating-a-package#menus for more details | ||
'context-menu': | ||
'.overlayer': | ||
'Enable atom-rails': 'atom-rails:toggle' | ||
|
||
'menu': [ | ||
{ | ||
'label': 'Packages' | ||
'submenu': [ | ||
'label': 'atom-rails' | ||
'submenu': [ | ||
{ 'label': 'Toggle', 'command': 'atom-rails:toggle' } | ||
] | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "atom-rails", | ||
"main": "./lib/atom-rails", | ||
"version": "0.1.0", | ||
"description": "Commands for Ruby on Rails development", | ||
"author": "Tom Kadwill", | ||
"activationEvents": [ | ||
"atom-rails:switch-to-model" | ||
], | ||
"repository": "https://github.com/atom/atom-rails", | ||
"license": "MIT", | ||
"engines": { | ||
"atom": ">0.50.0" | ||
}, | ||
"dependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
AtomRails = require '../lib/atom-rails' | ||
|
||
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. | ||
# | ||
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` | ||
# or `fdescribe`). Remove the `f` to unfocus the block. | ||
|
||
describe "AtomRails", -> | ||
activationPromise = null | ||
|
||
beforeEach -> | ||
atom.workspaceView = new WorkspaceView | ||
activationPromise = atom.packages.activatePackage('atomRails') | ||
|
||
describe "when the atom-rails:toggle event is triggered", -> | ||
it "attaches and then detaches the view", -> | ||
expect(atom.workspaceView.find('.atom-rails')).not.toExist() | ||
|
||
# This is an activation event, triggering it will cause the package to be | ||
# activated. | ||
atom.workspaceView.trigger 'atom-rails:toggle' | ||
|
||
waitsForPromise -> | ||
activationPromise | ||
|
||
runs -> | ||
expect(atom.workspaceView.find('.atom-rails')).toExist() | ||
atom.workspaceView.trigger 'atom-rails:toggle' | ||
expect(atom.workspaceView.find('.atom-rails')).not.toExist() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
AtomRailsView = require '../lib/atom-rails-view' | ||
{WorkspaceView} = require 'atom' | ||
|
||
describe "AtomRailsView", -> | ||
it "has one valid test", -> | ||
expect("life").toBe "easy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// The ui-variables file is provided by base themes provided by Atom. | ||
// | ||
// See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less | ||
// for a full listing of what's available. | ||
@import "ui-variables"; | ||
|
||
.atom-rails { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
REMOVE ME |