geny 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rspec-each +20 -0
- data/lib/geny/command.rb +3 -0
- data/lib/geny/dsl.rb +2 -1
- data/lib/{generators → geny/generators}/new/generator.rb +2 -1
- data/lib/{generators → geny/generators}/new/templates/generator.rb.erb +0 -0
- data/lib/geny/registry.rb +14 -9
- data/lib/geny/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 053de574e07eefcb259a4ef3949722575c18e36b
|
4
|
+
data.tar.gz: d9bcca07beaa5a8621e9fa5dce42f4468f3fa282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2336a52da788edeb5716327fb3fdc180bd3f4cda6f071a278f49ca2e815d1e6d3fa9b10cf3922511265ddaceecb3c01c535c05c97ec5af60dfc32ff3d1275c6b
|
7
|
+
data.tar.gz: 6ced3852fde17514e948abdfd51d1eece62a5ad26b988ace601df0426f4bbe9b76a86ec34b987bde8302fd9d98cd2d0deb288de8b4fa2643278e2346f9aa2057
|
data/bin/rspec-each
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Runs each spec file independently
|
3
|
+
|
4
|
+
for spec in $(find spec -name "*_spec.rb*"); do
|
5
|
+
echo "Running $spec..."
|
6
|
+
|
7
|
+
until bundle exec rspec "$spec"; do
|
8
|
+
echo -n -e "\n$spec failed. Retry? "
|
9
|
+
read answer
|
10
|
+
|
11
|
+
if [ "$answer" != "${answer#[Yy]}" ]; then
|
12
|
+
echo "Retrying..."
|
13
|
+
else
|
14
|
+
echo "Aborting!"
|
15
|
+
exit
|
16
|
+
fi
|
17
|
+
done
|
18
|
+
|
19
|
+
echo "Success!"
|
20
|
+
done
|
data/lib/geny/command.rb
CHANGED
data/lib/geny/dsl.rb
CHANGED
@@ -26,7 +26,8 @@ module Geny
|
|
26
26
|
|
27
27
|
# Define helper methods. These methods are available within
|
28
28
|
# the {#invoke} block and all templates.
|
29
|
-
def helpers(&block)
|
29
|
+
def helpers(*modules, &block)
|
30
|
+
@helpers += modules unless modules.empty?
|
30
31
|
@helpers << Module.new(&block) if block_given?
|
31
32
|
@helpers
|
32
33
|
end
|
File without changes
|
data/lib/geny/registry.rb
CHANGED
@@ -4,13 +4,17 @@ require "geny/command"
|
|
4
4
|
|
5
5
|
module Geny
|
6
6
|
class Registry
|
7
|
-
# The
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
# The load path for project-local generators
|
8
|
+
LOCAL_PATH = [File.join(Dir.pwd, ".geny")]
|
9
|
+
|
10
|
+
# The load path that is read from ENV vars
|
11
|
+
ENV_PATH = ENV.fetch("GENY_PATH", "").split(":")
|
12
|
+
|
13
|
+
# The load path for Geny's own generators
|
14
|
+
GENY_PATH = [File.join(__dir__, "generators")]
|
15
|
+
|
16
|
+
# The default load path. By default, Geny will search
|
17
|
+
LOAD_PATH = LOCAL_PATH + ENV_PATH + GENY_PATH
|
14
18
|
|
15
19
|
# The directories to search for commands in
|
16
20
|
# @return [Array<String>]
|
@@ -33,7 +37,7 @@ module Geny
|
|
33
37
|
path.glob(glob).map do |file|
|
34
38
|
root = file.dirname
|
35
39
|
name = root.relative_path_from(path)
|
36
|
-
name = name.to_s.tr(File::SEPARATOR,
|
40
|
+
name = name.to_s.tr(File::SEPARATOR, Command::SEPARATOR)
|
37
41
|
build(name, root.to_s)
|
38
42
|
end
|
39
43
|
end
|
@@ -46,7 +50,8 @@ module Geny
|
|
46
50
|
# @return [Command,nil]
|
47
51
|
def find(name)
|
48
52
|
load_path.each do |path|
|
49
|
-
|
53
|
+
parts = name.split(Command::SEPARATOR)
|
54
|
+
file = File.join(path, *parts, Command::FILENAME)
|
50
55
|
root = File.dirname(file)
|
51
56
|
return build(name, root) if File.exist?(file)
|
52
57
|
end
|
data/lib/geny/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Zane
|
@@ -140,11 +140,10 @@ files:
|
|
140
140
|
- README.md
|
141
141
|
- Rakefile
|
142
142
|
- bin/console
|
143
|
+
- bin/rspec-each
|
143
144
|
- bin/setup
|
144
145
|
- exe/geny
|
145
146
|
- geny.gemspec
|
146
|
-
- lib/generators/new/generator.rb
|
147
|
-
- lib/generators/new/templates/generator.rb.erb
|
148
147
|
- lib/geny.rb
|
149
148
|
- lib/geny/actions/files.rb
|
150
149
|
- lib/geny/actions/find.rb
|
@@ -160,6 +159,8 @@ files:
|
|
160
159
|
- lib/geny/context/view.rb
|
161
160
|
- lib/geny/dsl.rb
|
162
161
|
- lib/geny/error.rb
|
162
|
+
- lib/geny/generators/new/generator.rb
|
163
|
+
- lib/geny/generators/new/templates/generator.rb.erb
|
163
164
|
- lib/geny/registry.rb
|
164
165
|
- lib/geny/version.rb
|
165
166
|
homepage: https://github.com/rzane/geny
|