birdel 2.0.1 → 2.2.9
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/lib/birdel/com/com_actor.rb +1 -2
- data/lib/birdel/map/map_actor.rb +1 -1
- data/lib/birdel/synth/synth_actor.rb +99 -103
- data/lib/birdel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc87199dc0adacc6982d2c4ab43c9b3001481dddba08996b1fc010fb807e262c
|
4
|
+
data.tar.gz: b544fbcc07c01e3d21969e5e7855c3b55196ad4888fc896f4e73e94286b4a0c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e17261c75d3aa72c4a374359c1db468a32f44fa5041d5d7bc3da42d3e3f6039ffea5f8f69200e8443a996f9cdea8b67b2189ed5de45192c36694d450bfe6b3f
|
7
|
+
data.tar.gz: 1514f17739402180542d23218d411c9ed74f21f5f94508e13cd376d31f8b5acc30f53aaa43eed55a6f1be331c51a4e2f5430ea275f42f14a811a73abb537c24b
|
data/lib/birdel/com/com_actor.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
module Birdel
|
2
2
|
module Com
|
3
|
-
def roll
|
3
|
+
def self.roll(component_ns)
|
4
4
|
app_path = Pathname.new("#{Dir.pwd}")
|
5
5
|
components_path = app_path.join("app", "components")
|
6
|
-
component_ns = ARGV[0]
|
7
6
|
component_ns_camelized = component_ns.split("::").map(&:camelize).join("::")
|
8
7
|
component_name = component_ns_camelized.split("::").last
|
9
8
|
component_path = component_ns.split("::").join("/")
|
data/lib/birdel/map/map_actor.rb
CHANGED
@@ -1,114 +1,110 @@
|
|
1
1
|
|
2
2
|
module Birdel
|
3
3
|
module Synth
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
css_entries_error = true
|
40
|
-
puts "File not found: #{file_path}".red
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
file.puts ""
|
45
|
-
|
46
|
-
#components
|
47
|
-
puts "-> Components...".yellow
|
48
|
-
components = JSON.parse(File.read(entry_folder_components_path))
|
49
|
-
components.each do |component_path_string|
|
50
|
-
# full_component_path = Pathname.new("#{components_folder_path.to_s}/#{component_path_string}.css")
|
51
|
-
full_component_path = components_folder_path.join("#{component_path_string}.css")
|
52
|
-
if full_component_path.exist?
|
53
|
-
file_name = component_path_string.split("/").last
|
54
|
-
puts "+ #{file_name}.css".green
|
55
|
-
file.puts "@import url(\"#{full_component_path.relative_path_from(entry_folder_path).to_s}\");"
|
56
|
-
else
|
57
|
-
css_entries_error = true
|
58
|
-
puts "Component not found: #{component_path_string}".red
|
59
|
-
puts "Check => #{entry_folder_components_path.relative_path_from(root_dir_path)}".red.bold
|
60
|
-
end
|
61
|
-
end
|
4
|
+
def self.roll
|
5
|
+
root_dir_path = Pathname.new("#{Dir.pwd}")
|
6
|
+
app_folder_path = root_dir_path.join("app")
|
7
|
+
components_folder_path = app_folder_path.join("components")
|
8
|
+
js_folder_path = app_folder_path.join("javascript")
|
9
|
+
stylesheets_folder_path = app_folder_path.join("assets/stylesheets")
|
10
|
+
js_application_file_path = js_folder_path.join("ui/application.js")
|
11
|
+
css_bentries_path = stylesheets_folder_path.join("ui/bentries")
|
12
|
+
js_bentries_path = js_folder_path.join("ui/bentries")
|
13
|
+
|
14
|
+
css_entries_error = false
|
15
|
+
js_entries_error = false
|
16
|
+
css_bentries_path.each_child do |entry_folder_path|
|
17
|
+
# entry_folder_path = Pathname.new(entry_folder)
|
18
|
+
# entry_folder_index_path = Pathname.new("#{entry_folder}/components.css")
|
19
|
+
entry_folder_index_path = entry_folder_path.join("components.css")
|
20
|
+
puts "(css) Building #{entry_folder_index_path.relative_path_from(app_folder_path)}".yellow.bold
|
21
|
+
# entry_folder_components_path = Pathname.new("#{entry_folder}/components.json")
|
22
|
+
entry_folder_components_path = entry_folder_path.join("components.css.json")
|
23
|
+
entry_folder_precomponents_path = entry_folder_path.join("precomponents.css.json")
|
24
|
+
File.truncate(entry_folder_index_path, 0)
|
25
|
+
file = File.open(entry_folder_index_path, "w")
|
26
|
+
|
27
|
+
#precomponents
|
28
|
+
puts "-> Precomponents...".yellow
|
29
|
+
precomponents = JSON.parse(File.read(entry_folder_precomponents_path))
|
30
|
+
precomponents.each do |precomponent_path_string|
|
31
|
+
# # file_path = Pathname.new("#{stylesheets_folder_path.to_s}/#{precomponent_path_string}.css")
|
32
|
+
file_path = stylesheets_folder_path.join("#{precomponent_path_string}.css")
|
33
|
+
if file_path.exist?
|
34
|
+
puts "+ #{precomponent_path_string.split("/").last}.css".green
|
35
|
+
file.puts "@import url(\"#{file_path.relative_path_from(entry_folder_path).to_s}\");"
|
36
|
+
else
|
37
|
+
css_entries_error = true
|
38
|
+
puts "File not found: #{file_path}".red
|
62
39
|
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
#
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
puts "(
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
js_application_file_name = js_application_file_path.basename.to_s.split(".").first
|
82
|
-
file.puts "import { #{js_application_file_name} } from \"#{js_application_file_path.relative_path_from(entry_folder_path).to_s.gsub(js_application_file_path.extname, "")}\";"
|
83
|
-
file.puts ""
|
84
|
-
component_controllers.each do |component_path|
|
85
|
-
path_parts = component_path.split("/")
|
86
|
-
component_name = path_parts.pop
|
87
|
-
controller_from_components = "#{component_path}/#{component_name}_controller"
|
88
|
-
# component_controller_path = Pathname.new("#{components_folder_path.to_s}/#{controller_from_components}.js")
|
89
|
-
component_controller_path = components_folder_path.join("#{controller_from_components}.js")
|
90
|
-
if component_controller_path.exist?
|
91
|
-
component_path_dashed = component_path.tr("_", "-").gsub("/", "--")
|
92
|
-
camelized_component_name = component_name.split("_").map(&:capitalize).join
|
93
|
-
controller_backpath = component_controller_path.relative_path_from(entry_folder_path)
|
94
|
-
controller_backpath_without_ext = controller_backpath.to_s.gsub(controller_backpath.extname, "")
|
95
|
-
file.puts "import #{camelized_component_name} from \"#{controller_backpath_without_ext}\";"
|
96
|
-
file.puts "application.register(\"#{component_path_dashed}\", #{camelized_component_name});"
|
97
|
-
file.puts ""
|
98
|
-
puts "+ #{component_path_dashed}"
|
99
|
-
else
|
100
|
-
js_entries_error = true
|
101
|
-
puts "Stimulus controller not found: #{component_path}".red
|
102
|
-
end
|
103
|
-
end
|
40
|
+
end
|
41
|
+
|
42
|
+
file.puts ""
|
43
|
+
|
44
|
+
#components
|
45
|
+
puts "-> Components...".yellow
|
46
|
+
components = JSON.parse(File.read(entry_folder_components_path))
|
47
|
+
components.each do |component_path_string|
|
48
|
+
# full_component_path = Pathname.new("#{components_folder_path.to_s}/#{component_path_string}.css")
|
49
|
+
full_component_path = components_folder_path.join("#{component_path_string}.css")
|
50
|
+
if full_component_path.exist?
|
51
|
+
file_name = component_path_string.split("/").last
|
52
|
+
puts "+ #{file_name}.css".green
|
53
|
+
file.puts "@import url(\"#{full_component_path.relative_path_from(entry_folder_path).to_s}\");"
|
54
|
+
else
|
55
|
+
css_entries_error = true
|
56
|
+
puts "Component not found: #{component_path_string}".red
|
57
|
+
puts "Check => #{entry_folder_components_path.relative_path_from(root_dir_path)}".red.bold
|
104
58
|
end
|
105
|
-
|
106
|
-
|
107
|
-
|
59
|
+
end
|
60
|
+
end
|
61
|
+
if css_entries_error
|
62
|
+
puts "(css-error) Building failed.".red
|
63
|
+
exit
|
64
|
+
end
|
65
|
+
puts "(css-success) Building finished.".green
|
66
|
+
puts ""
|
67
|
+
|
68
|
+
js_bentries_path.each_child do |entry_folder_path|
|
69
|
+
# js_entries.each do |entry|
|
70
|
+
# index_path = Pathname.new("#{entry}/components.js")
|
71
|
+
index_path = entry_folder_path.join("components.js")
|
72
|
+
components_json_path = entry_folder_path.join("components.js.json")
|
73
|
+
# entry_folder_path = Pathname.new(entry)
|
74
|
+
puts "(js) Building #{index_path.relative_path_from(app_folder_path)}".green
|
75
|
+
puts "-> (js) Components...".yellow
|
76
|
+
File.truncate(index_path, 0)
|
77
|
+
component_controllers = JSON.parse(File.read(components_json_path))
|
78
|
+
file = File.open(index_path, "w")
|
79
|
+
js_application_file_name = js_application_file_path.basename.to_s.split(".").first
|
80
|
+
file.puts "import { #{js_application_file_name} } from \"#{js_application_file_path.relative_path_from(entry_folder_path).to_s.gsub(js_application_file_path.extname, "")}\";"
|
81
|
+
file.puts ""
|
82
|
+
component_controllers.each do |component_path|
|
83
|
+
path_parts = component_path.split("/")
|
84
|
+
component_name = path_parts.pop
|
85
|
+
controller_from_components = "#{component_path}/#{component_name}_controller"
|
86
|
+
# component_controller_path = Pathname.new("#{components_folder_path.to_s}/#{controller_from_components}.js")
|
87
|
+
component_controller_path = components_folder_path.join("#{controller_from_components}.js")
|
88
|
+
if component_controller_path.exist?
|
89
|
+
component_path_dashed = component_path.tr("_", "-").gsub("/", "--")
|
90
|
+
camelized_component_name = component_name.split("_").map(&:capitalize).join
|
91
|
+
controller_backpath = component_controller_path.relative_path_from(entry_folder_path)
|
92
|
+
controller_backpath_without_ext = controller_backpath.to_s.gsub(controller_backpath.extname, "")
|
93
|
+
file.puts "import #{camelized_component_name} from \"#{controller_backpath_without_ext}\";"
|
94
|
+
file.puts "application.register(\"#{component_path_dashed}\", #{camelized_component_name});"
|
95
|
+
file.puts ""
|
96
|
+
puts "+ #{component_path_dashed}"
|
97
|
+
else
|
98
|
+
js_entries_error = true
|
99
|
+
puts "Stimulus controller not found: #{component_path}".red
|
108
100
|
end
|
109
|
-
puts "(js-success) Building finished.".green
|
110
101
|
end
|
111
102
|
end
|
103
|
+
if js_entries_error
|
104
|
+
puts "(js-error) Building failed.".red
|
105
|
+
exit
|
106
|
+
end
|
107
|
+
puts "(js-success) Building finished.".green
|
112
108
|
end
|
113
109
|
end
|
114
110
|
end
|
data/lib/birdel/version.rb
CHANGED