instructions_list 0.1.4.beta → 0.1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f22678bc8c4b418eddab8ec8144ef0f003f372f9
4
- data.tar.gz: bcc566593d1a3938db9cc444f6264d8851665ae2
3
+ metadata.gz: b4b728bc89a8fdb314ee8fe3b3181b3a6b99a2b0
4
+ data.tar.gz: 3286949e39b6c0b6247d99c3d25e14e3a423769a
5
5
  SHA512:
6
- metadata.gz: b1c959d9e8f2cdff645902f198b17f8f5469487a73c522732832f34e9d7075c2ef0a888e1f24e09ad790a1a839ab11a2d18dbdc0391ce1d506ec920262bcef3f
7
- data.tar.gz: 2a0b948f1a708b58169234a0b255f7496c61ee2b94789f9deae36667b9b0fe97ef29971ee2da2382197389c0cb5d627ef6f19a189a20f562fb2bf7fe5265a05c
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 instruction=:all
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
- Dir["~/il/instructions/*.rb"].each {|file|
42
- require file
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.instruct.call()
60
- instruction.instructed.call()
71
+ unless instruction.instructed.call()
72
+ instruction.instruct.call()
61
73
  done instruction.name
62
74
  else
63
75
  check instruction.name
@@ -0,0 +1,8 @@
1
+ instruction "git" do
2
+ instructed?{
3
+ ItIs.done? "git"
4
+ }
5
+ instruct{
6
+ `echo git`
7
+ }
8
+ end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module InstructionsList
2
- VERSION = "0.1.4.beta"
2
+ VERSION = "0.1.5.beta"
3
3
  end
@@ -5,16 +5,16 @@ module InstructionsList
5
5
  INSTRUCTIONS=[]
6
6
  class ItIs
7
7
  def self.done? name
8
- `touch ./.instructions/state`
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
- #code
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 "./.instructions/"`
64
- `touch ./.Instructions/state`
63
+ `mkdir -p './.instructions/'`
64
+ `touch ./.instructions/state`
65
65
  `echo #{name} >> ./.instructions/state`
66
66
  check name
67
67
  end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'riot'
3
+ require_relative '../lib/instructions_list'
@@ -0,0 +1,10 @@
1
+ require_relative '_test_strap'
2
+
3
+ context "InstructionsLists::DSL" do
4
+
5
+ should("should add name to state when done") do
6
+
7
+
8
+
9
+ end
10
+ end
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.beta
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