gi-cli 0.1.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/bin/gi +5 -8
  4. data/lib/gi.rb +11 -4
  5. data/lib/gi/version.rb +1 -1
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13aabb08adc0d333096f75ea242bfc4381f6d5a6
4
- data.tar.gz: a7b74c8e5b5cae4809b25794268d8cd6d18c7111
3
+ metadata.gz: d0be11c362ef685952fe718fcb16edaabd2ba369
4
+ data.tar.gz: 77b69fcc36ad9919e6d4125d20d0a40872d753cd
5
5
  SHA512:
6
- metadata.gz: f564ef14beb14b0c2a2ed217660ad0513a8f7f12d5ffbd25b0919e93d79f484c1e810a7ad1695cd534c462d94e82693f4497497d0244813f3e4066f55d8a3d8c
7
- data.tar.gz: 4cd303fbab60829b0c75ee848b818bcd39104ae5afa94ac5bd4afff661d01be8f82ac464a4e73cbb008465a33b6712e5059bcbeff42cb7cc816b036092cefd69
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
- #### --dry
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
- #### --overwrite
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 <josh@bernsie.com>'
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.list
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
- if options.dry
36
- exec "#{gi.base(seeds)}"
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.base(seeds)} >> .gitignore"
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
- def base(suf)
6
- "curl -L -s http://gitignore.io/api/#{suf}"
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 list
9
- base('list')
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
+
@@ -1,3 +1,3 @@
1
1
  module Gi
2
- VERSION = "0.1.5"
2
+ VERSION = "1.0.0"
3
3
  end
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.1.5
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-05-23 00:00:00.000000000 Z
11
+ date: 2016-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander