eefgilm 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/README.md +31 -11
- data/bin/eefgilm +0 -3
- data/lib/eefgilm/gemfile.rb +3 -1
- data/lib/eefgilm/version.rb +1 -1
- data/test/data/sources/original/railsgem +1 -4
- data/test/features/gemfile_test.rb +4 -3
- data/test/test_helper.rb +0 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c84790515b5d71b3c39eb75ec2f7417855902220
|
4
|
+
data.tar.gz: bc84d0e662ac092ea9f9b9822912ff3c60dd218a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0567cab61b68de5e1bf85d4c81b3cb1fdbad6043011be10f6473bd519f3a39077b3018e1e599129344141c5939beea2580d82ba49d8bdabd964f1ba9c88f94c
|
7
|
+
data.tar.gz: dd0a5414a96a0634c549b0aef4306fe48dcd6aed9a27fe338ec1baee7b76ea2b602c517bb9d330cbd26e2ff10ab0b3bcb67787893f4a2c684152053b3272ed0b
|
data/Gemfile
CHANGED
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
data/lib/eefgilm/gemfile.rb
CHANGED
@@ -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|
|
data/lib/eefgilm/version.rb
CHANGED
@@ -32,9 +32,10 @@ describe "Gemfile" do
|
|
32
32
|
@worker.groups[:all].must_equal @worker.groups[:all].sort
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
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
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.
|
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-
|
12
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|