bulb 0.1.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +20 -0
  3. data/README.md +31 -13
  4. data/Rakefile +28 -6
  5. data/app/assets/config/bulb_manifest.js +1 -0
  6. data/app/assets/stylesheets/bulb/application.css +15 -0
  7. data/app/controllers/bulb/blob_controller.rb +15 -0
  8. data/app/controllers/bulb/bulb_controller.rb +5 -0
  9. data/app/controllers/bulb/concerns/bulb_controller.rb +38 -0
  10. data/app/controllers/bulb/repositories_controller.rb +9 -0
  11. data/app/controllers/bulb/tree_controller.rb +15 -0
  12. data/app/helpers/bulb/application_helper.rb +40 -0
  13. data/app/helpers/bulb/text_helper.rb +35 -0
  14. data/app/jobs/bulb/application_job.rb +4 -0
  15. data/app/models/bulb/application_record.rb +5 -0
  16. data/app/models/bulb/group.rb +7 -0
  17. data/app/models/bulb/repository.rb +36 -0
  18. data/app/validators/bulb/unexisting_validator.rb +9 -0
  19. data/app/views/bulb/blob/show.html.erb +16 -0
  20. data/app/views/bulb/repositories/show.html.erb +18 -0
  21. data/app/views/bulb/tree/_blob.html.erb +7 -0
  22. data/app/views/bulb/tree/_subtree.html.erb +7 -0
  23. data/app/views/bulb/tree/_tree.html.erb +9 -0
  24. data/app/views/bulb/tree/show.html.erb +3 -0
  25. data/config/routes.rb +12 -0
  26. data/db/migrate/20210809182658_create_bulb_groups.rb +12 -0
  27. data/db/migrate/20210809182912_create_bulb_repositories.rb +14 -0
  28. data/db/migrate/20220116171708_add_unique_index_on_slugs.rb +6 -0
  29. data/lib/bulb/engine.rb +7 -0
  30. data/lib/bulb/version.rb +1 -1
  31. data/lib/bulb.rb +3 -3
  32. data/lib/tasks/bulb_tasks.rake +4 -0
  33. metadata +94 -19
  34. data/.gitignore +0 -8
  35. data/.travis.yml +0 -6
  36. data/Gemfile +0 -7
  37. data/LICENSE.txt +0 -21
  38. data/bin/console +0 -14
  39. data/bin/setup +0 -8
  40. data/bulb.gemspec +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47c6026788df026b5ea24ea094d24f6730264d918bdfca283230fe07562248d6
4
- data.tar.gz: fa0259afd63979f16e36cf2ce17e0843dd4e00c9404a82f70a386ea653c59e22
3
+ metadata.gz: 4d8fbeacdbc0bd0d8bdb90769e4bb4e25e3a9327847f5b690605a72ad7c29d29
4
+ data.tar.gz: 5f3cc7e8cd6778b4afbee05e73de2371929b3fac18b82263c10e643927d36124
5
5
  SHA512:
