birdel 2.0.1 → 2.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 693df3b19b37d433014e89d1e4512a6f8c56d229ff86a81b69b87d1ac78f28f6
4
- data.tar.gz: 3c6d52dddbdc55ce36d4e3e598fc99bef95c57d7080378cd0c126ba8b3c23189
3
+ metadata.gz: c28d8862e05a3e3daa3fa7bf3952542a5b14bda3ef8cd6e2dbdf82748c29150c
4
+ data.tar.gz: 4354b48a7ef3451a0d5dc61dea584f0ed521b99d308bf87f88313d3cea584215
5
5
  SHA512:
6
- metadata.gz: d9accfd079dd830ea412ea4f0dae1df9550d4264106aa39113653318aa98af046cffbcd7995ca3fa0b337200b86b17a1c21bc0698f05938a1da3e4dee3e3c104
7
- data.tar.gz: cddd71dd6125c906721f98bf465c9e1f86cedabeba11d955d141d40c25e23230ad713c05fba51767e664ef0a645189d312d883cc471ff9441ee8ce2d911a6e93
6
+ metadata.gz: b54dfabb9a518b195dea5750d84acca9923f7f8f664c265698511929eb28f901780562db4b3820e5b5a75ee66f9ba1dfee6ae5a860a17e7ec06a9403c09dcbfd
7
+ data.tar.gz: 01c1380d2975df0b5064347aac65f63cd63c3f061fe1cf5a47bc4b52430f9d50aa2d2bac5da56cd6f8066dd6f1c27d4d0c1799fe00f282cb77e431895db6a945
@@ -1,6 +1,6 @@
1
1
  module Birdel
2
2
  module Com
3
- def roll
3
+ def self.roll
4
4
  app_path = Pathname.new("#{Dir.pwd}")
5
5
  components_path = app_path.join("app", "components")
6
6
  component_ns = ARGV[0]
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Birdel
3
3
  module Map
4
- def roll(entry_ns)
4
+ def self.roll(entry_ns)
5
5
  myapp_path = Pathname.new("#{Dir.pwd}")
6
6
  stylesheets_path = myapp_path.join("app", "assets", "stylesheets")
7
7
  javascript_path = myapp_path.join("app", "javascript")
@@ -1,114 +1,110 @@
1
1
 
2
2
  module Birdel
3
3
  module Synth
4
- class SynthActor
5
- class << self
6
- def roll
7
- root_dir_path = Pathname.new("#{Dir.pwd}")
8
- app_folder_path = root_dir_path.join("app")
9
- components_folder_path = app_folder_path.join("components")
10
- js_folder_path = app_folder_path.join("javascript")
11
- stylesheets_folder_path = app_folder_path.join("assets/stylesheets")
12
- js_application_file_path = js_folder_path.join("ui/application.js")
13
- css_bentries_path = stylesheets_folder_path.join("ui/bentries")
14
- js_bentries_path = js_folder_path.join("ui/bentries")
15
-
16
- css_entries_error = false
17
- js_entries_error = false
18
- css_bentries_path.each_child do |entry_folder_path|
19
- # entry_folder_path = Pathname.new(entry_folder)
20
- # entry_folder_index_path = Pathname.new("#{entry_folder}/components.css")
21
- entry_folder_index_path = entry_folder_path.join("components.css")
22
- puts "(css) Building #{entry_folder_index_path.relative_path_from(app_folder_path)}".yellow.bold
23
- # entry_folder_components_path = Pathname.new("#{entry_folder}/components.json")
24
- entry_folder_components_path = entry_folder_path.join("components.css.json")
25
- entry_folder_precomponents_path = entry_folder_path.join("precomponents.css.json")
26
- File.truncate(entry_folder_index_path, 0)
27
- file = File.open(entry_folder_index_path, "w")
28
-
29
- #precomponents
30
- puts "-> Precomponents...".yellow
31
- precomponents = JSON.parse(File.read(entry_folder_precomponents_path))
32
- precomponents.each do |precomponent_path_string|
33
- # # file_path = Pathname.new("#{stylesheets_folder_path.to_s}/#{precomponent_path_string}.css")
34
- file_path = stylesheets_folder_path.join("#{precomponent_path_string}.css")
35
- if file_path.exist?
36
- puts "+ #{precomponent_path_string.split("/").last}.css".green
37
- file.puts "@import url(\"#{file_path.relative_path_from(entry_folder_path).to_s}\");"
38
- else
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
- if css_entries_error
64
- puts "(css-error) Building failed.".red
65
- exit
66
- end
67
- puts "(css-success) Building finished.".green
68
- puts ""
69
-
70
- js_bentries_path.each_child do |entry_folder_path|
71
- # js_entries.each do |entry|
72
- # index_path = Pathname.new("#{entry}/components.js")
73
- index_path = entry_folder_path.join("components.js")
74
- components_json_path = entry_folder_path.join("components.js.json")
75
- # entry_folder_path = Pathname.new(entry)
76
- puts "(js) Building #{index_path.relative_path_from(app_folder_path)}".green
77
- puts "-> (js) Components...".yellow
78
- File.truncate(index_path, 0)
79
- component_controllers = JSON.parse(File.read(components_json_path))
80
- file = File.open(index_path, "w")
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
- if js_entries_error
106
- puts "(js-error) Building failed.".red
107
- exit
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Birdel
4
- VERSION = "2.0.1"
4
+ VERSION = "2.2.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birdel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhii