golf 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/golf/cli.rb +6 -5
- data/lib/golf/compiler.rb +3 -0
- data/lib/golf/version.rb +1 -1
- metadata +1 -1
data/lib/golf/cli.rb
CHANGED
@@ -32,12 +32,13 @@ module Golf
|
|
32
32
|
if name.include?('.')
|
33
33
|
component_name = name.split('.').last
|
34
34
|
package_name = name.gsub('.','/').split('/')[0...-1].join('/')
|
35
|
+
create_file "golfapp/components/#{package_name}/#{component_name}/#{component_name}.html" do
|
36
|
+
File.read(File.expand_path("../../../templates/component/Component.html", __FILE__))
|
37
|
+
end
|
35
38
|
else
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
create_file "golfapp/components/#{package_name}/#{component_name}.html" do
|
40
|
-
File.read(File.expand_path("../../../templates/component/Component.html", __FILE__))
|
39
|
+
create_file "golfapp/components/#{name}/#{name}.html" do
|
40
|
+
File.read(File.expand_path("../../../templates/component/Component.html", __FILE__))
|
41
|
+
end
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
data/lib/golf/compiler.rb
CHANGED
@@ -42,6 +42,9 @@ module Golf
|
|
42
42
|
Dir["#{dir}/**/*.#{type}"].each do |path|
|
43
43
|
if type == "html"
|
44
44
|
name = package_name(path)
|
45
|
+
arr = path.split('/')
|
46
|
+
last_two = arr.slice(arr.length - 2 ,2)
|
47
|
+
next if last_two[0] != last_two[1].gsub('.html','')
|
45
48
|
else
|
46
49
|
name = path.split('/').last.gsub(".#{type}",'')
|
47
50
|
end
|
data/lib/golf/version.rb
CHANGED