redcar_plugin 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +76 -0
- data/bin/redcar_plugin +9 -0
- data/lib/redcar_plugin.rb +73 -0
- data/repos.yaml +46 -0
- metadata +69 -0
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
Redcar plugin manager
|
2
|
+
=====================
|
3
|
+
|
4
|
+
Redcar plugin manager is simple command-line utility to help you install,update and delete [Redcar](http://redcareditor.com/) [plugins](https://github.com/redcar/redcar/wiki/Redcar-Plugins).
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
Just install the [gem](http://rubygems.com/redcar_plugin). Depends on [thor](https://github.com/wycats/thor).
|
10
|
+
> $ [sudo] gem install redcar_plugin
|
11
|
+
|
12
|
+
Usage
|
13
|
+
-----
|
14
|
+
|
15
|
+
### Install plugin
|
16
|
+
> $ redcar_plugin install plugin_name
|
17
|
+
|
18
|
+
### Uninstall plugin
|
19
|
+
|
20
|
+
> $ redcar_uninstall plugin_name
|
21
|
+
|
22
|
+
### Update plugin
|
23
|
+
|
24
|
+
> $ redcar_plugin update plugin_name
|
25
|
+
|
26
|
+
### Update all plugins
|
27
|
+
|
28
|
+
> $ redcar_plugin update_all
|
29
|
+
|
30
|
+
### List installed plugins
|
31
|
+
|
32
|
+
> $ redcar_plugin installed
|
33
|
+
|
34
|
+
### List avaible plugins
|
35
|
+
|
36
|
+
> $ redcar_plugin list
|
37
|
+
|
38
|
+
Contribution
|
39
|
+
------------
|
40
|
+
|
41
|
+
redcar_plugin command relies on repos.yaml which describes the name and url of the plugins.
|
42
|
+
So if you like your plugin to be available for installation through this tool, please fork the repo and add details about your plugin.
|
43
|
+
|
44
|
+
Meta
|
45
|
+
----
|
46
|
+
|
47
|
+
+ Author: Mitko Kostov
|
48
|
+
+ Website: [http://fireinside.me](http://fireinside.me)
|
49
|
+
+ Github: [mytrile](https://github.com/mytrile)
|
50
|
+
+ Twitter: [@mytrile](http://twitter.com/mytrile)
|
51
|
+
|
52
|
+
LICENSE
|
53
|
+
-------
|
54
|
+
|
55
|
+
### The MIT License
|
56
|
+
|
57
|
+
Copyright (c) 2011 Mitko Kostov
|
58
|
+
|
59
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
60
|
+
a copy of this software and associated documentation files (the
|
61
|
+
"Software"), to deal in the Software without restriction, including
|
62
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
63
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
64
|
+
permit persons to whom the Software is furnished to do so, subject to
|
65
|
+
the following conditions:
|
66
|
+
|
67
|
+
The above copyright notice and this permission notice shall be
|
68
|
+
included in all copies or substantial portions of the Software.
|
69
|
+
|
70
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
71
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
72
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
73
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
74
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
75
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
76
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bin/redcar_plugin
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
REPOS_FILE = File.join(File.dirname(__FILE__), "../repos.yaml")
|
2
|
+
class RedcarPlugin < Thor
|
3
|
+
|
4
|
+
def initialize(args=[], options={}, config={})
|
5
|
+
@list = YAML.load_file(REPOS_FILE)
|
6
|
+
@plugins_dir = "#{ENV['HOME']}/.redcar/plugins/"
|
7
|
+
@installed_plugins = Dir.entries(@plugins_dir).delete_if {|name| name =="." || name ==".."}
|
8
|
+
super(args,options,config)
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "install PLUGIN_NAME", "Install plugin PLUGIN_NAME"
|
12
|
+
def install(plugin_name)
|
13
|
+
name = plugin_name
|
14
|
+
url = @list['repos'][plugin_name]['url']
|
15
|
+
clone_repo(name,url)
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "update PLUGIN_NAME", "Update plugin PLUGIN_NAME"
|
19
|
+
def update(plugin_name)
|
20
|
+
if @installed_plugins.include?(plugin_name)
|
21
|
+
command = "cd #{@plugins_dir}#{plugin_name} && git pull"
|
22
|
+
puts "Plugin #{plugin_name} successfully updated" if system(command)
|
23
|
+
else
|
24
|
+
puts "Plugin #{plugin_name} not installed"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "update_all", "Update all plugins"
|
29
|
+
def update_all
|
30
|
+
@installed_plugins.each do |name|
|
31
|
+
command = "cd #{@plugins_dir}#{name} && git pull"
|
32
|
+
system("cd #{@plugins_dir}#{name} && git pull")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "delete PLUGIN_NAME", "Delete plugin PLUGIN_NAME"
|
37
|
+
def uninstall(plugin_name)
|
38
|
+
if @installed_plugins.include?(plugin_name)
|
39
|
+
command = "rm -rf #{@plugins_dir}#{plugin_name}"
|
40
|
+
puts "Plugin #{plugin_name} successfully deleted" if system(command)
|
41
|
+
else
|
42
|
+
puts "Plugin is not installed"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "installed", "List of installed plugins"
|
47
|
+
def installed
|
48
|
+
puts ''
|
49
|
+
puts " *** LIST OF INSTALLED PLUGINS ***"
|
50
|
+
puts ''
|
51
|
+
@installed_plugins.each {|name| puts name}
|
52
|
+
puts ''
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "list", "List of available plugins"
|
56
|
+
def list
|
57
|
+
puts ''
|
58
|
+
puts " *** LIST OF AVAILBLE PLUGINS ***"
|
59
|
+
puts ''
|
60
|
+
@list['repos'].each do |key, value|
|
61
|
+
puts "* #{key} - #{value['description']}"
|
62
|
+
end
|
63
|
+
puts ''
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def clone_repo(name,url)
|
69
|
+
puts "Plugin url: #{url}"
|
70
|
+
command = "git clone #{url} #{@plugins_dir}/#{name}"
|
71
|
+
puts "Plugin #{name} successfully installed" if system(command)
|
72
|
+
end
|
73
|
+
end
|
data/repos.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
repos:
|
2
|
+
go-to-github:
|
3
|
+
url: https://github.com/jablkopp/go-to-github.git
|
4
|
+
description: Show current file in github
|
5
|
+
github_viewer:
|
6
|
+
url: https://github.com/aokai/redcar_github_viewer.git
|
7
|
+
description: Small Plugin that allows browsing Github-Repositories
|
8
|
+
rsense:
|
9
|
+
url: https://github.com/Samsinite/rsense.git
|
10
|
+
description: Highly precise code completion for Ruby
|
11
|
+
gccsense:
|
12
|
+
url: https://github.com/Samsinite/gccsense.git
|
13
|
+
description: Highly precise code completion for C/C++
|
14
|
+
redcar-debug:
|
15
|
+
url: https://github.com/timfel/redcar-debug.git
|
16
|
+
description: General debugger interface to allow integration of remotely attaching commandline-driven debuggers
|
17
|
+
redcar-pastie:
|
18
|
+
url: https://github.com/antono/redcar-pastie.git
|
19
|
+
description: Support for Pastie, Gist and other patebins
|
20
|
+
redcar-help:
|
21
|
+
url: https://github.com/wcherry/redcar-help.git
|
22
|
+
description: Help system for Redcar
|
23
|
+
touchy:
|
24
|
+
url: https://github.com/mscharley/touchy.git
|
25
|
+
description: Adds a "Touch file" option to the project plugin's context menu.
|
26
|
+
code-package-view:
|
27
|
+
url: https://github.com/kattrali/redcar-code-package-view.git
|
28
|
+
description: View Directories in Redcar as grouped as packages
|
29
|
+
save-all-on-lose-focus:
|
30
|
+
url: https://github.com/rdp/redcar-save-all-on-lose-focus.git
|
31
|
+
description: Save all tabs when you "alt+tab" away form redcar
|
32
|
+
close-tabs:
|
33
|
+
url: https://github.com/crnixon/redcar-close-tabs.git
|
34
|
+
description: Close all tabs or close all tabs except the current one within a project
|
35
|
+
associated_file:
|
36
|
+
url: https://github.com/coffeeaddict/redcar_associated_file.git
|
37
|
+
description: Open an associated file (view, controller, test, model, fixture) with a keystroke
|
38
|
+
storytracker:
|
39
|
+
url: https://github.com/kattrali/redcar-storytracker.git
|
40
|
+
description: Basic Pivotal Tracker integration for the redcar text editor
|
41
|
+
hotswap:
|
42
|
+
url: https://github.com/kattrali/redcar-hotswap.git
|
43
|
+
description: Opens a context menu for opening a related file or running arbitrary Ruby commands
|
44
|
+
vimly:
|
45
|
+
url: https://github.com/kattrali/redcar-vimly.git
|
46
|
+
description: Some vim-like commands for the Redcar Editor
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redcar_plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: "0.3"
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mitko Kostov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-01 00:00:00 +03:00
|
14
|
+
default_executable: redcar_plugin
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: thor
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
description: A scripting framework that replaces rake, sake and rubigen
|
28
|
+
email: mitko.kostov@gmail.com
|
29
|
+
executables:
|
30
|
+
- redcar_plugin
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files: []
|
34
|
+
|
35
|
+
files:
|
36
|
+
- lib/redcar_plugin.rb
|
37
|
+
- bin/redcar_plugin
|
38
|
+
- README.md
|
39
|
+
- repos.yaml
|
40
|
+
has_rdoc: true
|
41
|
+
homepage: http://github.com/mytrile/redcar_plugin
|
42
|
+
licenses: []
|
43
|
+
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.6.2
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: A scripting framework that replaces rake, sake and rubigen
|
68
|
+
test_files: []
|
69
|
+
|