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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d55bab0d60719dea4bebf327e2d920203dd13e233aa6825d50a86d1068a0825
4
- data.tar.gz: 79c610109f204d06a4bf3e2034d8175034474a48c2ee976c13c3ef2cd9e06653
3
+ metadata.gz: 5a82b17b57a02dc7bb913d48aafdee4a1decf4a2fa782ff02b2bacf229e67824
4
+ data.tar.gz: c76daef03f636dfff65f159767b2ee5e0ad7680f472c8e1165653cad7f77228b
5
5
  SHA512:
6
- metadata.gz: d0fcb9587771014a46995ad835da9ccefcb4cd23b20784c5b8e2e05702bd2a4ba1017c04c4a7d893f1d2fff61dc6065db87f10db4d53b681884f97db65a9e7de
7
- data.tar.gz: d8dc8c26ebf8dd5a5873d736329556f971421d0faa2d54ebb6dd3931e24fd948355108f81d95585f198f62445224aafe08a10117fe3fdd1e742e5f68229c9a8b
6
+ metadata.gz: b9ef4cafd55bd401097799e89536315fa4bfa591f3ec3348c9e29f4ad29a3010641ef89a44e1b9452d0d4e8876fad0fdd54b45eab10a586e0358d49b580de0fd
7
+ data.tar.gz: f0b7614f1b2799d5cdea08108e4dfed21968f3f193ab5a83265a2aeb396aa9c0e4444603b8b371acce84b383cdd91055eac33be7d8f3890af88cd31654afc7a4
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in beautycode.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
8
+ # hiiii
9
+ gem 'rake', "~> 13.0"
9
10
 
10
11
  gem "minitest", "~> 5.0"
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 = Beautycode::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
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "beautycode"
4
+
5
+ Beautycode.process
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
- # Your code goes here...
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Beautycode
4
- VERSION = "0.1.0"
5
- end
3
+ # module BeautyCode
4
+ # VERSION = "1.1.0"
5
+ # end
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: 0.1.0
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