lense 0.3.4 → 0.3.5

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 +18 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a985317c752318434cd125d50af9e3edb429097d
4
- data.tar.gz: 10bb8e6d02530157ae24f49b7fc6ac87715c0590
3
+ metadata.gz: 642ab2773ac88e2bdb4611728d7aacbb5d86d28f
4
+ data.tar.gz: 5f0dda0541b7e275e40cd0e92b5ae846f9e8096c
5
5
  SHA512:
6
- metadata.gz: 30c9418559c0fef59d6259489315aa0f9c927e87b3274699b389e2abee19463fe1ff216d83870842e4b1e35044804259d5bf1300c4dc5564cad0d29d5a2df987
7
- data.tar.gz: b1b6f9bced70692fe184e2eccba16a85c67916e8095a0b59252e19a9ed7cd5d3cb15672168d0997e76c46d84e2e7cf38ef33a9b61718301369ba640d22362d00
6
+ metadata.gz: a9cd873d9a086d5ebe96bdf124eff6981f5fcc606032ecd79a0118f6942730bdd2cf60249061a725cbaf4de5346fc611633af821e12967689c15e104f1c244e0
7
+ data.tar.gz: 66514ee20f80fd94d403d09ad3d0bebaf34df6c4ad73231d528e343344146739e53918d1834ac795ea697781bf5058af94fc4b9029fde44c73f8471c3a74f4df
data/lib/lense.rb CHANGED
@@ -8,7 +8,7 @@ require 'psych'
8
8
  class LENSE
9
9
  attr_reader :config, :current_course, :lense_file_hash
10
10
 
11
- VERSION = '0.3.4'
11
+ VERSION = '0.3.5'
12
12
  LENSE_DIR = File.join(ENV['HOME'],'.lense')
13
13
  COURSES_DIR = File.join(LENSE_DIR,'courses')
14
14
  CURRENT_COURSE_FILE = File.join(LENSE_DIR,'current_course')
@@ -149,16 +149,25 @@ class LENSE
149
149
  end
150
150
 
151
151
  rows = @DB.execute 'select path from dependencies where not deleted;'
152
- if rows.length > 0
153
- say "\nUnstaged Modified Files:\n"
154
- rows.each do |row|
155
- path = row[0]
156
- dependency = get_dependency(path)
157
- hash = hash_file(path)
158
- say "\t<%= color('Modified: #{path}',:red) %>" unless hash = dependency[:file_hash]
159
- end
152
+ rows.map! do |row|
153
+ path = row[0]
154
+ {
155
+ path: path,
156
+ hash: hash_file(path),
157
+ }
158
+ end
159
+ files = rows.select do |file|
160
+ dependency = get_dependency(file[:path])
161
+ hash = hash_file(file[:path])
162
+ hash != dependency[:file_hash]
160
163
  end
161
164
 
165
+ if files.length > 0
166
+ say "\nUnstaged Modified Files:\n"
167
+ end
168
+ files.each do |file|
169
+ say "\t<%= color('Modified: #{file[:path]}',:red) %>"
170
+ end
162
171
  end
163
172
 
164
173
  def commit(msg)
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.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Zubieta