instructions_list 1.0.7.1.beta → 1.0.7.2.beta
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/exe/il +17 -23
- data/lib/instructions_list/version.rb +1 -1
- data/lib/instructions_list.rb +6 -6
- 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: c18448048e7594a46d847f6a5f92ca9c30034a63
|
4
|
+
data.tar.gz: 9c0a3730bed3ac017b56b7e7308b817b60e6dd3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c98b14e20d383e832baadd035157f3e0197cec7e87518fbd500e391f2e07d25d3a954cb802488a8e8096d493fb24e77e59e74b7d7350b76b3cbb60cc76ffc0e5
|
7
|
+
data.tar.gz: d8ab5027c24594659eac50e855c268081d2634bc95f1484666ab3cbcdf7d87a770de6cb95bf606795d93e4a4a40daf4ec922ab8c4defe6e8bdf28669ad44fed4
|
data/exe/il
CHANGED
@@ -14,30 +14,24 @@ module InstructionsList
|
|
14
14
|
end
|
15
15
|
desc "init KEY", "initialize a il directory with list key"
|
16
16
|
def init key
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
system "mkdir -p #{INSTRUCTIONS_DIR}"
|
18
|
+
system "touch #{KEY_PATH}"
|
19
|
+
system "echo #{key} > #{KEY_PATH}"
|
20
20
|
end
|
21
21
|
desc "reset", "reset state"
|
22
|
-
def reset
|
22
|
+
def reset
|
23
23
|
instructable do
|
24
|
-
if
|
25
|
-
`rm #{STATE}` if File.exists? STATE
|
26
|
-
`rm -rf .instructions`
|
27
|
-
return
|
28
|
-
end
|
29
|
-
|
30
|
-
`ex +g/#{name}/d -cwq #{STATE}`
|
24
|
+
system "rm -rf .instructions" if File.exists? STATE
|
31
25
|
end
|
32
26
|
end
|
33
27
|
desc "sync", "synchronize the instructions"
|
34
28
|
option :reset
|
35
29
|
def sync
|
36
30
|
if instructable?
|
37
|
-
|
38
|
-
|
31
|
+
system "mkdir -p #{PROJECT_CACHE}"
|
32
|
+
system "mkdir -p #{PROJECT_CACHE_ARTIFACTS}"
|
39
33
|
if options[:reset]
|
40
|
-
|
34
|
+
system "rm -rf #{PROJECT_CACHE}" if Dir.exists? PROJECT_CACHE
|
41
35
|
return
|
42
36
|
end
|
43
37
|
instructable do
|
@@ -101,7 +95,7 @@ module InstructionsList
|
|
101
95
|
instructable do
|
102
96
|
load_from "Instructions", HOME_CACHE << "/" if home?
|
103
97
|
load_from "Projects", PROJECT_CACHE << "/" if project?
|
104
|
-
do_instruction name, STACK, options[:force]
|
98
|
+
do_instruction name, STACK, options[:force]
|
105
99
|
|
106
100
|
end
|
107
101
|
rescue => e
|
@@ -128,14 +122,14 @@ module InstructionsList
|
|
128
122
|
instructable do
|
129
123
|
load_from "Instructions", HOME_CACHE << "/" if home?
|
130
124
|
load_from "Projects", PROJECT_CACHE << "/" if project?
|
131
|
-
undo_instruction name, STACK, options[:force]
|
125
|
+
undo_instruction name, STACK, options[:force]
|
132
126
|
|
133
127
|
end
|
134
128
|
rescue => e
|
135
129
|
puts ""
|
136
130
|
puts e.message
|
137
131
|
puts ""
|
138
|
-
|
132
|
+
system "il list"
|
139
133
|
puts ""
|
140
134
|
end
|
141
135
|
|
@@ -146,11 +140,11 @@ module InstructionsList
|
|
146
140
|
|
147
141
|
no_tasks do
|
148
142
|
def sync_home_instructions
|
149
|
-
|
143
|
+
system "mkdir -p /tmp/il/cache"
|
150
144
|
Dir.chdir ENV['HOME'] do
|
151
145
|
|
152
146
|
if options[:reset]
|
153
|
-
|
147
|
+
system "rm -rf #{HOME_CACHE}" if Dir.exists? HOME_CACHE
|
154
148
|
return
|
155
149
|
end
|
156
150
|
|
@@ -224,7 +218,7 @@ module InstructionsList
|
|
224
218
|
end
|
225
219
|
end
|
226
220
|
|
227
|
-
def do_instruction name, stack, force
|
221
|
+
def do_instruction name, stack, force
|
228
222
|
instruction = InstructionsList::INSTRUCTIONS.find { |i|
|
229
223
|
command_name(i.name.gsub(" ","_")) == command_name(name)
|
230
224
|
}
|
@@ -232,14 +226,14 @@ module InstructionsList
|
|
232
226
|
instruction.depends_on.each do |dependancy|
|
233
227
|
unless stack.include? command_name(dependancy.gsub(" ","_"))
|
234
228
|
stack << command_name(dependancy.gsub(" ","_"))
|
235
|
-
do_instruction(command_name(dependancy.gsub(" ", "_")), stack, force
|
229
|
+
do_instruction(command_name(dependancy.gsub(" ", "_")), stack, force)
|
236
230
|
end
|
237
231
|
end
|
238
232
|
execute_instruction instruction, force: force
|
239
233
|
|
240
234
|
end
|
241
235
|
|
242
|
-
def undo_instruction name, stack, force
|
236
|
+
def undo_instruction name, stack, force
|
243
237
|
instruction = InstructionsList::INSTRUCTIONS.find { |i|
|
244
238
|
command_name(i.name.gsub(" ","_")) == command_name(name)
|
245
239
|
}
|
@@ -247,7 +241,7 @@ module InstructionsList
|
|
247
241
|
instruction.depends_on.each do |dependancy|
|
248
242
|
unless stack.include? command_name(dependancy.gsub(" ","_"))
|
249
243
|
stack << command_name(dependancy.gsub(" ","_"))
|
250
|
-
undo_instruction(command_name(dependancy.gsub(" ", "_")), stack, force
|
244
|
+
undo_instruction(command_name(dependancy.gsub(" ", "_")), stack, force)
|
251
245
|
end
|
252
246
|
end
|
253
247
|
|
data/lib/instructions_list.rb
CHANGED
@@ -40,7 +40,7 @@ module InstructionsList
|
|
40
40
|
@depends_on = []
|
41
41
|
end
|
42
42
|
attr_reader :depends_on
|
43
|
-
attr_accessor :name,:instructed,:instruct
|
43
|
+
attr_accessor :name,:instructed,:instruct,:uninstruct
|
44
44
|
end
|
45
45
|
|
46
46
|
module DSL
|
@@ -84,13 +84,13 @@ module InstructionsList
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def mark_as_done(name)
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
system "mkdir -p './.instructions/'"
|
88
|
+
system "touch #{STATE}"
|
89
|
+
system "echo #{command_name(name.to_s.gsub(" ","_"))} >> #{STATE}"
|
90
90
|
check command_name(name)
|
91
91
|
end
|
92
92
|
def mark_as_undone(name)
|
93
|
-
|
93
|
+
system "ex +g/#{name}/d -cwq #{STATE}"
|
94
94
|
end
|
95
95
|
|
96
96
|
def command_name(name)
|
@@ -103,7 +103,7 @@ module InstructionsList
|
|
103
103
|
def check name
|
104
104
|
|
105
105
|
unless CHECKED.include? command_name(name)
|
106
|
-
|
106
|
+
system "echo #{command_name(name)} ✔︎"
|
107
107
|
return
|
108
108
|
end
|
109
109
|
|