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 +4 -4
 - data/lib/birdel/com/com_actor.rb +1 -1
 - 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: c28d8862e05a3e3daa3fa7bf3952542a5b14bda3ef8cd6e2dbdf82748c29150c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4354b48a7ef3451a0d5dc61dea584f0ed521b99d308bf87f88313d3cea584215
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b54dfabb9a518b195dea5750d84acca9923f7f8f664c265698511929eb28f901780562db4b3820e5b5a75ee66f9ba1dfee6ae5a860a17e7ec06a9403c09dcbfd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 01c1380d2975df0b5064347aac65f63cd63c3f061fe1cf5a47bc4b52430f9d50aa2d2bac5da56cd6f8066dd6f1c27d4d0c1799fe00f282cb77e431895db6a945
         
     | 
    
        data/lib/birdel/com/com_actor.rb
    CHANGED
    
    
    
        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