rails_complete 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mkd ADDED
@@ -0,0 +1,12 @@
1
+ Rails Complete
2
+ ==============
3
+
4
+ Adds auto-completion to the `rails` command.
5
+
6
+
7
+ License
8
+ -------
9
+
10
+ Copyright (c) 2010 Daniel Schierbeck, released under the MIT license.
11
+
12
+ See MIT-LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.test_files = Dir["test/test_*.rb"]
6
+ end
7
+
8
+ begin
9
+ require 'jeweler'
10
+ Jeweler::Tasks.new do |gem|
11
+ gem.name = "rails_complete"
12
+ gem.summary = "Bash completion for the rails command"
13
+ gem.description = "Tab completion for the rails command-line tool."
14
+ gem.email = "daniel.schierbeck@gmail.com"
15
+ gem.homepage = "http://github.com/dasch/rails-complete"
16
+ gem.authors = ["Daniel Schierbeck"]
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
21
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ comp_line = ENV["COMP_LINE"]
4
+ exit -1 if comp_line.nil?
5
+
6
+ parts = comp_line.scan(/\w+/)
7
+ exit 0 unless parts.size == 2
8
+
9
+ require 'rails_complete'
10
+
11
+ prefix = parts[1]
12
+
13
+ puts RailsComplete.complete(prefix)
@@ -0,0 +1,15 @@
1
+
2
+ module RailsComplete
3
+ class << self
4
+
5
+ COMMANDS = %w(server generate destroy plugin benchmarker profiler
6
+ console dbconsole application runner)
7
+
8
+ def complete(string)
9
+ string = string.chomp
10
+
11
+ COMMANDS.select {|cmd| cmd[0, string.length] == string }
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,49 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{rails_complete}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Daniel Schierbeck"]
12
+ s.date = %q{2010-09-19}
13
+ s.default_executable = %q{rails-complete.rb}
14
+ s.description = %q{Tab completion for the rails command-line tool.}
15
+ s.email = %q{daniel.schierbeck@gmail.com}
16
+ s.executables = ["rails-complete.rb"]
17
+ s.extra_rdoc_files = [
18
+ "README.mkd"
19
+ ]
20
+ s.files = [
21
+ "MIT-LICENSE",
22
+ "README.mkd",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "bin/rails-complete.rb",
26
+ "lib/rails_complete.rb",
27
+ "rails_complete.gemspec",
28
+ "test/test_completions.rb"
29
+ ]
30
+ s.homepage = %q{http://github.com/dasch/rails-complete}
31
+ s.rdoc_options = ["--charset=UTF-8"]
32
+ s.require_paths = ["lib"]
33
+ s.rubygems_version = %q{1.3.6}
34
+ s.summary = %q{Bash completion for the rails command}
35
+ s.test_files = [
36
+ "test/test_completions.rb"
37
+ ]
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
44
+ else
45
+ end
46
+ else
47
+ end
48
+ end
49
+
@@ -0,0 +1,14 @@
1
+
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+
6
+ require 'rails_complete'
7
+
8
+ class TestCompletions < Test::Unit::TestCase
9
+ def test_simple_completions
10
+ %w(s se ser serv serve server).each do |s|
11
+ assert_equal %w(server), RailsComplete.complete(s)
12
+ end
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_complete
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Daniel Schierbeck
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-09-19 00:00:00 +02:00
18
+ default_executable: rails-complete.rb
19
+ dependencies: []
20
+
21
+ description: Tab completion for the rails command-line tool.
22
+ email: daniel.schierbeck@gmail.com
23
+ executables:
24
+ - rails-complete.rb
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README.mkd
29
+ files:
30
+ - MIT-LICENSE
31
+ - README.mkd
32
+ - Rakefile
33
+ - VERSION
34
+ - bin/rails-complete.rb
35
+ - lib/rails_complete.rb
36
+ - rails_complete.gemspec
37
+ - test/test_completions.rb
38
+ has_rdoc: true
39
+ homepage: http://github.com/dasch/rails-complete
40
+ licenses: []
41
+
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --charset=UTF-8
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
53
+ version: "0"
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.3.6
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Bash completion for the rails command
68
+ test_files:
69
+ - test/test_completions.rb