Skip to content

Commit d6cfc8a

Browse files
committed
feat: ✨ Added Utils Functionality
1 parent 86e6f1c commit d6cfc8a

File tree

5 files changed

+57
-36
lines changed

5 files changed

+57
-36
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ coverage
77
\.yardoc
88
.DS_Store
99
.bundle/
10-
*/rspec_results.html
10+
*/rspec_results.html
11+
/vendor/*

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ gem "rspec"
55
gem "webmock"
66
gem "simplecov"
77
gem "activesupport"
8-
gem "yard"
8+
gem "yard"
9+
gem "contentstack_utils", path:'../contentstack-utils-ruby/'

Gemfile.lock

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,75 @@
1+
PATH
2+
remote: ../contentstack-utils-ruby
3+
specs:
4+
contentstack_utils (1.0.0)
5+
activesupport
6+
nokogiri
7+
18
GEM
29
remote: https://rubygems.org/
310
specs:
4-
activesupport (6.0.3.1)
11+
activesupport (6.1.1)
512
concurrent-ruby (~> 1.0, >= 1.0.2)
6-
i18n (>= 0.7, < 2)
7-
minitest (~> 5.1)
8-
tzinfo (~> 1.1)
9-
zeitwerk (~> 2.2, >= 2.2.2)
13+
i18n (>= 1.6, < 2)
14+
minitest (>= 5.1)
15+
tzinfo (~> 2.0)
16+
zeitwerk (~> 2.3)
1017
addressable (2.7.0)
1118
public_suffix (>= 2.0.2, < 5.0)
12-
concurrent-ruby (1.1.6)
13-
crack (0.4.3)
14-
safe_yaml (~> 1.0.0)
15-
diff-lcs (1.3)
16-
docile (1.3.2)
19+
concurrent-ruby (1.1.7)
20+
crack (0.4.5)
21+
rexml
22+
diff-lcs (1.4.4)
23+
docile (1.3.4)
1724
hashdiff (1.0.1)
18-
i18n (1.8.2)
25+
i18n (1.8.7)
1926
concurrent-ruby (~> 1.0)
20-
minitest (5.14.1)
21-
public_suffix (4.0.4)
22-
rspec (3.9.0)
23-
rspec-core (~> 3.9.0)
24-
rspec-expectations (~> 3.9.0)
25-
rspec-mocks (~> 3.9.0)
26-
rspec-core (3.9.1)
27-
rspec-support (~> 3.9.1)
28-
rspec-expectations (3.9.1)
27+
mini_portile2 (2.5.0)
28+
minitest (5.14.3)
29+
nokogiri (1.11.1)
30+
mini_portile2 (~> 2.5.0)
31+
racc (~> 1.4)
32+
public_suffix (4.0.6)
33+
racc (1.5.2)
34+
rexml (3.2.4)
35+
rspec (3.10.0)
36+
rspec-core (~> 3.10.0)
37+
rspec-expectations (~> 3.10.0)
38+
rspec-mocks (~> 3.10.0)
39+
rspec-core (3.10.1)
40+
rspec-support (~> 3.10.0)
41+
rspec-expectations (3.10.1)
2942
diff-lcs (>= 1.2.0, < 2.0)
30-
rspec-support (~> 3.9.0)
31-
rspec-mocks (3.9.1)
43+
rspec-support (~> 3.10.0)
44+
rspec-mocks (3.10.1)
3245
diff-lcs (>= 1.2.0, < 2.0)
33-
rspec-support (~> 3.9.0)
34-
rspec-support (3.9.2)
35-
safe_yaml (1.0.5)
36-
simplecov (0.18.5)
46+
rspec-support (~> 3.10.0)
47+
rspec-support (3.10.1)
48+
simplecov (0.21.1)
3749
docile (~> 1.1)
3850
simplecov-html (~> 0.11)
39-
simplecov-html (0.12.2)
40-
thread_safe (0.3.6)
41-
tzinfo (1.2.7)
42-
thread_safe (~> 0.1)
43-
webmock (3.8.3)
51+
simplecov_json_formatter (~> 0.1)
52+
simplecov-html (0.12.3)
53+
simplecov_json_formatter (0.1.2)
54+
tzinfo (2.0.4)
55+
concurrent-ruby (~> 1.0)
56+
webmock (3.11.0)
4457
addressable (>= 2.3.6)
4558
crack (>= 0.3.2)
4659
hashdiff (>= 0.4.0, < 2.0.0)
47-
yard (0.9.25)
48-
zeitwerk (2.3.0)
60+
yard (0.9.26)
61+
zeitwerk (2.4.2)
4962

5063
PLATFORMS
5164
ruby
5265

5366
DEPENDENCIES
5467
activesupport
68+
contentstack_utils!
5569
rspec
5670
simplecov
5771
webmock
5872
yard
5973

6074
BUNDLED WITH
61-
2.1.4
75+
1.17.2

contentstack.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ 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"
2425

2526
s.add_development_dependency 'rspec'
2627
s.add_development_dependency 'webmock'

lib/contentstack.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require "contentstack/version"
44
require "contentstack/client"
55
require "contentstack/region"
6+
require 'contentstack_utils'
67
require "util"
78

89

@@ -22,4 +23,7 @@
2223
# ==== Query entries
2324
# @stack.content_type('blog').query.regex('title', '.*hello.*').fetch
2425
module Contentstack
26+
def self.render_content(content, options)
27+
ContentstackUtils.render_content(content, options)
28+
end
2529
end

0 commit comments

Comments
 (0)