Skip to content

Commit bd8b852

Browse files
committed
Utils SDK added
1 parent d6cfc8a commit bd8b852

File tree

6 files changed

+59
-38
lines changed

6 files changed

+59
-38
lines changed

Gemfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
# Gemfile
22
source "https://rubygems.org"
3-
4-
gem "rspec"
5-
gem "webmock"
6-
gem "simplecov"
7-
gem "activesupport"
8-
gem "yard"
9-
gem "contentstack_utils", path:'../contentstack-utils-ruby/'
3+
gemspec

Gemfile.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
PATH
2-
remote: ../contentstack-utils-ruby
2+
remote: .
33
specs:
4-
contentstack_utils (1.0.0)
5-
activesupport
6-
nokogiri
4+
contentstack (0.2.0)
5+
activesupport (> 3.2.5)
6+
contentstack_utils (~> 1.0.0)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
activesupport (6.1.1)
11+
activesupport (6.1.3.1)
1212
concurrent-ruby (~> 1.0, >= 1.0.2)
1313
i18n (>= 1.6, < 2)
1414
minitest (>= 5.1)
1515
tzinfo (~> 2.0)
1616
zeitwerk (~> 2.3)
1717
addressable (2.7.0)
1818
public_suffix (>= 2.0.2, < 5.0)
19-
concurrent-ruby (1.1.7)
19+
concurrent-ruby (1.1.8)
20+
contentstack_utils (1.0.0)
21+
activesupport (~> 6.1.0)
22+
nokogiri (~> 1.11.0)
2023
crack (0.4.5)
2124
rexml
2225
diff-lcs (1.4.4)
23-
docile (1.3.4)
26+
docile (1.3.5)
2427
hashdiff (1.0.1)
25-
i18n (1.8.7)
28+
i18n (1.8.10)
2629
concurrent-ruby (~> 1.0)
27-
mini_portile2 (2.5.0)
28-
minitest (5.14.3)
29-
nokogiri (1.11.1)
30-
mini_portile2 (~> 2.5.0)
30+
minitest (5.14.4)
31+
nokogiri (1.11.2-arm64-darwin)
3132
racc (~> 1.4)
3233
public_suffix (4.0.6)
3334
racc (1.5.2)
34-
rexml (3.2.4)
35+
rexml (3.2.5)
3536
rspec (3.10.0)
3637
rspec-core (~> 3.10.0)
3738
rspec-expectations (~> 3.10.0)
@@ -41,35 +42,34 @@ GEM
4142
rspec-expectations (3.10.1)
4243
diff-lcs (>= 1.2.0, < 2.0)
4344
rspec-support (~> 3.10.0)
44-
rspec-mocks (3.10.1)
45+
rspec-mocks (3.10.2)
4546
diff-lcs (>= 1.2.0, < 2.0)
4647
rspec-support (~> 3.10.0)
47-
rspec-support (3.10.1)
48-
simplecov (0.21.1)
48+
rspec-support (3.10.2)
49+
simplecov (0.21.2)
4950
docile (~> 1.1)
5051
simplecov-html (~> 0.11)
5152
simplecov_json_formatter (~> 0.1)
5253
simplecov-html (0.12.3)
5354
simplecov_json_formatter (0.1.2)
5455
tzinfo (2.0.4)
5556
concurrent-ruby (~> 1.0)
56-
webmock (3.11.0)
57+
webmock (3.11.3)
5758
addressable (>= 2.3.6)
5859
crack (>= 0.3.2)
5960
hashdiff (>= 0.4.0, < 2.0.0)
6061
yard (0.9.26)
6162
zeitwerk (2.4.2)
6263

6364
PLATFORMS
64-
ruby
65+
universal-darwin-19
6566

6667
DEPENDENCIES
67-
activesupport
68-
contentstack_utils!
69-
rspec
70-
simplecov
71-
webmock
72-
yard
68+
contentstack!
69+
rspec (~> 3.10.0)
70+
simplecov (~> 0.21.1)
71+
webmock (~> 3.11.0)
72+
yard (~> 0.9.26)
7373

7474
BUNDLED WITH
75-
1.17.2
75+
2.2.7

contentstack.gemspec

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ Gem::Specification.new do |s|
2121
s.require_paths = ["lib"]
2222

2323
s.add_dependency 'activesupport', "> 3.2.5"
24-
s.add_runtime_dependency "contentstack_utils"
25-
26-
s.add_development_dependency 'rspec'
27-
s.add_development_dependency 'webmock'
28-
s.add_development_dependency 'simplecov'
24+
s.add_dependency "contentstack_utils", "~> 1.0.0"
25+
26+
s.add_development_dependency 'rspec', '~> 3.10.0'
27+
s.add_development_dependency 'webmock', '~> 3.11.0'
28+
s.add_development_dependency 'simplecov', '~> 0.21.1'
29+
s.add_development_dependency 'yard', '~> 0.9.26'
2930
end

lib/contentstack.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "contentstack/version"
44
require "contentstack/client"
55
require "contentstack/region"
6-
require 'contentstack_utils'
6+
require "contentstack_utils"
77
require "util"
88

99

lib/contentstack/entry.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ def include_fallback(flag=true)
152152
self
153153
end
154154

155+
# Include Embedded Objects (Entries and Assets) along with entry/entries details.
156+
#
157+
# Example
158+
#
159+
# @entry = @stack.content_type('product').entry(entry_uid)
160+
# @entry.include_embedded_items
161+
#
162+
# @return [Contentstack::Query]
163+
def include_embedded_items()
164+
@query[:include_embedded_items] = ['BASE']
165+
self
166+
end
167+
155168
#
156169
# @return [Contentstack::Query]
157170
def include(field_uids)

lib/contentstack/query.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,19 @@ def include_fallback(flag=true)
516516
self
517517
end
518518

519+
# Include Embedded Objects (Entries and Assets) along with entry/entries details.
520+
#
521+
# Example
522+
#
523+
# @query = @stack.content_type('product').query
524+
# @query.include_embedded_items
525+
#
526+
# @return [Contentstack::Query]
527+
def include_embedded_items()
528+
@query[:include_embedded_items] = ['BASE']
529+
self
530+
end
531+
519532
# Include objects in 'Draft' mode in response
520533
#
521534
# Example

0 commit comments

Comments
 (0)