eefgilm 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 213bba7090ed949e3691e4d491d2b5c7000f9e09
4
- data.tar.gz: c0a82a26ba9f22e5b3d6f81486e2f3aef194534c
3
+ metadata.gz: c84790515b5d71b3c39eb75ec2f7417855902220
4
+ data.tar.gz: bc84d0e662ac092ea9f9b9822912ff3c60dd218a
5
5
  SHA512:
6
- metadata.gz: b9938207fb7f954a211ca40172efb29f4df497ccd4231880d487f810c0b67de8890f8afe03e40328c8fdaab0710be240b57cd70e32fceebad84240c56bfc5acb
7
- data.tar.gz: 13c950cf7e793782f2b9ddfc4cc80af71a93a02269c8ba2d6551962fdfca8060699b0007c99e7393434189df282935b9b47ea29b85a4aff8a4195a788bbf988f
6
+ metadata.gz: e0567cab61b68de5e1bf85d4c81b3cb1fdbad6043011be10f6473bd519f3a39077b3018e1e599129344141c5939beea2580d82ba49d8bdabd964f1ba9c88f94c
7
+ data.tar.gz: dd0a5414a96a0634c549b0aef4306fe48dcd6aed9a27fe338ec1baee7b76ea2b602c517bb9d330cbd26e2ff10ab0b3bcb67787893f4a2c684152053b3272ed0b
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'pry'
4
+ gem 'pry-nav'
3
5
  gemspec
4
- gem "pry"
5
- gem "pry-nav"
data/README.md CHANGED
@@ -4,10 +4,26 @@
4
4
  #Eefgilm: A gem for cleaning up your Gemfile
5
5
 
6
6
  #Description:
7
- **Important, currently does not support group blocks. If you have groups they will not included in the revised gemfile!**
8
7
 
9
8
  This gem automatically modifies a ruby gemfile to make them a little easier to read, it does this by alphabetizing the gems, removing all comments, and removing all whitespace including leading and trailing.
10
9
 
10
+ These Gemfile best practices are all based on the [blog post](http://mcdowall.info/posts/gemfile-best-practices-and-discourse/) written by John McDowall.
11
+
12
+ ###These best practices are:
13
+
14
+ Consistent use of Ruby hash syntax. Use either the old hashrocket or the new Ruby 1.9 syntax, but not both.
15
+ Consistent use of a single quoted delimiter. Use either apostrophes or quotation marks, but not both.
16
+ No commented Gem references. If it’s commented out, it shouldn’t be there.
17
+ Comments relating to a Gem are on the same line as the gem statement, not above.
18
+ Group gems that are sourced from Git repos at the top. Chances are they are referencing pre-versions that will become general release and you can change the reference to be part of the General project group later.
19
+ Group gems that are sourced from a project path after Git repo sourced Gems. These are probably gems that you might make public and thus reference in the general project gem group later.
20
+ Group all of the General project gems together (consider using the :default group).
21
+ Group all of the Production project gems together after the General gems.
22
+ Group all of the Asset gems after the Production group.
23
+ Group all of the Test related gems after the Asset gems.
24
+ Group all of the Development related gems after the Test gems.
25
+ Within all Gem groups, sort the references by Alphabetical order.
26
+ When adding new gems, maintain the alphabetical ordering within the groups.
11
27
  ---
12
28
 
13
29
  ## Installation
@@ -24,6 +40,14 @@ and then run
24
40
 
25
41
  bundle install
26
42
 
43
+ ---
44
+
45
+ ## Demo
46
+
47
+ A gif of 2 versions of Gemfile i.e before using the gem and after using the gem.
48
+
49
+ ![Banner](http://i1248.photobucket.com/albums/hh483/jainrishi15/before-after-1_zps1b477ded.gif)
50
+
27
51
  ---
28
52
  ## Usage
29
53
 
@@ -47,21 +71,17 @@ We welcome contributions! If you want to help out you have many options:
47
71
 
48
72
  ---
49
73
  ##Issues
50
- If you find a bug or have a suggestion, please create a new issue and we will look into it. Thank You.
74
+ If you find a bug or have a suggestion, please create a new issue and we will look into it. Thank You.
51
75
  [Create a new issue](https://github.com/enilsen16/Eefgilm/issues/new)
52
76
 
53
- ---
54
- ##Contact
55
-
56
-
57
77
  ---
58
78
 
59
79
  ##Thanks
60
- The following people have helped with development or project design in one form or another:
61
- [Steve Buckley](https://github.com/buckleys78)
62
- [Brook Riggio](https://github.com/brookr)
63
- [Cheri](https://github.com/cherimarie)
64
- [David](https://github.com/dbalatero)
80
+ The following people have helped with development or project design in one form or another:<br>
81
+ [Steve Buckley](https://github.com/buckleys78)<br>
82
+ [Brook Riggio](https://github.com/brookr)<br>
83
+ [Cheri](https://github.com/cherimarie)<br>
84
+ [David](https://github.com/dbalatero)<br>
65
85
 
66
86
  ---
67
87
  ##License
data/bin/eefgilm CHANGED
@@ -2,6 +2,3 @@
2
2
  require 'eefgilm'
3
3
  gemfile = Eefgilm::Gemfile.new
4
4
  gemfile.clean!
5
-
6
-
7
-
@@ -1,6 +1,6 @@
1
1
  module Eefgilm
2
2
  class Gemfile
3
- attr_accessor :path, :source, :groups
3
+ attr_accessor :path, :source, :groups, :rubyversion
4
4
 
5
5
  def initialize(path = ".", options = {})
6
6
  @path = path
@@ -35,6 +35,7 @@ module Eefgilm
35
35
 
36
36
  file_lines.each do |line|
37
37
  self.source = line if line.match(/^source/)
38
+ self.rubyversion = line if line.match(/^ruby/)
38
39
 
39
40
  if line.match(/^\s*group/)
40
41
  group_block = line.match(/^group (:.*)[,|\s]/)[1]
@@ -71,6 +72,7 @@ module Eefgilm
71
72
  def recreate_file
72
73
  output = File.open( "#{@path}/Gemfile", "w+" )
73
74
  output.puts @source
75
+ output.puts @rubyversion
74
76
  output.puts
75
77
 
76
78
  @groups.each do |group, gems|
@@ -1,3 +1,3 @@
1
1
  module Eefgilm
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -38,6 +38,7 @@ gem 'spring'
38
38
  # Use debugger
39
39
  # gem 'debugger'
40
40
 
41
+ ruby "2.0.0"
41
42
 
42
43
  group :test do
43
44
  gem "minitest-rails-capybara"
@@ -51,7 +52,3 @@ group :production do
51
52
  gem 'pg'
52
53
  gem 'rails_12factor'
53
54
  end
54
-
55
-
56
-
57
-
@@ -32,9 +32,10 @@ describe "Gemfile" do
32
32
  @worker.groups[:all].must_equal @worker.groups[:all].sort
33
33
  end
34
34
 
35
- # it "should alphabetize gems within a group" do
36
-
37
- # end
35
+ it "should keep the ruby version" do
36
+ @worker.clean!
37
+ @worker.rubyversion.must_include 'ruby "2.0.0"'
38
+ end
38
39
 
39
40
  end
40
41
  end
data/test/test_helper.rb CHANGED
@@ -1,5 +1,2 @@
1
1
  require "minitest/autorun"
2
2
  require "eefgilm"
3
- require "pry"
4
- require "pry-nav"
5
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eefgilm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Nilsen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-30 00:00:00.000000000 Z
12
+ date: 2014-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest