mkgitignore 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/lib/mkgitignore/commands/append.rb +25 -0
- data/lib/mkgitignore/version.rb +7 -7
- data/lib/mkgitignore.rb +13 -0
- metadata +6 -13
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZjdiZjJlNzJiNjk4NzlkMWMyMDIwNDkyMjk4YzE1YzQ3NWMyNzMxOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGJmNWRjOTQ5NjQ3YzQ4NTIxNjA3ZDY1MDJkNjM1ZDg2NjBkNzc2MA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTMzOGUzODRmMTMzMzhjYzE4MTY4ZGEwMWJkNmRhZTZhNjkyYWM0MGM1YjRh
|
10
|
+
YTZhYTIwNTI0OGM1ZDRlZDJkNGIyODQ5NTk1MTRiOTc5NTkwMWZiNzJhMTZh
|
11
|
+
OTQxMjg3NzI1OTgxMTY4MTUwYmMyM2NjNmQ0YTI1MzVjMzE4MWM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZjZjNGRhOWI5MzJiOWY3Mzk0ZmYwNDQyZDAxZWVlMjEzODk5NzdiNDVlNzUz
|
14
|
+
MWM4MzNkMzAzMzFlNDRkOGUzMjIyMTM3YTk0YmY4YjBlYjA4MTViYTg3OGNk
|
15
|
+
OGQ0Y2YxYjg5M2Q2MmI5YzRjNzJlZjk4Njc2ZTQwNjBlNmY3NTY=
|
data/.gitignore
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
command :append do |c|
|
2
|
+
c.syntax = 'mkgitignore append TEMPLATE_NAMES [options]'
|
3
|
+
c.summary = 'Appends the current gitignore with the passed templates'
|
4
|
+
c.description = 'Combines passed Gitignore templates and appends your gitignore with the result'
|
5
|
+
c.example 'Append to your gitignore file with multiple passed templates', 'mkgitignore append osx objective-c'
|
6
|
+
c.option '--dry-run', 'Prints out the would be contents of the gitignore'
|
7
|
+
c.action do |args, options|
|
8
|
+
if args.count < 1
|
9
|
+
puts 'You must enter one or more template names. `mkgitignore append -h` for usage'.red
|
10
|
+
exit
|
11
|
+
end
|
12
|
+
|
13
|
+
templates = Mkgitignore::searchForTemplatesWithNames(args)
|
14
|
+
|
15
|
+
gitignore = String.new
|
16
|
+
templates.each { |t| gitignore += Mkgitignore::downloadFromURL(t["url"], t["name"]) }
|
17
|
+
|
18
|
+
if options.dry_run
|
19
|
+
puts "Would append:\n\n #{ gitignore }"
|
20
|
+
else
|
21
|
+
Mkgitignore::appendGitignore(gitignore)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
data/lib/mkgitignore/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Mkgitignore
|
2
|
-
AUTHOR =
|
3
|
-
WEBSITE =
|
4
|
-
EMAIL =
|
5
|
-
VERSION =
|
6
|
-
GITIGNORE_URL =
|
7
|
-
GITIGNORE_FILE_NAME =
|
8
|
-
BACKUP_FILE_NAME =
|
2
|
+
AUTHOR = 'Keith Smiley'
|
3
|
+
WEBSITE = 'https://github.com/Keithbsmiley/mkgitignore'
|
4
|
+
EMAIL = 'keithbsmiley@gmail.com'
|
5
|
+
VERSION = '0.1.3'
|
6
|
+
GITIGNORE_URL = 'https://api.github.com/repos/github/gitignore/contents/'
|
7
|
+
GITIGNORE_FILE_NAME = '.gitignore'
|
8
|
+
BACKUP_FILE_NAME = 'backup.gitignore'
|
9
9
|
end
|
data/lib/mkgitignore.rb
CHANGED
@@ -137,6 +137,17 @@ module Mkgitignore
|
|
137
137
|
file.close()
|
138
138
|
puts "Finished writing #{ Mkgitignore::GITIGNORE_FILE_NAME }".green
|
139
139
|
end
|
140
|
+
|
141
|
+
def self.appendGitignore(gitignore)
|
142
|
+
if File.exists?(Mkgitignore::GITIGNORE_FILE_NAME)
|
143
|
+
File.open(Mkgitignore::GITIGNORE_FILE_NAME, 'a') do |file|
|
144
|
+
file << gitignore
|
145
|
+
end
|
146
|
+
puts "Finished appending #{ Mkgitignore::GITIGNORE_FILE_NAME }".green
|
147
|
+
else
|
148
|
+
writeGitignore(gitignore, true)
|
149
|
+
end
|
150
|
+
end
|
140
151
|
end
|
141
152
|
|
142
153
|
|
@@ -144,3 +155,5 @@ require 'mkgitignore/commands/list'
|
|
144
155
|
require 'mkgitignore/commands/search'
|
145
156
|
require 'mkgitignore/commands/build'
|
146
157
|
require 'mkgitignore/commands/listbuild'
|
158
|
+
require 'mkgitignore/commands/append'
|
159
|
+
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkgitignore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Keith Smiley
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: commander
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rest-client
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: colored
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - '='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - '='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -73,6 +66,7 @@ files:
|
|
73
66
|
- Rakefile
|
74
67
|
- bin/mkgitignore
|
75
68
|
- lib/mkgitignore.rb
|
69
|
+
- lib/mkgitignore/commands/append.rb
|
76
70
|
- lib/mkgitignore/commands/build.rb
|
77
71
|
- lib/mkgitignore/commands/list.rb
|
78
72
|
- lib/mkgitignore/commands/listbuild.rb
|
@@ -81,26 +75,25 @@ files:
|
|
81
75
|
- mkgitignore.gemspec
|
82
76
|
homepage: https://github.com/Keithbsmiley/mkgitignore
|
83
77
|
licenses: []
|
78
|
+
metadata: {}
|
84
79
|
post_install_message:
|
85
80
|
rdoc_options: []
|
86
81
|
require_paths:
|
87
82
|
- lib
|
88
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
84
|
requirements:
|
91
85
|
- - ! '>='
|
92
86
|
- !ruby/object:Gem::Version
|
93
87
|
version: '0'
|
94
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
89
|
requirements:
|
97
90
|
- - ! '>='
|
98
91
|
- !ruby/object:Gem::Version
|
99
92
|
version: '0'
|
100
93
|
requirements: []
|
101
94
|
rubyforge_project:
|
102
|
-
rubygems_version:
|
95
|
+
rubygems_version: 2.0.3
|
103
96
|
signing_key:
|
104
|
-
specification_version:
|
97
|
+
specification_version: 4
|
105
98
|
summary: Create gitignores from Github's templates
|
106
99
|
test_files: []
|