bulb 0.2.0 → 0.3.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: 00c1343bdb8a84d4e9f36d45a86258cfa403438d682c66c275a7714420a219c6
4
- data.tar.gz: 845c1e07687d2ab11bed080d4d786d39c7de1c8eea88f3c89744e1ed18ffe7f3
3
+ metadata.gz: 984ba929900ecc1d616b8f807f1fdd9f6500f4cb8e62ab22523d936ccb57fd00
4
+ data.tar.gz: ea4d21695522c109fb53b767d993e481b9b679c162c4ce2e3fcdfbdc26cca4d7
5
5
  SHA512:
6
- metadata.gz: 8f43bcb98e5ef5ab0fe123118ec49cf79a0ab3f08f79a061241737a37e277777b74c63d57c9789d4e725f5bee39c7f11afcd8de06b0baa6e80b6972856f52a88
7
- data.tar.gz: 5c7a527aaf9017547cdc0fbec1393f2588f7ad96fde217a28b1bf528cfc850fc2ffb09f8479caa2b91e763c0e244d59b779279e3527127af681cded35a32a6f7
6
+ metadata.gz: 5b9621fb449e3985fb2ff2bbc110bfae13480ade7c744531a5417eac13b9714547326d35c696b87b487fe1fd1341a2af118a55e289a87db0b37fcd159608c7a9
7
+ data.tar.gz: ee4d4b2f85f9a6ea2b9245ee6589c431920de6941a7aada5f279cad71e81d0d9f54b27fa8ddb1f822ccce165128eb7a5f12031764f4adddf846fcf70003e0587
data/README.md CHANGED
@@ -1,10 +1,15 @@
1
1
  # Bulb
2
- Short description and motivation.
3
2
 
4
- ## Usage
5
- How to use my plugin.
3
+ Bulb is a Rails engine that allows easy displaying and management
4
+ of Git repositories.
5
+
6
+ The aim is to provide a very simple engine that you can integrate
7
+ into your personal or organization's website to easily browse your
8
+ Git repositories, stylize things as you wish and provide any feature
9
+ you would like to attach to your repos.
6
10
 
7
11
  ## Installation
12
+
8
13
  Add this line to your application's Gemfile:
9
14
 
10
15
  ```ruby
@@ -12,17 +17,23 @@ gem 'bulb'
12
17
  ```
13
18
 
14
19
  And then execute:
20
+
15
21
  ```bash
16
22
  $ bundle
17
23
  ```
18
24
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install bulb
25
+ ## Usage
26
+
27
+ Once installed, you can mount the engine to whichever path you
28
+ like:
29
+
30
+ ```ruby
31
+ mount Bulb::Engine => "/git"
22
32
  ```
23
33
 
24
- ## Contributing
25
- Contribution directions go here.
34
+ Then your repositories will be available through `/git/:group-slug/:slug`
35
+ like `/git/sites/personal`.
26
36
 
27
37
  ## License
38
+
28
39
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -14,6 +14,8 @@ module Bulb
14
14
  def create_git_repository
15
15
  full_path = fs_repository_path
16
16
 
17
+ raise RuntimeError.new if File.exist?(full_path)
18
+
17
19
  FileUtils.mkdir_p(full_path)
18
20
  Rugged::Repository.init_at(full_path, :bare)
19
21
  end
@@ -0,0 +1,7 @@
1
+ <div class="entry">
2
+ <div class="name">
3
+ <%= link_to blob[:name], blob_path(params[:path], blob[:name]) %>
4
+ </div>
5
+
6
+ <div class="date"></div>
7
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="entry">
2
+ <div class="name">
3
+ <%= link_to subtree[:name], tree_path(params[:path], subtree[:name]) %>
4
+ </div>
5
+
6
+ <div class="date"></div>
7
+ </div>
@@ -1,21 +1,9 @@
1
1
  <div class="tree">
2
- <% tree.each_tree do |folder| %>
3
- <div class="entry">
4
- <div class="name">
5
- <%= link_to folder[:name], tree_path(params[:path], folder[:name]) %>
6
- </div>
7
-
8
- <div class="date"></div>
9
- </div>
2
+ <% tree.each_tree do |subtree| %>
3
+ <%= render partial: 'bulb/tree/subtree', locals: { subtree: subtree } %>
10
4
  <% end %>
11
5
 
12
- <% tree.each_blob do |entry| %>
13
- <div class="entry">
14
- <div class="name">
15
- <%= link_to entry[:name], blob_path(params[:path], entry[:name]) %>
16
- </div>
17
-
18
- <div class="date"></div>
19
- </div>
6
+ <% tree.each_blob do |blob| %>
7
+ <%= render partial: 'bulb/tree/blob', locals: { blob: blob } %>
20
8
  <% end %>
21
9
  </div>
data/lib/bulb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bulb
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Dupret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-15 00:00:00.000000000 Z
11
+ date: 2022-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -92,6 +92,8 @@ files:
92
92
  - app/models/bulb/repository.rb
93
93
  - app/views/bulb/blob/show.html.erb
94
94
  - app/views/bulb/repositories/show.html.erb
95
+ - app/views/bulb/tree/_blob.html.erb
96
+ - app/views/bulb/tree/_subtree.html.erb
95
97
  - app/views/bulb/tree/_tree.html.erb
96
98
  - app/views/bulb/tree/show.html.erb
97
99
  - config/routes.rb