lense 0.1.18 → 0.1.19
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/bin/lense +3 -2
- data/lib/lense.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c561f54896fcd156fabe599e9207c6d397ea0605
|
4
|
+
data.tar.gz: 200b1105f9a528d8dfc82b6a453a248fb64c1783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e58e825b1a08fa3cc06036cb611315d4c40c98978d3eec1112b477c4293c307d054c45aad7bcf27f7e3158755d17853c2380f394d75e8d5b1ab5de862c2fd22
|
7
|
+
data.tar.gz: 678321ea7f32bf412afd2735fd13e6c3c98122bc3d00c75188ed11409c0a312fd1afd194cb5bd14dabb10100cf03b8cee1e865d310370a776e79c2fae01f0bdc
|
data/Gemfile
CHANGED
data/bin/lense
CHANGED
@@ -36,8 +36,9 @@ command :list do |c|
|
|
36
36
|
end
|
37
37
|
|
38
38
|
command :search do |c|
|
39
|
-
c.action do
|
40
|
-
|
39
|
+
c.action do |global_options,options,args|
|
40
|
+
exit_now!('Must supply search item.') if args.count < 1
|
41
|
+
LENSE_APP.search args[0]
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
data/lib/lense.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
require 'rest-client'
|
1
2
|
class LENSE
|
2
3
|
attr_reader :config, :current_course
|
3
4
|
|
4
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.19'
|
5
6
|
LENSE_DIR = File.join(ENV['HOME'],'.lense')
|
6
7
|
COURSES_DIR = File.join(LENSE_DIR,'courses')
|
7
8
|
CURRENT_COURSE_FILE = File.join(LENSE_DIR,'current_course')
|
@@ -42,4 +43,18 @@ class LENSE
|
|
42
43
|
end
|
43
44
|
puts "> Indicates current course"
|
44
45
|
end
|
46
|
+
|
47
|
+
def search(term)
|
48
|
+
puts "Searching course repository ..."
|
49
|
+
response = RestClient.get 'http://lightweightnetsec.com/lessons', { params: { format: 'json', text: term } }
|
50
|
+
courses = JSON.parse(response)
|
51
|
+
courses.each do |c|
|
52
|
+
puts "---"
|
53
|
+
puts "Title: #{c['title']}"
|
54
|
+
puts "Description: #{c['description']}"
|
55
|
+
print "Difficulty: "
|
56
|
+
c['difficulty'].times { print '*' }
|
57
|
+
puts ""
|
58
|
+
end
|
59
|
+
end
|
45
60
|
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.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Zubieta
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|