beautycode 0.1.0 → 1.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 +4 -4
- data/Gemfile +2 -1
- data/beautycode-0.1.0.gem +0 -0
- data/beautycode.gemspec +2 -2
- data/bin/beautycode +5 -0
- data/lib/beautycode.rb +21 -3
- data/lib/beautycode/version.rb +3 -3
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a82b17b57a02dc7bb913d48aafdee4a1decf4a2fa782ff02b2bacf229e67824
|
4
|
+
data.tar.gz: c76daef03f636dfff65f159767b2ee5e0ad7680f472c8e1165653cad7f77228b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9ef4cafd55bd401097799e89536315fa4bfa591f3ec3348c9e29f4ad29a3010641ef89a44e1b9452d0d4e8876fad0fdd54b45eab10a586e0358d49b580de0fd
|
7
|
+
data.tar.gz: f0b7614f1b2799d5cdea08108e4dfed21968f3f193ab5a83265a2aeb396aa9c0e4444603b8b371acce84b383cdd91055eac33be7d8f3890af88cd31654afc7a4
|
data/Gemfile
CHANGED
Binary file
|
data/beautycode.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "lib/beautycode/version"
|
3
|
+
# require_relative "lib/beautycode/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "beautycode"
|
7
|
-
spec.version =
|
7
|
+
spec.version = "1.2.0"
|
8
8
|
spec.authors = ["lanhnth-1450"]
|
9
9
|
spec.email = ["nguyen.thi.huyen.lanh@sun-asterisk.com"]
|
10
10
|
|
data/bin/beautycode
ADDED
data/lib/beautycode.rb
CHANGED
@@ -2,7 +2,25 @@
|
|
2
2
|
|
3
3
|
require_relative "beautycode/version"
|
4
4
|
|
5
|
-
module Beautycode
|
6
|
-
class Error < StandardError; end
|
7
|
-
|
5
|
+
# module Beautycode
|
6
|
+
# class Error < StandardError; end
|
7
|
+
|
8
|
+
class Beautycode
|
9
|
+
def self.process
|
10
|
+
current_project = `pwd`
|
11
|
+
current_project = current_project.gsub(/\n/,"")
|
12
|
+
content = File.read(current_project + "/Gemfile")
|
13
|
+
content = content.gsub(/\#\s.*\s*/,"")
|
14
|
+
content = content.gsub(/'/, '"')
|
15
|
+
content = content.gsub(/\s*^group/, "\n\ngroup")
|
16
|
+
content = content.gsub(/\s*^\s+^gem/, "\n\ngem")
|
17
|
+
File.open(current_project + "/Gemfile", "w") do |file|
|
18
|
+
file.puts content
|
19
|
+
end
|
20
|
+
system "echo", "-e", "\e[92mYour Gemfile was successfully beautified!"
|
21
|
+
rescue Exception => e
|
22
|
+
system "echo", "-e", "\e[91m#{e.message}"
|
23
|
+
system "echo", "-e", "\e[91mMake sure you're in the right place!"
|
24
|
+
end
|
8
25
|
end
|
26
|
+
# end
|
data/lib/beautycode/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beautycode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lanhnth-1450
|
@@ -25,7 +25,9 @@ files:
|
|
25
25
|
- LICENSE.txt
|
26
26
|
- README.md
|
27
27
|
- Rakefile
|
28
|
+
- beautycode-0.1.0.gem
|
28
29
|
- beautycode.gemspec
|
30
|
+
- bin/beautycode
|
29
31
|
- bin/console
|
30
32
|
- bin/setup
|
31
33
|
- exe/beautycode
|