truong_gf_beauty 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: d885a2e5f8593203c219d16d9df691c3a4d82f35ea6aa62274b6a532116891cc
4
+ data.tar.gz: 8c3f952b1ed6fe7c68a234add07c46a6170d6daab238bbd3f1cef8c585bd7569
5
+ SHA512:
6
+ metadata.gz: 82e974bc63bed9656639d813ee52666f69e9bb8657b0cd1fdbec664e0d837345c94e7ecfb14d0bd7d3f174a34f85b30c5d23b97dd99d11339df8967a59217e0e
7
+ data.tar.gz: 8283fcdcbb4e01426811384c276421b045b1ea5ac92570a2f7f0719ec9558b5ecbffd77e410b04fdf4eb090bc1e8c545ba25c4fcecc1311a88923589456b81c8
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "truong_gf_beauty"
4
+
5
+ TruongGfBeauty.proccess
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "truong_gf_beauty/version"
4
+
5
+ class TruongGfBeauty
6
+ def self.proccess
7
+ current_project = `pwd`
8
+ current_project = current_project.gsub(/\n/,"")
9
+ content = File.read(current_project + "/Gemfile")
10
+ content = content.gsub(/\#\s.*\s*/,"") # Xóa các dòng comment
11
+ content = content.gsub(/'/, '"') # Thay thế dấu ' bằng "
12
+ content = content.gsub(/\s*^group/, "\n\ngroup") # Remove các dòng trống
13
+ content = content.gsub(/\s*^\s+^gem/, "\n\ngem")
14
+ File.open(current_project + "/Gemfile", "w") do |file|
15
+ file.puts content
16
+ end
17
+ system "echo", "-e", "\e[92mYour Gemfile was successfully beautified!"
18
+ rescue Exception => e
19
+ system "echo", "-e", "\e[91m#{e.message}"
20
+ system "echo", "-e", "\e[91mMake sure you're in the right place!"
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: truong_gf_beauty
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - David
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple gem which will beautify your Gemfile
14
+ email: truong.dohuy0501@gmail.com
15
+ executables:
16
+ - truong_gf_beauty
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/truong_gf_beauty
21
+ - lib/truong_gf_beauty.rb
22
+ homepage:
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.2.3
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Gemfile Beautify
44
+ test_files: []