eefgilm 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -19
- data/eefgilm.gemspec +1 -1
- data/lib/eefgilm/gemfile.rb +5 -0
- data/lib/eefgilm/version.rb +1 -1
- data/test/data/sources/expected/Gemfile +1 -1
- data/test/data/sources/original/groupgems +1 -1
- data/test/data/sources/original/railsgem +1 -1
- data/test/features/gemfile_test.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be33a97de8785b7ed0d5b96a0628319ae8c499b
|
4
|
+
data.tar.gz: e577abb477ded83e8c0728ea61a6e4fdc8482123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c0a19209fe06d5a970931de68e7d8f0af2248d76f498535f3ee8dbef3ebeca93dd5fb8bd2edfc9aedbb795ee6c73e0bac3692e1f5bb1eab09ad4703f0832d9
|
7
|
+
data.tar.gz: 2ee5a10e3f3d9046857296dd62b36ff3ec18b0fd6c98a7167528d0e969769d54e6544f8be872d722e809e8a94ba5012c8cc498f07f413ea12a511379bdb3eab8
|
data/README.md
CHANGED
@@ -5,30 +5,29 @@
|
|
5
5
|
|
6
6
|
#Description:
|
7
7
|
|
8
|
-
|
8
|
+
Eefgilm 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.
|
9
9
|
|
10
|
-
These Gemfile best practices are all based on
|
10
|
+
These Gemfile best practices are all loosely based on a [blog post](http://mcdowall.info/posts/gemfile-best-practices-and-discourse/) written by John McDowall.
|
11
11
|
|
12
12
|
###These best practices are:
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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.
|
27
|
+
|
28
28
|
|
29
29
|
## Installation
|
30
|
-
The simplest way to install Eefgilm is to
|
31
|
-
Run this command:
|
30
|
+
The simplest way to install Eefgilm is to run this command:
|
32
31
|
|
33
32
|
gem install eefgilm
|
34
33
|
|
@@ -53,7 +52,7 @@ A gif of 2 versions of Gemfile i.e before using the gem and after using the gem.
|
|
53
52
|
|
54
53
|
Once you have installed eefgilm on your system or in a project directory its quite simple to use. In the directory who's gemfile you would like to modify run:
|
55
54
|
|
56
|
-
|
55
|
+
eefgilm
|
57
56
|
|
58
57
|
Currently it will not ask you for any confirmation before making modifications, nor will it create a backup so please be careful when using eefgilm. It may be a good idea to backup your gemfile beforehand hand this can be done with:
|
59
58
|
|
data/eefgilm.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["enilsen16@live.com", "lindsay_marco@hotmail.com"]
|
11
11
|
spec.summary = %q{A gem to keep your Gemfile in best practice .}
|
12
12
|
spec.description = %q{Eefgilm is a gem that is written to help keep your gemfile in order. It will alphabetize your gems, remove comments, and remove unnecessary whitespace. }
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "http://enilsen16.github.io/Eefgilm/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/eefgilm/gemfile.rb
CHANGED
@@ -35,6 +35,11 @@ module Eefgilm
|
|
35
35
|
|
36
36
|
file_lines.each do |line|
|
37
37
|
self.source = line if line.match(/^source/)
|
38
|
+
|
39
|
+
if self.source == "source 'http://rubygems.org'\n"
|
40
|
+
self.source = "source 'https://rubygems.org'\n"
|
41
|
+
end
|
42
|
+
|
38
43
|
self.rubyversion = line if line.match(/^ruby/)
|
39
44
|
|
40
45
|
if line.match(/^\s*group/)
|
data/lib/eefgilm/version.rb
CHANGED
@@ -40,6 +40,11 @@ describe "Gemfile" do
|
|
40
40
|
@worker.rubyversion.must_include 'ruby "2.0.0"'
|
41
41
|
end
|
42
42
|
|
43
|
+
it do
|
44
|
+
@worker.clean!
|
45
|
+
@worker.source.must_include 'https://rubygems.org'
|
46
|
+
end
|
47
|
+
|
43
48
|
it "without a specified ruby version, it should not have an extra line" do
|
44
49
|
regex = /^[\s]*$\n/
|
45
50
|
count = 0
|
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.1.
|
4
|
+
version: 1.1.2
|
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-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -79,7 +79,7 @@ files:
|
|
79
79
|
- test/data/sources/original/railsgem
|
80
80
|
- test/features/gemfile_test.rb
|
81
81
|
- test/test_helper.rb
|
82
|
-
homepage:
|
82
|
+
homepage: http://enilsen16.github.io/Eefgilm/
|
83
83
|
licenses:
|
84
84
|
- MIT
|
85
85
|
metadata: {}
|