Class: RestspecInstaller
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- RestspecInstaller
- Includes:
- Thor::Actions
- Defined in:
- lib/restspec/runners/installer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_gemfile ⇒ Object
- #create_api_dsl_files ⇒ Object
- #create_project_dir ⇒ Object
- #create_rspec_config ⇒ Object
- #create_spec_folders ⇒ Object
- #create_spec_helper ⇒ Object
- #create_support_files ⇒ Object
- #install_gems ⇒ Object
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/restspec/runners/installer.rb', line 8 def self.source_root Pathname.new(File.dirname(__FILE__)).join('../../../bin') end |
Instance Method Details
#copy_gemfile ⇒ Object
16 17 18 |
# File 'lib/restspec/runners/installer.rb', line 16 def copy_gemfile copy_file 'templates/Gemfile', "#{project}/Gemfile" end |
#create_api_dsl_files ⇒ Object
34 35 36 37 38 |
# File 'lib/restspec/runners/installer.rb', line 34 def create_api_dsl_files create_file "#{project}/spec/api/restspec/api_endpoints.rb" create_file "#{project}/spec/api/restspec/api_schemas.rb" create_file "#{project}/spec/api/restspec/api_requirements.rb" end |
#create_project_dir ⇒ Object
12 13 14 |
# File 'lib/restspec/runners/installer.rb', line 12 def create_project_dir empty_directory project end |
#create_rspec_config ⇒ Object
30 31 32 |
# File 'lib/restspec/runners/installer.rb', line 30 def create_rspec_config template 'templates/restspec_config.rb', "#{project}/spec/api/restspec/restspec_config.rb" end |
#create_spec_folders ⇒ Object
20 21 22 23 24 |
# File 'lib/restspec/runners/installer.rb', line 20 def create_spec_folders empty_directory "#{project}/spec" empty_directory "#{project}/spec/api" empty_directory "#{project}/spec/support" end |
#create_spec_helper ⇒ Object
26 27 28 |
# File 'lib/restspec/runners/installer.rb', line 26 def create_spec_helper template 'templates/spec_helper.rb', "#{project}/spec/spec_helper.rb" end |
#create_support_files ⇒ Object
40 41 42 43 |
# File 'lib/restspec/runners/installer.rb', line 40 def create_support_files create_file "#{project}/spec/support/custom_matchers.rb" copy_file "templates/custom_macros.rb", "#{project}/spec/support/custom_macros.rb" end |
#install_gems ⇒ Object
45 46 47 |
# File 'lib/restspec/runners/installer.rb', line 45 def install_gems inside(project) { run 'bundle install' } end |