neo_gruby-sequel 0.1.4 → 0.1.5.pre.rc1
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/neo_gruby/sequel/cli/sequel.rb +18 -16
 - data/lib/neo_gruby/sequel/db.rb +1 -1
 - data/lib/neo_gruby/sequel/version.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 5fd281f1b839068b7f981139316acae24629583351ebeff1933e6c358aa8efa8
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 539b6fcbf717f87cf93e9db69814a11eeca7660837bda697abe41c4deae0e7f2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f8f2eed574307f302a2f323eac521e2ade08a1ebba7c44252d3a43cfc5739eecdd21c218c48566e079565336ed8288e72fcdfb6afb8751774a2c70aceeb84f16
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9a57d65c8a43d8a2466a868c747e28c5ba4fb0034d5d837b21ed727e4b1976402a23be9ce3d043b0db2daac4028f60fbcc0eb1df695a2ea6595d5d399d1fbc63
         
     | 
| 
         @@ -1,31 +1,33 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require "dry/cli"
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module NeoGruby
         
     | 
| 
       4 
     | 
    
         
            -
              module  
     | 
| 
       5 
     | 
    
         
            -
                module  
     | 
| 
       6 
     | 
    
         
            -
                   
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
      
 4 
     | 
    
         
            +
              module CLI
         
     | 
| 
      
 5 
     | 
    
         
            +
                module Commands
         
     | 
| 
      
 6 
     | 
    
         
            +
                  module Sequel
         
     | 
| 
      
 7 
     | 
    
         
            +
                    class Migrate < Dry::CLI::Command
         
     | 
| 
      
 8 
     | 
    
         
            +
                      desc "Run database migration"
         
     | 
| 
       8 
9 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
                      argument :version, type: :string, desc: "Informe the migration name to destination"
         
     | 
| 
       10 
11 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
      
 12 
     | 
    
         
            +
                      def call(version: nil, **)
         
     | 
| 
      
 13 
     | 
    
         
            +
                        require './config/boot'
         
     | 
| 
      
 14 
     | 
    
         
            +
                        require 'sequel'
         
     | 
| 
      
 15 
     | 
    
         
            +
                        require 'yaml'
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
      
 17 
     | 
    
         
            +
                        ::Sequel.extension :migration
         
     | 
| 
       17 
18 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
                        config = YAML.load_file(NeoGruby.root.join('config', 'database.yml'))
         
     | 
| 
      
 20 
     | 
    
         
            +
                        config[NeoGruby.env].keys.each do |name|
         
     | 
| 
      
 21 
     | 
    
         
            +
                          dir = NeoGruby.root.join('db/migrations', name)
         
     | 
| 
      
 22 
     | 
    
         
            +
                          # puts dir if File.directory? dir
         
     | 
| 
      
 23 
     | 
    
         
            +
                          ::Sequel::Migrator.run(NeoGruby.db[name.to_sym], dir, target: version) if File.directory? dir
         
     | 
| 
      
 24 
     | 
    
         
            +
                        end
         
     | 
| 
       23 
25 
     | 
    
         
             
                      end
         
     | 
| 
       24 
26 
     | 
    
         
             
                    end
         
     | 
| 
       25 
27 
     | 
    
         
             
                  end
         
     | 
| 
       26 
28 
     | 
    
         | 
| 
       27 
29 
     | 
    
         
             
                  register "sequel" do |prefix|
         
     | 
| 
       28 
     | 
    
         
            -
                    prefix.register "migrate",  
     | 
| 
      
 30 
     | 
    
         
            +
                    prefix.register "migrate", Sequel::Migrate
         
     | 
| 
       29 
31 
     | 
    
         
             
                  end
         
     | 
| 
       30 
32 
     | 
    
         
             
                end
         
     | 
| 
       31 
33 
     | 
    
         
             
              end
         
     | 
    
        data/lib/neo_gruby/sequel/db.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: neo_gruby-sequel
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.5.pre.rc1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Welington Sampaio
         
     | 
| 
         @@ -81,9 +81,9 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       81 
81 
     | 
    
         
             
                  version: 2.3.0
         
     | 
| 
       82 
82 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       83 
83 
     | 
    
         
             
              requirements:
         
     | 
| 
       84 
     | 
    
         
            -
              - - " 
     | 
| 
      
 84 
     | 
    
         
            +
              - - ">"
         
     | 
| 
       85 
85 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       86 
     | 
    
         
            -
                  version:  
     | 
| 
      
 86 
     | 
    
         
            +
                  version: 1.3.1
         
     | 
| 
       87 
87 
     | 
    
         
             
            requirements: []
         
     | 
| 
       88 
88 
     | 
    
         
             
            rubygems_version: 3.0.3
         
     | 
| 
       89 
89 
     | 
    
         
             
            signing_key: 
         
     |