rails_baseline 0.2.9 → 0.3.10
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.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/rails_baseline/command.rb +8 -15
- data/lib/rails_baseline/helper_functions.rb +12 -0
- data/lib/rails_baseline/recipes.txt +0 -2
- data/lib/rails_baseline/template.rb +0 -8
- data/lib/rails_baseline/version.rb +1 -1
- metadata +1 -2
- data/lib/rails_baseline/recipes.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 724fc5afdd2edddf3fe1a62914db0ee7de40e92c
|
4
|
+
data.tar.gz: ed0bff7b231187bde20ae59a717d4c01ecaa614d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bee05d425ce614865dd09a63157310b439256029029df1da35393960351c906a9bd382858f6e53711fcef9e59ca92563c9625a4e2c2ede03aa79b6a1bff4194
|
7
|
+
data.tar.gz: 4ad8b93ff38069e7ae0d5b4349496f0759f2c4c092371497f4a046e0e7dd5f204318c9e65c2ae1339ace33e3c9deb8e58473a9ff4f3668aa30efb07528e9079e
|
data/README.md
CHANGED
@@ -27,6 +27,10 @@ The list is available to view through lib/recipes.txt as well.
|
|
27
27
|
|
28
28
|
$ rails_baseline new APP_NAME
|
29
29
|
|
30
|
+
If you want to specify a Rails version for your new Rails project:
|
31
|
+
|
32
|
+
$ rails_baseline new APP_NAME --version RAILS_VERSION
|
33
|
+
|
30
34
|
Please replace APP_NAME with your new Rails app name.
|
31
35
|
|
32
36
|
#### Post-Wizard Configuration
|
@@ -40,8 +44,8 @@ After the wizard, please configure these files according to your title, details
|
|
40
44
|
|
41
45
|
and run migration for the pending migration files:
|
42
46
|
|
43
|
-
|
44
|
-
|
47
|
+
$ rake db:create
|
48
|
+
$ rake db:migrate
|
45
49
|
|
46
50
|
## Changelog
|
47
51
|
|
@@ -52,6 +56,7 @@ and run migration for the pending migration files:
|
|
52
56
|
4. 0.1.3 - Added Quiet Assets, Decent Exposure, Paperclip, State Machines, Delayed Job and Kaminari
|
53
57
|
5. 0.1.7 - Various fixes, and generate a static home page
|
54
58
|
6. 0.2.9 - Modularize code base, removed several gems
|
59
|
+
7. 0.3.10 - Refactor code, removed unused files, added optional version
|
55
60
|
|
56
61
|
## Contributing
|
57
62
|
|
@@ -4,13 +4,9 @@ module RailsBaseline
|
|
4
4
|
class Command < Thor
|
5
5
|
include Thor::Actions
|
6
6
|
desc "new APP_NAME", "create a new Rails app"
|
7
|
+
method_option :version, type: :string, description: 'Optional Rails version', default: nil
|
7
8
|
def new(name)
|
8
|
-
run_template(name)
|
9
|
-
end
|
10
|
-
|
11
|
-
desc "list", "list all recipes"
|
12
|
-
def list
|
13
|
-
list_all_recipes
|
9
|
+
run_template(name, options)
|
14
10
|
end
|
15
11
|
|
16
12
|
no_tasks do
|
@@ -21,20 +17,17 @@ module RailsBaseline
|
|
21
17
|
def green; "\033[32m" end
|
22
18
|
def yellow; "\033[33m" end
|
23
19
|
|
24
|
-
def run_template(name)
|
20
|
+
def run_template(name, options = {})
|
25
21
|
puts "#{bold}Generating and Running Template..."
|
26
22
|
template_path = File.join( File.dirname(__FILE__), 'template.rb' )
|
27
23
|
file = File.open( template_path )
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
puts "#{yellow}All recipes in order:#{clear}"
|
33
|
-
recipes_list_path = File.join( File.dirname(__FILE__), 'recipes.txt' )
|
34
|
-
File.open(recipes_list_path, "r").each_line.with_index do |line, index|
|
35
|
-
puts "#{index+1}. #{line}"
|
24
|
+
if options[:version]
|
25
|
+
system "rails _#{options[:version]}_ new #{name} -m #{file.path} --skip-bundle"
|
26
|
+
else
|
27
|
+
system "rails new #{name} -m #{file.path} --skip-bundle"
|
36
28
|
end
|
37
29
|
end
|
30
|
+
|
38
31
|
end
|
39
32
|
end
|
40
33
|
end
|
@@ -47,4 +47,16 @@ def multiple_choice(question, choices)
|
|
47
47
|
end
|
48
48
|
answer = ask_wizard("Enter your selection:") while !values.keys.include?(answer)
|
49
49
|
values[answer]
|
50
|
+
end
|
51
|
+
|
52
|
+
def after_bundler(&block)
|
53
|
+
@after_blocks << [@current_recipe, block]
|
54
|
+
end
|
55
|
+
|
56
|
+
def after_everything(&block)
|
57
|
+
@after_everything_blocks << [@current_recipe, block]
|
58
|
+
end
|
59
|
+
|
60
|
+
def before_config(&block)
|
61
|
+
@before_configs[@current_recipe] = block
|
50
62
|
end
|
@@ -7,7 +7,6 @@ Database(Mongoid, MySQL, Postgresql, SQLite)
|
|
7
7
|
Devise
|
8
8
|
ActiveAdmin
|
9
9
|
CanCanCan
|
10
|
-
Decent Exposure
|
11
10
|
Paperclip
|
12
11
|
State Machines
|
13
12
|
Delayed Job
|
@@ -18,7 +17,6 @@ Hirb
|
|
18
17
|
SASS
|
19
18
|
Bootstrap
|
20
19
|
Font Awesome
|
21
|
-
Liquid
|
22
20
|
jQuery Validate
|
23
21
|
jQuery dataTables
|
24
22
|
Kaminari
|
@@ -32,20 +32,12 @@ recipes = [
|
|
32
32
|
'bundler'
|
33
33
|
]
|
34
34
|
|
35
|
-
# >----------------------------[ Initial Setup ]------------------------------<
|
36
|
-
|
37
|
-
# @recipes = ["database", "mongoid", "devise", "activeadmin", "git", "sass"]
|
38
35
|
@database_choice = nil
|
39
|
-
|
40
36
|
@current_recipe = nil
|
41
37
|
@configs = {}
|
42
|
-
|
43
38
|
@after_blocks = []
|
44
|
-
def after_bundler(&block); @after_blocks << [@current_recipe, block]; end
|
45
39
|
@after_everything_blocks = []
|
46
|
-
def after_everything(&block); @after_everything_blocks << [@current_recipe, block]; end
|
47
40
|
@before_configs = {}
|
48
|
-
def before_config(&block); @before_configs[@current_recipe] = block; end
|
49
41
|
|
50
42
|
for recipe in recipes
|
51
43
|
@current_recipe = recipe
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_baseline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoon Wai Yan
|
@@ -30,7 +30,6 @@ files:
|
|
30
30
|
- lib/rails_baseline/helper_functions.rb
|
31
31
|
- lib/rails_baseline/old_template.rb
|
32
32
|
- lib/rails_baseline/recipes.txt
|
33
|
-
- lib/rails_baseline/recipes.yml
|
34
33
|
- lib/rails_baseline/template.rb
|
35
34
|
- lib/rails_baseline/template_configurations.rb
|
36
35
|
- lib/rails_baseline/template_configurations/active_admin.rb
|
File without changes
|