fli_video 0.1.0 → 0.1.1

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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/{scripts/03-get-technical-design-and-features.rb → .builders/generators/back/scripts/01-get-technical-design-and-feature-list.rb} +5 -0
  3. data/{scripts/02-get-features-and-components.rb → .builders/generators/back/scripts/02-get-feature-list-and-components.rb} +4 -0
  4. data/{scripts/01-get-structure.rb → .builders/generators/back/scripts/03-get-structure.rb} +23 -3
  5. data/.builders/generators/back/scripts/generated/application-structure.json +231 -0
  6. data/.builders/generators/back/scripts/generated/features-and-components.md +988 -0
  7. data/.builders/generators/back/scripts/generated/technical-design-and-features.md +424 -0
  8. data/.builders/klues/add_episode.klue +1 -1
  9. data/.builders/klues/create_project.klue +1 -1
  10. data/.builders/klues/move_to_trash.klue +8 -2
  11. data/CHANGELOG.md +8 -0
  12. data/README.md +1 -1
  13. data/docs/feature-list.md +1 -0
  14. data/docs/generated/application-structure.json +2 -6
  15. data/docs/generated/features-and-components.md +36 -30
  16. data/docs/generated/technical-design-and-features.md +25 -8
  17. data/docs/technical-specifications.md +14 -1
  18. data/lib/fli_video/version.rb +1 -1
  19. data/package-lock.json +2 -2
  20. data/package.json +1 -1
  21. data/scripts/01-get-technical-design-and-feature-list.md +5 -0
  22. data/scripts/01-get-technical-design-and-feature-list.rb +39 -0
  23. data/scripts/02-get-feature-list-and-components.md +26 -0
  24. data/scripts/02-get-feature-list-and-components.rb +56 -0
  25. data/scripts/03-get-code-structure.md +33 -0
  26. data/scripts/03-get-code-structure.rb +73 -0
  27. metadata +14 -5
@@ -3,13 +3,16 @@
3
3
  ### Feature <-> DSL GPTs
4
4
  https://chat.openai.com/g/g-AyFi0UOXn-code-simplifier
5
5
 
6
- **Read Global Configuration**
6
+ **Global Configuration**
7
7
  Access and apply global configuration settings for video asset management and state consistency.
8
8
 
9
9
  **Project Configuration**
10
- Access and apply video or episode settings and state.
10
+ Access and apply video or episode settings and state. Infers project settings from existing project folders and files.
11
11
 
12
- **FileWatch Processor for File Event Commands**
12
+ **CLI Project Commands**
13
+ Efficiently execute and manage video project commands using a command-line interface, enhancing control and flexibility in project handling.
14
+
15
+ **FileWatch Processor**
13
16
  Utilize a FileWatch processor to automate file event responses, directing new recordings to designated folders for efficient content management.
14
17
 
15
18
  **Create Project**
@@ -64,9 +67,6 @@ Build a JSON datastore of files for an entire project based on existing project,
64
67
 
65
68
  ## Future Ideas
66
69
 
67
- **CLI Project Management Interface**
68
- Efficiently execute and manage video project commands using a command-line interface, enhancing control and flexibility in project handling.
69
-
70
70
  **Web Command Interface for Video Project Management**
71
71
  Introduce a streamlined, web-based interface for managing video project commands, enabling efficient control and organization of project components through simple browser interactions.
72
72
 
@@ -75,15 +75,15 @@ Generate a detailed report for a specific video project, including the episodes,
75
75
  This should be extracted to an AstroJS Website or HTML template servered by a local webserver and provide viewing and navigation for all my video projects.
76
76
 
77
77
 
78
- ## Klue Components
79
78
 
79
+ ## Klue Components
80
80
  Klue Component: `add_episode.klue`
81
81
 
82
82
  ```ruby
83
83
  component :add_episode do
84
84
  desc "Add a new episode to an existing podcast project."
85
85
 
86
- pattern "Interactor"
86
+ pattern "Command"
87
87
 
88
88
  comments <<~TEXT
89
89
  - Facilitates the addition of a new episode to a specific podcast project.
@@ -105,8 +105,8 @@ component :add_episode do
105
105
  # ~/video-projects/a21-ac-some-podcast/01-episode-about-something/.trash
106
106
  RUBY
107
107
  end
108
- ```
109
108
 
109
+ ```
110
110
  Klue Component: `change_chapter_name.klue`
111
111
 
112
112
  ```ruby
@@ -142,8 +142,8 @@ component :change_chapter_name do
142
142
  # 01-d-intro-CTA.mov
143
143
  RUBY
144
144
  end
145
- ```
146
145
 
146
+ ```
147
147
  Klue Component: `create_chapter_video.klue`
148
148
 
149
149
  ```ruby
@@ -181,15 +181,15 @@ component :create_chapter_video do
181
181
  # Output: '~/video-projects/a27-ac-some-podcast/chapters/01-intro-custom.mov'
182
182
  RUBY
183
183
  end
184
- ```
185
184
 
185
+ ```
186
186
  Klue Component: `create_project.klue`
187
187
 
188
188
  ```ruby
189
189
  component :create_project do
190
190
  desc "Setup a new video project for standalone YouTube video or Podcast."
191
191
 
192
- pattern "Interactor"
192
+ pattern "Command"
193
193
 
194
194
  comments <<~TEXT
195
195
  - Allows the creation of a new project, specifying if it's for a YouTube video or a Podcast.
@@ -223,8 +223,8 @@ component :create_project do
223
223
  # ~/video-projects/a21-ac-some-podcast/.fv.json
224
224
  RUBY
225
225
  end
226
- ```
227
226
 
227
+ ```
228
228
  Klue Component: `empty_trash.klue`
229
229
 
230
230
  ```ruby
@@ -252,8 +252,8 @@ component :empty_trash do
252
252
  # Empties the entire .trash folder in "~/video-projects/a27-ac-categorize-mp4-CI/.trash/
253
253
  RUBY
254
254
  end
255
- ```
256
255
 
256
+ ```
257
257
  Klue Component: `episode_path.klue`
258
258
 
259
259
  ```ruby
@@ -334,8 +334,8 @@ component :episode_path do
334
334
  episode_path.keywords # => ["TODO"]
335
335
  RUBY
336
336
  end
337
- ```
338
337
 
338
+ ```
339
339
  Klue Component: `global_config.klue`
340
340
 
341
341
  ```ruby
@@ -370,8 +370,8 @@ component :global_configuation do
370
370
  method :load
371
371
  method :save
372
372
  end
373
- ```
374
373
 
374
+ ```
375
375
  Klue Component: `move_ecamm_file.klue`
376
376
 
377
377
  ```ruby
@@ -396,8 +396,8 @@ component :move_ecamm_file do
396
396
  # ~/video-projects/a20-ad-some-video/recordings/Ecamm Live Recording on 2023-08-25 at 14.51.58.mov
397
397
  RUBY
398
398
  end
399
- ```
400
399
 
400
+ ```
401
401
  Klue Component: `move_to_trash.klue`
402
402
 
403
403
  ```ruby
@@ -414,9 +414,9 @@ component :move_to_trash do
414
414
 
415
415
  constructure(:parent_project)
416
416
 
417
- method :run(:file_name)
417
+ method :run(:file_name = nil)
418
418
 
419
- sample :move_video_to_trash, <<~RUBY
419
+ sample :move_named_video_to_trash, <<~RUBY
420
420
  project_path = ProjectPath.new('a27')
421
421
 
422
422
  command = move_to_trash.new(project_path)
@@ -424,14 +424,20 @@ component :move_to_trash do
424
424
  # Example of moving a specific suboptimal video take to the trash folder
425
425
  command.run('01-a-introduction.mov')
426
426
  # => "~/video-projects/a27-ac-categorize-mp4-CI/.trash/01-a-introduction.mov"
427
+ RUBY
428
+
429
+ sample :move_last_ecamm__video_to_trash, <<~RUBY
430
+ project_path = ProjectPath.new('a27')
427
431
 
432
+ command = move_to_trash.new(project_path)
433
+
428
434
  # Example of moving the last suboptimal video take to the trash folder
429
435
  command.run
430
436
  # => "~/video-projects/a27-ac-categorize-mp4-CI/.trash/Ecamm Live Recording on 2023-08-25 at 14.51.58.mov
431
437
  RUBY
432
438
  end
433
- ```
434
439
 
440
+ ```
435
441
  Klue Component: `open_in_finder.klue`
436
442
 
437
443
  ```ruby
@@ -460,8 +466,8 @@ component :open_in_finder do
460
466
  # Opens the folder for episode '01' of project 'a27' in Finder
461
467
  RUBY
462
468
  end
463
- ```
464
469
 
470
+ ```
465
471
  Klue Component: `project_config.klue`
466
472
 
467
473
  ```ruby
@@ -588,8 +594,8 @@ component :project_configuration do
588
594
  }
589
595
  JSON
590
596
  end
591
- ```
592
597
 
598
+ ```
593
599
  Klue Component: `project_meta_data_store.klue`
594
600
 
595
601
  ```ruby
@@ -621,8 +627,8 @@ component :project_meta_data_store do
621
627
  # Output: '~/video-projects/a27-ac-categorize-mp4-CI/project_metadata.json'
622
628
  RUBY
623
629
  end
624
- ```
625
630
 
631
+ ```
626
632
  Klue Component: `project_path.klue`
627
633
 
628
634
  ```ruby
@@ -703,8 +709,8 @@ component :project_path do
703
709
  project_path.keywords # => "CI"
704
710
  RUBY
705
711
  end
706
- ```
707
712
 
713
+ ```
708
714
  Klue Component: `recording_file_watcher.klue`
709
715
 
710
716
  ```ruby
@@ -736,8 +742,8 @@ component :filewatch_processor do
736
742
  filewatch_processor.move_file
737
743
  RUBY
738
744
  end
739
- ```
740
745
 
746
+ ```
741
747
  Klue Component: `recording_filename.klue`
742
748
 
743
749
  ```ruby
@@ -853,8 +859,8 @@ component :recording_filename do
853
859
  filename.filename # => "01-a-introduction-NEW_TAG.mov"
854
860
  RUBY
855
861
  end
856
- ```
857
862
 
863
+ ```
858
864
  Klue Component: `restore_from_trash.klue`
859
865
 
860
866
  ```ruby
@@ -887,8 +893,8 @@ component :restore_from_trash do
887
893
  # => "~/video-projects/a27-ac-categorize-mp4-CI/Ecamm Live Recording on 2023-08-25 at 14.51.58.mov"
888
894
  RUBY
889
895
  end
890
- ```
891
896
 
897
+ ```
892
898
  Klue Component: `switch_focus.klue`
893
899
 
894
900
  ```ruby
@@ -916,8 +922,8 @@ component :change_focus do
916
922
  change_focus.run('a21', '02')
917
923
  RUBY
918
924
  end
919
- ```
920
925
 
926
+ ```
921
927
  Klue Component: `text_to_speech.klue`
922
928
 
923
929
  ```ruby
@@ -950,8 +956,8 @@ component :text_to_speech do
950
956
  # Output: Transcriptions saved in '~/video-projects/a27-ac-categorize-mp4-CI/recordings/transcript/01-introduction.txt|srt|vtt|json|tsv'
951
957
  RUBY
952
958
  end
953
- ```
954
959
 
960
+ ```
955
961
  Klue Component: `transcript_data_store.klue`
956
962
 
957
963
  ```ruby
@@ -983,5 +989,5 @@ component :transcript_data_store do
983
989
  # Output: '~/video-projects/a27-ac-categorize-mp4-CI/project_transcripts.json'
984
990
  RUBY
985
991
  end
986
- ```
987
992
 
993
+ ```
@@ -1,6 +1,20 @@
1
+ # FliVideo
2
+
1
3
  ## Application Overview
2
4
 
3
- This document provides an overview of a specialized application designed primarily for video content creators using Ecamm Live on the Mac, and adaptable for OBS users. Tailored for projects ranging from individual YouTube videos to episodes in a podcast series, the application fits seamlessly into the workflow between video recording and editing. It streamlines the post-recording process, encompassing file organization, renaming, and assembly of video recordings, thereby enhancing the efficiency and structure of content creation.
5
+ FliVideo is a Video Asset Managment tool created by a YouTuber `@AppyDave` for YouTubers.
6
+
7
+ It provides a set of image, video and workflow management tools to help its creator 'AppyDave' to automate and systemetize the video production process.
8
+
9
+ The intiial idea behind FliVideo was Zappier for YouTubers, but it is evolving with a range of capabilities around script, b-roll and presenation canvas automation.
10
+
11
+ ### Video Recording Managment
12
+
13
+ FliVideo initially targeted video content creators using Ecamm Live on the Mac, and adaptable for OBS users.
14
+
15
+ Tailored for projects ranging from individual YouTube videos to episodes in a podcast series, the application fits seamlessly into the workflow between video recording and editing.
16
+
17
+ It streamlines the post-recording process, encompassing file organization, renaming, and assembly of video recordings, thereby enhancing the efficiency and structure of content creation.
4
18
 
5
19
  ### Core Functionality
6
20
 
@@ -74,8 +88,8 @@ a29-ac-gpts-analyze-pdf-transations
74
88
 
75
89
  ### Sample project codes
76
90
 
77
- - `ac` - AppyCast
78
91
  - `ad` - AppyDave
92
+ - `ac` - AppyDaveCoding
79
93
  - `fv` - FliVideo
80
94
  - `wp` - WinningPrompts
81
95
  - `c9` - Carnivore90
@@ -343,18 +357,23 @@ project-name/recordings/03-a-outro.mov
343
357
  project-name/recordings/03-b-outro-cta.mov
344
358
  project-name/recordings/03-c-outro.mov
345
359
  ```
360
+
361
+
346
362
  ## Features
347
363
 
348
364
  ### Feature <-> DSL GPTs
349
365
  https://chat.openai.com/g/g-AyFi0UOXn-code-simplifier
350
366
 
351
- **Read Global Configuration**
367
+ **Global Configuration**
352
368
  Access and apply global configuration settings for video asset management and state consistency.
353
369
 
354
370
  **Project Configuration**
355
- Access and apply video or episode settings and state.
371
+ Access and apply video or episode settings and state. Infers project settings from existing project folders and files.
372
+
373
+ **CLI Project Commands**
374
+ Efficiently execute and manage video project commands using a command-line interface, enhancing control and flexibility in project handling.
356
375
 
357
- **FileWatch Processor for File Event Commands**
376
+ **FileWatch Processor**
358
377
  Utilize a FileWatch processor to automate file event responses, directing new recordings to designated folders for efficient content management.
359
378
 
360
379
  **Create Project**
@@ -409,12 +428,10 @@ Build a JSON datastore of files for an entire project based on existing project,
409
428
 
410
429
  ## Future Ideas
411
430
 
412
- **CLI Project Management Interface**
413
- Efficiently execute and manage video project commands using a command-line interface, enhancing control and flexibility in project handling.
414
-
415
431
  **Web Command Interface for Video Project Management**
416
432
  Introduce a streamlined, web-based interface for managing video project commands, enabling efficient control and organization of project components through simple browser interactions.
417
433
 
418
434
  **Project Meta Report**
419
435
  Generate a detailed report for a specific video project, including the episodes, chapters, recordings, a list of recording IDs (chapter sequence + part sequence), and the name for the next video recording, file sizes.
420
436
  This should be extracted to an AstroJS Website or HTML template servered by a local webserver and provide viewing and navigation for all my video projects.
437
+
@@ -2,7 +2,19 @@
2
2
 
3
3
  ## Application Overview
4
4
 
5
- This document provides an overview of a specialized application designed primarily for video content creators using Ecamm Live on the Mac, and adaptable for OBS users. Tailored for projects ranging from individual YouTube videos to episodes in a podcast series, the application fits seamlessly into the workflow between video recording and editing. It streamlines the post-recording process, encompassing file organization, renaming, and assembly of video recordings, thereby enhancing the efficiency and structure of content creation.
5
+ FliVideo is a Video Asset Managment tool created by a YouTuber `@AppyDave` for YouTubers.
6
+
7
+ It provides a set of image, video and workflow management tools to help its creator 'AppyDave' to automate and systemetize the video production process.
8
+
9
+ The intiial idea behind FliVideo was Zappier for YouTubers, but it is evolving with a range of capabilities around script, b-roll and presenation canvas automation.
10
+
11
+ ### Video Recording Managment
12
+
13
+ FliVideo initially targeted video content creators using Ecamm Live on the Mac, and adaptable for OBS users.
14
+
15
+ Tailored for projects ranging from individual YouTube videos to episodes in a podcast series, the application fits seamlessly into the workflow between video recording and editing.
16
+
17
+ It streamlines the post-recording process, encompassing file organization, renaming, and assembly of video recordings, thereby enhancing the efficiency and structure of content creation.
6
18
 
7
19
  ### Core Functionality
8
20
 
@@ -345,3 +357,4 @@ project-name/recordings/03-a-outro.mov
345
357
  project-name/recordings/03-b-outro-cta.mov
346
358
  project-name/recordings/03-c-outro.mov
347
359
  ```
360
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FliVideo
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "fli_video",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "fli_video",
9
- "version": "0.1.0",
9
+ "version": "0.1.1",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.3",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fli_video",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "FliVideo - Video Asset Management for Content Creators",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,5 @@
1
+ ## Prompt:
2
+
3
+ Write a Ruby script to read `docs/technical-specifictions.md` and `docs/feature-list.md`,
4
+ and merge their content into `docs/generated/technical-design-and-features.md` and copy it to the clipboard.
5
+
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Method to read file contents
4
+ def read_file(file_path)
5
+ begin
6
+ File.read(file_path)
7
+ rescue => e
8
+ puts "Error reading file #{file_path}: #{e}"
9
+ ""
10
+ end
11
+ end
12
+
13
+ # Method to write content to a file
14
+ def write_file(file_path, *contents)
15
+ merged_content = contents.join("\n")
16
+ begin
17
+ # Ensure the directory exists
18
+ Dir.mkdir(File.dirname(file_path)) unless Dir.exist?(File.dirname(file_path))
19
+ File.write(file_path, merged_content)
20
+ rescue => e
21
+ puts "Error writing to file #{file_path}: #{e}"
22
+ end
23
+ end
24
+
25
+ # Method to copy content to clipboard
26
+ def copy_to_clipboard(content)
27
+ IO.popen('pbcopy', 'w') { |clip| clip.puts content }
28
+ end
29
+
30
+ # Main execution
31
+ technical_design = read_file('docs/technical-specifications.md')
32
+ feature_list = read_file('docs/feature-list.md')
33
+ output_file = 'docs/generated/technical-design-and-features.md'
34
+
35
+ # Merge and write the content to the output file
36
+ write_file(output_file, technical_design, feature_list)
37
+
38
+ # Copy content to clipboard
39
+ copy_to_clipboard("#{technical_design}\n#{feature_list}")
@@ -0,0 +1,26 @@
1
+ ## Prompt:
2
+
3
+ Write a Ruby script to read `docs/feature-list.md` and merge it with content from `.builders/klues/*.klue` files.
4
+ Write the result to `docs/generated/features-and-components.md` and copy it to the clipboard.
5
+
6
+ The Klue files should need a heading: "Klue Components"
7
+
8
+ The content from each Klue file have a simple heading and be wraped with in a code block with the language set to ruby.
9
+
10
+ Example:
11
+
12
+
13
+ ## Klue Components
14
+
15
+ Klue Component: `add_episode.klue`
16
+
17
+ ```ruby
18
+ # content of add_episode.klue goes here
19
+ ```
20
+
21
+ Klue Component: `change_chapter_name.klue`
22
+
23
+ ```ruby
24
+ # content of change_chapter_name.klue goes here
25
+ ```
26
+
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ require 'find'
3
+
4
+ # Method to read file contents
5
+ def read_file(file_path)
6
+ begin
7
+ File.read(file_path)
8
+ rescue => e
9
+ puts "Error reading file #{file_path}: #{e}"
10
+ ""
11
+ end
12
+ end
13
+
14
+ # Method to write content to a file
15
+ def write_file(file_path, content)
16
+ begin
17
+ # Ensure the directory exists
18
+ Dir.mkdir(File.dirname(file_path)) unless Dir.exist?(File.dirname(file_path))
19
+ File.write(file_path, content)
20
+ rescue => e
21
+ puts "Error writing to file #{file_path}: #{e}"
22
+ end
23
+ end
24
+
25
+ # Method to combine Klue files
26
+ def combine_klue_files(klue_dir)
27
+ klue_components = "## Klue Components\n"
28
+ Find.find(klue_dir) do |path|
29
+ if path =~ /.*\.klue$/
30
+ klue_file_content = read_file(path)
31
+ klue_components += "Klue Component: `#{File.basename(path)}`\n\n```ruby\n#{klue_file_content}\n```\n"
32
+ end
33
+ end
34
+ klue_components
35
+ end
36
+
37
+ # Method to copy content to clipboard
38
+ def copy_to_clipboard(content)
39
+ IO.popen('pbcopy', 'w') { |clip| clip.puts content }
40
+ end
41
+
42
+ # Read the feature list
43
+ feature_list = read_file('docs/feature-list.md')
44
+
45
+ # Combine Klue files
46
+ klue_components = combine_klue_files('.builders/klues')
47
+
48
+ # Merge contents
49
+ merged_content = "#{feature_list}\n\n#{klue_components}"
50
+
51
+ # Output file path
52
+ output_file = 'docs/generated/features-and-components.md'
53
+
54
+ # Write the merged content to the output file and copy to clipboard
55
+ write_file(output_file, merged_content)
56
+ copy_to_clipboard(merged_content)
@@ -0,0 +1,33 @@
1
+ ## Prompt:
2
+
3
+ Create a Ruby script to scan a project's directory, ignoring specific folders and files. For the remaining files generate a JSON file with their structure and content and write to `docs/generated/application-structure.json`
4
+
5
+ Store a copy of the data in the clipboard
6
+
7
+ For some files, eg. ` *.rb` I would like you to read the content and put it in the JSON
8
+
9
+ ### Sample Structure
10
+ ```json
11
+ [
12
+ {
13
+ "name": ".rspec_status",
14
+ "type": "file"
15
+ },
16
+ {
17
+ "name": "spec",
18
+ "type": "directory",
19
+ "children": [
20
+ {
21
+ "name": "spec_helper.rb",
22
+ "type": "file",
23
+ "content": "# frozen_string_literal: true\n\nrequire 'pry'\nrequire 'bundler/setup'\nrequire 'simplecov'\n\nSimpleCov.start\n\nrequire 'fli_video'\n\nRSpec.configure do |config|\n # Enable flags like --only-failures and --next-failure\n config.example_status_persistence_file_path = '.rspec_status'\n config.filter_run_when_matching :focus\n\n # Disable RSpec exposing methods globally on `Module` and `main`\n config.disable_monkey_patching!\n\n config.expect_with :rspec do |c|\n c.syntax = :expect\n end\nend\n"
24
+ },
25
+ {
26
+ "name": "fli_video_spec.rb",
27
+ "type": "file",
28
+ "content": "# frozen_string_literal: true\n\nRSpec.describe FliVideo do\n it 'has a version number' do\n expect(FliVideo::VERSION).not_to be_nil\n end\nend\n"
29
+ }
30
+ ]
31
+ },
32
+ ]
33
+ ```
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env ruby
2
+ require 'json'
3
+ require 'find'
4
+
5
+ # Method to read file contents based on inclusion patterns
6
+ def read_file_contents(file_path, include_content_for)
7
+ return nil unless include_content_for.any? { |pattern| File.fnmatch(pattern[:pattern], File.basename(file_path)) }
8
+ File.read(file_path)
9
+ end
10
+
11
+ # Method to write JSON content to a file
12
+ def write_structure_to_file(file_path, content)
13
+ File.write(file_path, JSON.pretty_generate(content))
14
+ end
15
+
16
+ # Method to copy content to clipboard
17
+ def copy_to_clipboard(content)
18
+ IO.popen('pbcopy', 'w') { |clip| clip.puts content }
19
+ end
20
+
21
+ # Method to scan and structure directory contents
22
+ def scan_directory(dir, ignore_folders, ignore_files, include_content_for)
23
+ Dir.children(dir).map do |entry|
24
+ path = "#{dir}/#{entry}"
25
+ next if ignore_folders.include?(File.basename(path)) || ignore_files.include?(File.basename(path))
26
+
27
+ if File.directory?(path)
28
+ { 'name' => entry, 'type' => 'directory', 'children' => scan_directory(path, ignore_folders, ignore_files, include_content_for) }
29
+ else
30
+ file_data = { 'name' => entry, 'type' => 'file' }
31
+ file_data['content'] = read_file_contents(path, include_content_for) if include_content_for.any? { |pattern| File.fnmatch(pattern[:pattern], entry) }
32
+ file_data
33
+ end
34
+ end.compact
35
+ end
36
+
37
+ # Method to build content for GPT clipboard
38
+ def build_gpt_content(structure)
39
+ JSON.pretty_generate(structure)
40
+ end
41
+
42
+ # Usage example:
43
+ ignore_folders = ['coverage', 'tmp', 'log', '.git', '.githooks', '.github', 'bin', 'sig', 'node_modules', '.builders', 'docs', 'scripts']
44
+
45
+ ignore_files = [
46
+ 'fli.rb',
47
+ 'application-structure.json',
48
+ '.rspec_status',
49
+ '.releaserc.json',
50
+ 'CODE_OF_CONDUCT.md',
51
+ 'Guardfile',
52
+ '.rspec',
53
+ 'CHANGELOG.md',
54
+ '.tool-versions',
55
+ 'Rakefile',
56
+ 'Gemfile.lock',
57
+ '.gitignore',
58
+ 'package-lock.json',
59
+ 'package.json',
60
+ '.rubocop.yml',
61
+ 'LICENSE.txt',
62
+ 'fli_video.gemspec',
63
+ '01-get-structure.rb'
64
+ ]
65
+ include_content_for = [
66
+ { pattern: '*.rb' },
67
+ ]
68
+
69
+ structure = scan_directory('.', ignore_folders, ignore_files, include_content_for)
70
+ write_structure_to_file('docs/generated/application-structure.json', structure)
71
+ gpt_content = build_gpt_content(structure)
72
+ copy_to_clipboard(gpt_content)
73
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fli_video
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-24 00:00:00.000000000 Z
11
+ date: 2024-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: k_log
@@ -34,6 +34,12 @@ files:
34
34
  - ".builders/_.rb"
35
35
  - ".builders/boot.rb"
36
36
  - ".builders/generators/01-bootstrap.rb"
37
+ - ".builders/generators/back/scripts/01-get-technical-design-and-feature-list.rb"
38
+ - ".builders/generators/back/scripts/02-get-feature-list-and-components.rb"
39
+ - ".builders/generators/back/scripts/03-get-structure.rb"
40
+ - ".builders/generators/back/scripts/generated/application-structure.json"
41
+ - ".builders/generators/back/scripts/generated/features-and-components.md"
42
+ - ".builders/generators/back/scripts/generated/technical-design-and-features.md"
37
43
  - ".builders/klues/add_episode.klue"
38
44
  - ".builders/klues/change_chapter_name.klue"
39
45
  - ".builders/klues/create_chapter_video.klue"
@@ -78,9 +84,12 @@ files:
78
84
  - lib/fli_video/version.rb
79
85
  - package-lock.json
80
86
  - package.json
81
- - scripts/01-get-structure.rb
82
- - scripts/02-get-features-and-components.rb
83
- - scripts/03-get-technical-design-and-features.rb
87
+ - scripts/01-get-technical-design-and-feature-list.md
88
+ - scripts/01-get-technical-design-and-feature-list.rb
89
+ - scripts/02-get-feature-list-and-components.md
90
+ - scripts/02-get-feature-list-and-components.rb
91
+ - scripts/03-get-code-structure.md
92
+ - scripts/03-get-code-structure.rb
84
93
  - sig/fli_video.rbs
85
94
  homepage: http://appydave.com/gems/fli_video
86
95
  licenses: