Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-26 09:10:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-26 09:10:34 +0300
commitfb553bbc1899eddaddb07cd9685cdabffbed9962 (patch)
tree473f1ad59a01e98d6ee1a04f462e524bb585f1e4 /app/helpers/whats_new_helper.rb
parenta51e52bf5b7a708255a858ca51de8d4a6e58b074 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/whats_new_helper.rb')
-rw-r--r--app/helpers/whats_new_helper.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/helpers/whats_new_helper.rb b/app/helpers/whats_new_helper.rb
new file mode 100644
index 00000000000..f0044daa645
--- /dev/null
+++ b/app/helpers/whats_new_helper.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module WhatsNewHelper
+ EMPTY_JSON = ''.to_json
+
+ def whats_new_most_recent_release_items
+ YAML.load_file(most_recent_release_file_path).to_json
+
+ rescue => e
+ Gitlab::ErrorTracking.track_exception(e, yaml_file_path: most_recent_release_file_path)
+
+ EMPTY_JSON
+ end
+
+ private
+
+ def most_recent_release_file_path
+ Dir.glob(files_path).max
+ end
+
+ def files_path
+ Rails.root.join('data', 'whats_new', '*.yml')
+ end
+end