fli_video 0.1.0 → 0.1.2

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 (29) 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/.rubocop.yml +5 -1
  12. data/CHANGELOG.md +15 -0
  13. data/README.md +1 -1
  14. data/docs/feature-list.md +1 -0
  15. data/docs/generated/application-structure.json +2 -6
  16. data/docs/generated/features-and-components.md +36 -30
  17. data/docs/generated/technical-design-and-features.md +25 -8
  18. data/docs/project-new.md +184 -0
  19. data/docs/technical-specifications.md +14 -1
  20. data/lib/fli_video/version.rb +1 -1
  21. data/package-lock.json +2 -2
  22. data/package.json +1 -1
  23. data/scripts/01-get-technical-design-and-feature-list.md +5 -0
  24. data/scripts/01-get-technical-design-and-feature-list.rb +39 -0
  25. data/scripts/02-get-feature-list-and-components.md +26 -0
  26. data/scripts/02-get-feature-list-and-components.rb +56 -0
  27. data/scripts/03-get-code-structure.md +33 -0
  28. data/scripts/03-get-code-structure.rb +73 -0
  29. metadata +15 -5
@@ -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.2
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-11-30 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"
@@ -71,6 +77,7 @@ files:
71
77
  - docs/generated/application-structure.json
72
78
  - docs/generated/features-and-components.md
73
79
  - docs/generated/technical-design-and-features.md
80
+ - docs/project-new.md
74
81
  - docs/technical-specifications.md
75
82
  - fli.rb
76
83
  - lib/fli_video.rb
@@ -78,9 +85,12 @@ files:
78
85
  - lib/fli_video/version.rb
79
86
  - package-lock.json
80
87
  - 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
88
+ - scripts/01-get-technical-design-and-feature-list.md
89
+ - scripts/01-get-technical-design-and-feature-list.rb
90
+ - scripts/02-get-feature-list-and-components.md
91
+ - scripts/02-get-feature-list-and-components.rb
92
+ - scripts/03-get-code-structure.md
93
+ - scripts/03-get-code-structure.rb
84
94
  - sig/fli_video.rbs
85
95
  homepage: http://appydave.com/gems/fli_video
86
96
  licenses: