File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
13if defined? ( PryByebug )
24 Pry . config . pager = false
35 Pry . commands . alias_command 'c' , 'continue'
46 Pry . commands . alias_command 's' , 'step'
57 Pry . commands . alias_command 'n' , 'next'
68 Pry . commands . alias_command 'f' , 'finish'
7- end
9+ end
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22require 'yaml'
33
4+
45namespace :projects do
56 desc 'Import starter projects'
67 task create_starter : :environment do
7-
8- Dir . each_child ( "#{ File . dirname ( __FILE__ ) } /project_components" ) do |dir_name |
9- config = YAML . safe_load ( File . open ( "#{ File . dirname ( __FILE__ ) } /project_components/#{ dir_name } /project_config.yml" ) . read )
8+ Dir . each_child ( "#{ File . dirname ( __FILE__ ) } /project_components" ) do |dir |
9+ config = YAML . safe_load ( File . open ( "#{ File . dirname ( __FILE__ ) } /project_components/#{ dir } /project_config.yml" ) . read )
1010 Project . find_by ( identifier : config [ 'IDENTIFIER' ] ) &.destroy
1111 new_project = Project . new ( identifier : config [ 'IDENTIFIER' ] , name : config [ 'NAME' ] )
1212 num_extra_components = 0
1313
14- Dir . each_child ( "#{ File . dirname ( __FILE__ ) } /project_components/#{ dir_name } " ) do |component |
14+ Dir . each_child ( "#{ File . dirname ( __FILE__ ) } /project_components/#{ dir } " ) do |component |
1515 if component != 'project_config.yml'
16- file = File . open ( File . dirname ( __FILE__ ) + "/project_components/#{ dir_name } /#{ component } " )
16+ file = File . open ( File . dirname ( __FILE__ ) + "/project_components/#{ dir } /#{ component } " )
1717 code = file . read
1818 file . close
1919 name = component . split ( '.' ) [ 0 ]
You can’t perform that action at this time.
0 commit comments