Sha256: ec982fe8e0e1d21882c2cf82c0d3481ba244d715ff828a213e98f73ef452837a

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

module Install
  module Figaro
    def self.included(thor)
      thor.class_eval do
        
        desc 'add_figaro', 'Add Figaro gem to Gemfile and run bundler'
        def add_figaro
          insert_into_file 'Gemfile', after: "gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]\n" do <<-CODE
  gem "figaro"
  CODE
          end

          run 'bundle install'
        end
        
        desc 'generate_figaro', 'Run Figaro installer'
        def generate_figaro
          run 'bundle exec figaro install'
        end
        
        desc 'generate_example', 'Create example application.yml file'
        def generate_example
          copy_file 'rails/config/application.example.yml', 'config/application.example.yml'
        end
        
        desc 'setup_figaro', 'Install and configure figaro gem'
        def setup_figaro
          add_figaro
          generate_figaro
          generate_example
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
myrails-7.0.0 lib/myrails/modules/figaro.rb