centuria 0.2.3 → 0.2.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 +4 -4
- data/exe/cent +10 -4
- data/lib/centuria.rb +2 -2
- data/lib/centuria/{generator → commands}/clear.rb +1 -2
- data/lib/centuria/commands/commands.rb +10 -0
- data/lib/centuria/{generator → commands}/tinker.rb +0 -0
- data/lib/centuria/gem_version.rb +1 -1
- data/lib/centuria/generators/create.rb +47 -0
- data/lib/centuria/{generator → generators}/gene_base.rb +2 -2
- data/lib/centuria/generators/templates/Gemfile.tt +12 -0
- data/lib/centuria/generators/templates/lib/app.rb.tt +2 -0
- data/lib/centuria/generators/templates/ruby-version.tt +1 -0
- metadata +10 -9
- data/lib/centuria/generator/commands.rb +0 -10
- data/lib/centuria/generator/create.rb +0 -30
- data/lib/centuria/templates/lib/app.txt.tt +0 -1
- data/lib/centuria/templates/lib/version.rb.tt +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0181ae250f9a25f0b9ef88444b8a39f975683652a61f467d741b8d30dd8ab30
|
4
|
+
data.tar.gz: 21b45f18f8560d3020cdc6bc47059b3c4b7c48a20ac412c08cc974eea2cb5fff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ae5a8122cfa9dd9c9f8f997a55abb92b0faad18c0e273ed71a6b10257d7bb769811f7a006eb4bc3e2f0a811007eed458e7ad2b2b55377fc3f26d9b4ec101cc
|
7
|
+
data.tar.gz: 4e79096aeeadcabcc015000f4f52d8f52a804a12f470b6456c56181887a6b8a45696ed1e0458f4f1ab99395e0737a4b87bd09caf3e495577883e3db421ceec6a
|
data/exe/cent
CHANGED
@@ -6,11 +6,17 @@ module Cent
|
|
6
6
|
class CLI < Thor
|
7
7
|
package_name "Centuria"
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
default_command :default
|
10
|
+
class_option :version, aliases: '-v', type: :boolean, default: false
|
11
|
+
class_option :help, aliases: '-h', type: :boolean, default: false
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
desc "", "default command"
|
14
|
+
def default
|
15
|
+
if options[:version]
|
16
|
+
say "Centuria #{Centuria.version}"
|
17
|
+
else
|
18
|
+
self.help
|
19
|
+
end
|
14
20
|
end
|
15
21
|
|
16
22
|
register(Create, "new", "new [NAME]", "you can generate text file for memo")
|
data/lib/centuria.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
$LOAD_PATH << File.expand_path("./centuria", __dir__)
|
2
2
|
|
3
3
|
require "centuria/version"
|
4
|
-
require "
|
5
|
-
require "
|
4
|
+
require "commands/commands"
|
5
|
+
require "generators/gene_base"
|
6
6
|
|
7
7
|
module Centuria
|
8
8
|
class Error < StandardError; end
|
File without changes
|
data/lib/centuria/gem_version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
require "generators/gene_base"
|
2
|
+
|
3
|
+
class Create < 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_template
|
14
|
+
|
15
|
+
if !use_symbol?(file_name)
|
16
|
+
|
17
|
+
files = %w(lib/app.rb Gemfile)
|
18
|
+
files.each do |file|
|
19
|
+
template "templates/#{file}", "#{file_name}/#{file}"
|
20
|
+
end
|
21
|
+
|
22
|
+
template "templates/ruby-version.tt", "#{file_name}/.ruby-version"
|
23
|
+
create_file "#{file_name}/README.md"
|
24
|
+
|
25
|
+
comment(file_name)
|
26
|
+
else
|
27
|
+
puts "your app name is include symbol cannot use this.\nplease one more."
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def use_symbol?(file)
|
35
|
+
match_str = file.match(/\W/)
|
36
|
+
if !match_str.nil?
|
37
|
+
match_str[0].is_a?(String)
|
38
|
+
else
|
39
|
+
false
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def comment(file)
|
44
|
+
say "[!]warning: please write yourself readme file"
|
45
|
+
say "template was successfully! please check your app: #{file}", :green
|
46
|
+
end
|
47
|
+
end
|
@@ -5,11 +5,11 @@ module GeneratorBase
|
|
5
5
|
module Template
|
6
6
|
|
7
7
|
def templater(file)
|
8
|
-
template("
|
8
|
+
template("templates/#{file}.tt", "#{file_name}/#{file}")
|
9
9
|
end
|
10
10
|
|
11
11
|
def make_dir(dir)
|
12
|
-
directory("
|
12
|
+
directory("templates/#{dir}", "#{file_name}/#{dir}")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
5
|
+
|
6
|
+
ruby <%= "'#{RUBY_VERSION}'" -%>
|
7
|
+
|
8
|
+
# this application gem
|
9
|
+
gem 'centuria'
|
10
|
+
|
11
|
+
# command line gem for centuria
|
12
|
+
gem 'thor'
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centuria
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kohei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,14 +74,15 @@ files:
|
|
74
74
|
- centuria.gemspec
|
75
75
|
- exe/cent
|
76
76
|
- lib/centuria.rb
|
77
|
+
- lib/centuria/commands/clear.rb
|
78
|
+
- lib/centuria/commands/commands.rb
|
79
|
+
- lib/centuria/commands/tinker.rb
|
77
80
|
- lib/centuria/gem_version.rb
|
78
|
-
- lib/centuria/
|
79
|
-
- lib/centuria/
|
80
|
-
- lib/centuria/
|
81
|
-
- lib/centuria/
|
82
|
-
- lib/centuria/
|
83
|
-
- lib/centuria/templates/lib/app.txt.tt
|
84
|
-
- lib/centuria/templates/lib/version.rb.tt
|
81
|
+
- lib/centuria/generators/create.rb
|
82
|
+
- lib/centuria/generators/gene_base.rb
|
83
|
+
- lib/centuria/generators/templates/Gemfile.tt
|
84
|
+
- lib/centuria/generators/templates/lib/app.rb.tt
|
85
|
+
- lib/centuria/generators/templates/ruby-version.tt
|
85
86
|
- lib/centuria/version.rb
|
86
87
|
homepage: https://github.com/Koh0412/centuria
|
87
88
|
licenses:
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require "generator/gene_base"
|
2
|
-
|
3
|
-
class Create < 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
|
-
say "[!]warning: please write yourself readme file"
|
24
|
-
end
|
25
|
-
|
26
|
-
def comment
|
27
|
-
say "template was successfully! please check your app: #{file_name}", :green
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
--- this is <%=file_name%>.txt. this txtfile can write memo. ---
|