put_rake 0.1.3 → 0.1.6

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
  SHA256:
3
- metadata.gz: 61852391e5b8e277e532468797d6984843a0b5b17b03f0fe020a4373a98b2f07
4
- data.tar.gz: 756b1034e603a008f2807af18dba781599e5f5a325934356d1a2432543614dc5
3
+ metadata.gz: b5d9d7bf945364e75b449387e94d81b7bc7f2b727d7ac2f8b0dbb5967542c2cf
4
+ data.tar.gz: beb82ce8e9af4a5fe17c38154278a91592f11f1a203b5fb76df388d2f6951566
5
5
  SHA512:
6
- metadata.gz: 4d89278ddee2924708f70cd832bea0186cafae173881426b7486085b0f2e871ae7f66209eec1b2aac81d193a84a7073af8eb64461ad4124f662c8180edef06bd
7
- data.tar.gz: 0dee5a1cea344259b933e3179bd383152581a929bf34312e6c84be926b90e3df14581a99efc9b3e160f6184adf11f36ac78a51c224cebceed25aa11b5a3a62fc
6
+ metadata.gz: 5d41721998e5048d73d90c28901f925dee374d8ec3ce5b2f19052e75ac13239e6d548ab4ad08163d094f6fdd04c1c93ad5ae7b90850eef82a7209ee7e5101a25
7
+ data.tar.gz: 34d26cabc80f71336eac48d4edfb46dbbcf3859da2e56d8a5cbb5e8d132ca7e998fdeeccb36d9547160bcb2215e7a1322a746ed5dcbf3c94b933ec4954535bbf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- put_rake (0.1.3)
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 (0.8.1)
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.2.1)
29
+ thor (1.3.1)
30
30
 
31
31
  PLATFORMS
32
32
  arm64-darwin-20
data/README.org CHANGED
@@ -36,12 +36,12 @@ The default templates are located on the install directory of libs,
36
36
  #+begin_src bash
37
37
  > put_rake path
38
38
  * Rakefile template paths
39
- /Users/bob/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/put_rake-0.1.3/lib/templates
39
+ /Users/hoge/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/put_rake-0.1.3/lib/templates
40
40
  #+end_src
41
41
  and the additionals can be located any path which is specified
42
42
  by the following command:
43
43
  #+begin_src bash
44
- put_rake add /Users/bob/bin/Rakefiles
44
+ put_rake add /Users/hoge/bin/Rakefiles
45
45
  #+end_src
46
46
 
47
47
  Happy Ruby.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PutRake
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/put_rake.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "thor"
3
3
  require "fileutils"
4
+ require 'command_line/global'
4
5
 
5
6
  require_relative "put_rake/version"
6
7
  #require_relative "put_rake/cli"
@@ -22,9 +23,9 @@ module PutRake
22
23
  end
23
24
 
24
25
  desc "path", "show Rakefile template path"
25
-
26
26
  def path
27
- additional_path = ENV["PUT_RAKE_PATH"].split(":")
27
+ tmp = ENV["PUT_RAKE_PATH"] || ""
28
+ additional_path = tmp.split(":")
28
29
  @gem_template_dirs = [
29
30
  File.join(File.dirname(__FILE__), "templates"), additional_path,
30
31
  ].flatten
@@ -32,7 +33,6 @@ module PutRake
32
33
  end
33
34
 
34
35
  desc "add PATH", "add Rakefile template PATH"
35
-
36
36
  def add(*args)
37
37
  add = args[0]
38
38
  puts "Additional template paths are obtained from ENV['PUT_RAKE_PATH']."
@@ -64,7 +64,7 @@ HEREDOC
64
64
  exit
65
65
  end
66
66
  @file_path = @file_path[0]
67
- if File.exists?("./Rakefile") # check exist and -a -f
67
+ if File.exist?("./Rakefile") # check exist and -a -f
68
68
  if options[:force]
69
69
  comm = "cp #{@file_path} ./Rakefile"
70
70
  elsif options[:add]
@@ -85,14 +85,22 @@ HEREDOC
85
85
  path()
86
86
  @rake_file_path = []
87
87
  puts "* Available Rakefiles"
88
- puts "%10s: %s" % ["EXT", "full path"]
88
+ puts "%20s: %s" % ["EXT", "some description"]
89
89
  @gem_template_dirs.each do |gem_template_dir|
90
+ puts "** #{gem_template_dir}"
90
91
  files = File.join(gem_template_dir, "*")
91
92
  Dir.glob(files).each do |file|
92
93
  next if file[-1] == "~"
94
+ next unless File.basename(file) =~ /^Rakefile/
93
95
  @rake_file_path << file
94
96
  key = file.match(/Rakefile_(.*)/)[1]
95
- puts "%10s: %s" % [key, file]
97
+ res = command_line "rake -T -f #{file}"
98
+ command = res.stdout.split("\n")[0]
99
+ if command
100
+ puts "%20s: %s" % [key, command.scan(/#.+/)[0]]
101
+ else
102
+ puts "%20s: %s" % [key, File.basename(file)]
103
+ end
96
104
  end
97
105
  end
98
106
  end
@@ -6,7 +6,7 @@ task :default do
6
6
  system "rake -T"
7
7
  end
8
8
 
9
- desc 'git auto'
9
+ desc 'git automatic pull and push'
10
10
  task :git_auto do
11
11
  print "Input comments: "
12
12
  comment = STDIN.gets.chomp
@@ -17,6 +17,7 @@ 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
+ puts res.stderr.red
20
21
  puts res.stdout.green
21
22
  end
22
23
  end
@@ -7,8 +7,8 @@ task :default do
7
7
  end
8
8
 
9
9
  namespace :some_name_space do
10
- desc "task desciption" #desc descriptio
11
- task task_name: do # any name on task_name
10
+ desc "task desciption" #desc -> descriptin
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.3
4
+ version: 0.1.6
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: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2024-05-29 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.2.22
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.