herage 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4015c5e2ec6ed4f92953c92bc35a2f9442e317f5
4
+ data.tar.gz: 769ec9f8f22de323a9844454eeb0b0feef5cd8d1
5
+ SHA512:
6
+ metadata.gz: 32aa6b03e14d2ab4b095a285ce2ed3dbb49a393c656208fb076d129852e0d2c7f069941a2a8ede7a5be94acabcfdf886a6fbb7bf1411e7c91fe3ad3bd65b8c42
7
+ data.tar.gz: 81bd4e66b3be7ed6dcd12a9900b64158af909f6443e80f127f0c0fad7e505ffc64f0d4a402bf3ed41f4a055459b149141d0f7f2972c35089efa2fc8be17e6ae5
data/bin/herage CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'herage'
4
3
  require 'fileutils'
5
4
 
6
5
  app_name = ARGV[0]
@@ -10,6 +9,21 @@ if app_name.nil?
10
9
  exit
11
10
  end
12
11
 
12
+ if `which ruby` == '' || !`ruby --version`.include?('2.0')
13
+ puts "Please install Ruby 2.0 first (for example: http://rvm.io/)"
14
+ exit
15
+ end
16
+
17
+ if `which rails` == '' || !`rails --version`.include?('4.0')
18
+ puts "Please install Rails 4.0 first (gem install rails -v 4.0)"
19
+ exit
20
+ end
21
+
22
+ if `which heroku` == '' || !`heroku version`.include?('heroku-toolbelt')
23
+ puts "Please install the Heroku Toolbelt first: https://toolbelt.heroku.com/"
24
+ exit
25
+ end
26
+
13
27
  if app_name =~ /[^a-z]/
14
28
  puts "Usage:\nherage <app_name>"
15
29
  puts "<app_name> should be composed only by alphabetics characters, ie: \"awesomeapp\""
@@ -17,4 +31,4 @@ if app_name =~ /[^a-z]/
17
31
  end
18
32
 
19
33
  template_path = File.expand_path(File.join(__FILE__, '../../lib/template.rb'))
20
- exec "rails new #{app_name} -d postgresql -m #{template_path}"
34
+ exec "rails new #{app_name} -m #{template_path}"
@@ -4,13 +4,12 @@ require File.expand_path('../lib/herage/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["olistik"]
6
6
  gem.email = ["maurizio.demagnis@gmail.com"]
7
- gem.description = %q{A RubyonRails application generator tailored to a very opinionated set of requirements}
7
+ gem.description = %q{A Ruby on Rails application generator tailored to a very opinionated set of requirements}
8
8
  gem.summary = %q{Unleash the rage with Heroku and Rails}
9
9
  gem.homepage = ""
10
10
 
11
11
  gem.add_dependency 'pg'
12
- gem.add_dependency 'heroku', '~> 2.25.0'
13
- gem.add_dependency 'rails', '~> 3.2.6'
12
+ gem.add_dependency 'rails', '~> 4.0.0'
14
13
  gem.files = `git ls-files`.split($\)
15
14
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
@@ -1,3 +1,3 @@
1
1
  module Herage
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -7,32 +7,62 @@ git :init
7
7
  git add: "."
8
8
  git commit: "-a -m 'Genesis'"
9
9
 
10
- insert_into_file 'Gemfile', "ruby '1.9.3'\n", after: "source 'https://rubygems.org'\n"
10
+ insert_into_file 'Gemfile', "ruby '2.0.0'\n", after: "source 'https://rubygems.org'\n"
11
+
12
+ gsub_file 'Gemfile', /.*sqlite.*/, "\n"
13
+
14
+ gem_group :production do
15
+ gem 'pg'
16
+ gem 'rails_12factor'
17
+ gem 'unicorn'
18
+ end
11
19
 
12
- gem 'heroku'
13
20
  gem 'foreman'
14
- gem 'thin'
15
21
  gem 'haml-rails'
16
- gem 'twitter-bootstrap-rails', git: 'git://github.com/seyhunak/twitter-bootstrap-rails.git', branch: 'static'
22
+
17
23
  gem_group :development do
18
24
  gem 'pry'
25
+ gem 'sqlite3'
19
26
  end
27
+
20
28
  # removes comments from the Gemfile
21
29
  gsub_file 'Gemfile', /# .*\n/, ''
22
30
  # removes empty lines
23
31
  gsub_file 'Gemfile', /\s+\n/, "\n"
24
32
  gsub_file 'Gemfile', /\n+/, "\n"
25
33
 
26
- run 'bundle install --local'
27
- run 'rbenv rehash'
34
+ run 'bundle install --without production'
28
35
 
29
36
  remove_file 'public/index.html'
30
37
  git rm: 'public/index.html'
31
38
  generate(:controller, 'home index')
32
39
  route "root :to => 'home#index'"
33
40
 
41
+ create_file 'Procfile', 'web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb'
34
42
 
35
- create_file 'Procfile', 'web: bundle exec thin start -p $PORT'
43
+ create_file 'config/unicorn.rb' do
44
+ <<-eos
45
+ worker_processes 1
46
+ timeout 30
47
+ preload_app true
48
+ before_fork do |server, worker|
49
+ Signal.trap 'TERM' do
50
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
51
+ Process.kill 'QUIT', Process.pid
52
+ end
53
+ defined?(ActiveRecord::Base) and
54
+ ActiveRecord::Base.connection.disconnect!
55
+ end
56
+ after_fork do |server, worker|
57
+ Signal.trap 'TERM' do
58
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to
59
+ sent QUIT'
60
+ end
61
+ defined?(ActiveRecord::Base) and
62
+ ActiveRecord::Base.establish_connection
63
+ end
64
+ eos
65
+ end
36
66
 
37
67
  create_file '.env', ''
38
68
 
@@ -43,8 +73,6 @@ append_file '.gitignore' do
43
73
  eos
44
74
  end
45
75
 
46
- gsub_file 'config/database.yml', /(username: ).+$/, '\1olistik'
47
-
48
76
  rake "db:create", env: 'development'
49
77
  rake "db:create", env: 'test'
50
78
 
@@ -83,7 +111,6 @@ create_file 'app/assets/javascripts/application.js' do
83
111
  <<-eos
84
112
  //= require jquery
85
113
  //= require jquery_ujs
86
- //= require bootstrap
87
114
  //= require_tree .
88
115
  eos
89
116
  end
@@ -94,7 +121,6 @@ create_file 'app/assets/stylesheets/application.css' do
94
121
  /*
95
122
  * the top of the compiled file, but it's generally better to create a new file per style scope.
96
123
  *= require_self
97
- *= require bootstrap
98
124
  *= require_tree .
99
125
  */
100
126
  eos
@@ -130,13 +156,13 @@ ____
130
156
  License
131
157
  -------
132
158
 
133
- Copyright (c) 2012 Maurizio de Magnis. Distributed under the MIT License. See LICENSE.txt for further details.
159
+ Copyright (c) 2013 Maurizio de Magnis. Distributed under the MIT License. See LICENSE.txt for further details.
134
160
  eos
135
161
  end
136
162
 
137
163
  create_file 'LICENSE.txt' do
138
164
  <<-eos
139
- Copyright (c) 2012 Maurizio De Magnis
165
+ Copyright (c) 2013 Maurizio De Magnis
140
166
 
141
167
  Permission is hereby granted, free of charge, to any person obtaining
142
168
  a copy of this software and associated documentation files (the
@@ -162,6 +188,6 @@ end
162
188
  git add: "."
163
189
  git commit: "-a -m 'Setup'"
164
190
 
165
- run "heroku apps:create --stack cedar #{app_name}"
191
+ run "heroku apps:create #{app_name}"
166
192
  run 'git push heroku master'
167
193
  run 'heroku run rake db:migrate'
metadata CHANGED
@@ -1,66 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - olistik
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-06-13 00:00:00.000000000 Z
11
+ date: 2013-07-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: pg
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: heroku
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 2.25.0
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 2.25.0
46
27
  - !ruby/object:Gem::Dependency
47
28
  name: rails
48
29
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
30
  requirements:
51
31
  - - ~>
52
32
  - !ruby/object:Gem::Version
53
- version: 3.2.6
33
+ version: 4.0.0
54
34
  type: :runtime
55
35
  prerelease: false
56
36
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
37
  requirements:
59
38
  - - ~>
60
39
  - !ruby/object:Gem::Version
61
- version: 3.2.6
62
- description: A RubyonRails application generator tailored to a very opinionated set
63
- of requirements
40
+ version: 4.0.0
41
+ description: A Ruby on Rails application generator tailored to a very opinionated
42
+ set of requirements
64
43
  email:
65
44
  - maurizio.demagnis@gmail.com
66
45
  executables:
@@ -80,26 +59,25 @@ files:
80
59
  - lib/template.rb
81
60
  homepage: ''
82
61
  licenses: []
62
+ metadata: {}
83
63
  post_install_message:
84
64
  rdoc_options: []
85
65
  require_paths:
86
66
  - lib
87
67
  required_ruby_version: !ruby/object:Gem::Requirement
88
- none: false
89
68
  requirements:
90
- - - ! '>='
69
+ - - '>='
91
70
  - !ruby/object:Gem::Version
92
71
  version: '0'
93
72
  required_rubygems_version: !ruby/object:Gem::Requirement
94
- none: false
95
73
  requirements:
96
- - - ! '>='
74
+ - - '>='
97
75
  - !ruby/object:Gem::Version
98
76
  version: '0'
99
77
  requirements: []
100
78
  rubyforge_project:
101
- rubygems_version: 1.8.23
79
+ rubygems_version: 2.0.3
102
80
  signing_key:
103
- specification_version: 3
81
+ specification_version: 4
104
82
  summary: Unleash the rage with Heroku and Rails
105
83
  test_files: []