gf_beauty 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/gf_beauty +5 -0
  3. data/lib/gf_beauty.rb +18 -0
  4. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c0de5681ae6b393c5d30a3bdde5e5cb38b2f33d5
4
+ data.tar.gz: 2dc2db9db3ab65ef9c5eeedb04dd93ebc82994ef
5
+ SHA512:
6
+ metadata.gz: f9bda95fb2c48a69c9746b4a4f29561645e8c3641185cb94f5f4fcb0c02b06b5472d91cb8e69e9f0578a77d5feee0070011888ef4b1d74023f5c17db9439ac1d
7
+ data.tar.gz: a34a2674e3763a2b1f67ee8d014ff4f9bf85a3af548c9e79f0c33ef8eaa16fce17f3f6944471212130b1add6d91d260ee3b887d67c3ef3b02990af85212c13ae
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "gf_beauty"
4
+
5
+ GfBeauty.process
@@ -0,0 +1,18 @@
1
+ class GfBeauty
2
+ def self.process
3
+ current_project = `pwd`
4
+ current_project = current_project.gsub(/\n/,"")
5
+ content = File.read(current_project + "/Gemfile")
6
+ content = content.gsub(/\#\s.*\s*/,"")
7
+ content = content.gsub(/'/, '"')
8
+ content = content.gsub(/\s*^group/, "\n\ngroup")
9
+ content = content.gsub(/\s*^\s+^gem/, "\n\ngem")
10
+ File.open(current_project + "/Gemfile", "w") do |file|
11
+ file.puts content
12
+ end
13
+ system "echo", "-e", "\e[92mYour Gemfile was successfully beautified!"
14
+ rescue Exception => e
15
+ system "echo", "-e", "\e[91m#{e.message}"
16
+ system "echo", "-e", "\e[91mMake sure you're in the right place!"
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gf_beauty
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.9
5
+ platform: ruby
6
+ authors:
7
+ - Tran Xuan Nam
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple gem which will beautify your Gemfile
14
+ email: tran.xuan.nam@framgia.com
15
+ executables:
16
+ - gf_beauty
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/gf_beauty
21
+ - lib/gf_beauty.rb
22
+ homepage: https://rubygems.org/gems/gf_beauty
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.6.11
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Gemfile Beautify
46
+ test_files: []