izi_json_ld 1.0.4 → 1.0.5
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 +5 -5
 - data/app/entities/article_entity.rb +2 -2
 - data/app/entities/organization_entity.rb +3 -0
 - data/app/entities/person_entity.rb +14 -0
 - data/app/entities/web_page_entity.rb +2 -1
 - data/lib/izi_json_ld/version.rb +1 -1
 - data/spec/dummy/log/test.log +4685 -0
 - data/spec/entities/article_entity_spec.rb +36 -0
 - metadata +4 -4
 
| 
         @@ -66,6 +66,7 @@ RSpec.describe ArticleEntity do 
     | 
|
| 
       66 
66 
     | 
    
         
             
                  ['Publisher logo type', %w[publisher logo @type], 'ImageObject'],
         
     | 
| 
       67 
67 
     | 
    
         
             
                  ['Publisher logo', %w[publisher logo url], 'https://exampla.com/logo.png'],
         
     | 
| 
       68 
68 
     | 
    
         
             
                  ['Post image', %w[image], 'https://exampla.com/blog/page.png'],
         
     | 
| 
      
 69 
     | 
    
         
            +
                  ['Author as org', %w[author @type], 'Organization'],
         
     | 
| 
       69 
70 
     | 
    
         
             
                  ['Author name', %w[author name], 'TestUser']
         
     | 
| 
       70 
71 
     | 
    
         
             
                ].each do |(desc, path, val)|
         
     | 
| 
       71 
72 
     | 
    
         
             
                  it "should render #{desc}[#{path.join('.')}]" do
         
     | 
| 
         @@ -74,4 +75,39 @@ RSpec.describe ArticleEntity do 
     | 
|
| 
       74 
75 
     | 
    
         
             
                  end
         
     | 
| 
       75 
76 
     | 
    
         
             
                end
         
     | 
| 
       76 
77 
     | 
    
         
             
              end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
              context 'with author as a Person' do
         
     | 
| 
      
 80 
     | 
    
         
            +
                let(:item) do
         
     | 
| 
      
 81 
     | 
    
         
            +
                  described_class.new(
         
     | 
| 
      
 82 
     | 
    
         
            +
                    mainEntityOfPage: {
         
     | 
| 
      
 83 
     | 
    
         
            +
                      web_page: 'https://exampla.com/blog/page'
         
     | 
| 
      
 84 
     | 
    
         
            +
                    },
         
     | 
| 
      
 85 
     | 
    
         
            +
                    headline: 'Test Article Title',
         
     | 
| 
      
 86 
     | 
    
         
            +
                    publisher: {
         
     | 
| 
      
 87 
     | 
    
         
            +
                      person_name: 'SiteOwner',
         
     | 
| 
      
 88 
     | 
    
         
            +
                      email: 'site.owner@example.com',
         
     | 
| 
      
 89 
     | 
    
         
            +
                      image: 'owner.png'
         
     | 
| 
      
 90 
     | 
    
         
            +
                    },
         
     | 
| 
      
 91 
     | 
    
         
            +
                    author: {
         
     | 
| 
      
 92 
     | 
    
         
            +
                      person_name: 'TestBlogger',
         
     | 
| 
      
 93 
     | 
    
         
            +
                      image: 'blogger.png'
         
     | 
| 
      
 94 
     | 
    
         
            +
                    }
         
     | 
| 
      
 95 
     | 
    
         
            +
                  )
         
     | 
| 
      
 96 
     | 
    
         
            +
                end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                [
         
     | 
| 
      
 99 
     | 
    
         
            +
                  ['Publisher as person', %w[publisher @type], 'Person'],
         
     | 
| 
      
 100 
     | 
    
         
            +
                  ['Publisher name', %w[publisher name], 'SiteOwner'],
         
     | 
| 
      
 101 
     | 
    
         
            +
                  ['Publisher email', %w[publisher email], 'site.owner@example.com'],
         
     | 
| 
      
 102 
     | 
    
         
            +
                  ['Publisher image', %w[publisher image], 'owner.png'],
         
     | 
| 
      
 103 
     | 
    
         
            +
                  ['Author as person', %w[author @type], 'Person'],
         
     | 
| 
      
 104 
     | 
    
         
            +
                  ['Author name', %w[author name], 'TestBlogger'],
         
     | 
| 
      
 105 
     | 
    
         
            +
                  ['Author image', %w[author image], 'blogger.png']
         
     | 
| 
      
 106 
     | 
    
         
            +
                ].each do |(desc, path, val)|
         
     | 
| 
      
 107 
     | 
    
         
            +
                  it "should render #{desc}[#{path.join('.')}]" do
         
     | 
| 
      
 108 
     | 
    
         
            +
                    expect(item.as_json.dig(*path)).to be_present
         
     | 
| 
      
 109 
     | 
    
         
            +
                    expect(item.as_json.dig(*path)).to eq val
         
     | 
| 
      
 110 
     | 
    
         
            +
                  end
         
     | 
| 
      
 111 
     | 
    
         
            +
                end
         
     | 
| 
      
 112 
     | 
    
         
            +
              end
         
     | 
| 
       77 
113 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: izi_json_ld
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - IzikAJ
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-03- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-03-18 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: dry-struct
         
     | 
| 
         @@ -55,6 +55,7 @@ files: 
     | 
|
| 
       55 
55 
     | 
    
         
             
            - app/entities/list_item_entity.rb
         
     | 
| 
       56 
56 
     | 
    
         
             
            - app/entities/offer_entity.rb
         
     | 
| 
       57 
57 
     | 
    
         
             
            - app/entities/organization_entity.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - app/entities/person_entity.rb
         
     | 
| 
       58 
59 
     | 
    
         
             
            - app/entities/product_entity.rb
         
     | 
| 
       59 
60 
     | 
    
         
             
            - app/entities/rating_entity.rb
         
     | 
| 
       60 
61 
     | 
    
         
             
            - app/entities/review_entity.rb
         
     | 
| 
         @@ -120,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       120 
121 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       121 
122 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       122 
123 
     | 
    
         
             
            requirements: []
         
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
            rubygems_version: 2.5.2.3
         
     | 
| 
      
 124 
     | 
    
         
            +
            rubygems_version: 3.1.2
         
     | 
| 
       125 
125 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       126 
126 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       127 
127 
     | 
    
         
             
            summary: Izi Lightup
         
     |