rake-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +27 -0
- data/Rakefile +2 -0
- data/lib/rake-rails.rb +2 -0
- data/lib/rake-rails/railtie.rb +10 -0
- data/lib/rake-rails/tasks.rb +50 -0
- data/lib/rake-rails/version.rb +5 -0
- data/rake-rails.gemspec +19 -0
- metadata +72 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Andy Lindeman
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# rake-rails
|
2
|
+
|
3
|
+
Reduces the confusion for newcomers by allowing `rails` commands to be run via
|
4
|
+
`rake`. Inspiration from [@j3](http://twitter.com/j3)'s presentation
|
5
|
+
[Adventures on the Golden Path](https://speakerdeck.com/u/j3/p/adventures-on-the-golden-path).
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
Add to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'rake-rails'
|
13
|
+
```
|
14
|
+
|
15
|
+
Install via:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ bundle install
|
19
|
+
```
|
20
|
+
|
21
|
+
Use right away!
|
22
|
+
|
23
|
+
```
|
24
|
+
$ rake generate model Post title:string
|
25
|
+
$ rake console
|
26
|
+
$ rake server
|
27
|
+
```
|
data/Rakefile
ADDED
data/lib/rake-rails.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
module Rake
|
4
|
+
module Rails
|
5
|
+
TASKS = {
|
6
|
+
"generate" => "Generate new code (short-cut alias: \"g\")",
|
7
|
+
"console" => "Start the Rails console (short-cut alias: \"c\")",
|
8
|
+
"server" => "Start the Rails server (short-cut alias: \"s\")",
|
9
|
+
"dbconsole" => "Start a console for the database specified in config/database.yml (short-cut alias: \"db\")",
|
10
|
+
|
11
|
+
"application" => "Generate the Rails application code",
|
12
|
+
"destroy" => "Undo code generated with \"generate\"",
|
13
|
+
"benchmarker" => "See how fast a piece of code runs",
|
14
|
+
"profiler" => "Get profile information from a piece of code",
|
15
|
+
"plugin" => "Install a plugin",
|
16
|
+
"runner" => "Run a piece of code in the application environment"
|
17
|
+
}
|
18
|
+
|
19
|
+
ALIASES = {
|
20
|
+
"g" => "generate",
|
21
|
+
"c" => "console",
|
22
|
+
"s" => "server",
|
23
|
+
"db" => "dbcsonsole"
|
24
|
+
}
|
25
|
+
|
26
|
+
class Tasks
|
27
|
+
include Rake::DSL
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
TASKS.each do |command, description|
|
31
|
+
desc description
|
32
|
+
task command do
|
33
|
+
prevent_additional_arguments_from_running_as_tasks
|
34
|
+
require 'rails/cli'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
ALIASES.each do |alias_command, command|
|
39
|
+
task alias_command => command
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def prevent_additional_arguments_from_running_as_tasks
|
46
|
+
Rake.application.top_level_tasks.clear
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/rake-rails.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rake-rails/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Andy Lindeman"]
|
6
|
+
gem.email = ["alindeman@gmail.com"]
|
7
|
+
gem.description = %q{Allows `rails` commands to be run via `rake`. For example: `rake generate`}
|
8
|
+
gem.summary = %q{Reduces the confusion for newcomers by allowing `rails` commands to be run via `rake`.}
|
9
|
+
gem.homepage = "https://github.com/alindeman/rake-rails"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "rake-rails"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Rake::Rails::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency "rake"
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rake-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andy Lindeman
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: ! 'Allows `rails` commands to be run via `rake`. For example: `rake generate`'
|
31
|
+
email:
|
32
|
+
- alindeman@gmail.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- .gitignore
|
38
|
+
- Gemfile
|
39
|
+
- LICENSE
|
40
|
+
- README.md
|
41
|
+
- Rakefile
|
42
|
+
- lib/rake-rails.rb
|
43
|
+
- lib/rake-rails/railtie.rb
|
44
|
+
- lib/rake-rails/tasks.rb
|
45
|
+
- lib/rake-rails/version.rb
|
46
|
+
- rake-rails.gemspec
|
47
|
+
homepage: https://github.com/alindeman/rake-rails
|
48
|
+
licenses: []
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 1.8.24
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Reduces the confusion for newcomers by allowing `rails` commands to be run
|
71
|
+
via `rake`.
|
72
|
+
test_files: []
|