gemfile_beautify 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 224f3b1f2b0b6a3dda11fa4b9e5def01b489d09e
4
- data.tar.gz: 1644a1c824e02bbff823b335c324ac698acc399a
3
+ metadata.gz: fb580fdfaa2c8ae409071fd4a4e795f868077fc9
4
+ data.tar.gz: aeb9c207bee95de5429a80cc91882d98b849b7d2
5
5
  SHA512:
6
- metadata.gz: 0359494635991c5345421ed84d16ec19f69470b0f8abb046f787dcab434d8a015d746389bb6a285c0612a2d41d8065a49f2c41c311e2bfebe96e504d71460b31
7
- data.tar.gz: 1c3f9db19cfb1dec31be73fe63f78b4148d94d6bb4fccfeb1e8583002b338a4839773291943ecefd0b34d2b05131ef3e56ce5b6c22e7d4644cbfdc76c9cc41f6
6
+ metadata.gz: d9cc301f58db56ab9e6ad0441812c6e369ed9d2620c5831573425742364b96e73155b461f8c7bfb8b380278bf01ce125a39ecfdfff455df7792de00ae6340691
7
+ data.tar.gz: 90ff389156a1354cd8e36396c35e8b52312d9f51595b49a0bdc340bf60b7be1e0836fbe3a171cd22b21a4aa99cb913989ad6fbfa2130c37ca9d7af2fa458ccb1
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'gemfile_beautify'
3
+ require "gemfile_beautify"
4
4
 
5
- GemFileBeautify.hi
5
+ GemFileBeautify.process
@@ -1,5 +1,12 @@
1
1
  class GemFileBeautify
2
- def self.hi
3
- p %x[pwd]
2
+ def self.process
3
+ current_project = `pwd`
4
+ output = current_project.gsub(/\n/,"")
5
+ content = File.read(output + "/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(output + "/a", 'w') {|file| file.puts content}
4
11
  end
5
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemfile_beautify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tran Xuan Nam