decentralize 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7969a46d53c49480ede9305359818ab90198dab11d3dede64c72677e74a64ce4
4
+ data.tar.gz: 568e0394f237c63ec67d264f114b7c3dc0de3215c60328e92a63d077507f2eee
5
+ SHA512:
6
+ metadata.gz: aedf216682f2aa2e0aecbfb5badb9f851b8a7c304eb72021880bcd60ebba88fc7e307d3663092658dea90e4f4f6edc2e1d2c2d322f531041e25641ccb9c83abd
7
+ data.tar.gz: 31c5cf3788f04979fdd5112c8e18f7efa84244f3867c0444b97b28db31bba8e989f904ab08124f23095fc0a0e080d2f57b19c66a7d5f95fe643ea517f942281b
data/.mdlrc ADDED
@@ -0,0 +1,5 @@
1
+ # see: https://github.com/markdownlint/markdownlint/blob/main/docs/configuration.md
2
+
3
+ git_recurse true
4
+ show_kramdown_warnings true
5
+ style "#{File.dirname(__FILE__)}/markdownlint.rb"
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,13 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2025-10-17 10:26:23 UTC using RuboCop version 1.81.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ RSpec/ExpectActual:
12
+ Exclude:
13
+ - "spec/decentralize_spec.rb"
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-10-17
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ veganstraightedge@gmail.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Shane Becker
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/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Decentralize
2
+
3
+ ⚠️ **Under construction** ⚠️
4
+ A tool to modify a `Gemfile` so that each gem can be installed from its source.
5
+
6
+ Goal: install gems from the source code repo, not a gem server
7
+
8
+ ## Tradeoffs
9
+
10
+ - ❌ **Ergonomics:** A `Gemfile` full of `git`, `tag`, `branch` args is uglier
11
+ - ❌ **Performance:** Installing gems from source repos is probably slower than installing from a gem server
12
+ - ❌ **Transitive dependencies:** Gems in `Gemfile` get installed from source repo (`git`, `github`, etc), but transitive dependencies are not installed from source repos. Is there a way to install transitive dependencies from source repos?
13
+ - ❌ **Bootstrapping:** This gem needs to phone home to a gem server to fetch metadata for `Gemfile` gems
14
+
15
+ - ⚠️ **Updates:** Will Dependabot version bump PRs Just Work?
16
+ - ⚠️ **Namespaces:** Will this leads to multiple gems of the same name/space colliding?
17
+ - ⚠️ **Phishing:** Will this enable phishing attacks?
18
+ - ⚠️ **Discovery:** Will discovery of gems be harder if we’re installing from source repos?
19
+ - ⚠️ **Security:** Will this introduce security vulnerabilities? Checksums!?
20
+
21
+ - ✅ **Decentralization:** Installing gems doesn’t depend on any gem server, sort of (but it does depend on a gem server for metadata)
22
+ - ✅ **Transparency:** Installing gems from source repos is more transparent than installing from a gem server
23
+ - ✅ **Resilience:** Makes it harder for a bad actor to takeover a gem
24
+
25
+ ## Examples
26
+
27
+ `Gemfile`and `Gemfile.lock` examples are in `/spec/examples`.
28
+
29
+ ## Installation
30
+
31
+ Install the gem and add to the application’s `Gemfile` by executing:
32
+
33
+ ```sh
34
+ bundle add decentralize
35
+ ```
36
+
37
+ If Bundler is not being used to manage dependencies, install the gem by executing:
38
+
39
+ ```sh
40
+ gem install decentralize
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ Hypothetical CLI usage:
46
+
47
+ ```sh
48
+ decentralize # easiest usage
49
+ decentralize path/to/Gemfile # default: ./Gemfile
50
+ ```
51
+
52
+ Optional args:
53
+
54
+ ```sh
55
+ # print help
56
+ decentralize -h
57
+ decentralize --help
58
+
59
+ # print version
60
+ decentralize -v
61
+ decentralize --version
62
+
63
+ # dry run, print what would happen without modifying files
64
+ decentralize -dry-run
65
+
66
+ # asks for confirmation/choice of git remote args
67
+ decentralize -i --interactive
68
+ ```
69
+
70
+ ## Development
71
+
72
+ After checking out the repo, run `bin/setup` to install dependencies.
73
+ Then, run `rake spec` to run the tests.
74
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
75
+
76
+ To install this gem onto your local machine, run `bundle exec rake install`.
77
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
78
+ which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to
79
+ [rubygems.org](https://rubygems.org).
80
+
81
+ ## Contributing
82
+
83
+ Bug reports and pull requests are welcome on GitHub at https://github.com/veganstraightedge/decentralize.
84
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
85
+ [code of conduct](https://github.com/veganstraightedge/decentralize/blob/main/CODE_OF_CONDUCT.md).
86
+
87
+ ## License
88
+
89
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
90
+
91
+ ## Code of Conduct
92
+
93
+ Everyone interacting in the Decentralize project’s codebases,
94
+ issue trackers, chat rooms and mailing lists is expected to follow the
95
+ [code of conduct](https://github.com/veganstraightedge/decentralize/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require 'rubocop/rake_task'
7
+
8
+ RuboCop::RakeTask.new
9
+
10
+ task default: %i[spec rubocop]
data/TODO.md ADDED
@@ -0,0 +1,53 @@
1
+ # TODO
2
+
3
+ Goal: make a gem that will change a Gemfile to install gems from their source repository (GitHub, GitLab, Bitbucket, etc) using Bundler's for git locations.
4
+
5
+ ```ruby
6
+ # examples
7
+ gem 'nokogiri', '1.7.0.1', git: 'https://github.com/sparklemotion/nokogiri'
8
+ gem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'
9
+ git 'https://github.com/rails/rails.git' do
10
+ gem 'railties'
11
+ gem 'actionpack'
12
+ gem 'activemodel'
13
+ end
14
+ git 'https://github.com/rails/rails.git', ref: '4aded' do
15
+ git 'https://github.com/rails/rails.git', branch: '5-0-stable' do
16
+ git 'https://github.com/rails/rails.git', tag: 'v5.0.0' do
17
+ gem 'rails', github: 'rails', ref: 'a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56'
18
+ gem 'keystone', bitbucket: 'musicone/keystone'
19
+ gem 'my_gist', gist: '4815162342'
20
+ ```
21
+
22
+ Reference: https://bundler.io/guides/git.html
23
+
24
+ ## Development guielines
25
+
26
+ - Always latest ruby
27
+ - Always latest bundler
28
+ - Always latest rubygems
29
+ - Use Seattle.rb style
30
+ - Test first!
31
+ - Use RSpec
32
+ - Small and simple is better than big and complex (methods, files, PRs, etc)
33
+ -
34
+
35
+ ## Unorganized tasks
36
+
37
+ - [_] Use Bundler to analyze and understand Gemfile
38
+ - [_] Check for already installed gems in Gemfile
39
+ - [_] Use their .gemspec for remote repo info
40
+ - [_] Fetch remote gemspecs
41
+ - [_] Or scrape gem host for gem remote repo info
42
+ - [_] For each gem repo, figure out how to does versioning
43
+ - [_] Tags, branches, GitHub Releases, some other secret third thing
44
+ - [_] How to handle private repositories?
45
+ - [_] Add git keyword args to `gem` lines in Gemfile
46
+ - [_] Try to maintain existing formatting
47
+ - [_] Check checksums for increased security and safety
48
+ - [_] Create CLI
49
+ - [_] decentralize path_to_gemfile (default: './Gemfile')
50
+ - [_] -h --help
51
+ - [_] -v --version
52
+ - [_] -dry-run
53
+ - [_] -i --interactive : asks for confirmation/choice of git remote args
@@ -0,0 +1,3 @@
1
+ module Decentralize
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,6 @@
1
+ require_relative 'decentralize/version'
2
+
3
+ module Decentralize
4
+ class Error < StandardError; end
5
+ # Your code goes here...
6
+ end
data/markdownlint.rb ADDED
@@ -0,0 +1,56 @@
1
+ # mdl (markdownlint) links
2
+ # gem repo:
3
+ # https://github.com/markdownlint/markdownlint
4
+ # rules:
5
+ # https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md
6
+ # configuration:
7
+ # https://github.com/markdownlint/markdownlint/blob/main/docs/configuration.md
8
+ # relevant .mdlrc
9
+ # styles:
10
+ # https://github.com/markdownlint/markdownlint/blob/main/docs/creating_styles.md
11
+ # relevant to this file!
12
+
13
+ # load all rules
14
+ all
15
+
16
+ # skip these rules/tags
17
+ # https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md
18
+
19
+ # allow long lines
20
+ exclude_rule 'MD013'
21
+
22
+ exclude_rule 'MD034'
23
+ # allow bare URLs
24
+
25
+ # configure these rules (like .rubocop.yml)
26
+ # any rule in with `params` is configurable
27
+ # search here for which rules have `params`:
28
+ # https://github.com/markdownlint/markdownlint/blob/main/lib/mdl/rules.rb
29
+
30
+ # ensure that all headings are ATX style
31
+ # ATX headings are 1-6 leading octothorpes, example:
32
+ # # This is an ATX H1
33
+ # ## This is an ATX H2
34
+ rule 'MD003', style: :atx
35
+
36
+ # ensure that all unordered lists start with a hyphen,
37
+ # not asterisks or pluses
38
+ rule 'MD004', style: :dash
39
+
40
+ # indent nested listed with four spaces
41
+ rule 'MD007', indent: 4
42
+
43
+ # allow ending heading with question mark
44
+ # default disallowed list is: ".,;:!?"
45
+ rule 'MD026', punctuation: '.,;:!'
46
+
47
+ # ensure that all horizontal lists are hyphen style,
48
+ # not asterisks or hyphens with spaces
49
+ rule 'MD035', style: '---'
50
+
51
+ # ensure that all code blocks use backtick fences, not indentation
52
+ # example:
53
+ # ```ruby
54
+ # ...
55
+ # ```
56
+ rule 'MD046', style: :fenced
@@ -0,0 +1,4 @@
1
+ module Decentralize
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: decentralize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Shane Becker
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: 'A tool to modify a `Gemfile` so that each gem can be installed from
13
+ its source
14
+
15
+ '
16
+ email:
17
+ - veganstraightedge@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".mdlrc"
23
+ - ".rubocop_todo.yml"
24
+ - CHANGELOG.md
25
+ - CODE_OF_CONDUCT.md
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - TODO.md
30
+ - lib/decentralize.rb
31
+ - lib/decentralize/version.rb
32
+ - markdownlint.rb
33
+ - sig/decentralize.rbs
34
+ homepage: https://github.com/veganstraightedge/decentralize
35
+ licenses:
36
+ - MIT
37
+ metadata:
38
+ homepage_uri: https://github.com/veganstraightedge/decentralize
39
+ source_code_uri: https://github.com/veganstraightedge/decentralize
40
+ changelog_uri: https://github.com/veganstraightedge/decentralize/blob/main/CHANGELOG.md
41
+ rubygems_mfa_required: 'true'
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.4.7
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubygems_version: 3.7.2
57
+ specification_version: 4
58
+ summary: Modify a Gemfile and install gems from upstream repos
59
+ test_files: []