lense 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +12 -1
  3. data/bin/lense +17 -2
  4. data/lense.gemspec +2 -3
  5. data/lib/lense.rb +1 -1
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5536b601870c998b17c2ea7a946b8a32949ecdea
4
- data.tar.gz: bf03879eaf5de65870c930f53140c1871dc08028
3
+ metadata.gz: c993d1ce47b9907ab8c5ac23e79d99dec6d5e27e
4
+ data.tar.gz: 46497b05673bc1e9c51407f175943461591fb099
5
5
  SHA512:
6
- metadata.gz: df951b16ed87b7ee26d570a0694565d7dcf8332f7a65f0be23605f8ee0cfe1fbe18c192e5e2363dec6f859bb47c60467038edbc52de390bb52c62d9748cc7611
7
- data.tar.gz: 5cc43acddd068fc8ca4ad34f86e1de18a96740ca54ae802eee88bc9c72fc23b65226ae65d54d84da86888e017d5d1e2ed8989746aa77daf4cf88952b1a8a88ac
6
+ metadata.gz: ceb37863ad7bc74d200f9f97d8483c41753866ef1bdb72f8e537533bb2f3d359377ec8c53c4a788cedfb0edb84493e96582d092bb1424c770c829b726e2cb36c
7
+ data.tar.gz: 50f5be19564b46cc8a3c344486ce68e3eac6d87cd5a7ac07411b68fa565b2b3cbaffe6e26bfc881797c0d920dfcd36067546d5f271013a91502e2385166c07eb
data/Rakefile CHANGED
@@ -3,4 +3,15 @@ task :default => :test
3
3
  desc 'run the tests'
4
4
  task :test do
5
5
  sh 'rspec spec'
6
- end
6
+ end
7
+
8
+ desc 'build the gem'
9
+ task :build do
10
+ sh 'gem build lense.gemspec'
11
+ end
12
+
13
+ require_relative 'lib/lense'
14
+ desc 'publish gem to rubygems.org'
15
+ task :publish do
16
+ sh "gem push lense-#{LENSE::VERSION}.gem"
17
+ end
data/bin/lense CHANGED
@@ -1,14 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'gli'
4
+ require 'lense/helpers'
4
5
 
5
6
  include GLI::App
6
7
 
7
8
  program_desc 'A tool for creating, executing and managing LENSE courses.'
8
9
 
10
+ desc "turn off warning logs."
11
+ switch [:q,:quiet]
12
+
9
13
  pre do |global_options,command,options,args|
10
- puts 'TODO add health and initialization check'
11
- true
14
+ found_docker = system_check('which docker')
15
+ docker_running = found_docker && system_check('docker version')
16
+ found_vagrant = system_check('which vagrant')
17
+
18
+ puts "WARNING: Docker not found. Unable to run courses that use Docker!" unless found_docker || global_options[:quiet]
19
+ puts "WARNING: Docker is not running. Unable to run courses that use Docker!" if (found_docker && !docker_running) && !global_options[:quiet]
20
+ puts "WARNING: Vagrant not found. Unable to run courses that use Vagrant!" unless found_vagrant || global_options[:quiet]
21
+
22
+ minimal_needed = found_docker || found_vagrant
23
+ puts global_options[:quiet]
24
+ puts "ERROR: Must have either Docker or Vagrant!" unless minimal_needed
25
+
26
+ minimal_needed
12
27
  end
13
28
 
14
29
  command :list do |c|
data/lense.gemspec CHANGED
@@ -3,8 +3,7 @@ require './lib/lense'
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'lense'
5
5
  s.version = LENSE::VERSION
6
- s.summary = 'Commandline tools for creation, distribution, and execution of \
7
- Lightweight Environment for Network Security Education (LENSE)'
6
+ s.summary = 'Commandline tools for creation, distribution, and execution of Lightweight Environment for Network Security Education (LENSE)'
8
7
  s.homepage = 'https://github.com/defunkt/gist'
9
8
  s.email = ['mazubieta@gmail.com', 'lance.lacoste@gmail.com']
10
9
  s.authors = ['Manuel Zubieta', 'Lance Lacoste']
@@ -15,4 +14,4 @@ Gem::Specification.new do |s|
15
14
 
16
15
  s.add_development_dependency 'rake'
17
16
  s.add_development_dependency 'rspec', '>3'
18
- end
17
+ end
data/lib/lense.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module LENSE
2
2
  extend self
3
3
 
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lense
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Zubieta
@@ -79,6 +79,6 @@ rubyforge_project:
79
79
  rubygems_version: 2.4.5
80
80
  signing_key:
81
81
  specification_version: 4
82
- summary: Commandline tools for creation, distribution, and execution of \ Lightweight
82
+ summary: Commandline tools for creation, distribution, and execution of Lightweight
83
83
  Environment for Network Security Education (LENSE)
84
84
  test_files: []