source_browser 0.1.0 → 0.2.0

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: fc01ebe8cf52d45b5288d2884f8da766e489036b1c05d7024692bb2f6620dd64
4
- data.tar.gz: f93945cdd7f4d22e613cd687bbc7244b32a8963a579a5e0df7eddef735344e3b
3
+ metadata.gz: 9f857424624a453cf0619e61e3dc7f591164e5bc56d751502d2b373a55de2f08
4
+ data.tar.gz: 5814c61500d631925543af9bdccda1706375220f8fbc7480cdd3014e82b98103
5
5
  SHA512:
6
- metadata.gz: 6af6190eb5be7c8ca3dab742380b9a1162b117014147c472afdb6c5cfb67ea93ecab6a6b47d25fd65a4c98d650aaf6ab0fbc7be645582d9fbb935ea32c510426
7
- data.tar.gz: 0ab968a2e340c3de5002cc95a731f0c5bf91a75391c303ff162b21188f5144a1215961b05304586c1d67475c022b7a4cc2a9e66a50dffa3099cd519257866e7b
6
+ metadata.gz: c193578d72c75a44795eaef15b905215403aaeb10ef9cea891ade6bd23462322166c327b59c48b0f79ecb23f6bc282a409ac49dd91a717592176abc18384cac2
7
+ data.tar.gz: b10a21701d720baa36581294c5d296e87f25cc131584d5089c137d6ae3714adcb8a91b401a6dfb9d9d8632fe8772b4b7dc434d821541711605a4701d0ceca48f
data/README.md CHANGED
@@ -16,11 +16,18 @@ And then execute:
16
16
  $ bundle
17
17
  ```
18
18
 
19
- Or install it yourself as:
19
+ Run the installer:
20
+
20
21
  ```bash
21
- $ gem install source_browser
22
+ bin/rails generate source_browser:install
23
+ ```
24
+
25
+ Mount the engine in your `config/routes.rb`
26
+ ```rb
27
+ mount SourceBrowser::Engine, at: "/source"
22
28
  ```
23
29
 
30
+
24
31
  ## Contributing
25
32
  Contribution directions go here.
26
33
 
data/config/routes.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  SourceBrowser::Engine.routes.draw do
2
2
  root "source#index"
3
- get "*id" => "source#show", as: :browse, format: false, defaults: {format: 'html'}
4
- get "objects/*id" => "objects#show", as: :object, format: false, defaults: {format: 'html'}
3
+ get "*id" => "source#show", as: :browse, format: false, defaults: {format: "html"}
4
+ get "objects/*id", to: "objects#show",
5
+ as: :object,
6
+ format: false,
7
+ defaults: {format: "html"}
5
8
  end
@@ -0,0 +1,5 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ bin/rails generate source_browser:install
@@ -0,0 +1,35 @@
1
+ module SourceBrowser
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("templates", __dir__)
5
+
6
+ def edit_dockerfile
7
+ gsub_file "Dockerfile", "curl libjemalloc2", "curl git libjemalloc2"
8
+ gsub_file "Dockerfile", "build-essential git", "build-essential"
9
+
10
+ insert_into_file "Dockerfile", after: "USER 1000:1000\n" do
11
+ "\nRUN git config --global --add safe.directory /rails\n"
12
+ end
13
+ rescue Errno::ENOENT
14
+ puts "Skipping Dockerfile"
15
+ end
16
+
17
+ def edit_config_deploy_yml
18
+ uncomment_lines "config/deploy.yml", /args:/
19
+
20
+ insert_into_file "config/deploy.yml", after: " args:\n" do
21
+ " BUILDKIT_CONTEXT_KEEP_GIT_DIR: 1\n"
22
+ end
23
+ rescue Errno::ENOENT
24
+ puts "Skipping config/deploy.yml"
25
+ end
26
+
27
+ def edit_dockerignore
28
+ comment_lines ".dockerignore", "/.git/"
29
+ comment_lines ".dockerignore", "/.gitignore"
30
+ rescue Errno::ENOENT
31
+ puts "Skipping .dockerignore"
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module SourceBrowser
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Peterson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-10-10 00:00:00.000000000 Z
12
+ date: 2024-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -78,6 +78,8 @@ files:
78
78
  - app/views/source_browser/source/index.html.erb
79
79
  - app/views/source_browser/source/show.html.erb
80
80
  - config/routes.rb
81
+ - lib/generators/source_browser/install/USAGE
82
+ - lib/generators/source_browser/install/install_generator.rb
81
83
  - lib/source_browser.rb
82
84
  - lib/source_browser/engine.rb
83
85
  - lib/source_browser/version.rb