djinni 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea5e8f1cef093a7500f760b453448830ad92b0b
|
4
|
+
data.tar.gz: a85a0322e73454913e284b02181e35bd0171fc93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad6db4b68eb697e3132cf9e558a367c30cd4155816282ab591921be7fcd98079ddb7277ae42904bd1cc5481c0758994cd2af70221daaca2d04e18890b92b049e
|
7
|
+
data.tar.gz: 71bd1a4c5d022f289d36ca805544ffe553f12f79180c2dd2cd72cd7b6bd9712b4fb72c4d6df6761576a3161e7e5feb64541b7ab0970d33086b94da7eaa5d3dd6
|
data/lib/djinni.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
+
require "fagin"
|
1
2
|
require "io/console"
|
2
|
-
require "pathname"
|
3
3
|
require "terminfo"
|
4
4
|
|
5
5
|
class Djinni
|
@@ -123,39 +123,13 @@ class Djinni
|
|
123
123
|
load_wishes("#{File.dirname(__FILE__)}/djinni/wish")
|
124
124
|
end
|
125
125
|
|
126
|
-
def load_wish(clas)
|
127
|
-
return if (clas.nil?)
|
128
|
-
clas.strip!
|
129
|
-
return if (clas.empty?)
|
130
|
-
|
131
|
-
wish = nil
|
132
|
-
begin
|
133
|
-
wish = Object::const_get(clas).new
|
134
|
-
rescue NameError => e
|
135
|
-
raise Error::UnknownWishError.new(clas)
|
136
|
-
end
|
137
|
-
|
138
|
-
return if (wish.nil?)
|
139
|
-
|
140
|
-
wish.aliases.each do |aliaz|
|
141
|
-
@wishes[aliaz] = wish
|
142
|
-
end
|
143
|
-
end
|
144
|
-
private :load_wish
|
145
|
-
|
146
126
|
def load_wishes(dir)
|
147
127
|
return if @loaded_from.include?(dir)
|
148
128
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
%x(
|
155
|
-
\grep -E "^ *class .+ \< Djinni::Wish" #{file} | \
|
156
|
-
awk '{print $2}'
|
157
|
-
).each_line do |clas|
|
158
|
-
load_wish(clas)
|
129
|
+
classes = Fagin.find_children("Djinni::Wish", dir)
|
130
|
+
classes.each do |clas, wish|
|
131
|
+
wish.aliases.each do |aliaz|
|
132
|
+
@wishes[aliaz] = wish
|
159
133
|
end
|
160
134
|
end
|
161
135
|
|
data/lib/djinni/wish.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: djinni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
@@ -50,6 +50,26 @@ dependencies:
|
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 10.4.2
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: fagin
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.1'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.1.0
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.1'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 0.1.0
|
53
73
|
- !ruby/object:Gem::Dependency
|
54
74
|
name: ruby-terminfo
|
55
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,9 +102,9 @@ files:
|
|
82
102
|
- lib/djinni/error.rb
|
83
103
|
- lib/djinni/error/unknown_wish_error.rb
|
84
104
|
- lib/djinni/wish.rb
|
85
|
-
- lib/djinni/wish/
|
86
|
-
- lib/djinni/wish/
|
87
|
-
- lib/djinni/wish/
|
105
|
+
- lib/djinni/wish/help.rb
|
106
|
+
- lib/djinni/wish/history.rb
|
107
|
+
- lib/djinni/wish/quit.rb
|
88
108
|
homepage: http://mjwhitta.github.io/djinni
|
89
109
|
licenses:
|
90
110
|
- GPL-3.0
|