Skip to content

Commit

Permalink
Updates the example
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed Mar 27, 2019
1 parent 02e7707 commit a7bea7f
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions example/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AllCops:
TargetRubyVersion: 2.3
Exclude:
- '*.gemspec'
- 'vendor/**/*'
Expand Down
2 changes: 2 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

source 'https://rubygems.org'
gemspec
2 changes: 2 additions & 0 deletions example/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
Expand Down
4 changes: 3 additions & 1 deletion example/app/app.rb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require_relative 'controllers'
# frozen_string_literal: true

require_relative 'controllers/example'
1 change: 0 additions & 1 deletion example/app/controllers.rb

This file was deleted.

2 changes: 2 additions & 0 deletions example/app/controllers/example.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module CMSScan
module Controller
# Example Controller
Expand Down
1 change: 1 addition & 0 deletions example/bin/cmsscan
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'cmsscan'

Expand Down
4 changes: 2 additions & 2 deletions example/cmsscan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Gem::Specification.new do |s|
s.executables = ['cmsscan']
s.require_paths = ['lib']

s.add_dependency 'cms_scanner', '~> 0.0.41.1'
s.add_dependency 'cms_scanner', '~> 0.0.42.0'

s.add_development_dependency 'bundler', '>= 1.6'
s.add_development_dependency 'coveralls', '~> 0.8.0'
s.add_development_dependency 'rake', '~> 12.3'
s.add_development_dependency 'rspec', '~> 3.8.0'
s.add_development_dependency 'rspec-its', '~> 1.2.0'
s.add_development_dependency 'rubocop', '~> 0.62.0'
s.add_development_dependency 'rubocop', '~> 0.66.0'
s.add_development_dependency 'simplecov', '~> 0.16.1'
s.add_development_dependency 'webmock', '~> 3.5.1'
end
2 changes: 2 additions & 0 deletions example/lib/cmsscan.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Gems
require 'cms_scanner'
require 'yajl/json_gem'
Expand Down
2 changes: 2 additions & 0 deletions example/lib/cmsscan/controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module CMSScan
# Needed to load at least the Core controller
# Otherwise, the following error will be raised:
Expand Down
9 changes: 9 additions & 0 deletions example/lib/cmsscan/target.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# frozen_string_literal: true

module CMSScan
# Custom Target Class
class Target < CMSScanner::Target
# Put your own methods there

# Method which should be defined.
# Used to set a specific exit code if the scan found issues
# See the CMSScanner/lib/cms_scanner/exit_code.rb
def vulnerable?
false
end
end
end
5 changes: 3 additions & 2 deletions example/lib/cmsscan/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Version
# frozen_string_literal: true

module CMSScan
VERSION = '1.0'.freeze
VERSION = '1.0'
end
2 changes: 2 additions & 0 deletions example/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'simplecov'
Expand Down

0 comments on commit a7bea7f

Please sign in to comment.