ncore 3.4.4 → 3.5.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/CHANGELOG.md +16 -0
 - data/LICENSE +1 -1
 - data/lib/ncore/associations.rb +95 -56
 - data/lib/ncore/attributes.rb +3 -1
 - data/lib/ncore/rails/log_subscriber.rb +3 -3
 - data/lib/ncore/version.rb +1 -1
 - data/ncore.gemspec +1 -1
 - metadata +5 -5
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 16e01242ae632039f017faa4e3c51e6c885b05bb86ba0c53db9e6cf21b5e011b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 849bce6e876e202690601839d0b0012a70347aeb25fe0fff0c56006f180e5a61
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ced939921588d62b7141fb481b1aa8638be6e297f0d355137c4aa155c8efde8d41198e4d76acdb9c574cf9bdefe7026df384dc84a70002153b38ded55cf9e80e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2497400057a0229616f5d9771f141be8966e65ab7d9ab767c3c54c3efaeb13f15017d46d7da6c1f73f23b22032c093d2a3f93246f968fece9ade3372dc981a66
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #### 3.5.1
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            - Preserve 'metadata' and 'errors' keys as attributes when inside a standard
         
     | 
| 
      
 4 
     | 
    
         
            +
              data payload
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            #### 3.5.0
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            - Allow ActiveModel 7.1
         
     | 
| 
      
 9 
     | 
    
         
            +
            - Update LogSubscriber for ActiveSupport 7.1
         
     | 
| 
      
 10 
     | 
    
         
            +
            - Associations: add arg :association_key to has_many, belongs_to
         
     | 
| 
      
 11 
     | 
    
         
            +
            - Associations: has_many now builds retrieve_{assoc}
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       1 
13 
     | 
    
         
             
            #### 3.4.4
         
     | 
| 
       2 
14 
     | 
    
         | 
| 
       3 
15 
     | 
    
         
             
            - Improve keepalive handling
         
     | 
| 
         @@ -96,6 +108,10 @@ Other changes 
     | 
|
| 
       96 
108 
     | 
    
         
             
              - #i18n_scope, config via Api.i18n_scope=
         
     | 
| 
       97 
109 
     | 
    
         
             
              - #cache_key, #cache_version, #cache_key_with_version
         
     | 
| 
       98 
110 
     | 
    
         | 
| 
      
 111 
     | 
    
         
            +
            #### 2.3.3
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
            - Improve keepalive handling
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
       99 
115 
     | 
    
         
             
            #### 2.3.2
         
     | 
| 
       100 
116 
     | 
    
         | 
| 
       101 
117 
     | 
    
         
             
            - Allow ActiveSupport 7.0
         
     | 
    
        data/LICENSE
    CHANGED
    
    
    
        data/lib/ncore/associations.rb
    CHANGED
    
    | 
         @@ -1,109 +1,148 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module NCore
         
     | 
| 
       2 
2 
     | 
    
         
             
              module Associations
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                   
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 4 
     | 
    
         
            +
                # assoc_name       - plural association name
         
     | 
| 
      
 5 
     | 
    
         
            +
                # :association_key - key used by the association to reference the parent
         
     | 
| 
      
 6 
     | 
    
         
            +
                #                    defaults to `attrib_name+'_id'`
         
     | 
| 
      
 7 
     | 
    
         
            +
                # :class_name      - Module::Class of the child association, as a string
         
     | 
| 
      
 8 
     | 
    
         
            +
                def has_many(assoc_name, association_key: nil, class_name: nil)
         
     | 
| 
      
 9 
     | 
    
         
            +
                  assoc_name = assoc_name.to_s
         
     | 
| 
      
 10 
     | 
    
         
            +
                  parent_key = association_key&.to_s || "#{attrib_name}_id"
         
     | 
| 
      
 11 
     | 
    
         
            +
                  klass      = class_name || "#{module_name}::#{assoc_name.camelize.singularize}"
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  # def items({})
         
     | 
| 
      
 14 
     | 
    
         
            +
                  class_eval <<-A1, __FILE__, __LINE__+1
         
     | 
| 
      
 15 
     | 
    
         
            +
                    def #{assoc_name}(params={})
         
     | 
| 
       10 
16 
     | 
    
         
             
                      return [] unless id
         
     | 
| 
       11 
17 
     | 
    
         
             
                      reload = params.delete :reload
         
     | 
| 
       12 
18 
     | 
    
         
             
                      cacheable = params.except(:credentials, :request).empty?
         
     | 
| 
       13 
19 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       14 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 20 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       15 
21 
     | 
    
         
             
                      if cacheable
         
     | 
| 
       16 
22 
     | 
    
         
             
                        # only cache unfiltered, default api call
         
     | 
| 
       17 
     | 
    
         
            -
                        @attribs[:#{ 
     | 
| 
      
 23 
     | 
    
         
            +
                        @attribs[:#{assoc_name}] = (!reload && @attribs[:#{assoc_name}]) || #{klass}.all(params)
         
     | 
| 
       18 
24 
     | 
    
         
             
                      else
         
     | 
| 
       19 
25 
     | 
    
         
             
                        #{klass}.all(params)
         
     | 
| 
       20 
26 
     | 
    
         
             
                      end
         
     | 
| 
       21 
27 
     | 
    
         
             
                    end
         
     | 
| 
       22 
     | 
    
         
            -
                   
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
      
 28 
     | 
    
         
            +
                  A1
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  # def find_item(id, {})
         
     | 
| 
      
 31 
     | 
    
         
            +
                  class_eval <<-F1, __FILE__, __LINE__+1
         
     | 
| 
      
 32 
     | 
    
         
            +
                    def find_#{assoc_name.singularize}(aid, params={})
         
     | 
| 
       25 
33 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       26 
34 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       27 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 35 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       28 
36 
     | 
    
         
             
                      #{klass}.find(aid, params)
         
     | 
| 
       29 
37 
     | 
    
         
             
                    end
         
     | 
| 
       30 
     | 
    
         
            -
                   
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
                   
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
                  F1
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  # def retrieve_item(id, {})
         
     | 
| 
      
 41 
     | 
    
         
            +
                  class_eval <<-F2, __FILE__, __LINE__+1
         
     | 
| 
      
 42 
     | 
    
         
            +
                    def retrieve_#{assoc_name.singularize}(aid, params={})
         
     | 
| 
       34 
43 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       35 
44 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       36 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
       37 
     | 
    
         
            -
                      #{klass}. 
     | 
| 
      
 45 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
      
 46 
     | 
    
         
            +
                      #{klass}.retrieve(aid, params)
         
     | 
| 
       38 
47 
     | 
    
         
             
                    end
         
     | 
| 
       39 
     | 
    
         
            -
                   
     | 
| 
      
 48 
     | 
    
         
            +
                  F2
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                  # def create_item({})
         
     | 
| 
       40 
51 
     | 
    
         
             
                  # will always return the object; check .errors? or .valid? to see how it went
         
     | 
| 
       41 
     | 
    
         
            -
                  class_eval <<- 
     | 
| 
       42 
     | 
    
         
            -
                    def  
     | 
| 
      
 52 
     | 
    
         
            +
                  class_eval <<-C1, __FILE__, __LINE__+1
         
     | 
| 
      
 53 
     | 
    
         
            +
                    def create_#{assoc_name.singularize}(params={})
         
     | 
| 
       43 
54 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       44 
55 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       45 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
       46 
     | 
    
         
            -
                      #{klass}. 
     | 
| 
      
 56 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
      
 57 
     | 
    
         
            +
                      #{klass}.create(params)
         
     | 
| 
       47 
58 
     | 
    
         
             
                    end
         
     | 
| 
       48 
     | 
    
         
            -
                   
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
      
 59 
     | 
    
         
            +
                  C1
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                  # def create_item!({})
         
     | 
| 
      
 62 
     | 
    
         
            +
                  class_eval <<-C2, __FILE__, __LINE__+1
         
     | 
| 
      
 63 
     | 
    
         
            +
                    def create_#{assoc_name.singularize}!(params={})
         
     | 
| 
       51 
64 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       52 
65 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       53 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 66 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       54 
67 
     | 
    
         
             
                      #{klass}.create!(params)
         
     | 
| 
       55 
68 
     | 
    
         
             
                    end
         
     | 
| 
       56 
     | 
    
         
            -
                   
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
      
 69 
     | 
    
         
            +
                  C2
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                  # def update_item(id, {})
         
     | 
| 
      
 72 
     | 
    
         
            +
                  # will always return the object; check .errors? or .valid? to see how it went
         
     | 
| 
      
 73 
     | 
    
         
            +
                  class_eval <<-U1, __FILE__, __LINE__+1
         
     | 
| 
      
 74 
     | 
    
         
            +
                    def update_#{assoc_name.singularize}(aid, params={})
         
     | 
| 
      
 75 
     | 
    
         
            +
                      raise UnsavedObjectError unless id
         
     | 
| 
      
 76 
     | 
    
         
            +
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
      
 77 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
      
 78 
     | 
    
         
            +
                      #{klass}.update(aid, params)
         
     | 
| 
      
 79 
     | 
    
         
            +
                    end
         
     | 
| 
      
 80 
     | 
    
         
            +
                  U1
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                  # def update_item!(id, {})
         
     | 
| 
      
 83 
     | 
    
         
            +
                  class_eval <<-U2, __FILE__, __LINE__+1
         
     | 
| 
      
 84 
     | 
    
         
            +
                    def update_#{assoc_name.singularize}!(aid, params={})
         
     | 
| 
       59 
85 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       60 
86 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       61 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 87 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       62 
88 
     | 
    
         
             
                      #{klass}.update!(aid, params)
         
     | 
| 
       63 
89 
     | 
    
         
             
                    end
         
     | 
| 
       64 
     | 
    
         
            -
                   
     | 
| 
      
 90 
     | 
    
         
            +
                  U2
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                  # def delete_item(id, {})
         
     | 
| 
       65 
93 
     | 
    
         
             
                  # will always return the object; check .errors? or .valid? to see how it went
         
     | 
| 
       66 
     | 
    
         
            -
                  class_eval <<- 
     | 
| 
       67 
     | 
    
         
            -
                    def delete_#{ 
     | 
| 
      
 94 
     | 
    
         
            +
                  class_eval <<-D1, __FILE__, __LINE__+1
         
     | 
| 
      
 95 
     | 
    
         
            +
                    def delete_#{assoc_name.singularize}(aid, params={})
         
     | 
| 
       68 
96 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       69 
97 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       70 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 98 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       71 
99 
     | 
    
         
             
                      #{klass}.delete(aid, params)
         
     | 
| 
       72 
100 
     | 
    
         
             
                    end
         
     | 
| 
       73 
     | 
    
         
            -
                   
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
      
 101 
     | 
    
         
            +
                  D1
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
                  # def delete_item!(id, {})
         
     | 
| 
      
 104 
     | 
    
         
            +
                  class_eval <<-D2, __FILE__, __LINE__+1
         
     | 
| 
      
 105 
     | 
    
         
            +
                    def delete_#{assoc_name.singularize}!(aid, params={})
         
     | 
| 
       76 
106 
     | 
    
         
             
                      raise UnsavedObjectError unless id
         
     | 
| 
       77 
107 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       78 
     | 
    
         
            -
                      params[:#{ 
     | 
| 
      
 108 
     | 
    
         
            +
                      params[:#{parent_key}] = id
         
     | 
| 
       79 
109 
     | 
    
         
             
                      #{klass}.delete!(aid, params)
         
     | 
| 
       80 
110 
     | 
    
         
             
                    end
         
     | 
| 
       81 
     | 
    
         
            -
                   
     | 
| 
      
 111 
     | 
    
         
            +
                  D2
         
     | 
| 
       82 
112 
     | 
    
         
             
                end
         
     | 
| 
       83 
113 
     | 
    
         | 
| 
       84 
     | 
    
         
            -
                 
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
                   
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
      
 114 
     | 
    
         
            +
                # assoc_name       - singular association name
         
     | 
| 
      
 115 
     | 
    
         
            +
                # :association_key - key on this resource used to reference the parent association
         
     | 
| 
      
 116 
     | 
    
         
            +
                #                    defaults to `assoc_name+'_id'`
         
     | 
| 
      
 117 
     | 
    
         
            +
                # :class_name      - Module::Class of the parent association, as a string
         
     | 
| 
      
 118 
     | 
    
         
            +
                def belongs_to(assoc_name, association_key: nil, class_name: nil)
         
     | 
| 
      
 119 
     | 
    
         
            +
                  assoc_name = assoc_name.to_s
         
     | 
| 
      
 120 
     | 
    
         
            +
                  parent_key = association_key&.to_s || "#{assoc_name}_id"
         
     | 
| 
      
 121 
     | 
    
         
            +
                  klass      = class_name || "#{module_name}::#{assoc_name.camelize}"
         
     | 
| 
      
 122 
     | 
    
         
            +
             
     | 
| 
      
 123 
     | 
    
         
            +
                  # attr :parent_id
         
     | 
| 
      
 124 
     | 
    
         
            +
                  # def parent({})
         
     | 
| 
      
 125 
     | 
    
         
            +
                  class_eval <<-P1, __FILE__, __LINE__+1
         
     | 
| 
      
 126 
     | 
    
         
            +
                    attr :#{parent_key}
         
     | 
| 
      
 127 
     | 
    
         
            +
                    def #{assoc_name}(params={})
         
     | 
| 
      
 128 
     | 
    
         
            +
                      return nil unless #{parent_key}
         
     | 
| 
       91 
129 
     | 
    
         
             
                      params = parse_request_params(params).reverse_merge credentials: api_creds
         
     | 
| 
       92 
130 
     | 
    
         
             
                      if params.except(:credentials, :request).empty?
         
     | 
| 
       93 
131 
     | 
    
         
             
                        # only cache unfiltered, default api call
         
     | 
| 
       94 
     | 
    
         
            -
                        @attribs[:#{ 
     | 
| 
      
 132 
     | 
    
         
            +
                        @attribs[:#{assoc_name}] ||= #{klass}.find(#{parent_key}, params)
         
     | 
| 
       95 
133 
     | 
    
         
             
                      else
         
     | 
| 
       96 
     | 
    
         
            -
                        #{klass}.find(#{ 
     | 
| 
      
 134 
     | 
    
         
            +
                        #{klass}.find(#{parent_key}, params)
         
     | 
| 
       97 
135 
     | 
    
         
             
                      end
         
     | 
| 
       98 
136 
     | 
    
         
             
                    end
         
     | 
| 
       99 
     | 
    
         
            -
                   
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
                      @attribs[:#{ 
     | 
| 
      
 137 
     | 
    
         
            +
                  P1
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
                  class_eval <<-P2, __FILE__, __LINE__+1
         
     | 
| 
      
 140 
     | 
    
         
            +
                    def #{parent_key}=(v)
         
     | 
| 
      
 141 
     | 
    
         
            +
                      @attribs[:#{assoc_name}] = nil unless @attribs[:#{parent_key}] == v
         
     | 
| 
      
 142 
     | 
    
         
            +
                      @attribs[:#{parent_key}] = v
         
     | 
| 
       104 
143 
     | 
    
         
             
                    end
         
     | 
| 
       105 
     | 
    
         
            -
                    private :#{ 
     | 
| 
       106 
     | 
    
         
            -
                   
     | 
| 
      
 144 
     | 
    
         
            +
                    private :#{parent_key}=
         
     | 
| 
      
 145 
     | 
    
         
            +
                  P2
         
     | 
| 
       107 
146 
     | 
    
         
             
                end
         
     | 
| 
       108 
147 
     | 
    
         | 
| 
       109 
148 
     | 
    
         
             
              end
         
     | 
    
        data/lib/ncore/attributes.rb
    CHANGED
    
    | 
         @@ -168,7 +168,9 @@ module NCore 
     | 
|
| 
       168 
168 
     | 
    
         
             
                  self.metadata = args[:metadata] || {}.with_indifferent_access
         
     | 
| 
       169 
169 
     | 
    
         
             
                  self.errors = parse_errors(args[:errors])
         
     | 
| 
       170 
170 
     | 
    
         
             
                  args[:data].each do |k,v|
         
     | 
| 
       171 
     | 
    
         
            -
                    if  
     | 
| 
      
 171 
     | 
    
         
            +
                    if k=='metadata' || k=='errors'
         
     | 
| 
      
 172 
     | 
    
         
            +
                      @attribs[k] = self.class.interpret_type(v, api_creds)
         
     | 
| 
      
 173 
     | 
    
         
            +
                    elsif respond_to?("#{k}=")
         
     | 
| 
       172 
174 
     | 
    
         
             
                      send "#{k}=", self.class.interpret_type(v, api_creds)
         
     | 
| 
       173 
175 
     | 
    
         
             
                    else
         
     | 
| 
       174 
176 
     | 
    
         
             
                      @attribs[k] = self.class.interpret_type(v, api_creds)
         
     | 
| 
         @@ -37,11 +37,11 @@ module NCore 
     | 
|
| 
       37 
37 
     | 
    
         
             
                  msg = "%s %s" % [http_method, url]
         
     | 
| 
       38 
38 
     | 
    
         
             
                  res = " -> %d (%.1f ms)" % [http_status, event.duration]
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
                  msg = color(msg,  
     | 
| 
      
 40 
     | 
    
         
            +
                  msg = color(msg, :yellow)
         
     | 
| 
       41 
41 
     | 
    
         
             
                  if (200..299).include? http_status
         
     | 
| 
       42 
     | 
    
         
            -
                    res = color(res,  
     | 
| 
      
 42 
     | 
    
         
            +
                    res = color(res, :green, bold: true)
         
     | 
| 
       43 
43 
     | 
    
         
             
                  else
         
     | 
| 
       44 
     | 
    
         
            -
                    res = color(res,  
     | 
| 
      
 44 
     | 
    
         
            +
                    res = color(res, :red, bold: true)
         
     | 
| 
       45 
45 
     | 
    
         
             
                  end
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
                  if (200..299).include? http_status
         
     | 
    
        data/lib/ncore/version.rb
    CHANGED
    
    
    
        data/ncore.gemspec
    CHANGED
    
    | 
         @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       18 
18 
     | 
    
         
             
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
       19 
19 
     | 
    
         
             
              spec.require_paths = ["lib"]
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
              spec.add_dependency 'activemodel', '>= 5.2', '< 7. 
     | 
| 
      
 21 
     | 
    
         
            +
              spec.add_dependency 'activemodel', '>= 5.2', '< 7.2'
         
     | 
| 
       22 
22 
     | 
    
         
             
              spec.add_dependency 'excon', '~> 0.32'
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
              spec.add_development_dependency "bundler"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ncore
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.5.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Notioneer Team
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-01-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activemodel
         
     | 
| 
         @@ -19,7 +19,7 @@ dependencies: 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    version: '5.2'
         
     | 
| 
       20 
20 
     | 
    
         
             
                - - "<"
         
     | 
| 
       21 
21 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       22 
     | 
    
         
            -
                    version: '7. 
     | 
| 
      
 22 
     | 
    
         
            +
                    version: '7.2'
         
     | 
| 
       23 
23 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       24 
24 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       25 
25 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -29,7 +29,7 @@ dependencies: 
     | 
|
| 
       29 
29 
     | 
    
         
             
                    version: '5.2'
         
     | 
| 
       30 
30 
     | 
    
         
             
                - - "<"
         
     | 
| 
       31 
31 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       32 
     | 
    
         
            -
                    version: '7. 
     | 
| 
      
 32 
     | 
    
         
            +
                    version: '7.2'
         
     | 
| 
       33 
33 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       34 
34 
     | 
    
         
             
              name: excon
         
     | 
| 
       35 
35 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       142 
142 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       143 
143 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       144 
144 
     | 
    
         
             
            requirements: []
         
     | 
| 
       145 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 145 
     | 
    
         
            +
            rubygems_version: 3.3.26
         
     | 
| 
       146 
146 
     | 
    
         
             
            signing_key:
         
     | 
| 
       147 
147 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       148 
148 
     | 
    
         
             
            summary: NCore - Gem for building REST API clients
         
     |