helproku 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE.txt +10 -8
- data/README.md +14 -2
- data/helproku.gemspec +1 -1
- data/lib/helproku.rb +73 -5
- data/lib/helproku/version.rb +2 -2
- metadata +2 -2
data/LICENSE.txt
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
Copyright (c) 2013 Gareth Tan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
License for Use
|
|
4
4
|
|
|
5
|
-
Permission is hereby granted
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
the following conditions:
|
|
5
|
+
Permission is hereby granted to any person obtaining a copy of this
|
|
6
|
+
software and associated documentation files (the "Software") to
|
|
7
|
+
use, copy, modify, and/or merge, provided that such activites do
|
|
8
|
+
not generate any profit for the person who uses, copes, modifies, and/or
|
|
9
|
+
merges the Software. The previously-granted rights are further subject
|
|
10
|
+
to the following conditions:
|
|
12
11
|
|
|
13
12
|
The above copyright notice and this permission notice shall be
|
|
14
13
|
included in all copies or substantial portions of the Software.
|
|
15
14
|
|
|
15
|
+
The original author be credited in all copies, modifications, and
|
|
16
|
+
merges of the Software.
|
|
17
|
+
|
|
16
18
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
19
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
20
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Helproku
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Helproku is a gem to make it easier to set up a Ruby on Rails application on Heroku. It commands Rails to set up the Postgres and SQLite databases in the right way, creates a Github repository for you, a Heroku app for you, and uploads everything to that Github repository.
|
|
4
|
+
|
|
5
|
+
In future relases Helproku will be able to add features to your app wholesale. For example, running `rails generate helproku:mailers` should set up Sendgrid on Heroku and Letter Opener for local development without you needing to type a single character more.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -18,7 +20,17 @@ Or install it yourself as:
|
|
|
18
20
|
|
|
19
21
|
## Usage
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
Helproku is best used in conjunction with a Rails application template, which is available on this repsository.
|
|
24
|
+
|
|
25
|
+
rails new [APP NAME] -m [LOCATION OF APPLICATION TEMPLATE]
|
|
26
|
+
|
|
27
|
+
You can alias this in .bash_profile to a command like `railsnew`, like such:
|
|
28
|
+
|
|
29
|
+
railsnew(){
|
|
30
|
+
rails new $1 -m [LOCATION OF APPLICATION TEMPLATE]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
which can then replace your `rails new` command.
|
|
22
34
|
|
|
23
35
|
## Contributing
|
|
24
36
|
|
data/helproku.gemspec
CHANGED
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
spec.description = %q{Helps you set up a Rails app with Heroku.}
|
|
12
12
|
spec.summary = %q{Initializes a Rails app for you, sets up Github, and creates a Heroku repository.}
|
|
13
13
|
spec.homepage = ""
|
|
14
|
-
spec.license = "
|
|
14
|
+
spec.license = "Custom"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
data/lib/helproku.rb
CHANGED
|
@@ -1,12 +1,80 @@
|
|
|
1
1
|
require "helproku/version"
|
|
2
2
|
|
|
3
3
|
module Helproku
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
module Generators
|
|
5
|
+
class InitGenerator < Rails::Generators::Base
|
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
def setup_databases
|
|
9
|
+
comment_lines "Gemfile", /sqlite3/
|
|
10
|
+
gsub_file "config/database.yml",
|
|
11
|
+
/adapter: sqlite3\n\s+database: db\/production.sqlite3/,
|
|
12
|
+
"adapter: postgresql\n database: db/production"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def include_common_gems
|
|
16
|
+
gem_group :development do
|
|
17
|
+
gem 'better_errors'
|
|
18
|
+
gem 'binding_of_caller'
|
|
19
|
+
gem 'sqlite3'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
gem_group :development, :test do
|
|
23
|
+
gem "rspec-rails"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
gem_group :production do
|
|
27
|
+
gem 'pg'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def set_version
|
|
32
|
+
append_to_file "Gemfile", "ruby '1.9.3'", after: "source 'https://rubygems.org'\n"
|
|
33
|
+
inside Rails.root do
|
|
34
|
+
run "bundle install"
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def setup_git
|
|
39
|
+
git :init
|
|
40
|
+
git add: "."
|
|
41
|
+
git commit: "-am 'Pretty awesome first commit!'"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def get_github_username
|
|
45
|
+
@gituser = ask "Enter your Github username:"
|
|
46
|
+
@project = Rails.application.class.parent_name.downcase
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def upload_git
|
|
50
|
+
run "curl -u '#{@gituser}' https://api.github.com/user/repos -d '{\"name\" : \"#{@project}\"}' "
|
|
51
|
+
git remote: "add origin git@github.com:#{@gituser}/#{@project}.git"
|
|
52
|
+
git push: "-u origin master"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def setup_heroku
|
|
56
|
+
inside Rails.root do
|
|
57
|
+
run "heroku create"
|
|
58
|
+
end
|
|
59
|
+
git push: "heroku master"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class DeviseGenerator < Rails::Generators::Base
|
|
64
|
+
# Should include the Devise gem, run install on devise,
|
|
65
|
+
# and generate the views. Also migrate the database.
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
class MailGenerator < Rails::Generators::Base
|
|
69
|
+
# Should set up Sendgrid for production and Letter Opener
|
|
70
|
+
# for development.
|
|
71
|
+
# Should also run the correct Heroku command to set up
|
|
72
|
+
# Sendgrid there.
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class PaperclipGenerator < Rails::Generators::Base
|
|
76
|
+
# Should include the paperclip gem, the aws-paperclip gem,
|
|
77
|
+
# and Figaro for AWS.
|
|
10
78
|
end
|
|
11
79
|
end
|
|
12
80
|
end
|
data/lib/helproku/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module Helproku
|
|
2
|
-
VERSION = "0.0.
|
|
3
|
-
end
|
|
2
|
+
VERSION = "0.0.2"
|
|
3
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: helproku
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -60,7 +60,7 @@ files:
|
|
|
60
60
|
- lib/helproku/version.rb
|
|
61
61
|
homepage: ''
|
|
62
62
|
licenses:
|
|
63
|
-
-
|
|
63
|
+
- Custom
|
|
64
64
|
post_install_message:
|
|
65
65
|
rdoc_options: []
|
|
66
66
|
require_paths:
|