6
- metadata.gz: 2d56200cf08c19be3b6581ecda79dc21ded7097b21ffe6e08c415c41363a4a8ee06c7fd12c369dc0f8e14e954029cec65e1dad61c3a6de2d69c6e3b0a57f4323
7
- data.tar.gz: 997e24b4a90f6ea7a940a874bcbd408e2374a1bb35fed8b5e18da03e09dc9ac5728fec6923021618bfdbfa083c28a9dfd2676ffcb25b8ad9f7548ebece47e066
6
+ metadata.gz: f9c474bbb7aabc5cf420731d94ce969ac2327f3b3e6bf37f9b8a3ac1edd1214747d34aaba27319a8460c1dc8cf1b0fac46eac1446955e838ec52ef43e6771b42
7
+ data.tar.gz: d1e1ccedb16cfbbe54ae1ef1253feba5d77d9fef8c1bb2bcd36b191915e6c419d6f543890a3a515c864483f7fffbea9177e5c8232d999e347eff48a24d87217c
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2020 Robin Dupret
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Bulb
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bulb`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Bulb is a Rails engine that allows easy displaying and management
4
+ of Git repositories.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
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
8
12
 
@@ -14,26 +18,40 @@ gem 'bulb'
14
18
 
15
19
  And then execute:
16
20
 
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install bulb
21
+ ```bash
22
+ $ bundle
23
+ ```
22
24
 
23
25
  ## Usage
24
26
 
25
- TODO: Write usage instructions here
27
+ Once installed, you need to generate the needed migrations to
28
+ create the tables and migrate your database:
26
29
 
27
- ## Development
30
+ ```bash
31
+ $ rake bulb:install:migrations
32
+ $ rake db:migrate
33
+ ```
28
34
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ Then, you can mount the engine to whichever path you like:
30
36
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+ ```ruby
38
+ mount Bulb::Engine => "/git"
39
+ ```
40
+
41
+ Then your repositories will be available through `/git/:group-slug/:slug`
42
+ like `/git/sites/personal`.
32
43
 
33
- ## Contributing
44
+ To configure where your repositories are stored and who own them, you can
45
+ open your `config/application.rb` or any environment-specific file and add
46
+ the following:
34
47
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bulb.
48
+ ```ruby
49
+ config.bulb.repositories_path = '/srv/git/'
50
+ config.bulb.repositories_owner = 'git'
51
+ ```
36
52
 
53
+ Where `git` is a Unix user on your system that must be the owner of the
54
+ repository folders.
37
55
 
38
56
  ## License
39
57
 
data/Rakefile CHANGED
@@ -1,10 +1,32 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Bulb'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
3
25
 
4
26
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
8
30
  end
9
31
 
10
- task :default => :test
32
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/bulb .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,15 @@
1
+ module Bulb
2
+ class BlobController < BulbController
3
+ before_action :set_repository
4
+ before_action :handle_special_formats
5
+
6
+ def show
7
+ @git_repository = @repository.git_repository
8
+ @blob_hash = @git_repository.head.target.tree.path(params[:path])
9
+
10
+ redirect_to repository_tree_path if @blob_hash[:type] == :tree
11
+
12
+ @blob = @git_repository.lookup(@blob_hash[:oid])
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module Bulb
2
+ class BulbController < ::ApplicationController
3
+ include Bulb::Concerns::Controllers::BulbController
4
+ end
5
+ end
@@ -0,0 +1,38 @@
1
+ module Bulb::Concerns::BulbController
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ helper Rails.application.routes.url_helpers
6
+ helper Bulb::ApplicationHelper
7
+ helper Bulb::TextHelper
8
+
9
+ protect_from_forgery with: :exception
10
+
11
+ protected
12
+ def set_repository
13
+ @group = Bulb::Group.find_by(slug: params[:group_slug])
14
+ @repository = Bulb::Repository.find_by(group: @group, slug: params[:slug])
15
+ end
16
+
17
+ def group_slug
18
+ params[:group_slug]
19
+ end
20
+
21
+ def slug
22
+ params[:slug]
23
+ end
24
+
25
+ def handle_special_formats
26
+ redirect_formats = [
27
+ "text/css",
28
+ "text/javascript",
29
+ "text/plain",
30
+ "image/svg+xml", "image/png", "image/gif", "image/jpeg", "image/jpg",
31
+ "application/x-yaml",
32
+ "application/xml"
33
+ ]
34
+
35
+ request.formats = [:html] if redirect_formats.include?(request.formats.first.to_s)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,9 @@
1
+ module Bulb
2
+ class RepositoriesController < BulbController
3
+ before_action :set_repository
4
+
5
+ def show
6
+ @git_repository = @repository.git_repository
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ module Bulb
2
+ class TreeController < BulbController
3
+ before_action :set_repository
4
+ before_action :handle_special_formats
5
+
6
+ def show
7
+ @git_repository = @repository.git_repository
8
+ tree_hash = @git_repository.head.target.tree.path(params[:path])
9
+
10
+ redirect_to repository_blob_path if tree_hash[:type] == :blob
11
+
12
+ @tree = @git_repository.lookup(tree_hash[:oid])
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,40 @@
1
+ module Bulb
2
+ module ApplicationHelper
3
+ def tree_path(root, name)
4
+ root = root ? (root + "/") : ""
5
+ bulb.repository_tree_path(reference: 'master', path: root + name)
6
+ end
7
+
8
+ def blob_path(root, name)
9
+ root = root ? (root + "/") : ""
10
+ bulb.repository_blob_path(reference: 'master', path: root + name)
11
+ end
12
+
13
+ def breadcrumb
14
+ parts = params[:path].split("/")
15
+ last = parts.pop
16
+
17
+ reference = params[:reference]
18
+ group_slug = params[:group_slug]
19
+ slug = params[:slug]
20
+
21
+ elements = []
22
+
23
+ elements << content_tag(:li) do
24
+ link_to @repository.slug, bulb.repository_path(group_slug, slug)
25
+ end
26
+
27
+ parts.each_with_index do |part, index|
28
+ path = parts[0..index].join("/")
29
+
30
+ elements << content_tag(:li) do
31
+ link_to part, bulb.repository_tree_path(reference: reference, path: path)
32
+ end
33
+ end
34
+
35
+ elements << content_tag(:li, last)
36
+
37
+ content_tag(:ul, elements.join.html_safe, class: 'breadcrumb')
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,35 @@
1
+ module Bulb
2
+ module TextHelper
3
+ def highlight_blob(filename, content)
4
+ tokens, lexer = lex(content, filename: filename)
5
+
6
+ formatter = Rouge::Formatters::HTMLLineTable.new(html_formatter)
7
+ formatter.format(tokens)
8
+ end
9
+
10
+ private
11
+ def lex(code, lang: nil, filename: nil)
12
+ lexer = if lang
13
+ Rouge::Lexer.find_fancy(lang, code) || Rouge::Lexers::PlainText
14
+ elsif filename
15
+ # Rouge highlights `.h` files as `C` by default but we can safely
16
+ # highlight it as `C++` because the latter is almost a superset of
17
+ # the former and there are certainly far more C++ keywords that
18
+ # don't exist in C, than the other way around.
19
+ if filename.end_with?(".h")
20
+ Rouge::Lexers::Cpp
21
+ else
22
+ Rouge::Lexer.guess(filename: filename, source: code)
23
+ end
24
+ else
25
+ Rouge::Lexers::PlainText
26
+ end
27
+
28
+ [lexer.lex(code), lexer]
29
+ end
30
+
31
+ def html_formatter
32
+ Rouge::Formatters::HTML.new
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,4 @@
1
+ module Bulb
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Bulb
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Bulb
2
+ class Group < ApplicationRecord
3
+ has_many :repositories
4
+
5
+ validates_uniqueness_of :slug, case_sensitive: false
6
+ end
7
+ end
@@ -0,0 +1,36 @@
1
+ require 'rugged'
2
+
3
+ module Bulb
4
+ class Repository < ApplicationRecord
5
+ belongs_to :group, class_name: 'Group', foreign_key: 'bulb_group_id'
6
+
7
+ before_create :create_git_repository
8
+
9
+ validates_uniqueness_of :slug, scope: :bulb_group_id
10
+ validates :fs_repository_path, 'bulb/unexisting': true, on: :create
11
+
12
+ def git_repository
13
+ @git_repository ||= Rugged::Repository.new(fs_repository_path)
14
+ end
15
+
16
+ private
17
+ def create_git_repository
18
+ full_path = fs_repository_path
19
+
20
+ FileUtils.mkdir_p(full_path)
21
+ Rugged::Repository.init_at(full_path, :bare)
22
+
23
+ if (owner = Bulb.repositories_owner).present?
24
+ FileUtils.chown_R(owner, owner, full_path)
25
+ end
26
+ end
27
+
28
+ def fs_repository_path
29
+ if group.nil?
30
+ File.join(Bulb.repositories_path, "#{slug}.git")
31
+ else
32
+ File.join(Bulb.repositories_path, group.slug, "#{slug}.git")
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ module Bulb
2
+ class UnexistingValidator < ActiveModel::EachValidator
3
+ def validate_each(record, attribute, value)
4
+ if File.exist?(value)
5
+ record.errors.add attribute, 'must not exist'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ <%= breadcrumb %>
2
+
3
+ <% unless @blob.binary? %>
4
+ <div class="blob highlight">
5
+ <%= raw highlight_blob @blob_hash[:name], @blob.content.force_encoding(Encoding::UTF_8) %>
6
+ </div>
7
+ <% else %>
8
+ <div class="blob">
9
+ <% match = @blob_hash[:name].match(/\.(jpg|jpeg|png|gif)$/) %>
10
+ <% if match %>
11
+ <img src="data:image/<%= match[1] %>;base64,<%= Base64.strict_encode64(@blob.content) %>">
12
+ <% else %>
13
+ Nothing to display.
14
+ <% end %>
15
+ </div>
16
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <%= content_for(:banner) do %>
2
+ <h2>
3
+ <%= link_to @group.name, group_path(@group.slug) %> /
4
+ <%= @repository.name %>
5
+ </h2>
6
+
7
+ <p class="repo-description"><%= @repository.description %></p>
8
+ <% end %>
9
+
10
+ <% if @git_repository.empty? %>
11
+ Nothing here for the moment.
12
+ <% else %>
13
+ <%= render partial: 'bulb/tree/tree', locals: { tree: @git_repository.head.target.tree } %>
14
+
15
+ <div class="readme">
16
+ <%= raw markdown @git_repository.lookup(@git_repository.head.target.tree.each.find { |b| b[:name].start_with?("README") }[:oid]).content %>
17
+ </div>
18
+ <% 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>
@@ -0,0 +1,9 @@
1
+ <div class="tree">
2
+ <% tree.each_tree do |subtree| %>
3
+ <%= render partial: 'bulb/tree/subtree', locals: { subtree: subtree } %>
4
+ <% end %>
5
+
6
+ <% tree.each_blob do |blob| %>
7
+ <%= render partial: 'bulb/tree/blob', locals: { blob: blob } %>
8
+ <% end %>
9
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= breadcrumb %>
2
+
3
+ <%= render partial: 'tree', locals: { tree: @tree } %>
data/config/routes.rb ADDED
@@ -0,0 +1,12 @@
1
+ Bulb::Engine.routes.draw do
2
+ scope '/:group_slug', format: false do
3
+ get '/' => 'groups#show', as: :group
4
+
5
+ scope '/:slug', as: :repository, format: false do
6
+ get '/' => 'repositories#show'
7
+
8
+ get '/tree/:reference/*path' => 'tree#show', as: :tree
9
+ get '/blob/:reference/*path' => 'blob#show', as: :blob
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateBulbGroups < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :bulb_groups do |t|
4
+ t.string :name
5
+ t.string :slug
6
+ t.integer :visibility
7
+ t.text :description
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ class CreateBulbRepositories < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :bulb_repositories do |t|
4
+ t.string :name
5
+ t.string :slug
6
+ t.integer :visibility
7
+ t.text :description
8
+ t.json :language_stats
9
+ t.references :bulb_group, null: false, foreign_key: true
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ class AddUniqueIndexOnSlugs < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_index :bulb_groups, :slug, unique: true
4
+ add_index :bulb_repositories, [:bulb_group_id, :slug], unique: true
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ module Bulb
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Bulb
4
+
5
+ config.bulb = Bulb
6
+ end
7
+ end
data/lib/bulb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bulb
2
- VERSION = "0.1.0"
2
+ VERSION = '0.4.0'
3
3
  end
data/lib/bulb.rb CHANGED
@@ -1,6 +1,6 @@
1
- require "bulb/version"
1
+ require "bulb/engine"
2
2
 
3
3
  module Bulb
4
- class Error < StandardError; end
5
- # Your code goes here...
4
+ mattr_accessor :repositories_path
5
+ mattr_accessor :repositories_owner
6
6
  end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bulb do
3
+ # # Task goes here
4
+ # end
metadata CHANGED
@@ -1,38 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Dupret
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-08 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Write a longer description or delete this line.
11
+ date: 2022-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.1.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 6.1.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: rugged
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rouge
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.26'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.26'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Boilerplate code to display and manage Git repositories.
14
70
  email:
15
- - robin.dupret@hey.com
71
+ - robin.dupret@gmail.com
16
72
  executables: []
17
73
  extensions: []
18
74
  extra_rdoc_files: []
19
75
  files:
20
- - ".gitignore"
21
- - ".travis.yml"
22
- - Gemfile
23
- - LICENSE.txt
76
+ - LICENSE
24
77
  - README.md
25
78
  - Rakefile
26
- - bin/console
27
- - bin/setup
28
- - bulb.gemspec
79
+ - app/assets/config/bulb_manifest.js
80
+ - app/assets/stylesheets/bulb/application.css
81
+ - app/controllers/bulb/blob_controller.rb
82
+ - app/controllers/bulb/bulb_controller.rb
83
+ - app/controllers/bulb/concerns/bulb_controller.rb
84
+ - app/controllers/bulb/repositories_controller.rb
85
+ - app/controllers/bulb/tree_controller.rb
86
+ - app/helpers/bulb/application_helper.rb
87
+ - app/helpers/bulb/text_helper.rb
88
+ - app/jobs/bulb/application_job.rb
89
+ - app/models/bulb/application_record.rb
90
+ - app/models/bulb/group.rb
91
+ - app/models/bulb/repository.rb
92
+ - app/validators/bulb/unexisting_validator.rb
93
+ - app/views/bulb/blob/show.html.erb
94
+ - app/views/bulb/repositories/show.html.erb
95
+ - app/views/bulb/tree/_blob.html.erb
96
+ - app/views/bulb/tree/_subtree.html.erb
97
+ - app/views/bulb/tree/_tree.html.erb
98
+ - app/views/bulb/tree/show.html.erb
99
+ - config/routes.rb
100
+ - db/migrate/20210809182658_create_bulb_groups.rb
101
+ - db/migrate/20210809182912_create_bulb_repositories.rb
102
+ - db/migrate/20220116171708_add_unique_index_on_slugs.rb
29
103
  - lib/bulb.rb
104
+ - lib/bulb/engine.rb
30
105
  - lib/bulb/version.rb
31
- homepage: https://github.com
106
+ - lib/tasks/bulb_tasks.rake
107
+ homepage: ''
32
108
  licenses:
33
109
  - MIT
34
- metadata:
35
- homepage_uri: https://github.com
110
+ metadata: {}
36
111
  post_install_message:
37
112
  rdoc_options: []
38
113
  require_paths:
@@ -41,15 +116,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
41
116
  requirements:
42
117
  - - ">="
43
118
  - !ruby/object:Gem::Version
44
- version: 2.3.0
119
+ version: '0'
45
120
  required_rubygems_version: !ruby/object:Gem::Requirement
46
121
  requirements:
47
122
  - - ">="
48
123
  - !ruby/object:Gem::Version
49
124
  version: '0'
50
125
  requirements: []
51
- rubygems_version: 3.1.4
126
+ rubygems_version: 3.2.22
52
127
  signing_key:
53
128
  specification_version: 4
54
- summary: Write a short summary, because RubyGems requires one.
129
+ summary: A Rails engine to deal with Git repositories
55
130
  test_files: []
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.2
6
- before_install: gem install bundler -v 2.1.4
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in bulb.gemspec
4
- gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "minitest", "~> 5.0"
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Robin Dupret
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "bulb"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bulb.gemspec DELETED
@@ -1,25 +0,0 @@
1
- require_relative 'lib/bulb/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "bulb"
5
- spec.version = Bulb::VERSION
6
- spec.authors = ["Robin Dupret"]
7
- spec.email = ["robin.dupret@hey.com"]
8
-
9
- spec.summary = %q{Write a short summary, because RubyGems requires one.}
10
- spec.description = %q{Write a longer description or delete this line.}
11
- spec.homepage = "https://github.com"
12
- spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
-
15
- spec.metadata["homepage_uri"] = spec.homepage
16
-
17
- # Specify which files should be added to the gem when it is released.
18
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- end
22
- spec.bindir = "exe"
23
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ["lib"]
25
- end