crafti 0.0.16 → 0.0.17
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/bin/crafti +1 -2
- data/lib/crafti.rb +4 -12
- data/lib/crafti/cli.rb +0 -5
- data/lib/crafti/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d22f93d08ccbd5c809862d7d53e3d29fa47279ab
|
4
|
+
data.tar.gz: e9ed8eb6aa507c2c73ecb8cb76a4b3e31fc39319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47962f267a96b7ddeeb66670af811ca118615fcb0532a654bd19161d36b97af591a015154fa8d2ebb3e5a8fd2be38ecd97816fa98c715d8c73f595c19dbfea15
|
7
|
+
data.tar.gz: 7403ff5d6582a71d5c9950c678af1b581faef9d15bf1e59c77a8a81f3328e233b95669359ffa00baaa40aa032489e66d82fffe9f7e31ac4b419899b2cbcc44f1
|
data/bin/crafti
CHANGED
@@ -7,7 +7,7 @@ require 'crafti'
|
|
7
7
|
options = Crafti::CLI.parse(ARGV)
|
8
8
|
|
9
9
|
if options.event == "generate"
|
10
|
-
Crafti::FileReader.generate(options.template_path
|
10
|
+
Crafti::FileReader.generate(options.template_path)
|
11
11
|
else
|
12
12
|
puts "That command is not supported."
|
13
13
|
exit
|
@@ -19,6 +19,5 @@ end
|
|
19
19
|
# puts options.inspect
|
20
20
|
# puts "Values:\n"
|
21
21
|
# puts "path: #{path.to_s}"
|
22
|
-
# puts "Name: #{options.name}"
|
23
22
|
# puts "\nContent:\n#{path.read}"
|
24
23
|
|
data/lib/crafti.rb
CHANGED
@@ -86,28 +86,20 @@ module Crafti
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
module AppName
|
90
|
-
def self.name(appname = nil)
|
91
|
-
@name ||= appname
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
89
|
class FileReader
|
96
|
-
def self.generate(file
|
97
|
-
app = new(file
|
90
|
+
def self.generate(file)
|
91
|
+
app = new(file)
|
98
92
|
app.evaluate
|
99
93
|
end
|
100
94
|
|
101
95
|
attr_reader :content
|
102
|
-
def initialize(file
|
103
|
-
::Crafti::AppName.name(app_name)
|
96
|
+
def initialize(file)
|
104
97
|
@content = ::Pathname.new(file.to_s).expand_path.read
|
105
98
|
end
|
106
99
|
|
107
100
|
def evaluate
|
108
101
|
klass = Class.new do
|
109
102
|
Kernel.extend(Crafti::KernelExtension)
|
110
|
-
Kernel.extend(Crafti::AppName)
|
111
103
|
def self.execute(string)
|
112
104
|
eval string
|
113
105
|
end
|
@@ -121,7 +113,7 @@ module Crafti
|
|
121
113
|
include FileUtilsExtension
|
122
114
|
|
123
115
|
def self.root(appname, &block)
|
124
|
-
app = new(
|
116
|
+
app = new(appname)
|
125
117
|
app.create_root_directory
|
126
118
|
app.evaluate(&block) if block_given?
|
127
119
|
end
|
data/lib/crafti/cli.rb
CHANGED
@@ -17,11 +17,6 @@ module Crafti
|
|
17
17
|
TEXT
|
18
18
|
opts.separator ""
|
19
19
|
|
20
|
-
opts.on("-n", "--name NAME", "Name of the application you're creating. This overrides the name in the app template.") do |name|
|
21
|
-
name = nil if name.nil? || name == ''
|
22
|
-
options.name = name
|
23
|
-
end
|
24
|
-
|
25
20
|
opts.on("-t", "--template PATH", "Path to the application template") do |path|
|
26
21
|
options.template_path = path
|
27
22
|
end
|
data/lib/crafti/version.rb
CHANGED