File tree Expand file tree Collapse file tree 11 files changed +80
-20
lines changed Expand file tree Collapse file tree 11 files changed +80
-20
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ jobs:
14
14
15
15
steps :
16
16
- uses : actions/checkout@v3
17
- - name : Set up Ruby 2.6
17
+ - name : Set up Ruby 2.7
18
18
uses : actions/setup-ruby@v1
19
19
with :
20
- ruby-version : 2.6 .x
20
+ ruby-version : 2.7 .x
21
21
22
22
- name : Publish to RubyGems
23
23
run : |
Original file line number Diff line number Diff line change 1
1
## CHANGELOG
2
2
3
+ ## Version 0.6.4
4
+ ### Date: 17th-Apr-2023
5
+ ### Enhancement
6
+ - Include metadata support for Asset, Entry and Query,
7
+ - Region support for Azure-EU added
8
+
9
+ ------------------------------------------------
10
+
11
+ ## Version 0.6.3.1
12
+ ### Date: 17th-Mar-2023
13
+ ### Package Update
14
+ - Activesupport gem version limit removed (for supporting ruby v3.0 and above) .
15
+
16
+ ------------------------------------------------
17
+
3
18
## Version 0.6.3
4
19
### Date: 16th-Mar-2023
5
20
### Package Update
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- contentstack (0.6.3 )
5
- activesupport (~> 3.2 )
4
+ contentstack (0.6.4 )
5
+ activesupport (>= 3.2 )
6
6
contentstack_utils (~> 1.0 )
7
7
8
8
GEM
9
9
remote: https://rubygems.org/
10
10
specs:
11
- activesupport (3.2.22.5 )
12
- i18n (~> 0.6 , >= 0.6.4 )
13
- multi_json (~> 1.0 )
14
- addressable (2.8.1 )
11
+ activesupport (7.0.4.3 )
12
+ concurrent-ruby (~> 1.0 , >= 1.0.2 )
13
+ i18n (>= 1.6 , < 2 )
14
+ minitest (>= 5.1 )
15
+ tzinfo (~> 2.0 )
16
+ addressable (2.8.4 )
15
17
public_suffix (>= 2.0.2 , < 6.0 )
16
18
concurrent-ruby (1.2.2 )
17
- contentstack_utils (1.1.2 )
18
- activesupport (>= 3.2 , < 7.0.4 )
19
- nokogiri (~> 1.11 , >= 1.11.0 )
19
+ contentstack_utils (1.1.3. 2 )
20
+ activesupport (>= 3.2 )
21
+ nokogiri (~> 1.11 )
20
22
crack (0.4.5 )
21
23
rexml
22
24
diff-lcs (1.5.0 )
23
25
docile (1.4.0 )
24
26
hashdiff (1.0.1 )
25
- i18n (0.9.5 )
27
+ i18n (1.12.0 )
26
28
concurrent-ruby (~> 1.0 )
27
29
mini_portile2 (2.8.1 )
28
- multi_json ( 1.15 .0 )
29
- nokogiri (1.13.10 )
30
+ minitest ( 5.18 .0 )
31
+ nokogiri (1.14.3 )
30
32
mini_portile2 (~> 2.8.0 )
31
33
racc (~> 1.4 )
32
- nokogiri (1.13.10 -x64-mingw32 )
34
+ nokogiri (1.14.3 -x64-mingw32 )
33
35
racc (~> 1.4 )
34
36
public_suffix (5.0.1 )
35
37
racc (1.6.2 )
53
55
simplecov_json_formatter (~> 0.1 )
54
56
simplecov-html (0.12.3 )
55
57
simplecov_json_formatter (0.1.4 )
58
+ tzinfo (2.0.6 )
59
+ concurrent-ruby (~> 1.0 )
56
60
webmock (3.11.3 )
57
61
addressable (>= 2.3.6 )
58
62
crack (>= 0.3.2 )
59
63
hashdiff (>= 0.4.0 , < 2.0.0 )
60
- webrick (1.7.0 )
61
- yard (0.9.28 )
62
- webrick (~> 1.7.0 )
64
+ yard (0.9.34 )
63
65
64
66
PLATFORMS
65
67
ruby
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
s . files = `git ls-files` . split ( "\n " )
21
21
s . require_paths = [ "lib" ]
22
22
23
- s . add_dependency 'activesupport' , '~> 3.2'
23
+ s . add_dependency 'activesupport' , '>= 3.2'
24
24
s . add_dependency 'contentstack_utils' , '~> 1.0'
25
25
26
26
s . add_development_dependency 'rspec' , '~> 3.10.0'
Original file line number Diff line number Diff line change @@ -80,11 +80,16 @@ def sync(params)
80
80
81
81
private
82
82
def get_default_region_hosts ( region = 'us' )
83
+ host = "https://cdn.contentstack.io"
83
84
case region
84
85
when "us"
85
86
host = "https://cdn.contentstack.io"
86
87
when "eu"
87
88
host = "https://eu-cdn.contentstack.com"
89
+ when "azure-na"
90
+ host = "https://azure-na-cdn.contentstack.com"
91
+ when "azure-eu"
92
+ host = "https://azure-eu-cdn.contentstack.com"
88
93
end
89
94
host
90
95
end
Original file line number Diff line number Diff line change @@ -167,6 +167,20 @@ def include_branch(flag=true)
167
167
self
168
168
end
169
169
170
+ # Include the metadata for publish content.
171
+ #
172
+ # Example
173
+ #
174
+ # @entry = @stack.content_type('product').entry(entry_uid)
175
+ # @entry.include_metadata
176
+ #
177
+ # @return [Contentstack::Entry]
178
+ def include_metadata ( flag = true )
179
+ @query [ :include_metadata ] = flag
180
+ self
181
+ end
182
+
183
+
170
184
# Include Embedded Objects (Entries and Assets) along with entry/entries details.
171
185
#
172
186
# Example
Original file line number Diff line number Diff line change @@ -348,6 +348,18 @@ def include_count(flag=true)
348
348
self
349
349
end
350
350
351
+ # Retrieve count and data of objects in result.
352
+ #
353
+ # Example
354
+ # @query = @stack.content_type('category').query
355
+ # @query.include_metadata
356
+ #
357
+ # @return [Contentstack::Query]
358
+ def include_metadata ( flag = true )
359
+ @query [ :include_metadata ] = flag
360
+ self
361
+ end
362
+
351
363
# Sort the results in ascending order with the given key.
352
364
# Sort the returned entries in ascending order of the provided key.
353
365
#
Original file line number Diff line number Diff line change @@ -2,5 +2,7 @@ module Contentstack
2
2
class Region
3
3
EU = 'eu'
4
4
US = 'us'
5
+ AZURE_NA = 'azure-na'
6
+ AZURE_EU = 'azure-eu'
5
7
end
6
8
end
Original file line number Diff line number Diff line change 1
1
module Contentstack
2
- VERSION = "0.6.3 "
2
+ VERSION = "0.6.4 "
3
3
end
Original file line number Diff line number Diff line change 87
87
data = category . include_content_type . fetch
88
88
expect ( data . content_type ) . not_to be nil
89
89
end
90
+
91
+ it "should get data using `include_metadata` method" do
92
+ data = category . include_metadata . fetch
93
+ expect ( data . content_type ) . not_to be nil
94
+ end
90
95
91
96
it "should get data using `include_reference` method" do
92
97
data = product . include_reference ( 'categories' ) . fetch
Original file line number Diff line number Diff line change 65
65
expect ( data . count ) . to eq 5
66
66
end
67
67
68
+ it "should get data using `include_metadata` method" do
69
+ data = category_query . include_metadata . fetch
70
+ expect ( data . length ) . to eq 5
71
+ end
72
+
68
73
it "should get data using `only` method with string parameter" do
69
74
data = category_query . only ( "title" ) . fetch
70
75
expect ( data . first . fields [ :title ] ) . not_to be nil
You can’t perform that action at this time.
0 commit comments