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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3d86b901aabc84fc45ea951418d0f24628f659b
4
- data.tar.gz: 7770ad54d1fe1dc95759cb3076d9c02d9b3cc730
3
+ metadata.gz: 724fc5afdd2edddf3fe1a62914db0ee7de40e92c
4
+ data.tar.gz: ed0bff7b231187bde20ae59a717d4c01ecaa614d
5
5
  SHA512:
6
- metadata.gz: e704d004f2efc5467fe93826f358a0a226f3291f33669b8209ca92791726c1f305ca9203897288b7f48e55a2a58e00251adbc8a604e885daadbac6b341c4e8db
7
- data.tar.gz: 2c2e6f7406997eb40befd6375afd00e1c6f08219c6a44696082750b74237fb780ad90a8d614c3f180d0e9ed198c1d2b1d5bd76bda2d8fa92c655b2ef5f386179
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
- $ rake db:create
44
- $ rake db:migrate
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
- system "rails new #{name} -m #{file.path} --skip-bundle"
29
- end
30
-
31
- def list_all_recipes
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
@@ -1,3 +1,3 @@
1
1
  module RailsBaseline
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.10"
3
3
  end
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.2.9
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