Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add beuaty pry & some usefull gems #241

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions composer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,10 @@ 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
end

## Email
Expand Down Expand Up @@ -1326,6 +1330,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]}
Expand Down Expand Up @@ -1451,6 +1456,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

Expand Down Expand Up @@ -1620,10 +1629,12 @@ 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
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
Expand All @@ -1635,8 +1646,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'
Expand Down Expand Up @@ -1848,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')
Expand Down Expand Up @@ -2602,6 +2625,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<

Expand Down Expand Up @@ -2707,12 +2731,25 @@ 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]
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
Expand Down Expand Up @@ -2824,6 +2861,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)
Expand Down