lense 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lense.rb +9 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1c255e67aca842a9f42eec6c56c2f30e5b52bf
4
- data.tar.gz: 16ca5fb148c64ebc0595beca638a3a7d58fd38e0
3
+ metadata.gz: c87de13b1733ae9f75203599c6bf3aadc779a9f5
4
+ data.tar.gz: 6e33398067eb91a40ff3dbf2e50cf5eed0c267cd
5
5
  SHA512:
6
- metadata.gz: fef97de3bb0f9a70585ccc65284cca5234e2596908133043ae639132109fc0591a5d9494634cce68c02a0f5e3281878f77b762643cbbf9c7654184bd6eb0c9ed
7
- data.tar.gz: 37cac146a3d01728efbe1a8d158ec76532b9aec777cf989b25b7016640e7a0a6e83e56e00baf40089c4505a506223c2ebee7a1807c6414ace7f8c6e184ce83fb
6
+ metadata.gz: c1d8f8808a3b9f4088ce1450b94a3cf4f28ed0a7d7d6d21cb65751f1a3db0fb72950f2bf1b307bfaeace10c412d8506c95e8758132807a17efc39d863cae2005
7
+ data.tar.gz: fd0864cb9f74af352ecfc5b4a6983360efed45baecb2836dab2c30689b2ad3f5c3452cd443f9f3fa80cfac512d61bdf7f4b8bf142893173dbd0cacbff002d902
data/lib/lense.rb CHANGED
@@ -1,15 +1,18 @@
1
1
  require 'rest-client'
2
2
  require 'highline/import'
3
+ require 'digest'
3
4
 
4
5
  class LENSE
5
- attr_reader :config, :current_course
6
+ attr_reader :config, :current_course, :lense_file_hash
6
7
 
7
- VERSION = '0.1.30'
8
+ VERSION = '0.1.31'
8
9
  LENSE_DIR = File.join(ENV['HOME'],'.lense')
9
10
  COURSES_DIR = File.join(LENSE_DIR,'courses')
10
11
  CURRENT_COURSE_FILE = File.join(LENSE_DIR,'current_course')
11
12
  LOCAL_LENSE_DIR = File.join(ENV['PWD'],'.lense')
12
13
  DEPS_DIR = File.join(LOCAL_LENSE_DIR,'deps')
14
+ REFS_DIR = File.join(LOCAL_LENSE_DIR,'refs')
15
+ CURRENT_REF_FILE = File.join(REFS_DIR,'current')
13
16
  LENSE_FILE = File.join(ENV['PWD'],'LENSEfile')
14
17
 
15
18
  def initialize()
@@ -24,6 +27,7 @@ class LENSE
24
27
 
25
28
  @current_course = File.read(CURRENT_COURSE_FILE).strip()
26
29
  @current_course = '> NOT SET <' if @current_course.empty?
30
+ @lense_file_hash = Digest::SHA256.hexdigest(File.read(LENSE_FILE)) if File.file?(LENSE_FILE)
27
31
  end
28
32
 
29
33
  def select_course(course)
@@ -108,6 +112,8 @@ class LENSE
108
112
  def init()
109
113
  Dir.mkdir(LOCAL_LENSE_DIR) unless File.directory?(LOCAL_LENSE_DIR)
110
114
  Dir.mkdir(DEPS_DIR) unless File.directory?(DEPS_DIR)
115
+ Dir.mkdir(REFS_DIR) unless File.directory?(REFS_DIR)
116
+ File.open(CURRENT_REF_FILE, 'w') {} unless File.file?(CURRENT_REF_FILE)
111
117
  unless File.file?(LENSE_FILE)
112
118
  File.open(LENSE_FILE,'w') do |file|
113
119
  file.puts "---"
@@ -126,6 +132,7 @@ class LENSE
126
132
  end
127
133
 
128
134
  def status()
135
+ say "Hash : #{@lense_file_hash}"
129
136
  exit_now!("Not a LENSE project: .lense") unless File.directory?(LOCAL_LENSE_DIR)
130
137
  end
131
138
  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.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Zubieta