instructions_list 0.1.4.beta → 0.1.5.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/il +24 -12
- data/instructions/git.rb +8 -0
- data/instructions_list.gemspec +2 -0
- data/lib/instructions_list/version.rb +1 -1
- data/lib/instructions_list.rb +10 -10
- data/tests/_test_strap.rb +3 -0
- data/tests/dsl_tests.rb +10 -0
- metadata +32 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4b728bc89a8fdb314ee8fe3b3181b3a6b99a2b0
|
4
|
+
data.tar.gz: 3286949e39b6c0b6247d99c3d25e14e3a423769a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 665cb96b38e9bfab62b28b93db1a1f4e973dd5170056f997636c24d4876f2970ae15ffdebeb3d9025c12b96446d0eef7cdd318ee56bd3f38c66ee91ac27b2630
|
7
|
+
data.tar.gz: 95525cf12ec95c1254fa97b74dd8e36c5ca2fe180f8eaf2847c95ccd92c8761c401446604029d22fd6174979f79eb92a0b56f6d4df08f25336d6486bbb1f50d2
|
data/exe/il
CHANGED
@@ -20,30 +20,29 @@ module InstructionsList
|
|
20
20
|
def list
|
21
21
|
puts "add a new instruction"
|
22
22
|
end
|
23
|
-
no_tasks do
|
24
|
-
|
25
|
-
end
|
26
23
|
end
|
27
24
|
|
28
25
|
class CLI < Thor
|
26
|
+
include Thor::Actions
|
27
|
+
|
28
|
+
def self.source_root
|
29
|
+
File.dirname(__FILE__)
|
30
|
+
end
|
29
31
|
desc "init", "initialize a il directory"
|
30
32
|
def init
|
31
33
|
`mkdir -p ./.instructions/`
|
32
34
|
`mkdir -p instructions`
|
33
35
|
end
|
34
36
|
desc "reset", "reset state"
|
35
|
-
def reset
|
37
|
+
def reset
|
36
38
|
`rm ./.instructions/state`
|
37
39
|
end
|
38
40
|
desc "do", "do an instruction"
|
39
41
|
def do instruction=:all
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
Dir["./instructions/*.rb"].each {|file|
|
45
|
-
require file
|
46
|
-
}
|
43
|
+
load_from "Defaults","#{File.join(File.dirname(__FILE__), "../instructions/")}"
|
44
|
+
load_from "User","~/il/instructions/"
|
45
|
+
load_from "Project","./instructions/"
|
47
46
|
|
48
47
|
instruction = InstructionsList::INSTRUCTIONS.find{ |i| i.name == instruction }
|
49
48
|
raise "Ooooops cant find #{Instruction}" if instruction.nil?
|
@@ -55,9 +54,22 @@ module InstructionsList
|
|
55
54
|
end
|
56
55
|
|
57
56
|
no_tasks do
|
57
|
+
def load_from name, path
|
58
|
+
puts "search in #{name}"
|
59
|
+
|
60
|
+
if Dir["#{path}*.rb"].any?
|
61
|
+
Dir["#{path}*.rb"].each {|file|
|
62
|
+
pn = Pathname.new(file)
|
63
|
+
require file
|
64
|
+
puts " #{File.basename(pn)}".gsub(".rb","")
|
65
|
+
}
|
66
|
+
else
|
67
|
+
puts " none"
|
68
|
+
end
|
69
|
+
end
|
58
70
|
def execute instruction
|
59
|
-
unless instruction.
|
60
|
-
instruction.
|
71
|
+
unless instruction.instructed.call()
|
72
|
+
instruction.instruct.call()
|
61
73
|
done instruction.name
|
62
74
|
else
|
63
75
|
check instruction.name
|
data/instructions/git.rb
ADDED
data/instructions_list.gemspec
CHANGED
@@ -26,6 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.15"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "riot"
|
30
|
+
spec.add_development_dependency "rr"
|
29
31
|
spec.add_dependency "thor"
|
30
32
|
spec.add_dependency "pry"
|
31
33
|
|
data/lib/instructions_list.rb
CHANGED
@@ -5,16 +5,16 @@ module InstructionsList
|
|
5
5
|
INSTRUCTIONS=[]
|
6
6
|
class ItIs
|
7
7
|
def self.done? name
|
8
|
-
|
8
|
+
return false unless File.exists? "./.instructions/state"
|
9
9
|
File.readlines("./.instructions/state").include? "#{name}\n"
|
10
10
|
end
|
11
|
-
def self.running? name
|
12
|
-
|
13
|
-
end
|
14
|
-
def self.installed? exe_path
|
15
|
-
end
|
16
|
-
def self.exists? context,path
|
17
|
-
end
|
11
|
+
# def self.running? name
|
12
|
+
# #code
|
13
|
+
# end
|
14
|
+
# def self.installed? exe_path
|
15
|
+
# end
|
16
|
+
# def self.exists? context,path
|
17
|
+
# end
|
18
18
|
end
|
19
19
|
|
20
20
|
class Instruction
|
@@ -60,8 +60,8 @@ module InstructionsList
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def done(name)
|
63
|
-
`mkdir -p
|
64
|
-
`touch ./.
|
63
|
+
`mkdir -p './.instructions/'`
|
64
|
+
`touch ./.instructions/state`
|
65
65
|
`echo #{name} >> ./.instructions/state`
|
66
66
|
check name
|
67
67
|
end
|
data/tests/dsl_tests.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instructions_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coco Coder (aka Delaney Burke)
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: riot
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: thor
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,6 +112,7 @@ files:
|
|
84
112
|
- bin/console
|
85
113
|
- bin/setup
|
86
114
|
- exe/il
|
115
|
+
- instructions/git.rb
|
87
116
|
- instructions/test.rb
|
88
117
|
- instructions_list.gemspec
|
89
118
|
- lib/instructions_list.rb
|
@@ -91,6 +120,8 @@ files:
|
|
91
120
|
- lib/package_manager.rb
|
92
121
|
- tags
|
93
122
|
- templates/instruction.tt
|
123
|
+
- tests/_test_strap.rb
|
124
|
+
- tests/dsl_tests.rb
|
94
125
|
homepage: https://github.com/cococoder/instructions_list
|
95
126
|
licenses:
|
96
127
|
- MIT
|