Class: ProxyRb::Initializers::RSpecInitializer
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- ProxyRb::Initializers::RSpecInitializer
- Includes:
- Thor::Actions
- Defined in:
- lib/proxy_rb/initializer.rb
Overview
Add proxy_rb + rspec to project
Instance Method Summary collapse
Instance Method Details
#create_helper ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/proxy_rb/initializer.rb', line 76 def create_helper file = 'spec/spec_helper.rb' creator = if File.exist? file :append_to_file else :create_file end send creator, file, " $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\n ::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }\n ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }\n EOS\nend\n" |
#create_support_file ⇒ Object
92 93 94 95 96 |
# File 'lib/proxy_rb/initializer.rb', line 92 def create_support_file create_file 'spec/support/proxy_rb.rb', " require 'proxy_rb/rspec'\n EOS\nend\n" |