ordinare 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ordinare +6 -1
- data/lib/ordinare.rb +32 -1
- data/lib/ordinare/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8566fad853305a7e8df3a8fe54e3df79865c93ca
|
4
|
+
data.tar.gz: d72ccc3aae0cadb3a10306aaa73751836e0dec63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1188eea460b3e86824be3c654e5093fc8653820f14cf4eec4ba19a36e3b36da6800afdb864024b9de417d1caf207018a78130c7e4420184f89f1ad8196bda43
|
7
|
+
data.tar.gz: 005c9150c4b7abd6a1564baa7d7d2ac4540177ce68cbec1bf3958fdc705eda8b9c2c6d32cba70fd87959a5aa4914eaa83274458d6642a9839708e51b80769cbf
|
data/bin/ordinare
CHANGED
data/lib/ordinare.rb
CHANGED
@@ -1,7 +1,38 @@
|
|
1
1
|
require "ordinare/version"
|
2
|
+
require "optparse"
|
2
3
|
|
3
4
|
module Ordinare
|
4
|
-
|
5
|
+
module_function
|
6
|
+
|
7
|
+
def hi
|
5
8
|
"Ciao, sono Ordinare"
|
6
9
|
end
|
10
|
+
|
11
|
+
def parse_args
|
12
|
+
OptionParser.new do |opts|
|
13
|
+
opts.banner = "Usage: ordinare inside your Rails project"
|
14
|
+
|
15
|
+
opts.on("-v", "--version", "Check gem version") do
|
16
|
+
puts Ordinare::VERSION
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("-h", "--help", "Get help") do
|
20
|
+
puts opts
|
21
|
+
end
|
22
|
+
end.parse!
|
23
|
+
end
|
24
|
+
|
25
|
+
def sort(path = "Gemfile")
|
26
|
+
unless File.file?(path)
|
27
|
+
abort("No Gemfile found in the current directory, is this a Rails project with Gemfile?")
|
28
|
+
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
|
+
end
|
7
38
|
end
|
data/lib/ordinare/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ordinare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Đuza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
12
|
-
dependencies:
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: Ordinare sorts gems in your Gemfile alphabetically
|
14
28
|
email: nikolaseap@gmail.com
|
15
29
|
executables:
|