Method: Charyf::Generators::AppGenerator#create_root_files

Defined in:
lib/charyf/utils/generators/app/app_generator.rb

#create_root_filesObject



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/charyf/utils/generators/app/app_generator.rb', line 130

def create_root_files
  build(:readme)
  build(:gitignore)   unless options[:skip_git]
  build(:version_control)


  unless options[:skip_gemfile]
    if options[:lib]

      begin
        # Temporary change root
        self.destination_root = File.expand_path('..', destination_root)
        if File.exist?(File.join(destination_root, 'Gemfile'))
          build(:update_gemfile)
        else
          build(:gemfile)
        end
      ensure
        self.destination_root = File.expand_path('charyf', destination_root)
      end

    else
      build(:gemfile)
    end
  end
end