Skip to content

Commit

Permalink
Removed changelog from landing page and cleanup unused methods & depe…
Browse files Browse the repository at this point in the history
…ndency

Signed-off-by: Vanessa Fotso <[email protected]>
  • Loading branch information
vanessuniq committed Oct 2, 2023
1 parent d463284 commit 6956429
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 42 deletions.
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ gem 'rubyzip'
gem 'mitre-inspec-objects'
gem 'rest-client'

# Markdown processing
gem 'redcarpet'

group :development do
gem 'listen', '~> 3.1.5'
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ GEM
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.6.0)
regexp_parser (2.2.1)
request_store (1.5.1)
rack (>= 1.4)
Expand Down Expand Up @@ -565,7 +564,6 @@ DEPENDENCIES
pg (>= 0.18, < 2.0)
puma (~> 5.6)
rails (~> 6.1.4)
redcarpet
rest-client
rspec-mocks
rspec-rails (~> 4.0.0)
Expand Down
35 changes: 0 additions & 35 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,4 @@ def base_navigation

nav_links
end

# Get the latest release changes to display on the landing page
def latest_release_details
changelog_path = Rails.root.join('CHANGELOG.md')
release_details = ''

begin
File.open(changelog_path, 'r') do |file|
line = file.gets
while line
if line.start_with?('## [v')
# Found the beginning of a release, start reading details
release_details = line
line = file.gets
while line && !line.start_with?('## [v')
release_details += line
line = file.gets
end
# Exit the loop once the latest release details have been read
break
end
line = file.gets
end
end
rescue StandardError => e
Rails.logger.error "Unable to read latest release: #{e.message}"
end

release_details
end

def markdown_to_html(text)
options = %i[hard_wrap autolink no_intra_emphasis fenced_code_blocks]
Markdown.new(text, *options).to_html
end
end
5 changes: 4 additions & 1 deletion app/javascript/components/navbar/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<b-navbar toggleable="lg" type="dark" variant="dark">
<b-navbar-brand id="heading" href="/">
<i class="mdi mdi-radar" aria-hidden="true" />
VULCAN <span class="latest-release">{{ currentVersion }}</span>
VULCAN
<b-link href="https://vulcan.mitre.org/CHANGELOG.html" target="_blank">
<span class="latest-release">{{ currentVersion }}</span>
</b-link>
</b-navbar-brand>
<b-navbar-toggle target="nav-collapse" />

Expand Down
1 change: 0 additions & 1 deletion app/views/devise/shared/_what_is_vulcan.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

%p Vulcan helps Subject Matter Experts (SMEs) apply Security Requirements Guides (SRGs) to author Security Technical Implementation Guides (STIGs) & corresponding InSpec Profiles as security testing content.
%p=Settings['welcome_text']
%div.h-25.mt-4.p-2.overflow-auto=markdown_to_html(latest_release_details).html_safe

0 comments on commit 6956429

Please sign in to comment.