gi-cli 0.1.5 → 1.0.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 +4 -4
- data/README.md +4 -2
- data/bin/gi +5 -8
- data/lib/gi.rb +11 -4
- data/lib/gi/version.rb +1 -1
- 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: d0be11c362ef685952fe718fcb16edaabd2ba369
|
4
|
+
data.tar.gz: 77b69fcc36ad9919e6d4125d20d0a40872d753cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af0fcb7302cd291d072f27380dc78477866c54e8f82fd96a12ac630047bb54ddc88420139a24ccbbbff04339fb3a8766b7545b0755b81348cbfd7d20f6d412a
|
7
|
+
data.tar.gz: 029c33f13f3231b55d2c06ff7b3dcaca856cfb62f1aa547747cdb62c5d044288f2fd06a65cc15ae25caff49931c005ac540cfac2206e3a92ecf2d40f4d9e843f
|
data/README.md
CHANGED
@@ -24,10 +24,12 @@ the default command is the one that appends the `.gitignore` file, it works in a
|
|
24
24
|
1. `$ gi osx,ruby,node,emacs`
|
25
25
|
2. `$ gi seed osx,ruby,node,emacs`
|
26
26
|
|
27
|
-
|
27
|
+
> --dry
|
28
|
+
|
28
29
|
attaching the `--dry` flag to the initial `seed` command will simply print out the (would be) contents of the .gitignore to the terminal and not actually create a file on the hard drive _(really this only exists for testing but hey, someone might use it)_
|
29
30
|
|
30
|
-
|
31
|
+
> --overwrite
|
32
|
+
|
31
33
|
attaching the `--overwrite` flag to `seed` will overwrite the existing `.gitignore` with the seeded one.
|
32
34
|
|
33
35
|
## Contributing
|
data/bin/gi
CHANGED
@@ -9,7 +9,7 @@ program :name, 'gi'
|
|
9
9
|
program :version, Gi::VERSION
|
10
10
|
program :description, 'Create a seeded .gitignore file'
|
11
11
|
program :help_formatter, :compact
|
12
|
-
program :help, 'Author', 'Josh Burns <
|
12
|
+
program :help, 'Author', 'Josh Burns <joshyburnss@gmail.com>'
|
13
13
|
|
14
14
|
gi = Gi::Api.new
|
15
15
|
|
@@ -17,14 +17,13 @@ command :list do |c|
|
|
17
17
|
c.syntax = 'gi list'
|
18
18
|
c.description = 'list possible seeds'
|
19
19
|
c.action do
|
20
|
-
gi.
|
20
|
+
gi.listAll
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
command :seed do |c|
|
25
25
|
c.syntax = 'gi seed <list,of,arguments>'
|
26
26
|
c.description = 'append .gitignore with the provided seed list OR use --overwrite to overwrite the existing one all together'
|
27
|
-
c.option '--dry', 'does not create .gitignore but prints it out'
|
28
27
|
c.option '--overwrite', 'if one exists overwrite .gitignore with the seeded one'
|
29
28
|
c.action do |args, options|
|
30
29
|
if args.empty?
|
@@ -32,13 +31,11 @@ command :seed do |c|
|
|
32
31
|
exec cmd
|
33
32
|
else
|
34
33
|
seeds = args.join(',')
|
35
|
-
|
36
|
-
|
37
|
-
elsif options.overwrite
|
38
|
-
cmd = "#{gi.base(seeds)} > .gitignore"
|
34
|
+
if options.overwrite
|
35
|
+
cmd = "#{gi.ignores(seeds)} > .gitignore"
|
39
36
|
exec cmd
|
40
37
|
else
|
41
|
-
cmd = "#{gi.
|
38
|
+
cmd = "#{gi.ignores(seeds)} >> .gitignore"
|
42
39
|
exec cmd
|
43
40
|
end
|
44
41
|
end
|
data/lib/gi.rb
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
require "gi/version"
|
2
|
+
require 'open3'
|
2
3
|
|
3
4
|
module Gi
|
4
5
|
class Api
|
5
|
-
|
6
|
-
|
6
|
+
# def base(suf)
|
7
|
+
# "curl -L -s http://gitignore.io/api/#{suf}"
|
8
|
+
# end
|
9
|
+
def listAll
|
10
|
+
puts `curl -L -s http://gitignore.io/api/list`
|
7
11
|
end
|
8
|
-
def
|
9
|
-
|
12
|
+
def ignores(suf)
|
13
|
+
cmd = "curl -L -s http://gitignore.io/api/#{suf}"
|
14
|
+
return cmd
|
10
15
|
end
|
11
16
|
end
|
12
17
|
end
|
18
|
+
|
19
|
+
|
data/lib/gi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gi-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Burns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|