From 101aed8237fc9618f7fdec3da716b9871985ed9c Mon Sep 17 00:00:00 2001 From: kvokka Date: Sat, 2 Jan 2016 22:40:50 +0100 Subject: [PATCH 1/5] Pry beuaty added & moved pry to dev only --- composer.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/composer.rb b/composer.rb index 8d0f479..8cd8fd1 100644 --- a/composer.rb +++ b/composer.rb @@ -2711,8 +2711,15 @@ def set_default_role prefs[:pry] = true if config['pry'] if prefs[:pry] say_wizard "recipe adding pry-rails gem" - add_gem 'pry-rails', :group => [:development, :test] - add_gem 'pry-rescue', :group => [:development, :test] + add_gem 'pry-rails', :group => [:development] + add_gem 'pry-rescue', :group => [:development] + + #add some beauty to irb + add_gem 'pry-doc', :group => [:development] + add_gem 'pry-state', :group => [:development] + add_gem 'pry-coolline', :group => [:development] + add_gem 'hirb', :group => [:development] + add_gem 'awesome_print', require: "ap" , :group => [:development] end ## Rubocop From 39be18b6d497569fe078c91587338ee5b4498a18 Mon Sep 17 00:00:00 2001 From: kvokka Date: Sat, 2 Jan 2016 22:44:01 +0100 Subject: [PATCH 2/5] Guard live reload added --- composer.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.rb b/composer.rb index 8cd8fd1..56963ed 100644 --- a/composer.rb +++ b/composer.rb @@ -1624,6 +1624,7 @@ def which(cmd) add_gem 'guard-bundler', :group => :development add_gem 'guard-rails', :group => :development add_gem 'guard-rspec', :group => :development + add_gem 'guard-livereload', :group => :development add_gem 'rb-inotify', :group => :development, :require => false add_gem 'rb-fsevent', :group => :development, :require => false add_gem 'rb-fchange', :group => :development, :require => false From 8a7bd9ab9c618d88ee2871cd62aac55288509224 Mon Sep 17 00:00:00 2001 From: kvokka Date: Sun, 3 Jan 2016 09:52:12 +0100 Subject: [PATCH 3/5] Font awesome added --- composer.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.rb b/composer.rb index 56963ed..532baa2 100644 --- a/composer.rb +++ b/composer.rb @@ -1221,6 +1221,9 @@ def which(cmd) ["Bootstrap 3.3", "bootstrap3"], ["Bootstrap 2.3", "bootstrap2"], ["Zurb Foundation 5.5", "foundation5"], ["Zurb Foundation 4.0", "foundation4"], ["Simple CSS", "simple"]] unless prefs.has_key? :frontend + if (prefer :frontend, 'bootstrap3') || (prefer :frontend, 'bootstrap2') + prefs[:icon_lib] = multiple_choice "Add font awesome icon lib?", [["None", "none"], + ["Font awesome", "font_awesome"]] unless prefs.has_key? :icon_lib end ## Email @@ -1636,8 +1639,10 @@ def which(cmd) case prefs[:frontend] when 'bootstrap2' add_gem 'bootstrap-sass', '~> 2.3.2.2' + add_gem 'font-awesome-rails' if prefer :icon_lib, 'font_awesome' when 'bootstrap3' add_gem 'bootstrap-sass' + add_gem 'font-awesome-rails' if prefer :icon_lib, 'font_awesome' when 'foundation4' add_gem 'zurb-foundation', '~> 4.3.2' add_gem 'compass-rails', '~> 1.1.2' From 0ba7136bea1fae3b2a9ce4882d5bd73fc73a99ac Mon Sep 17 00:00:00 2001 From: kvokka Date: Sun, 3 Jan 2016 10:12:28 +0100 Subject: [PATCH 4/5] Chrome meta panel --- composer.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/composer.rb b/composer.rb index 532baa2..570ca6e 100644 --- a/composer.rb +++ b/composer.rb @@ -1329,6 +1329,7 @@ def which(cmd) local_env_file: #{prefs[:local_env_file]} quiet_assets: #{prefs[:quiet_assets]} better_errors: #{prefs[:better_errors]} + chrome_rails_panel: #{prefs[:chrome_rails_panel]} pry: #{prefs[:pry]} rvmrc: #{prefs[:rvmrc]} dashboard: #{prefs[:dashboard]} @@ -1454,6 +1455,10 @@ def which(cmd) choose Enter your selection: [#{prefs[:pry]}] option Use or create a project-specific rvm gemset? choose Enter your selection: [#{prefs[:rvmrc]}] +option Use additional external icon lib? +choose Enter your selection: [#{prefs[:icon_lib]}] +option Add chrome rails panel(best for AJAX debug)? +choose Enter your selection: [#{prefs[:chrome_rails_panel]}] TEXT end @@ -2608,6 +2613,7 @@ def set_default_role config['better_errors'] = yes_wizard?("Improve error reporting with 'better_errors' during development?") if true && true unless config.key?('better_errors') || prefs.has_key?(:better_errors) config['pry'] = yes_wizard?("Use 'pry' as console replacement during development and test?") if true && true unless config.key?('pry') || prefs.has_key?(:pry) config['rubocop'] = yes_wizard?("Use 'rubocop' to ensure that your code conforms to the Ruby style guide?") if true && true unless config.key?('rubocop') || prefs.has_key?(:rubocop) +config['chrome_rails_panel'] = yes_wizard?("Use chrome meta panel (easy AJAX debug)?") if true && true unless config.key?('chrome_rails_panel') || prefs.has_key?(:chrome_rails_panel) @configs[@current_recipe] = config # >---------------------------- recipes/extras.rb ----------------------------start< @@ -2713,6 +2719,12 @@ def set_default_role end end +prefs[:chrome_rails_panel] = true if config['chrome_rails_panel'] +if prefs[:chrome_rails_panel] + say_wizard 'Add rails meta panel on your chrome browser. You need this https://chrome.google.com/webstore/detail/railspanel/gjpfobpafnhjhbajcjgccbbdofdckggg' + add_gem 'meta_request', :group => [:development] +end + # Pry prefs[:pry] = true if config['pry'] if prefs[:pry] @@ -2837,6 +2849,7 @@ def set_default_role redacted_prefs = prefs.clone redacted_prefs.delete(:ban_spiders) redacted_prefs.delete(:better_errors) +redacted_prefs.delete(:chrome_rails_panel) redacted_prefs.delete(:pry) redacted_prefs.delete(:dev_webserver) redacted_prefs.delete(:git) From a715f96756a2cdd4d90975396d3b231c7f81329a Mon Sep 17 00:00:00 2001 From: kvokka Date: Sun, 3 Jan 2016 11:39:25 +0100 Subject: [PATCH 5/5] shoulda-matchers rspec added & init setup & last version patch --- composer.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/composer.rb b/composer.rb index 570ca6e..c353e48 100644 --- a/composer.rb +++ b/composer.rb @@ -1223,7 +1223,8 @@ def which(cmd) ["Simple CSS", "simple"]] unless prefs.has_key? :frontend if (prefer :frontend, 'bootstrap3') || (prefer :frontend, 'bootstrap2') prefs[:icon_lib] = multiple_choice "Add font awesome icon lib?", [["None", "none"], - ["Font awesome", "font_awesome"]] unless prefs.has_key? :icon_lib + ["Font awesome", "font_awesome"]] unless prefs.has_key? :icon_lib + end end ## Email @@ -1628,6 +1629,7 @@ def which(cmd) add_gem 'database_cleaner', :group => :test add_gem 'launchy', :group => :test add_gem 'selenium-webdriver', :group => :test + add_gem 'shoulda-matchers', :group => :test if prefer :continuous_testing, 'guard' add_gem 'guard-bundler', :group => :development add_gem 'guard-rails', :group => :development @@ -1859,6 +1861,16 @@ def which(cmd) stage_three do say_wizard "recipe stage three" if prefer :tests, 'rspec' + #Better hide it into other gem + File.open( 'spec/support/shoulda.rb', 'w' ) {|f| f.write ["require 'bundler/setup'", + "::Bundler.require(:default, :test)", + "require 'shoulda/matchers'", + "Shoulda::Matchers.configure do |config|", + " config.integrate do |with|", + " with.test_framework :rspec", + " with.library :rails", + " end", + "end"].join("\n") } if prefer :authentication, 'devise' generate 'testing:configure devise -f' if (prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable')