plastic_rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/plastic_rails/version.rb +1 -1
 - metadata +2 -9
 - data/tmpl/Dockerfile +0 -37
 - data/tmpl/apps/.keep +0 -0
 - data/tmpl/build.sh +0 -20
 - data/tmpl/docker-compose.yml +0 -28
 - data/tmpl/init/Gemfile +0 -2
 - data/tmpl/init/application_template/template.rb +0 -12
 - data/tmpl/init/application_template/template/config/database.yml +0 -54
 - data/tmpl/setup.sh +0 -19
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: fdb7c135f44fc073f189797c4e28186ac696dd3253a655a39b20aa655cac2b33
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 80496abf6809a62be2d3dada9802f33070f8a8e04071134024d9495e5e3b1699
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8572821cf9ad1da0dd53719a53c959a8d48604a399148a7f6246e6eaea4e00bc4f20cec7ec2dc839a16de4ce8c56566fc75c1b086a3cf9635815142ed2f320fc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: feab6b5c1495b63ef607162368cd108d3283e98d255f945900a4ffaeb321a073e3998fc22e2bb5ba455ce4e65adeb654c0590b80e7de45c6f90d3fa4cf5cbbba
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: plastic_rails
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Koki Hashimoto
         
     | 
| 
         @@ -77,18 +77,11 @@ files: 
     | 
|
| 
       77 
77 
     | 
    
         
             
            - lib/tmpl/build.sh
         
     | 
| 
       78 
78 
     | 
    
         
             
            - lib/tmpl/docker-compose.yml
         
     | 
| 
       79 
79 
     | 
    
         
             
            - lib/tmpl/init/Gemfile
         
     | 
| 
      
 80 
     | 
    
         
            +
            - lib/tmpl/init/Gemfile.lock
         
     | 
| 
       80 
81 
     | 
    
         
             
            - lib/tmpl/init/application_template/template.rb
         
     | 
| 
       81 
82 
     | 
    
         
             
            - lib/tmpl/init/application_template/template/config/database.yml
         
     | 
| 
       82 
83 
     | 
    
         
             
            - lib/tmpl/setup.sh
         
     | 
| 
       83 
84 
     | 
    
         
             
            - plastic_rails.gemspec
         
     | 
| 
       84 
     | 
    
         
            -
            - tmpl/Dockerfile
         
     | 
| 
       85 
     | 
    
         
            -
            - tmpl/apps/.keep
         
     | 
| 
       86 
     | 
    
         
            -
            - tmpl/build.sh
         
     | 
| 
       87 
     | 
    
         
            -
            - tmpl/docker-compose.yml
         
     | 
| 
       88 
     | 
    
         
            -
            - tmpl/init/Gemfile
         
     | 
| 
       89 
     | 
    
         
            -
            - tmpl/init/application_template/template.rb
         
     | 
| 
       90 
     | 
    
         
            -
            - tmpl/init/application_template/template/config/database.yml
         
     | 
| 
       91 
     | 
    
         
            -
            - tmpl/setup.sh
         
     | 
| 
       92 
85 
     | 
    
         
             
            homepage: http://github.com/koki-h/plastic_rails
         
     | 
| 
       93 
86 
     | 
    
         
             
            licenses:
         
     | 
| 
       94 
87 
     | 
    
         
             
            - MIT
         
     | 
    
        data/tmpl/Dockerfile
    DELETED
    
    | 
         @@ -1,37 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            FROM ruby:2.6.5-alpine3.9
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            RUN apk update
         
     | 
| 
       4 
     | 
    
         
            -
            RUN apk upgrade
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            RUN apk add --no-cache \
         
     | 
| 
       7 
     | 
    
         
            -
                  bash git vim openssh openssl yarn sudo su-exec shadow tzdata \
         
     | 
| 
       8 
     | 
    
         
            -
                  mysql-client mysql-dev\
         
     | 
| 
       9 
     | 
    
         
            -
                  build-base libxml2-dev libxslt-dev
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            ARG UID=1000
         
     | 
| 
       12 
     | 
    
         
            -
            ARG GID=1000
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
            RUN mkdir /var/mail
         
     | 
| 
       15 
     | 
    
         
            -
            RUN groupadd -g $GID devel
         
     | 
| 
       16 
     | 
    
         
            -
            RUN useradd -u $UID -g devel -m devel
         
     | 
| 
       17 
     | 
    
         
            -
            RUN echo "devel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
            # install rails
         
     | 
| 
       20 
     | 
    
         
            -
            WORKDIR /tmp
         
     | 
| 
       21 
     | 
    
         
            -
            COPY init/Gemfile /tmp/Gemfile
         
     | 
| 
       22 
     | 
    
         
            -
            COPY init/Gemfile.lock /tmp/Gemfile.lock
         
     | 
| 
       23 
     | 
    
         
            -
            RUN bundle install
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            COPY ./apps /apps
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
            RUN apk add --no-cache openssl
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
            WORKDIR /apps
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
            USER devel
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
            RUN openssl rand -hex 64 > /home/devel/.secret_key_base
         
     | 
| 
       34 
     | 
    
         
            -
            RUN echo $'export SECRET_KEY_BASE=$(cat /home/devel/.secret_key_base)' \
         
     | 
| 
       35 
     | 
    
         
            -
              >> /home/devel/.bashrc
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
            COPY init/application_template/ /tmp/application_template/
         
     | 
    
        data/tmpl/apps/.keep
    DELETED
    
    | 
         
            File without changes
         
     | 
    
        data/tmpl/build.sh
    DELETED
    
    | 
         @@ -1,20 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/bin/bash
         
     | 
| 
       2 
     | 
    
         
            -
            set -eu
         
     | 
| 
       3 
     | 
    
         
            -
            APPNAME=$1
         
     | 
| 
       4 
     | 
    
         
            -
            BUILD_CMD="docker-compose build --no-cache --build-arg APPNAME=$APPNAME"
         
     | 
| 
       5 
     | 
    
         
            -
            RUN_ON_WEB_CMD="docker-compose run --rm web"
         
     | 
| 
       6 
     | 
    
         
            -
            OSTYPE=$(uname)
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            case "$OSTYPE" in
         
     | 
| 
       9 
     | 
    
         
            -
              Darwin*)
         
     | 
| 
       10 
     | 
    
         
            -
                $BUILD_CMD web
         
     | 
| 
       11 
     | 
    
         
            -
                ;;
         
     | 
| 
       12 
     | 
    
         
            -
              Linux*)
         
     | 
| 
       13 
     | 
    
         
            -
                $BUILD_CMD --build-arg UID=$(id -u) --build-arg GID=$(id -g) web
         
     | 
| 
       14 
     | 
    
         
            -
                ;;
         
     | 
| 
       15 
     | 
    
         
            -
              *)
         
     | 
| 
       16 
     | 
    
         
            -
                echo "Unknown OS Type: $OSTYPE"
         
     | 
| 
       17 
     | 
    
         
            -
                ;;
         
     | 
| 
       18 
     | 
    
         
            -
            esac
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            $RUN_ON_WEB_CMD rails new $APPNAME --database=mysql --skip-bundle --skip-webpack-install -m /tmp/application_template/template.rb
         
     | 
    
        data/tmpl/docker-compose.yml
    DELETED
    
    | 
         @@ -1,28 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            version: '3'
         
     | 
| 
       2 
     | 
    
         
            -
            services:
         
     | 
| 
       3 
     | 
    
         
            -
              db:
         
     | 
| 
       4 
     | 
    
         
            -
                image: mysql:5.7
         
     | 
| 
       5 
     | 
    
         
            -
                environment:
         
     | 
| 
       6 
     | 
    
         
            -
                  MYSQL_USER: root
         
     | 
| 
       7 
     | 
    
         
            -
                  MYSQL_ROOT_PASSWORD: password
         
     | 
| 
       8 
     | 
    
         
            -
                ports:
         
     | 
| 
       9 
     | 
    
         
            -
                  - '3316:3306'
         
     | 
| 
       10 
     | 
    
         
            -
                volumes:
         
     | 
| 
       11 
     | 
    
         
            -
                  - %DB_PATH%:/var/lib/mysql
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
              web:
         
     | 
| 
       14 
     | 
    
         
            -
                build: .
         
     | 
| 
       15 
     | 
    
         
            -
                command: /bin/sh
         
     | 
| 
       16 
     | 
    
         
            -
                environment:
         
     | 
| 
       17 
     | 
    
         
            -
                  WEBPACKER_DEV_SERVER_HOST: "0.0.0.0"
         
     | 
| 
       18 
     | 
    
         
            -
                  RAILS_SERVE_STATIC_FILES: "1"
         
     | 
| 
       19 
     | 
    
         
            -
                  EDITOR: "vim"
         
     | 
| 
       20 
     | 
    
         
            -
                volumes:
         
     | 
| 
       21 
     | 
    
         
            -
                  - ./apps:/apps
         
     | 
| 
       22 
     | 
    
         
            -
                ports:
         
     | 
| 
       23 
     | 
    
         
            -
                  - "3000:3000"
         
     | 
| 
       24 
     | 
    
         
            -
                  - "3035:3035"
         
     | 
| 
       25 
     | 
    
         
            -
                depends_on:
         
     | 
| 
       26 
     | 
    
         
            -
                  - db
         
     | 
| 
       27 
     | 
    
         
            -
                tty: true
         
     | 
| 
       28 
     | 
    
         
            -
                working_dir: /apps/
         
     | 
    
        data/tmpl/init/Gemfile
    DELETED
    
    
| 
         @@ -1,12 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            @app_name = app_name
         
     | 
| 
       2 
     | 
    
         
            -
            def source_paths
         
     | 
| 
       3 
     | 
    
         
            -
              ["#{__dir__}/template"]
         
     | 
| 
       4 
     | 
    
         
            -
            end
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            # Database
         
     | 
| 
       7 
     | 
    
         
            -
            inside 'config' do
         
     | 
| 
       8 
     | 
    
         
            -
              remove_file "database.yml"
         
     | 
| 
       9 
     | 
    
         
            -
              copy_file "database.yml"
         
     | 
| 
       10 
     | 
    
         
            -
              gsub_file 'database.yml', /%APPNAME%/, @app_name
         
     | 
| 
       11 
     | 
    
         
            -
              gsub_file 'database.yml', /%APPNAME_UPPERCASE%/, @app_name.upcase
         
     | 
| 
       12 
     | 
    
         
            -
            end
         
     | 
| 
         @@ -1,54 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # MySQL. Versions 5.5.8 and up are supported.
         
     | 
| 
       2 
     | 
    
         
            -
            #
         
     | 
| 
       3 
     | 
    
         
            -
            # Install the MySQL driver
         
     | 
| 
       4 
     | 
    
         
            -
            #   gem install mysql2
         
     | 
| 
       5 
     | 
    
         
            -
            #
         
     | 
| 
       6 
     | 
    
         
            -
            # Ensure the MySQL gem is defined in your Gemfile
         
     | 
| 
       7 
     | 
    
         
            -
            #   gem 'mysql2'
         
     | 
| 
       8 
     | 
    
         
            -
            #
         
     | 
| 
       9 
     | 
    
         
            -
            # And be sure to use new-style password hashing:
         
     | 
| 
       10 
     | 
    
         
            -
            #   https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
         
     | 
| 
       11 
     | 
    
         
            -
            #
         
     | 
| 
       12 
     | 
    
         
            -
            default: &default
         
     | 
| 
       13 
     | 
    
         
            -
              adapter: mysql2
         
     | 
| 
       14 
     | 
    
         
            -
              encoding: utf8mb4
         
     | 
| 
       15 
     | 
    
         
            -
              pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
         
     | 
| 
       16 
     | 
    
         
            -
              username: root
         
     | 
| 
       17 
     | 
    
         
            -
              password: password
         
     | 
| 
       18 
     | 
    
         
            -
              host: db
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            development:
         
     | 
| 
       21 
     | 
    
         
            -
              <<: *default
         
     | 
| 
       22 
     | 
    
         
            -
              database: %APPNAME%_development
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
            # Warning: The database defined as "test" will be erased and
         
     | 
| 
       25 
     | 
    
         
            -
            # re-generated from your development database when you run "rake".
         
     | 
| 
       26 
     | 
    
         
            -
            # Do not set this db to the same as development or production.
         
     | 
| 
       27 
     | 
    
         
            -
            test:
         
     | 
| 
       28 
     | 
    
         
            -
              <<: *default
         
     | 
| 
       29 
     | 
    
         
            -
              database: %APPNAME%_test
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
            # As with config/credentials.yml, you never want to store sensitive information,
         
     | 
| 
       32 
     | 
    
         
            -
            # like your database password, in your source code. If your source code is
         
     | 
| 
       33 
     | 
    
         
            -
            # ever seen by anyone, they now have access to your database.
         
     | 
| 
       34 
     | 
    
         
            -
            #
         
     | 
| 
       35 
     | 
    
         
            -
            # Instead, provide the password as a unix environment variable when you boot
         
     | 
| 
       36 
     | 
    
         
            -
            # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
         
     | 
| 
       37 
     | 
    
         
            -
            # for a full rundown on how to provide these environment variables in a
         
     | 
| 
       38 
     | 
    
         
            -
            # production deployment.
         
     | 
| 
       39 
     | 
    
         
            -
            #
         
     | 
| 
       40 
     | 
    
         
            -
            # On Heroku and other platform providers, you may have a full connection URL
         
     | 
| 
       41 
     | 
    
         
            -
            # available as an environment variable. For example:
         
     | 
| 
       42 
     | 
    
         
            -
            #
         
     | 
| 
       43 
     | 
    
         
            -
            #   DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
         
     | 
| 
       44 
     | 
    
         
            -
            #
         
     | 
| 
       45 
     | 
    
         
            -
            # You can use this database configuration with:
         
     | 
| 
       46 
     | 
    
         
            -
            #
         
     | 
| 
       47 
     | 
    
         
            -
            #   production:
         
     | 
| 
       48 
     | 
    
         
            -
            #     url: <%= ENV['DATABASE_URL'] %>
         
     | 
| 
       49 
     | 
    
         
            -
            #
         
     | 
| 
       50 
     | 
    
         
            -
            production:
         
     | 
| 
       51 
     | 
    
         
            -
              <<: *default
         
     | 
| 
       52 
     | 
    
         
            -
              database: %APPNAME%_production
         
     | 
| 
       53 
     | 
    
         
            -
              username: %APPNAME%
         
     | 
| 
       54 
     | 
    
         
            -
              password: <%= ENV['%APPNAME_UPPERCASE%_DATABASE_PASSWORD'] %>
         
     | 
    
        data/tmpl/setup.sh
    DELETED
    
    | 
         @@ -1,19 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/bin/bash
         
     | 
| 
       2 
     | 
    
         
            -
            set -eu
         
     | 
| 
       3 
     | 
    
         
            -
            ESC="\e["
         
     | 
| 
       4 
     | 
    
         
            -
            ESCEND=m
         
     | 
| 
       5 
     | 
    
         
            -
            COLOR_OFF=$(printf ${ESC}${ESCEND})
         
     | 
| 
       6 
     | 
    
         
            -
            COLOR_CMD=$(printf "${ESC}36;1;${ESCEND}") # front: cyan;bold 
         
     | 
| 
       7 
     | 
    
         
            -
            RUN_ON_WEB_CMD="docker-compose exec web"
         
     | 
| 
       8 
     | 
    
         
            -
            #RUN_ON_WEB_CMD="docker-compose run --rm web"
         
     | 
| 
       9 
     | 
    
         
            -
            function docker_run {
         
     | 
| 
       10 
     | 
    
         
            -
              cmd=$1
         
     | 
| 
       11 
     | 
    
         
            -
              echo ${COLOR_CMD}${cmd}${COLOR_OFF}
         
     | 
| 
       12 
     | 
    
         
            -
              $RUN_ON_WEB_CMD $cmd
         
     | 
| 
       13 
     | 
    
         
            -
            }
         
     | 
| 
       14 
     | 
    
         
            -
            docker-compose up -d
         
     | 
| 
       15 
     | 
    
         
            -
            docker_run "bundle install "
         
     | 
| 
       16 
     | 
    
         
            -
            docker_run "yarn install --check-files"
         
     | 
| 
       17 
     | 
    
         
            -
            docker_run "yarn upgrade"
         
     | 
| 
       18 
     | 
    
         
            -
            docker_run "rails webpacker:install"
         
     | 
| 
       19 
     | 
    
         
            -
            docker_run "rails db:setup"
         
     |