lense 0.1.34 → 0.1.35
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 +14 -14
- 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: be3f12acaccc21f3485bba48d63e0a41e07123f3
|
4
|
+
data.tar.gz: 99f4f893f2bcf3470f55220377e8431d0d7a9423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394affe97a84b904c8db385ba4b81e8c2faf2d348561be06f400e6bbece23566da414e993822604c6c0b7b4b9944d1fda8137821112486e5285d5c02ec43774e
|
7
|
+
data.tar.gz: c25d6849d5af275f3b2bf89267487a09532aeb5963f675cf08feff5fa218cf3d7f39882329544e7565ca8be44c48245ebec3f63c9ddc16b8de1a09720f1d8309
|
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.35'
|
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')
|
@@ -137,7 +137,7 @@ class LENSE
|
|
137
137
|
def status()
|
138
138
|
say "Hash : #{@lense_file_hash}"
|
139
139
|
exit_now!("Not a LENSE project: .lense") unless File.directory?(LOCAL_LENSE_DIR)
|
140
|
-
@
|
140
|
+
@DB.execute "select path from staging;".each { |p| say "Staged: #{p}"}
|
141
141
|
# check changes in depenancy files
|
142
142
|
# - for each depenceny
|
143
143
|
# - - get the current file hash
|
@@ -153,11 +153,11 @@ class LENSE
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def stage(file)
|
156
|
-
@
|
156
|
+
@DB.execute "insert into staging (path) values (?);", file if File.file?(file)
|
157
157
|
end
|
158
158
|
|
159
159
|
def unstage(file)
|
160
|
-
@
|
160
|
+
@DB.execute "delete from staging where path = '?';", file
|
161
161
|
end
|
162
162
|
|
163
163
|
def remove(file)
|
@@ -165,27 +165,27 @@ class LENSE
|
|
165
165
|
|
166
166
|
private
|
167
167
|
def setup_db()
|
168
|
-
@
|
168
|
+
@DB.execute <<-SQL
|
169
169
|
CREATE TABLE IF NOT EXISTS dependencies (
|
170
170
|
id integer primary key autoincrement,
|
171
171
|
path text not null,
|
172
172
|
added_at datetime not null
|
173
173
|
);
|
174
174
|
SQL
|
175
|
-
@
|
175
|
+
@DB.execute <<-SQL
|
176
176
|
CREATE UNIQUE INDEX IF NOT EXISTS dependency_path_idx ON dependencies (path);
|
177
177
|
SQL
|
178
|
-
@
|
178
|
+
@DB.execute <<-SQL
|
179
179
|
CREATE TABLE IF NOT EXISTS commits (
|
180
180
|
id integer primary key autoincrement,
|
181
181
|
hash text not null,
|
182
182
|
created_at datetime not null
|
183
183
|
);
|
184
184
|
SQL
|
185
|
-
@
|
185
|
+
@DB.execute <<-SQL
|
186
186
|
CREATE INDEX IF NOT EXISTS commits_hash_idx ON commits (hash);
|
187
187
|
SQL
|
188
|
-
@
|
188
|
+
@DB.execute <<-SQL
|
189
189
|
CREATE TABLE IF NOT EXISTS revisions (
|
190
190
|
id integer primary key autoincrement,
|
191
191
|
dependency_id integer not null,
|
@@ -194,22 +194,22 @@ class LENSE
|
|
194
194
|
created_at datetime not null
|
195
195
|
);
|
196
196
|
SQL
|
197
|
-
@
|
197
|
+
@DB.execute <<-SQL
|
198
198
|
CREATE INDEX IF NOT EXISTS revisions_hash_idx ON revisions (hash);
|
199
199
|
SQL
|
200
|
-
@
|
200
|
+
@DB.execute <<-SQL
|
201
201
|
CREATE INDEX IF NOT EXISTS revisions_dependency_id_idx ON revisions (dependency_id);
|
202
202
|
SQL
|
203
|
-
@
|
203
|
+
@DB.execute <<-SQL
|
204
204
|
CREATE INDEX IF NOT EXISTS revisions_commit_id_idx ON revisions (commit_id);
|
205
205
|
SQL
|
206
|
-
@
|
206
|
+
@DB.execute <<-SQL
|
207
207
|
CREATE TABLE IF NOT EXISTS staging (
|
208
208
|
id integer primary key autoincrement,
|
209
209
|
path text not null
|
210
210
|
);
|
211
211
|
SQL
|
212
|
-
@
|
212
|
+
@DB.execute <<-SQL
|
213
213
|
CREATE UNIQUE INDEX IF NOT EXISTS staging_path_idx ON staging (path);
|
214
214
|
SQL
|
215
215
|
end
|