lense 0.1.40 → 0.1.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lense.rb +7 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bbdf21aadab61017389535e532066172719aee1
|
4
|
+
data.tar.gz: 75a77c016ee8d9123186b82ceb7c4dc0831de854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b629be34db17d4e5682bde3ef8d78693eb73687802748b2f8a8d89e371db7aae01188352c833607a5ddfe3d2c949ed82e9721f68f83b0db332f0072dd60a14f
|
7
|
+
data.tar.gz: ac24c186f30769e59412cbc39a827562c4378926027f90f3788a84a255ec10425647451f2a7ec29f1d7aafd065a59625889b985c953493b94d4fe963410a4859
|
data/lib/lense.rb
CHANGED
@@ -6,7 +6,7 @@ require 'sqlite3'
|
|
6
6
|
class LENSE
|
7
7
|
attr_reader :config, :current_course, :lense_file_hash
|
8
8
|
|
9
|
-
VERSION = '0.1.
|
9
|
+
VERSION = '0.1.41'
|
10
10
|
LENSE_DIR = File.join(ENV['HOME'],'.lense')
|
11
11
|
COURSES_DIR = File.join(LENSE_DIR,'courses')
|
12
12
|
CURRENT_COURSE_FILE = File.join(LENSE_DIR,'current_course')
|
@@ -122,7 +122,7 @@ class LENSE
|
|
122
122
|
file.puts "title: Uninitialized Project"
|
123
123
|
file.puts "difficulty:"
|
124
124
|
file.puts "authors: []"
|
125
|
-
file.puts "
|
125
|
+
file.puts "dependencies: []"
|
126
126
|
file.puts "up:"
|
127
127
|
file.puts " - echo 'Hello'"
|
128
128
|
file.puts "down:"
|
@@ -162,18 +162,17 @@ class LENSE
|
|
162
162
|
def stage(file)
|
163
163
|
if File.file?(file)
|
164
164
|
dependency = get_dependency(file)
|
165
|
-
if
|
165
|
+
if dependency.nil?
|
166
166
|
should_stage = true
|
167
167
|
else
|
168
168
|
current_hash = Digest::SHA256.hexdigest(File.read(file))
|
169
|
-
rows = @DB.execute "select "
|
170
169
|
# is it modified?
|
171
|
-
if
|
172
|
-
say "Staging because we haven't seen this revision"
|
173
|
-
should_stage = true
|
174
|
-
else
|
170
|
+
if dependency.file_hash == current_hash
|
175
171
|
say "Not Staging because we've seen this file"
|
176
172
|
should_stage = false
|
173
|
+
else
|
174
|
+
say "Staging because we haven't seen this revision"
|
175
|
+
should_stage = true
|
177
176
|
end
|
178
177
|
end
|
179
178
|
|