centuria 0.1.2 → 0.2.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/exe/cent +10 -1
- data/lib/centuria.rb +4 -0
- data/lib/centuria/gem_version.rb +2 -2
- data/lib/centuria/generator/clear.rb +23 -0
- data/lib/centuria/generator/commands.rb +4 -0
- data/lib/centuria/generator/gene_base.rb +15 -0
- data/lib/centuria/generator/generator.rb +24 -0
- data/lib/centuria/templates/lib/app.txt.tt +1 -0
- data/lib/centuria/templates/lib/version.rb.tt +3 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b254018a92a60c4f65c9ee916ed83bcb8e862b0a425fcc730f9faa1a3e62d079
|
4
|
+
data.tar.gz: 8a40816127cb227db681904e4192c8ea99d747bccaa66b38614c2498443fe065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb617c6274553bf8cbeda92a0ab59d85cf50a6a77f555aa13d7ae3054efd3995b1449073e798dc4b5fb4a725c5f4ab3d1fa4a748ba3ac52fba34ae32c6a037d
|
7
|
+
data.tar.gz: db3ffeec9a3f06fc3f5228b1ed894370f604a770b59d3dbaffdaa5a04f08c4e4b0fe2c3c19ddc76614ef2b12ac362ffad157c3b66bb13d6db7526ed8681ccc36
|
data/Gemfile.lock
CHANGED
data/exe/cent
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'centuria'
|
4
|
-
puts Centuria.logging
|
4
|
+
# puts Centuria.logging
|
5
|
+
|
6
|
+
module Cent
|
7
|
+
class CLI < Thor
|
8
|
+
register(Generator, "g", "g [NAME]", "you can generate text file for memo")
|
9
|
+
register(Clear, "clear", "clear [NAME]", "you can destroy file or directory")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Cent::CLI.start(ARGV)
|
data/lib/centuria.rb
CHANGED
data/lib/centuria/gem_version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "generator/gene_base"
|
2
|
+
|
3
|
+
class Clear < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
include GeneratorBase::Template
|
6
|
+
|
7
|
+
argument :name
|
8
|
+
|
9
|
+
def remove_all
|
10
|
+
puts "are you sure remove it?(Y or N)"
|
11
|
+
clear = STDIN.gets.chomp
|
12
|
+
if clear == "Y" || clear == "y"
|
13
|
+
if Dir.exist?("#{name}") || File.exist?("#{name}")
|
14
|
+
remove_file name
|
15
|
+
puts "finish remove to your request! name: #{name}"
|
16
|
+
else
|
17
|
+
puts "your request file: #{name} is not exist."
|
18
|
+
end
|
19
|
+
else
|
20
|
+
puts "back home without delete it."
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
module GeneratorBase
|
4
|
+
|
5
|
+
module Template
|
6
|
+
|
7
|
+
def templater(file)
|
8
|
+
template("../templates/#{file}.tt", "#{file_name}/#{file}")
|
9
|
+
end
|
10
|
+
|
11
|
+
def make_dir(dir)
|
12
|
+
directory("../templates/#{dir}", "#{file_name}/#{dir}")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "generator/gene_base"
|
2
|
+
|
3
|
+
class Generator < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
include GeneratorBase::Template
|
6
|
+
|
7
|
+
argument :file_name
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
File.dirname(__FILE__)
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_lib_file
|
14
|
+
templater "lib/app.txt"
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_version
|
18
|
+
templater "lib/version.rb"
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_readme
|
22
|
+
create_file "#{file_name}/README.md"
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
--- this is <%=file_name%>.txt. this txtfile can write memo. ---
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centuria
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kohei
|
@@ -74,6 +74,12 @@ files:
|
|
74
74
|
- exe/cent
|
75
75
|
- lib/centuria.rb
|
76
76
|
- lib/centuria/gem_version.rb
|
77
|
+
- lib/centuria/generator/clear.rb
|
78
|
+
- lib/centuria/generator/commands.rb
|
79
|
+
- lib/centuria/generator/gene_base.rb
|
80
|
+
- lib/centuria/generator/generator.rb
|
81
|
+
- lib/centuria/templates/lib/app.txt.tt
|
82
|
+
- lib/centuria/templates/lib/version.rb.tt
|
77
83
|
- lib/centuria/version.rb
|
78
84
|
- sample_app.gemspec
|
79
85
|
homepage: https://github.com/Koh0412/centuria
|