ordinare 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ordinare.rb +4 -8
- data/lib/ordinare/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743972cecf02bab4d0a114da6a8651a12c94d92b
|
4
|
+
data.tar.gz: 89f6440b2527ce97870024f74a02de40c3dcd787
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8fe2162765bb5a34d6deb4d392d811c2bd2c1da169df4a7d80fd39e863018869975b72583be90c2060cfa6b51b04027c8902ed10e8a359d4b82df7478bc12d
|
7
|
+
data.tar.gz: 3b0c33285d24d861bb86e9107881784b4a6e93fc6493b3c932a9d8250d260464aeec8a327dc5fa625344d6ef9d3eb2c22287b0c53b7b34af77cd0781ea81fd54
|
data/lib/ordinare.rb
CHANGED
@@ -12,6 +12,10 @@ module Ordinare
|
|
12
12
|
OptionParser.new do |opts|
|
13
13
|
opts.banner = "Usage: ordinare inside your Rails project"
|
14
14
|
|
15
|
+
opts.on("-pFILE", "--path=FILE", "Order file") do |filename|
|
16
|
+
Ordinare.sort(filename)
|
17
|
+
end
|
18
|
+
|
15
19
|
opts.on("-v", "--version", "Check gem version") do
|
16
20
|
puts Ordinare::VERSION
|
17
21
|
end
|
@@ -26,13 +30,5 @@ module Ordinare
|
|
26
30
|
unless File.file?(path)
|
27
31
|
abort("No Gemfile found in the current directory, is this a Rails project with Gemfile?")
|
28
32
|
end
|
29
|
-
|
30
|
-
content = File.readlines(path)
|
31
|
-
|
32
|
-
content.sort
|
33
|
-
|
34
|
-
File.open("#{path}.ordinare", "w+") do |file|
|
35
|
-
content.each { |line| file.puts(line) }
|
36
|
-
end
|
37
33
|
end
|
38
34
|
end
|
data/lib/ordinare/version.rb
CHANGED