put_rake 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/put_rake/version.rb +1 -1
- data/lib/put_rake.rb +10 -8
- data/lib/templates/Rakefile_git_auto +2 -6
- data/lib/templates/Rakefile_template +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cf1b560ac0fd68a165ddd89b5c89a197be18092cacbd6b2d7a63fadd33e7f4f
|
4
|
+
data.tar.gz: 4909104d1141e17b5a4ba218661e1ead61e535bb688d3672687fe504a62a9cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b824025b5d3126181931031214b19fc6bcc13de4ca6852f78d2260f947e1a14d53dbae9f144ac48f0d733fdf5ecd262eff84b862125b7c787ea43ed4b61a392b
|
7
|
+
data.tar.gz: 732e37b946bc12be3e999c1d330d4f2668568c854ac1b7aa2149f8e1f3273647bd1b93508b46ce7099bebba96e4f3ca1e31ea1975964df8a04f4a72b80b23396
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
put_rake (0.1.
|
4
|
+
put_rake (0.1.6)
|
5
5
|
colorize
|
6
6
|
command_line
|
7
7
|
thor
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
colorize (
|
12
|
+
colorize (1.1.0)
|
13
13
|
command_line (2.0.1)
|
14
14
|
diff-lcs (1.5.0)
|
15
15
|
rake (13.0.6)
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
27
|
rspec-support (~> 3.12.0)
|
28
28
|
rspec-support (3.12.0)
|
29
|
-
thor (1.
|
29
|
+
thor (1.3.1)
|
30
30
|
|
31
31
|
PLATFORMS
|
32
32
|
arm64-darwin-20
|
data/lib/put_rake/version.rb
CHANGED
data/lib/put_rake.rb
CHANGED
@@ -23,9 +23,9 @@ module PutRake
|
|
23
23
|
end
|
24
24
|
|
25
25
|
desc "path", "show Rakefile template path"
|
26
|
-
|
27
26
|
def path
|
28
|
-
|
27
|
+
tmp = ENV["PUT_RAKE_PATH"] || ""
|
28
|
+
additional_path = tmp.split(":")
|
29
29
|
@gem_template_dirs = [
|
30
30
|
File.join(File.dirname(__FILE__), "templates"), additional_path,
|
31
31
|
].flatten
|
@@ -33,7 +33,6 @@ module PutRake
|
|
33
33
|
end
|
34
34
|
|
35
35
|
desc "add PATH", "add Rakefile template PATH"
|
36
|
-
|
37
36
|
def add(*args)
|
38
37
|
add = args[0]
|
39
38
|
puts "Additional template paths are obtained from ENV['PUT_RAKE_PATH']."
|
@@ -65,7 +64,7 @@ HEREDOC
|
|
65
64
|
exit
|
66
65
|
end
|
67
66
|
@file_path = @file_path[0]
|
68
|
-
if File.
|
67
|
+
if File.exist?("./Rakefile") # check exist and -a -f
|
69
68
|
if options[:force]
|
70
69
|
comm = "cp #{@file_path} ./Rakefile"
|
71
70
|
elsif options[:add]
|
@@ -86,18 +85,21 @@ HEREDOC
|
|
86
85
|
path()
|
87
86
|
@rake_file_path = []
|
88
87
|
puts "* Available Rakefiles"
|
89
|
-
puts "%
|
88
|
+
puts "%20s: %s" % ["EXT", "some description"]
|
90
89
|
@gem_template_dirs.each do |gem_template_dir|
|
91
90
|
puts "** #{gem_template_dir}"
|
92
91
|
files = File.join(gem_template_dir, "*")
|
93
92
|
Dir.glob(files).each do |file|
|
94
93
|
next if file[-1] == "~"
|
94
|
+
next unless File.basename(file) =~ /^Rakefile/
|
95
95
|
@rake_file_path << file
|
96
96
|
key = file.match(/Rakefile_(.*)/)[1]
|
97
97
|
res = command_line "rake -T -f #{file}"
|
98
|
-
command = res.stdout.split("\n")
|
99
|
-
|
100
|
-
|
98
|
+
command = res.stdout.split("\n").collect do |line|
|
99
|
+
line.include?(key) ? line : nil
|
100
|
+
end
|
101
|
+
if command.compact[0] != nil
|
102
|
+
puts "%20s: %s" % [key, command.compact[0].scan(/#.+/)[0]]
|
101
103
|
else
|
102
104
|
puts "%20s: %s" % [key, File.basename(file)]
|
103
105
|
end
|
@@ -17,12 +17,8 @@ task :git_auto do
|
|
17
17
|
"git push origin main"].each do |comm|
|
18
18
|
puts comm.cyan
|
19
19
|
res = command_line comm
|
20
|
-
|
21
|
-
|
22
|
-
exit
|
23
|
-
else
|
24
|
-
puts res.stdout.green
|
25
|
-
end
|
20
|
+
puts res.stderr.red
|
21
|
+
puts res.stdout.green
|
26
22
|
end
|
27
23
|
end
|
28
24
|
|
@@ -7,8 +7,8 @@ task :default do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
namespace :some_name_space do
|
10
|
-
desc "task
|
11
|
-
task task_name
|
10
|
+
desc "task description" #desc -> description
|
11
|
+
task :task_name do # any name on task_name
|
12
12
|
# your code goes
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: put_rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeto R. Nishiani
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.5.6
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Put a template of Rakefiles on the local dir.
|