yk_command 0.3.3 → 0.3.4

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: 4b49f365c88cbf5ee075910240c942e69f1b8b8664924ede94580f16112bc793
4
- data.tar.gz: 7f6f89f46517311f2e7f53ec67b797f3eb62c88c5309379656ab9c29d964f483
3
+ metadata.gz: 10d4e010f47854863889d0355b15a90db4e5b2d3b0da54dc6c61442e46c5e551
4
+ data.tar.gz: 489241ebf693643495565629f1178ecede774de50871922ee820d60aeb446be0
5
5
  SHA512:
6
- metadata.gz: 024c3862ab8543cbcd93dc4da9d13f3e5b452e8a5cd08b5a2a1389f6f1f11175bce32925ae0608e675f7acf1fbc6b15e029f72f19ecc75299cad151577209dce
7
- data.tar.gz: 3224b9d71c410180fce7d8ee96859bd9eeae55e9c48e478b7d350306bd0c8e1ad4abc27a4ca55405630af09a825c6a1c04ddcfaadc84961605424fd2f4a52d47
6
+ metadata.gz: 1edd69c1bf991e941cd854f7144f086c9960ff92c8fc492624a778b8919a6f8d66923de56ed537116d7709a50ea27ce2f094d763b2c908c5fa2e4979c9fba9c7
7
+ data.tar.gz: 4963ad8ffa31709bcf2d7a5265eb2d5e1f817f4404b2f712c5bf9505c09e0fd06bb622eed7166bf72bb1f93fa6df32dd129cdf5ff36d044b9acf85a01d5e0490
data/.idea/vcs.xml CHANGED
@@ -4,6 +4,7 @@
4
4
  <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
5
  <mapping directory="$PROJECT_DIR$/CXFApp" vcs="Git" />
6
6
  <mapping directory="$PROJECT_DIR$/CXFAppHome" vcs="Git" />
7
+ <mapping directory="$PROJECT_DIR$/HomeModule" vcs="Git" />
7
8
  <mapping directory="$PROJECT_DIR$/MerchanHome" vcs="Git" />
8
9
  <mapping directory="$PROJECT_DIR$/MerchantHome" vcs="Git" />
9
10
  <mapping directory="$PROJECT_DIR$/SUHome3" vcs="Git" />
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yk_command (0.3.2)
4
+ yk_command (0.3.4)
5
5
  bundler
6
6
  colored
7
7
  thor
data/README.md CHANGED
@@ -17,7 +17,7 @@ rvm install 2.7.2
17
17
  ```
18
18
 
19
19
  ```shell
20
- rvm gemset create rails23
20
+ rvm gemset create 2.7.2@tom
21
21
  ```
22
22
 
23
23
  ```shell
@@ -61,4 +61,9 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
61
61
 
62
62
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
63
63
 
64
-
64
+ ```shell
65
+ $ rake build
66
+
67
+ $ rake release
68
+
69
+ ```
@@ -10,7 +10,34 @@ module YkCommand
10
10
 
11
11
  CONFIG_FILE = '.YKModuleFilesConfig.yml'.freeze
12
12
 
13
- desc 'create', '开始配置'
13
+ desc 'generate <Path> <Module Name> <Language> <Prefix - 前缀> <Author - 作者>', '直接生成项目 例子: yk_command generate . HomeModule oc MT Tom.Liu '
14
+ method_option :generate, aliases: '-g'
15
+ def generate(path = nil,name,lang ,class_prefix,author)
16
+ @name = name
17
+ @module = @name
18
+ @lang = lang
19
+ @class_prefix = class_prefix
20
+ @final_path = "#{path}/#{@name}"
21
+ @author = author
22
+ @prefixed_module = @class_prefix + @module
23
+
24
+ say "generating file in path:#{@final_path}", :green
25
+
26
+ if File.exist?(@final_path.to_s)
27
+ say "#{@final_path} 已存在:", :red
28
+ else
29
+ prepare_folder
30
+ if File.exist?("#{@final_path}/configure")
31
+ system("#{@final_path}/configure", @name, @lang, @class_prefix, *@additional_args)
32
+ else
33
+ say 'Template does not have a configure file', :red
34
+ end
35
+ yk_module_folders
36
+ yk_template_files
37
+ end
38
+ end
39
+
40
+ desc 'create <Path>', '在某个路径下交互式生成项目'
14
41
  method_option :create, aliases: '-c'
15
42
  def create(path = nil)
16
43
  path = Dir.pwd if path.nil?
@@ -81,7 +108,6 @@ module YkCommand
81
108
  @author = config[:author]
82
109
  @date = Time.now.strftime('%d/%m/%y')
83
110
  @lang = config[:language]
84
- @prefixed_module = "YK#{@name}"
85
111
  end
86
112
 
87
113
  def prepare_folder
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YkCommand
4
- VERSION = '0.3.3'.freeze
4
+ VERSION = '0.3.4'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yk_command
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Major Tom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-02 00:00:00.000000000 Z
11
+ date: 2022-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler