codekindly-utils 0.0.13 → 0.0.14
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/code_kindly/utils/active_record.rb +8 -6
 - data/lib/code_kindly/utils/version.rb +1 -1
 - metadata +5 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a63346ba5c2ae3f64f3ec02e879aeec8be27f4e6ff2b87c948239a3df2e92677
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9c085ad8982632732ab1e81460e036991438206d0c3ac750b5683a302e83549a
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ed6a912aa2056fdd19b7df73d6a695bdc4e5e2f40deba1205f47c06fb0e3ff8e256cba0dab18f5f83009f6228d047c82f1b1db47c01184d91921261a6b7c2ada
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f912458c47a0d9157884a85354fe3dd67ecaa8a9c1d61bb19f8856c6a32ecefcbfc563ca77aa2dc7d54c7bb8b5e2b39bc1e5d05f9b744e8275334b1f1288c230
         
     | 
| 
         @@ -34,18 +34,21 @@ module CodeKindly 
     | 
|
| 
       34 
34 
     | 
    
         
             
                      configs[name || default_name]
         
     | 
| 
       35 
35 
     | 
    
         
             
                    end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
                    # rubocop:disable  
     | 
| 
       38 
     | 
    
         
            -
                    def configs
         
     | 
| 
      
 37 
     | 
    
         
            +
                    def configs # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
         
     | 
| 
       39 
38 
     | 
    
         
             
                      @configs ||= ::ActiveRecord::Base.configurations
         
     | 
| 
      
 39 
     | 
    
         
            +
                      if @configs.class.name == 'ActiveRecord::DatabaseConfigurations' # rubocop:disable Style/ClassEqualityComparison
         
     | 
| 
      
 40 
     | 
    
         
            +
                        @configs = @configs.configs_for.each_with_object({}) do |config, hash|
         
     | 
| 
      
 41 
     | 
    
         
            +
                          hash[config.env_name] = config.config
         
     | 
| 
      
 42 
     | 
    
         
            +
                        end
         
     | 
| 
      
 43 
     | 
    
         
            +
                      end
         
     | 
| 
       40 
44 
     | 
    
         
             
                      return @configs unless @configs == {}
         
     | 
| 
       41 
45 
     | 
    
         
             
                      return @configs unless RAILS.respond_to?(:root)
         
     | 
| 
       42 
46 
     | 
    
         | 
| 
       43 
47 
     | 
    
         
             
                      file = RAILS.root.join('config', 'database.yml')
         
     | 
| 
       44 
48 
     | 
    
         
             
                      return @configs unless ::File.readable?(file)
         
     | 
| 
       45 
49 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
                      @configs = YAML.load(::File.read(file))
         
     | 
| 
      
 50 
     | 
    
         
            +
                      @configs = YAML.load(::File.read(file)) # rubocop:disable Security/YAMLLoad
         
     | 
| 
       47 
51 
     | 
    
         
             
                    end
         
     | 
| 
       48 
     | 
    
         
            -
                    # rubocop:enable Security/YAMLLoad
         
     | 
| 
       49 
52 
     | 
    
         | 
| 
       50 
53 
     | 
    
         
             
                    def configurations
         
     | 
| 
       51 
54 
     | 
    
         
             
                      deprecate :configurations, :configs, :'0.1.0'
         
     | 
| 
         @@ -103,8 +106,7 @@ module CodeKindly 
     | 
|
| 
       103 
106 
     | 
    
         
             
                    def load_classes_in_development
         
     | 
| 
       104 
107 
     | 
    
         
             
                      return unless RAILS.try(:env).try(:development?)
         
     | 
| 
       105 
108 
     | 
    
         | 
| 
       106 
     | 
    
         
            -
                       
     | 
| 
       107 
     | 
    
         
            -
                      ::Dir.glob(model_files) do |f|
         
     | 
| 
      
 109 
     | 
    
         
            +
                      ::Dir.glob(RAILS.root.join('app/models/**/*.rb').to_s) do |f|
         
     | 
| 
       108 
110 
     | 
    
         
             
                        klass = ::File.basename(f, '.rb').classify
         
     | 
| 
       109 
111 
     | 
    
         
             
                        next if Kernel.const_defined? klass
         
     | 
| 
       110 
112 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: codekindly-utils
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.14
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jeremy Weathers
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-06-19 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: highline
         
     | 
| 
         @@ -72,14 +72,14 @@ dependencies: 
     | 
|
| 
       72 
72 
     | 
    
         
             
                requirements:
         
     | 
| 
       73 
73 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       74 
74 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       75 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '2.2'
         
     | 
| 
       76 
76 
     | 
    
         
             
              type: :development
         
     | 
| 
       77 
77 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       78 
78 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       79 
79 
     | 
    
         
             
                requirements:
         
     | 
| 
       80 
80 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       81 
81 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       82 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '2.2'
         
     | 
| 
       83 
83 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       84 
84 
     | 
    
         
             
              name: pry-byebug
         
     | 
| 
       85 
85 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -195,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       195 
195 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       196 
196 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       197 
197 
     | 
    
         
             
            requirements: []
         
     | 
| 
       198 
     | 
    
         
            -
             
     | 
| 
       199 
     | 
    
         
            -
            rubygems_version: 2.7.6
         
     | 
| 
      
 198 
     | 
    
         
            +
            rubygems_version: 3.2.15
         
     | 
| 
       200 
199 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       201 
200 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       202 
201 
     | 
    
         
             
            summary: These are small utilities that I like to have around in my projects.
         
     |